{"version":3,"file":"index.cjs","sources":["../../src/api/client.gen.ts","../../src/api/sdk.gen.ts","../../src/constants.ts","../../src/utils/internal/array.ts","../../src/api-client.ts","../../src/utils/internal/bytes.ts","../../src/utils/nfd.ts","../../src/utils/internal/nfd.ts","../../src/utils/internal/state.ts","../../../../node_modules/.pnpm/@algorandfoundation+algokit-utils@8.2.2_algosdk@3.2.0/node_modules/@algorandfoundation/algokit-utils/types/app-arc56.mjs","../../../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js","../../../../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js","../../../../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js","../../../../node_modules/.pnpm/@algorandfoundation+algokit-utils@8.2.2_algosdk@3.2.0/node_modules/@algorandfoundation/algokit-utils/types/async-event-emitter.mjs","../../../../node_modules/.pnpm/@algorandfoundation+algokit-utils@8.2.2_algosdk@3.2.0/node_modules/@algorandfoundation/algokit-utils/types/logging.mjs","../../../../node_modules/.pnpm/@algorandfoundation+algokit-utils@8.2.2_algosdk@3.2.0/node_modules/@algorandfoundation/algokit-utils/types/config.mjs","../../../../node_modules/.pnpm/@algorandfoundation+algokit-utils@8.2.2_algosdk@3.2.0/node_modules/@algorandfoundation/algokit-utils/config.mjs","../../../../node_modules/.pnpm/@algorandfoundation+algokit-utils@8.2.2_algosdk@3.2.0/node_modules/@algorandfoundation/algokit-utils/util.mjs","../../../../node_modules/.pnpm/@algorandfoundation+algokit-utils@8.2.2_algosdk@3.2.0/node_modules/@algorandfoundation/algokit-utils/types/lifecycle-events.mjs","../../../../node_modules/.pnpm/@algorandfoundation+algokit-utils@8.2.2_algosdk@3.2.0/node_modules/@algorandfoundation/algokit-utils/types/app-spec.mjs","../../../../node_modules/.pnpm/@algorandfoundation+algokit-utils@8.2.2_algosdk@3.2.0/node_modules/@algorandfoundation/algokit-utils/types/logic-error.mjs","../../../../node_modules/.pnpm/@algorandfoundation+algokit-utils@8.2.2_algosdk@3.2.0/node_modules/@algorandfoundation/algokit-utils/types/app-client.mjs","../../src/contracts/NFDInstanceClient.ts","../../src/contracts/NFDRegistryClient.ts","../../src/modules/base.ts","../../src/modules/lookup.ts","../../../../node_modules/.pnpm/@algorandfoundation+algokit-utils@8.2.2_algosdk@3.2.0/node_modules/@algorandfoundation/algokit-utils/types/amount.mjs","../../src/utils/error-parser.ts","../../src/modules/manager.ts","../../src/modules/minting.ts","../../src/client.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport {\n  type Config,\n  type ClientOptions as DefaultClientOptions,\n  createClient,\n  createConfig,\n} from '@hey-api/client-fetch'\n\nimport type { ClientOptions } from './types.gen'\n\n/**\n * The `createClientConfig()` function will be called on client initialization\n * and the returned object will become the client's initial configuration.\n *\n * You may want to initialize your client this way instead of calling\n * `setConfig()`. This is useful for example if you're using Next.js\n * to ensure your client always has the correct values.\n */\nexport type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> =\n  (\n    override?: Config<DefaultClientOptions & T>,\n  ) => Config<Required<DefaultClientOptions> & T>\n\nexport const client = createClient(\n  createConfig<ClientOptions>({\n    baseUrl: 'https://api.nf.domains',\n  }),\n)\n","// This file is auto-generated by @hey-api/openapi-ts\n\nimport { client as _heyApiClient } from './client.gen'\n\nimport type {\n  InfoInfoOpenapi3YamlData,\n  InfoVersionData,\n  InfoVersionResponse,\n  NfdGetNfdData,\n  NfdGetNfdResponse,\n  NfdGetNfdError,\n  NfdActivityData,\n  NfdActivityResponse,\n  NfdActivityError,\n  NfdAnalyticsData,\n  NfdAnalyticsResponse,\n  NfdAnalyticsError,\n  NfdBadgesData,\n  NfdBadgesResponse,\n  NfdBadgesError,\n  NfdBlueskyLeadersData,\n  NfdBlueskyLeadersResponse,\n  NfdBlueskyLeadersError,\n  NfdBrowseData,\n  NfdBrowseResponse,\n  NfdBrowseError,\n  NfdConsensusLeadersData,\n  NfdConsensusLeadersResponse,\n  NfdConsensusLeadersError,\n  NfdConsensusMetricsData,\n  NfdConsensusMetricsResponse,\n  NfdConsensusMetricsError,\n  NfdContractLockData,\n  NfdContractLockResponse,\n  NfdContractLockError,\n  NfdContractUpgradeData,\n  NfdContractUpgradeResponse,\n  NfdContractUpgradeError,\n  NfdDonationsData,\n  NfdDonationsResponse,\n  NfdDonationsError,\n  NfdGetQuoteData,\n  NfdGetQuoteResponse,\n  NfdGetQuoteError,\n  NfdIsValidNfdData,\n  NfdIsValidNfdResponse,\n  NfdIsValidNfdError,\n  NfdIsValidAsaData,\n  NfdIsValidAsaResponse,\n  NfdIsValidAsaError,\n  NfdLinkAddressData,\n  NfdLinkAddressResponse,\n  NfdLinkAddressError,\n  NfdUnlinkAddressData,\n  NfdUnlinkAddressResponse,\n  NfdUnlinkAddressError,\n  NfdSetPrimaryAddressData,\n  NfdSetPrimaryAddressResponse,\n  NfdSetPrimaryAddressError,\n  NfdSetPrimaryNfdData,\n  NfdSetPrimaryNfdResponse,\n  NfdSetPrimaryNfdError,\n  NfdGetLookupData,\n  NfdGetLookupResponse,\n  NfdGetLookupError,\n  NfdMintData,\n  NfdMintResponse,\n  NfdMintError,\n  NfdGetNameSigData,\n  NfdGetNameSigResponse,\n  NfdGetNameSigError,\n  NfdOfferData,\n  NfdOfferResponse,\n  NfdOfferError,\n  NfdPostOfferToOwnerData,\n  NfdPostOfferToOwnerResponse,\n  NfdPostOfferToOwnerError,\n  NfdPurchaseData,\n  NfdPurchaseResponse,\n  NfdPurchaseError,\n  NfdRenewData,\n  NfdRenewResponse,\n  NfdRenewError,\n  NfdRescindOfferData,\n  NfdRescindOfferResponse,\n  NfdRescindOfferError,\n  NfdGetRevAddressSigData,\n  NfdGetRevAddressSigResponse,\n  NfdGetRevAddressSigError,\n  NfdSegmentLeadersData,\n  NfdSegmentLeadersResponse,\n  NfdSegmentLeadersError,\n  NfdSegmentLockData,\n  NfdSegmentLockResponse,\n  NfdSegmentLockError,\n  NfdSuggestData,\n  NfdSuggestResponse,\n  NfdSuggestError,\n  NfdTotalsData,\n  NfdTotalsResponse,\n  NfdTotalsError,\n  NfdTwitterLeadersData,\n  NfdTwitterLeadersResponse,\n  NfdTwitterLeadersError,\n  NfdUpdatePartialData,\n  NfdUpdatePartialResponse,\n  NfdUpdatePartialError,\n  NfdUpdateAllData,\n  NfdUpdateAllResponse,\n  NfdUpdateAllError,\n  NfdUpdateImageData,\n  NfdUpdateImageResponse,\n  NfdUpdateImageError,\n  NfdGetNfdsForAddressesV2Data,\n  NfdGetNfdsForAddressesV2Response,\n  NfdGetNfdsForAddressesV2Error,\n  NfdDonationLeadersV2Data,\n  NfdDonationLeadersV2Response,\n  NfdDonationLeadersV2Error,\n  NfdDonationListV2Data,\n  NfdDonationListV2Response,\n  NfdDonationListV2Error,\n  NfdSearchV2Data,\n  NfdSearchV2Response,\n  NfdSearchV2Error,\n  NfdContractUpgradeV3Data,\n  NfdContractUpgradeV3Response,\n  NfdContractUpgradeV3Error,\n  NfdVaultOptInLockData,\n  NfdVaultOptInLockResponse,\n  NfdVaultOptInLockError,\n  NfdSendFromVaultData,\n  NfdSendFromVaultResponse,\n  NfdSendFromVaultError,\n  NfdSendToVaultData,\n  NfdSendToVaultResponse,\n  NfdSendToVaultError,\n  NfdVerifyConfirmData,\n  NfdVerifyConfirmResponse,\n  NfdVerifyConfirmError,\n  NfdVerifyRequestData,\n  NfdVerifyRequestResponse,\n  NfdVerifyRequestError,\n} from './types.gen'\nimport type {\n  Options as ClientOptions,\n  TDataShape,\n  Client,\n} from '@hey-api/client-fetch'\n\nexport type Options<\n  TData extends TDataShape = TDataShape,\n  ThrowOnError extends boolean = boolean,\n> = ClientOptions<TData, ThrowOnError> & {\n  /**\n   * You can provide a client instance returned by `createClient()` instead of\n   * individual options. This might be also useful if you want to implement a\n   * custom client.\n   */\n  client?: Client\n  /**\n   * You can pass arbitrary values through the `meta` object. This can be\n   * used to access values that aren't defined as part of the SDK function.\n   */\n  meta?: Record<string, unknown>\n}\n\n/**\n * Download ./pubfiles/openapi3.yaml\n * YAML document containing the API swagger definition\n */\nexport const infoInfoOpenapi3Yaml = <ThrowOnError extends boolean = false>(\n  options?: Options<InfoInfoOpenapi3YamlData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<unknown, unknown, ThrowOnError>(\n    {\n      url: '/info/openapi3.yaml',\n      ...options,\n    },\n  )\n}\n\n/**\n * version info\n * Returns version information for the service\n */\nexport const infoVersion = <ThrowOnError extends boolean = false>(\n  options?: Options<InfoVersionData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    InfoVersionResponse,\n    unknown,\n    ThrowOnError\n  >({\n    url: '/info/version',\n    ...options,\n  })\n}\n\n/**\n * Get a specific NFD by name or by its application ID\n * Get a specific NFD by name or by its application ID\n */\nexport const nfdGetNfd = <ThrowOnError extends boolean = false>(\n  options: Options<NfdGetNfdData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    NfdGetNfdResponse,\n    NfdGetNfdError,\n    ThrowOnError\n  >({\n    url: '/nfd/{nameOrID}',\n    ...options,\n  })\n}\n\n/**\n * Fetch change activity for an NFD\n * Fetch change activity for an NFD, specifically general 'block-level' deltas for an NFD\n */\nexport const nfdActivity = <ThrowOnError extends boolean = false>(\n  options: Options<NfdActivityData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    NfdActivityResponse,\n    NfdActivityError,\n    ThrowOnError\n  >({\n    url: '/nfd/activity',\n    ...options,\n  })\n}\n\n/**\n * Fetch NFD analytics via various filters\n * Fetch NFD analytics via various filters\n */\nexport const nfdAnalytics = <ThrowOnError extends boolean = false>(\n  options?: Options<NfdAnalyticsData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    NfdAnalyticsResponse,\n    NfdAnalyticsError,\n    ThrowOnError\n  >({\n    url: '/nfd/analytics',\n    ...options,\n  })\n}\n\n/**\n * Fetch badge information (donations/etc) for an NFD\n * Fetch badge information (ie: donations) for an NFD\n */\nexport const nfdBadges = <ThrowOnError extends boolean = false>(\n  options: Options<NfdBadgesData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    NfdBadgesResponse,\n    NfdBadgesError,\n    ThrowOnError\n  >({\n    url: '/nfd/badges/{name}',\n    ...options,\n  })\n}\n\n/**\n * blueskyLeaders nfd\n * Get top bluesky influencers\n */\nexport const nfdBlueskyLeaders = <ThrowOnError extends boolean = false>(\n  options?: Options<NfdBlueskyLeadersData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    NfdBlueskyLeadersResponse,\n    NfdBlueskyLeadersError,\n    ThrowOnError\n  >({\n    url: '/nfd/bluesky/leaders',\n    ...options,\n  })\n}\n\n/**\n * Browse NFDs via various filters\n */\nexport const nfdBrowse = <ThrowOnError extends boolean = false>(\n  options?: Options<NfdBrowseData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    NfdBrowseResponse,\n    NfdBrowseError,\n    ThrowOnError\n  >({\n    url: '/nfd/browse',\n    ...options,\n  })\n}\n\n/**\n * consensusLeaders nfd\n * Get top consensus leaders\n */\nexport const nfdConsensusLeaders = <ThrowOnError extends boolean = false>(\n  options?: Options<NfdConsensusLeadersData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    NfdConsensusLeadersResponse,\n    NfdConsensusLeadersError,\n    ThrowOnError\n  >({\n    url: '/nfd/consensus/leaders',\n    ...options,\n  })\n}\n\n/**\n * consensusMetrics nfd\n * Get general metrics about Algorand consensus\n */\nexport const nfdConsensusMetrics = <ThrowOnError extends boolean = false>(\n  options?: Options<NfdConsensusMetricsData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    NfdConsensusMetricsResponse,\n    NfdConsensusMetricsError,\n    ThrowOnError\n  >({\n    url: '/nfd/consensus/metrics',\n    ...options,\n  })\n}\n\n/**\n * contractLock nfd\n * Lock/Unlock an NFD contract - if locked, the contract can never being modified until unlocked again by the owner.\n */\nexport const nfdContractLock = <ThrowOnError extends boolean = false>(\n  options: Options<NfdContractLockData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdContractLockResponse,\n    NfdContractLockError,\n    ThrowOnError\n  >({\n    url: '/nfd/contract/lock/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * contractUpgrade nfd\n * Request upgrade of a pre 2.11 NFD to 2.11 (going no further)\n */\nexport const nfdContractUpgrade = <ThrowOnError extends boolean = false>(\n  options: Options<NfdContractUpgradeData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdContractUpgradeResponse,\n    NfdContractUpgradeError,\n    ThrowOnError\n  >({\n    url: '/nfd/contract/upgrade/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * donations nfd\n * Fetch donation activity for an NFD, totalling amounts sent 'to' designated donation accounts\n */\nexport const nfdDonations = <ThrowOnError extends boolean = false>(\n  options: Options<NfdDonationsData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    NfdDonationsResponse,\n    NfdDonationsError,\n    ThrowOnError\n  >({\n    url: '/nfd/donations/{name}',\n    ...options,\n  })\n}\n\n/**\n * getQuote nfd\n * get price / carry cost to mint or rewnew an NFD (if existing)\n */\nexport const nfdGetQuote = <ThrowOnError extends boolean = false>(\n  options: Options<NfdGetQuoteData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    NfdGetQuoteResponse,\n    NfdGetQuoteError,\n    ThrowOnError\n  >({\n    url: '/nfd/getQuote/{name}',\n    ...options,\n  })\n}\n\n/**\n * isValidNFD nfd\n * Determines if specified NFD Application ID is authentic\n */\nexport const nfdIsValidNfd = <ThrowOnError extends boolean = false>(\n  options: Options<NfdIsValidNfdData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    NfdIsValidNfdResponse,\n    NfdIsValidNfdError,\n    ThrowOnError\n  >({\n    url: '/nfd/isValid/{appID}',\n    ...options,\n  })\n}\n\n/**\n * isValidASA nfd\n * Determines if specified NFD NFT ASA ID is authentic NFD\n */\nexport const nfdIsValidAsa = <ThrowOnError extends boolean = false>(\n  options: Options<NfdIsValidAsaData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    NfdIsValidAsaResponse,\n    NfdIsValidAsaError,\n    ThrowOnError\n  >({\n    url: '/nfd/isValidASA/{asaID}',\n    ...options,\n  })\n}\n\n/**\n * linkAddress nfd\n * Link one or more addresses to an NFD, adding to the reverse-address lookups as well as to this NFD.  Sender must be owner, and each added address must be able to be signed for.\n */\nexport const nfdLinkAddress = <ThrowOnError extends boolean = false>(\n  options: Options<NfdLinkAddressData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdLinkAddressResponse,\n    NfdLinkAddressError,\n    ThrowOnError\n  >({\n    url: '/nfd/links/addAddress/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * unlinkAddress nfd\n * UnLink one or more addresses to an NFD, adding to the reverse-address lookups as well as to this NFD.  Sender must be owner, and each added address must be able to be signed for.\n */\nexport const nfdUnlinkAddress = <ThrowOnError extends boolean = false>(\n  options: Options<NfdUnlinkAddressData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdUnlinkAddressResponse,\n    NfdUnlinkAddressError,\n    ThrowOnError\n  >({\n    url: '/nfd/links/removeAddress/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * setPrimaryAddress nfd\n * Set which of the currently verified addresses should be the first in the list (swapping positions as necessary)\n */\nexport const nfdSetPrimaryAddress = <ThrowOnError extends boolean = false>(\n  options: Options<NfdSetPrimaryAddressData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdSetPrimaryAddressResponse,\n    NfdSetPrimaryAddressError,\n    ThrowOnError\n  >({\n    url: '/nfd/links/setPrimaryAddress/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * setPrimaryNFD nfd\n * Set the specified NFD as the primary NFD to return for the specified address via its reverse lookup\n */\nexport const nfdSetPrimaryNfd = <ThrowOnError extends boolean = false>(\n  options: Options<NfdSetPrimaryNfdData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdSetPrimaryNfdResponse,\n    NfdSetPrimaryNfdError,\n    ThrowOnError\n  >({\n    url: '/nfd/links/setPrimaryNFD/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * Reverse Address lookup with results returned per address\n * Get the primary NFD for an address.  Must be verified address, or if allowUnverified is set, it may match against an unverified address\n */\nexport const nfdGetLookup = <ThrowOnError extends boolean = false>(\n  options: Options<NfdGetLookupData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    NfdGetLookupResponse,\n    NfdGetLookupError,\n    ThrowOnError\n  >({\n    url: '/nfd/lookup',\n    ...options,\n  })\n}\n\n/**\n * mint nfd\n * Mint a new NFD, with user buying specified NFD and paying for a prorated amount of time based on its yearly price.\n */\nexport const nfdMint = <ThrowOnError extends boolean = false>(\n  options: Options<NfdMintData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdMintResponse,\n    NfdMintError,\n    ThrowOnError\n  >({\n    url: '/nfd/mint',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * getNameSig nfd\n * Returns NameSig address for an NFD name (usable for V1 only)\n */\nexport const nfdGetNameSig = <ThrowOnError extends boolean = false>(\n  options: Options<NfdGetNameSigData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    NfdGetNameSigResponse,\n    NfdGetNameSigError,\n    ThrowOnError\n  >({\n    url: '/nfd/nameSig/{name}',\n    ...options,\n  })\n}\n\n/**\n * offer nfd\n * Offer up an NFD for sale - specifying price and optionally an address it is reserved for.\n */\nexport const nfdOffer = <ThrowOnError extends boolean = false>(\n  options: Options<NfdOfferData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdOfferResponse,\n    NfdOfferError,\n    ThrowOnError\n  >({\n    url: '/nfd/offer/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * postOfferToOwner nfd\n * Post an offer to buy to the owner of an NFD, offering up a particular amount with optional note for them to consider\n */\nexport const nfdPostOfferToOwner = <ThrowOnError extends boolean = false>(\n  options: Options<NfdPostOfferToOwnerData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdPostOfferToOwnerResponse,\n    NfdPostOfferToOwnerError,\n    ThrowOnError\n  >({\n    url: '/nfd/postOfferToOwner/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * purchase nfd\n * Purchase an NFD for sale - specifying buyer (to sign transaction) and price\n */\nexport const nfdPurchase = <ThrowOnError extends boolean = false>(\n  options: Options<NfdPurchaseData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdPurchaseResponse,\n    NfdPurchaseError,\n    ThrowOnError\n  >({\n    url: '/nfd/purchase/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * renew nfd\n * Renew or extend the expiration of an NFD.  If current owner, renews at base price. If other owner, can take ownership but goes through reverse auction process for first 28 days where price drops to base price - with price being for 1 year\n */\nexport const nfdRenew = <ThrowOnError extends boolean = false>(\n  options: Options<NfdRenewData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdRenewResponse,\n    NfdRenewError,\n    ThrowOnError\n  >({\n    url: '/nfd/renew',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * rescindOffer nfd\n * Rescind offer of sale. Claiming NFD back for self, and removing it for sale.\n */\nexport const nfdRescindOffer = <ThrowOnError extends boolean = false>(\n  options: Options<NfdRescindOfferData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdRescindOfferResponse,\n    NfdRescindOfferError,\n    ThrowOnError\n  >({\n    url: '/nfd/rescindOffer/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * getRevAddressSig nfd\n * Returns RevAddress address for an NFD name (usable for V1 only)\n */\nexport const nfdGetRevAddressSig = <ThrowOnError extends boolean = false>(\n  options: Options<NfdGetRevAddressSigData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    NfdGetRevAddressSigResponse,\n    NfdGetRevAddressSigError,\n    ThrowOnError\n  >({\n    url: '/nfd/revAddressSig/{address}',\n    ...options,\n  })\n}\n\n/**\n * segmentLeaders nfd\n * Get top segment roots\n */\nexport const nfdSegmentLeaders = <ThrowOnError extends boolean = false>(\n  options?: Options<NfdSegmentLeadersData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    NfdSegmentLeadersResponse,\n    NfdSegmentLeadersError,\n    ThrowOnError\n  >({\n    url: '/nfd/segment/leaders',\n    ...options,\n  })\n}\n\n/**\n * Lock/Unlock an NFD segment - specifying open price if unlocking\n * Lock/Unlock an NFD segment - if locked, the segment only allows minted names created by the segment owner.  If unlocked, anyone can mint off the segment for the price (in USD) the owner sets\n */\nexport const nfdSegmentLock = <ThrowOnError extends boolean = false>(\n  options: Options<NfdSegmentLockData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdSegmentLockResponse,\n    NfdSegmentLockError,\n    ThrowOnError\n  >({\n    url: '/nfd/segment/lock/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * suggest nfd\n * Suggest NFDs to purchase\n */\nexport const nfdSuggest = <ThrowOnError extends boolean = false>(\n  options: Options<NfdSuggestData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    NfdSuggestResponse,\n    NfdSuggestError,\n    ThrowOnError\n  >({\n    url: '/nfd/suggest/{name}',\n    ...options,\n  })\n}\n\n/**\n * totals nfd\n * Fetch NFD summary data - results subject to change in the future\n */\nexport const nfdTotals = <ThrowOnError extends boolean = false>(\n  options?: Options<NfdTotalsData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    NfdTotalsResponse,\n    NfdTotalsError,\n    ThrowOnError\n  >({\n    url: '/nfd/totals',\n    ...options,\n  })\n}\n\n/**\n * twitterLeaders nfd\n * Get top twitter influencers\n */\nexport const nfdTwitterLeaders = <ThrowOnError extends boolean = false>(\n  options?: Options<NfdTwitterLeadersData, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    NfdTwitterLeadersResponse,\n    NfdTwitterLeadersError,\n    ThrowOnError\n  >({\n    url: '/nfd/twitter/leaders',\n    ...options,\n  })\n}\n\n/**\n * updatePartial nfd\n * Set an attribute in an NFD on behalf of a particular sender (who must be the owner).  Can set user-defined fields, or clear verified fields (except v.ca*)\n */\nexport const nfdUpdatePartial = <ThrowOnError extends boolean = false>(\n  options: Options<NfdUpdatePartialData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).patch<\n    NfdUpdatePartialResponse,\n    NfdUpdatePartialError,\n    ThrowOnError\n  >({\n    url: '/nfd/update/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * updateAll nfd\n * Replace all NFD user-settable attributes with those passed-in, removing, adding and replacing on behalf of a particular sender (who must be the owner).  Returns transaction group of transactions to sign\n */\nexport const nfdUpdateAll = <ThrowOnError extends boolean = false>(\n  options: Options<NfdUpdateAllData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).put<\n    NfdUpdateAllResponse,\n    NfdUpdateAllError,\n    ThrowOnError\n  >({\n    url: '/nfd/update/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * updateImage nfd\n * Update the avatar or banner image associated with an NFD by uploading new image content\n */\nexport const nfdUpdateImage = <ThrowOnError extends boolean = false>(\n  options: Options<NfdUpdateImageData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdUpdateImageResponse,\n    NfdUpdateImageError,\n    ThrowOnError\n  >({\n    url: '/nfd/updateImage/{name}/{sender}/{which}',\n    ...options,\n  })\n}\n\n/**\n * Reverse Address lookup with results returned per address\n * Get all NFDs which have been explicitly linked to one or more verified [or unverified] Algorand address(es).  Unverified addresses will match but return as unverifiedCaAlgo array.  These should be treated specially and not have the same trust level as verified addresses as they can be falsely attributed.  The caAlgo array is what should be trusted for things like NFT creation addresses. For reverse lookups returning multiple NFDs, the first result should be used.\n */\nexport const nfdGetNfdsForAddressesV2 = <ThrowOnError extends boolean = false>(\n  options: Options<NfdGetNfdsForAddressesV2Data, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    NfdGetNfdsForAddressesV2Response,\n    NfdGetNfdsForAddressesV2Error,\n    ThrowOnError\n  >({\n    url: '/nfd/v2/address',\n    ...options,\n  })\n}\n\n/**\n * donationLeadersV2 nfd\n * Get top donors to a specific NFD Donation target\n */\nexport const nfdDonationLeadersV2 = <ThrowOnError extends boolean = false>(\n  options: Options<NfdDonationLeadersV2Data, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).get<\n    NfdDonationLeadersV2Response,\n    NfdDonationLeadersV2Error,\n    ThrowOnError\n  >({\n    url: '/nfd/v2/donations/leaders/{name}',\n    ...options,\n  })\n}\n\n/**\n * donationListV2 nfd\n * Fetch list of tracked Donation NFD 'targets'.\n */\nexport const nfdDonationListV2 = <ThrowOnError extends boolean = false>(\n  options?: Options<NfdDonationListV2Data, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    NfdDonationListV2Response,\n    NfdDonationListV2Error,\n    ThrowOnError\n  >({\n    url: '/nfd/v2/donations/list',\n    ...options,\n  })\n}\n\n/**\n * Search NFDs via various filters\n * Search NFDs via various filters\n */\nexport const nfdSearchV2 = <ThrowOnError extends boolean = false>(\n  options?: Options<NfdSearchV2Data, ThrowOnError>,\n) => {\n  return (options?.client ?? _heyApiClient).get<\n    NfdSearchV2Response,\n    NfdSearchV2Error,\n    ThrowOnError\n  >({\n    url: '/nfd/v2/search',\n    ...options,\n  })\n}\n\n/**\n * ContractUpgradeV3 nfd\n * Request upgrade of a 2.11 or 3.x NFD to 3.x+ (post renewals). First switch to 3.x will pay 1 year renewal fee\n */\nexport const nfdContractUpgradeV3 = <ThrowOnError extends boolean = false>(\n  options: Options<NfdContractUpgradeV3Data, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdContractUpgradeV3Response,\n    NfdContractUpgradeV3Error,\n    ThrowOnError\n  >({\n    url: '/nfd/v3/contract/upgrade/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * vaultOptInLock nfd\n * Lock/Unlock ability for the specified NFD Vault to auto opt-in to assets, allowing airdrops from other accounts\n */\nexport const nfdVaultOptInLock = <ThrowOnError extends boolean = false>(\n  options: Options<NfdVaultOptInLockData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdVaultOptInLockResponse,\n    NfdVaultOptInLockError,\n    ThrowOnError\n  >({\n    url: '/nfd/vault/lock/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * sendFromVault nfd\n * Send an amount of an asset [0 == ALGO] to another account FROM the NFD Vault.  Only owner of NFD can send.\n */\nexport const nfdSendFromVault = <ThrowOnError extends boolean = false>(\n  options: Options<NfdSendFromVaultData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdSendFromVaultResponse,\n    NfdSendFromVaultError,\n    ThrowOnError\n  >({\n    url: '/nfd/vault/sendFrom/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * sendToVault nfd\n * Provide transaction to send an asset owned by sender account to an NFD vault.  Call to have opt-in to vault will be included if necessary.  Callable by NFD owner, or if Opt-in is UNLOCKED (or asset already opted-in), anyone can call\n */\nexport const nfdSendToVault = <ThrowOnError extends boolean = false>(\n  options: Options<NfdSendToVaultData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdSendToVaultResponse,\n    NfdSendToVaultError,\n    ThrowOnError\n  >({\n    url: '/nfd/vault/sendTo/{name}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * verifyConfirm nfd\n * Verify a particular piece of data on, or off-chain.  Each verification differs in its requirements\n */\nexport const nfdVerifyConfirm = <ThrowOnError extends boolean = false>(\n  options: Options<NfdVerifyConfirmData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdVerifyConfirmResponse,\n    NfdVerifyConfirmError,\n    ThrowOnError\n  >({\n    url: '/nfd/verify/confirm/{id}',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n\n/**\n * verifyRequest nfd\n * Request Verification for particular piece of data on, or off-chain.  Each verification differs in its requirements. Returns data to be used in challenge\n */\nexport const nfdVerifyRequest = <ThrowOnError extends boolean = false>(\n  options: Options<NfdVerifyRequestData, ThrowOnError>,\n) => {\n  return (options.client ?? _heyApiClient).post<\n    NfdVerifyRequestResponse,\n    NfdVerifyRequestError,\n    ThrowOnError\n  >({\n    url: '/nfd/verify/request',\n    ...options,\n    headers: {\n      'Content-Type': 'application/json',\n      ...options?.headers,\n    },\n  })\n}\n","/** The NFD registry app IDs for each network */\nexport enum NfdRegistryId {\n  MAINNET = 760937186,\n  TESTNET = 84366825,\n}\n\n/** The default sender addresses (fee sinks) for each network */\nexport enum DefaultSender {\n  MAINNET = 'Y76M3MSY6DKBRHBL7C3NNDXGS5IIMQVQVUAB6MP4XEMMGVF2QWNPL226CA',\n  TESTNET = 'A7NMWS3NT3IUDMLVO26ULGXGIIOUQ3ND2TXSER6EBGRZNOBOUIQXHIBGDE',\n}\n\n/** The base URLs for the NFD API for each network */\nexport enum NfdApiBaseUrl {\n  MAINNET = 'https://api.nf.domains',\n  TESTNET = 'https://api.testnet.nf.domains',\n}\n","/**\n * Split an array into chunks of a specified size\n * @param array - The array to split\n * @param chunkSize - The maximum size of each chunk\n * @returns An array of chunks\n */\nexport function chunkArray<T>(array: T[], chunkSize = 20): T[][] {\n  if (!array.length) return []\n  if (array.length <= chunkSize) return [array]\n\n  const chunks: T[][] = []\n  for (let i = 0; i < array.length; i += chunkSize) {\n    chunks.push(array.slice(i, i + chunkSize))\n  }\n  return chunks\n}\n","import { client } from './api/client.gen'\nimport { nfdGetLookup, nfdGetNfd, nfdSearchV2 } from './api/sdk.gen'\nimport { NfdApiBaseUrl, NfdRegistryId } from './constants'\nimport { chunkArray } from './utils/internal/array'\n\nimport type {\n  Nfd,\n  SearchOptions,\n  SearchResponse,\n  ReverseLookupOptions,\n  ResolveOptions,\n} from './types'\n\n/**\n * Client for interacting with the NFD API\n * This class wraps the auto-generated API client to provide a more convenient interface\n */\nexport class NfdApiClient {\n  private readonly _client = client\n\n  /**\n   * Create a new NfdApiClient instance\n   * @param registryId - The registry ID to determine which network to use\n   */\n  constructor(registryId?: number | bigint) {\n    // Set the base URL based on the registry ID\n    if (registryId !== undefined) {\n      const baseUrl =\n        BigInt(registryId) === BigInt(NfdRegistryId.TESTNET)\n          ? NfdApiBaseUrl.TESTNET\n          : NfdApiBaseUrl.MAINNET\n\n      this.setBaseUrl(baseUrl)\n    }\n  }\n\n  /**\n   * Create a new NfdApiClient instance configured for MainNet\n   * @returns A new NfdApiClient instance\n   */\n  public static mainNet(): NfdApiClient {\n    const apiClient = new NfdApiClient()\n    apiClient.setBaseUrl(NfdApiBaseUrl.MAINNET)\n    return apiClient\n  }\n\n  /**\n   * Create a new NfdApiClient instance configured for TestNet\n   * @returns A new NfdApiClient instance\n   */\n  public static testNet(): NfdApiClient {\n    const apiClient = new NfdApiClient()\n    apiClient.setBaseUrl(NfdApiBaseUrl.TESTNET)\n    return apiClient\n  }\n\n  /**\n   * Get the raw generated API client\n   * @returns The raw API client\n   */\n  public get client(): typeof client {\n    return this._client\n  }\n\n  /**\n   * Set the base URL for the API client\n   * @param baseUrl - The base URL to use for API requests\n   */\n  public setBaseUrl(baseUrl: string): void {\n    this._client.setConfig({\n      baseUrl,\n    })\n  }\n\n  /**\n   * Resolve an NFD by name or application ID using the API\n   */\n  public async resolve(\n    nameOrId: string,\n    options: ResolveOptions = {},\n  ): Promise<Nfd> {\n    // Add cache parameter if needed\n    const params = this._getCacheParam(options.nocache)\n\n    const response = await nfdGetNfd({\n      client: this._client,\n      query: {\n        view: options.view,\n        poll: options.poll,\n        ...params,\n      },\n      path: {\n        nameOrID: nameOrId,\n      },\n      throwOnError: true,\n    })\n\n    return response.data as Nfd\n  }\n\n  /**\n   * Perform a reverse lookup to find NFDs associated with Algorand addresses\n   * @param addresses - Array of Algorand addresses to look up\n   * @param options - Options for the lookup\n   * @returns Record mapping addresses to their associated NFDs\n   * @remarks\n   * This method returns a record where each key is an Algorand address and the value is the NFD associated with that address.\n   * If an address is not associated with any NFDs, the value will be an empty object.\n   */\n  public async reverseLookup(\n    addresses: string[],\n    options: ReverseLookupOptions = {},\n  ): Promise<Record<string, Nfd>> {\n    // Filter out empty addresses\n    const validAddresses = addresses.filter((addr) => addr.trim() !== '')\n    if (validAddresses.length === 0) {\n      return {}\n    }\n\n    // Split addresses into chunks of 20 (API limit)\n    const addressChunks = chunkArray(validAddresses, 20)\n\n    try {\n      // Add cache parameter if needed\n      const params = this._getCacheParam(options.nocache)\n\n      // Make parallel requests for each chunk\n      const responses = await Promise.all(\n        addressChunks.map((chunk) =>\n          nfdGetLookup({\n            client: this._client,\n            query: {\n              address: chunk,\n              view: options.view,\n              allowUnverified: options.allowUnverified,\n              ...params,\n            },\n            throwOnError: false, // Handle errors per chunk\n          }).catch((error) => {\n            // Return empty result for this chunk if 404 (not found)\n            if (error.response?.status === 404) {\n              return { data: {} }\n            }\n            // Re-throw other errors\n            throw error\n          }),\n        ),\n      )\n\n      // Merge all responses\n      const mergedResults: Record<string, Nfd> = {}\n\n      for (const response of responses) {\n        if (response.data) {\n          Object.entries(response.data).forEach(([address, nfd]) => {\n            mergedResults[address] = nfd as Nfd\n          })\n        }\n      }\n\n      return mergedResults\n    } catch (error) {\n      const errorMessage =\n        error instanceof Error ? error.message : String(error)\n      throw new Error(`Error performing reverse lookup: ${errorMessage}`)\n    }\n  }\n\n  /**\n   * Search for NFDs using the API\n   */\n  public async search(options: SearchOptions = {}): Promise<SearchResponse> {\n    // Add cache parameter if needed\n    const params = this._getCacheParam(options.nocache)\n\n    const response = await nfdSearchV2({\n      client: this._client,\n      query: {\n        name: options.name,\n        category: options.category,\n        saleType: options.saleType,\n        state: options.state,\n        parentAppID: options.parentAppId,\n        length: options.length,\n        traits: options.traits,\n        owner: options.owner,\n        reservedFor: options.reservedFor,\n        excludeUserReserved: options.excludeUserReserved,\n        prefix: options.prefix,\n        substring: options.substring,\n        vproperty: options.verifiedProperty,\n        vvalue: options.verifiedValue,\n        segmentLocked: options.segmentLocked,\n        segmentRoot: options.segmentRoot,\n        minPrice: options.minPrice,\n        maxPrice: options.maxPrice,\n        minPriceUsd: options.minPriceUsd,\n        maxPriceUsd: options.maxPriceUsd,\n        changedAfter: options.changedAfter,\n        expiresBefore: options.expiresBefore,\n        limit: options.limit,\n        offset: options.offset,\n        sort: options.sort,\n        view: options.view,\n        ...params,\n      },\n      throwOnError: true,\n    })\n\n    return {\n      ...response.data,\n      nfds: response.data.nfds.map((nfd) => nfd as Nfd),\n    }\n  }\n\n  /**\n   * Internal method for cache parameter\n   * @private\n   */\n  private _getCacheParam(flag?: boolean): Record<string, number | undefined> {\n    if (!flag) {\n      return {}\n    }\n\n    const now = new Date()\n    const minutes = now.getMinutes()\n    const seconds = now.getSeconds()\n    const value = Math.floor(((minutes * 60 + seconds) % 120) / 4)\n    return { _cb: value }\n  }\n}\n","/**\n * Convert a string to a Uint8Array\n * @param str - The string to convert\n * @returns The string as a Uint8Array\n */\nexport function strToUint8Array(str: string): Uint8Array {\n  return new Uint8Array(str.length).map((_, i) => str.charCodeAt(i))\n}\n\n/**\n * Concatenate two Uint8Arrays\n * @param array1 - The first array\n * @param array2 - The second array\n * @returns The concatenated array\n */\nexport function concatUint8Arrays(\n  array1: Uint8Array,\n  array2: Uint8Array,\n): Uint8Array {\n  const concatenatedArray = new Uint8Array(array1.length + array2.length)\n\n  // Set the first array values\n  concatenatedArray.set(array1, 0)\n\n  // Set the second array values starting from the end of the first array\n  concatenatedArray.set(array2, array1.length)\n\n  return concatenatedArray\n}\n\n/**\n * Check if a Uint8Array contains only zero bytes\n * @param array - The array to check\n * @returns True if all bytes are zero, false otherwise\n */\nexport function isZeroBytes(array: Uint8Array): boolean {\n  return array.every((byte) => byte === 0)\n}\n","import type { Nfd } from '../types'\n\n/**\n * Check if segment minting is unlocked for an NFD\n * @param nfd - The NFD object to check\n * @returns True if segment minting is unlocked, false otherwise\n *\n * Note: By default, segment minting is locked when a root NFD is created.\n * The segmentLocked property is only set to '0' when explicitly unlocked.\n * If the property doesn't exist or is set to any value other than '0',\n * segment minting should be considered locked.\n */\nexport function isSegmentMintingUnlocked(nfd: Nfd | null): boolean {\n  if (!nfd) return false\n  return nfd.properties?.internal?.segmentLocked === '0'\n}\n\n/**\n * Check if the caller is authorized to mint a segment for the given parent NFD\n * @param nfd - The parent NFD object\n * @param callerAddress - The address of the caller attempting to mint a segment\n * @returns True if the caller is authorized to mint a segment, false otherwise\n */\nexport function canMintSegment(\n  nfd: Nfd | null,\n  callerAddress: string,\n): boolean {\n  if (!nfd) return false\n\n  // If segment minting is unlocked, anyone can mint segments\n  if (isSegmentMintingUnlocked(nfd)) return true\n\n  // If segment minting is locked, only the owner can mint segments\n  return nfd.owner === callerAddress\n}\n\n/**\n * Check if name is a valid NFD root/segment\n * @param name - The NFD name to validate\n * @returns True if the name is valid, false otherwise\n */\nexport function isValidName(name: string): boolean {\n  return /^([a-z0-9]{1,27}\\.){0,1}(?<basename>[a-z0-9]{1,27})\\.algo$/g.test(\n    name,\n  )\n}\n\n/**\n * Check if name is a valid NFD segment\n * @param name - The NFD name to validate\n * @returns True if the name is a segment, false otherwise\n */\nexport function isSegmentName(name: string): boolean {\n  return /^[a-z0-9]{1,27}\\.(?<basename>[a-z0-9]{1,27})\\.algo$/g.test(name)\n}\n\n/**\n * Extract the parent NFD name from a segment NFD name\n * @param segmentName - The segment NFD name (e.g., \"xxx.yyy.algo\")\n * @returns The parent NFD name (e.g., \"yyy.algo\")\n * @throws If the segment name is invalid\n */\nexport function extractParentName(segmentName: string): string {\n  if (!isSegmentName(segmentName)) {\n    throw new Error(`Invalid segment name: ${segmentName}`)\n  }\n  return segmentName.split('.')[1] + '.algo'\n}\n\n/**\n * Get the basename of an NFD (e.g., for \"xxx.yyy.algo\" returns \"yyy\")\n * @param name - The NFD name\n * @returns The basename of the NFD\n */\nexport function getNfdBasename(name: string): string {\n  if (!isValidName(name)) return name\n  const parts = name.split('.')\n  return parts[parts.length - 2]\n}\n","import { isValidName, isSegmentName, getNfdBasename } from '../nfd'\n\n/**\n * Determine the state of an NFD based on its properties\n * @param params - Parameters to determine the state\n * @returns The NFD state\n */\nexport function determineNfdState(params: {\n  expired: boolean\n  owner: string\n  nfdAccount: string\n  reservedFor?: string\n  sellAmount: number\n  isMinting: boolean\n}): 'available' | 'minting' | 'reserved' | 'forSale' | 'owned' | 'expired' {\n  // Check expiration first\n  if (params.expired) {\n    return 'expired'\n  }\n\n  // Check if reserved\n  if (params.owner === params.nfdAccount && params.reservedFor) {\n    return 'reserved'\n  }\n\n  // Check if for sale (any non-zero sell amount)\n  if (params.sellAmount !== 0) {\n    return 'forSale'\n  }\n\n  // Check if minting\n  if (params.isMinting) {\n    return 'minting'\n  }\n\n  // Check if owned by someone other than the NFD account\n  if (params.owner !== params.nfdAccount) {\n    return 'owned'\n  }\n\n  // Default to available\n  return 'available'\n}\n\n/**\n * Generate meta tags for an NFD based on its properties\n * @param name - The NFD name\n * @param segmentCount - The number of segments\n * @returns An array of meta tags\n */\nexport function generateMetaTags(name: string, segmentCount: number): string[] {\n  const tags: string[] = []\n\n  // Only process valid NFD names\n  if (isValidName(name)) {\n    // Add character count tag based on basename length\n    const basenameLength = getNfdBasename(name).length\n    if (basenameLength < 10) {\n      tags.push(`${basenameLength}_letters`)\n    } else {\n      tags.push('10+_letters')\n    }\n\n    // Add segment status tags\n    if (isSegmentName(name)) {\n      tags.push('segment')\n    } else if (segmentCount === 0) {\n      tags.push('pristine')\n    }\n  }\n\n  return tags\n}\n","import { Address, decodeUint64 } from 'algosdk'\n\nimport type { AppState } from '@algorandfoundation/algokit-utils/types/app'\n\n/**\n * Parse a string value from global state, returning empty string if not found\n * @param key - The key to parse\n * @param state - The application state\n * @returns The parsed string value\n */\nexport function parseString(key: string, state: AppState): string {\n  if (!state[key]) return ''\n  return state[key].value?.toString() ?? ''\n}\n\n/**\n * Parse a uint64 value from global state, returning 0 if not found\n * @param key - The key to parse\n * @param state - The application state\n * @returns The parsed number value\n */\nexport function parseUint64(key: string, state: AppState): number {\n  if (!state[key]) return 0\n  const value = state[key]\n  // Only process if it has valueRaw (string variant of AppState)\n  if ('valueRaw' in value) {\n    return Number(decodeUint64(value.valueRaw, 'bigint'))\n  }\n  return 0\n}\n\n/**\n * Parse an Algorand address from global state, returning empty string if not found\n * @param key - The key to parse\n * @param state - The application state\n * @returns The parsed address as a string\n */\nexport function parseAddress(key: string, state: AppState): string {\n  if (!state[key]) return ''\n\n  try {\n    const value = state[key]\n    // For raw 32-byte public keys (string variant with valueRaw)\n    if ('valueRaw' in value && value.valueRaw.length === 32) {\n      return new Address(value.valueRaw).toString()\n    }\n\n    // For regular address strings\n    return Address.fromString(value.value.toString()).toString()\n  } catch (error) {\n    console.error(`Failed to parse address for key ${key}:`, error)\n    return ''\n  }\n}\n","import algosdk from 'algosdk';\n\n/**\n * Wrapper around `algosdk.ABIMethod` that represents an ARC-56 ABI method.\n */\nclass Arc56Method extends algosdk.ABIMethod {\n    constructor(method) {\n        super(method);\n        this.method = method;\n        this.args = method.args.map((arg) => ({\n            ...arg,\n            type: algosdk.abiTypeIsTransaction(arg.type) || algosdk.abiTypeIsReference(arg.type) ? arg.type : algosdk.ABIType.from(arg.type),\n        }));\n        this.returns = {\n            ...this.method.returns,\n            type: this.method.returns.type === 'void' ? 'void' : algosdk.ABIType.from(this.method.returns.type),\n        };\n    }\n    toJSON() {\n        return this.method;\n    }\n}\n/**\n * Returns the `ABITupleType` for the given ARC-56 struct definition\n * @param struct The ARC-56 struct definition\n * @returns The `ABITupleType`\n */\nfunction getABITupleTypeFromABIStructDefinition(struct, structs) {\n    return new algosdk.ABITupleType(struct.map((v) => typeof v.type === 'string'\n        ? structs[v.type]\n            ? getABITupleTypeFromABIStructDefinition(structs[v.type], structs)\n            : algosdk.ABIType.from(v.type)\n        : getABITupleTypeFromABIStructDefinition(v.type, structs)));\n}\n/**\n * Converts a decoded ABI tuple as a struct.\n * @param decodedABITuple The decoded ABI tuple value\n * @param structFields The struct fields from an ARC-56 app spec\n * @returns The struct as a Record<string, any>\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getABIStructFromABITuple(decodedABITuple, structFields, structs) {\n    return Object.fromEntries(structFields.map(({ name: key, type }, i) => {\n        const abiValue = decodedABITuple[i];\n        return [\n            key,\n            (typeof type === 'string' && !structs[type]) || !Array.isArray(abiValue)\n                ? decodedABITuple[i]\n                : getABIStructFromABITuple(abiValue, typeof type === 'string' ? structs[type] : type, structs),\n        ];\n    }));\n}\n/**\n * Converts an ARC-56 struct as an ABI tuple.\n * @param struct The struct to convert\n * @param structFields The struct fields from an ARC-56 app spec\n * @returns The struct as a decoded ABI tuple\n */\nfunction getABITupleFromABIStruct(struct, structFields, structs) {\n    return structFields.map(({ name: key, type }) => {\n        const value = struct[key];\n        return typeof type === 'string' && !structs[type]\n            ? value\n            : getABITupleFromABIStruct(value, typeof type === 'string' ? structs[type] : type, structs);\n    });\n}\n/**\n * Returns the decoded ABI value (or struct for a struct type)\n * for the given raw Algorand value given an ARC-56 type and defined ARC-56 structs.\n * @param value The raw Algorand value (bytes or uint64)\n * @param type The ARC-56 type - either an ABI Type string or a struct name\n * @param structs The defined ARC-56 structs\n * @returns The decoded ABI value or struct\n */\nfunction getABIDecodedValue(value, type, structs) {\n    if (type === 'AVMBytes' || typeof value !== 'object')\n        return value;\n    if (type === 'AVMString')\n        return Buffer.from(value).toString('utf-8');\n    if (type === 'AVMUint64')\n        return algosdk.ABIType.from('uint64').decode(value);\n    if (structs[type]) {\n        const tupleValue = getABITupleTypeFromABIStructDefinition(structs[type], structs).decode(value);\n        return getABIStructFromABITuple(tupleValue, structs[type], structs);\n    }\n    return algosdk.ABIType.from(type).decode(value);\n}\n/**\n * Returns the ABI-encoded value for the given value.\n * @param value The value to encode either already in encoded binary form (`Uint8Array`), a decoded ABI value or an ARC-56 struct\n * @param type The ARC-56 type - either an ABI Type string or a struct name\n * @param structs The defined ARC-56 structs\n * @returns The binary ABI-encoded value\n */\nfunction getABIEncodedValue(value, type, structs) {\n    if (typeof value === 'object' && value instanceof Uint8Array)\n        return value;\n    if (type === 'AVMUint64')\n        return algosdk.ABIType.from('uint64').encode(value);\n    if (type === 'AVMBytes' || type === 'AVMString') {\n        if (typeof value === 'string')\n            return Buffer.from(value, 'utf-8');\n        if (typeof value !== 'object' || !(value instanceof Uint8Array))\n            throw new Error(`Expected bytes value for ${type}, but got ${value}`);\n        return value;\n    }\n    if (structs[type]) {\n        const tupleType = getABITupleTypeFromABIStructDefinition(structs[type], structs);\n        if (Array.isArray(value)) {\n            tupleType.encode(value);\n        }\n        else {\n            return tupleType.encode(getABITupleFromABIStruct(value, structs[type], structs));\n        }\n    }\n    return algosdk.ABIType.from(type).encode(value);\n}\n/**\n * Returns the ARC-56 ABI method object for a given method name or signature and ARC-56 app spec.\n * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.\n * e.g. `my_method` or `my_method(unit64,string)bytes`\n * @param appSpec The app spec for the app\n * @returns The `Arc56Method`\n */\nfunction getArc56Method(methodNameOrSignature, appSpec) {\n    let method;\n    if (!methodNameOrSignature.includes('(')) {\n        const methods = appSpec.methods.filter((m) => m.name === methodNameOrSignature);\n        if (methods.length === 0)\n            throw new Error(`Unable to find method ${methodNameOrSignature} in ${appSpec.name} app.`);\n        if (methods.length > 1) {\n            throw new Error(`Received a call to method ${methodNameOrSignature} in contract ${appSpec.name}, but this resolved to multiple methods; please pass in an ABI signature instead: ${appSpec.methods\n                .map((m) => new algosdk.ABIMethod(m).getSignature())\n                .join(', ')}`);\n        }\n        method = methods[0];\n    }\n    else {\n        const m = appSpec.methods.find((m) => new algosdk.ABIMethod(m).getSignature() === methodNameOrSignature);\n        if (!m)\n            throw new Error(`Unable to find method ${methodNameOrSignature} in ${appSpec.name} app.`);\n        method = m;\n    }\n    return new Arc56Method(method);\n}\n/**\n * Checks for decode errors on the AppCallTransactionResult and maps the return value to the specified generic type\n *\n * @param returnValue The smart contract response\n * @param method The method that was called\n * @param structs The struct fields from the app spec\n * @returns The smart contract response with an updated return value\n */\nfunction getArc56ReturnValue(returnValue, method, structs) {\n    const m = 'method' in method ? method.method : method;\n    const type = m.returns.struct ?? m.returns.type;\n    if (returnValue?.decodeError) {\n        throw returnValue.decodeError;\n    }\n    if (type === undefined || type === 'void' || returnValue?.returnValue === undefined)\n        return undefined;\n    if (type === 'AVMBytes')\n        return returnValue.rawReturnValue;\n    if (type === 'AVMString')\n        return Buffer.from(returnValue.rawReturnValue).toString('utf-8');\n    if (type === 'AVMUint64')\n        return algosdk.ABIType.from('uint64').decode(returnValue.rawReturnValue);\n    if (structs[type]) {\n        return getABIStructFromABITuple(returnValue.returnValue, structs[type], structs);\n    }\n    return returnValue.returnValue;\n}\n\nexport { Arc56Method, getABIDecodedValue, getABIEncodedValue, getABIStructFromABITuple, getABITupleFromABIStruct, getABITupleTypeFromABIStructDefinition, getArc56Method, getArc56ReturnValue };\n//# sourceMappingURL=app-arc56.mjs.map\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n  lookup[i] = code[i]\n  revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n  var len = b64.length\n\n  if (len % 4 > 0) {\n    throw new Error('Invalid string. Length must be a multiple of 4')\n  }\n\n  // Trim off extra bytes after placeholder bytes are found\n  // See: https://github.com/beatgammit/base64-js/issues/42\n  var validLen = b64.indexOf('=')\n  if (validLen === -1) validLen = len\n\n  var placeHoldersLen = validLen === len\n    ? 0\n    : 4 - (validLen % 4)\n\n  return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n  var lens = getLens(b64)\n  var validLen = lens[0]\n  var placeHoldersLen = lens[1]\n  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n  var tmp\n  var lens = getLens(b64)\n  var validLen = lens[0]\n  var placeHoldersLen = lens[1]\n\n  var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n  var curByte = 0\n\n  // if there are placeholders, only get up to the last complete 4 chars\n  var len = placeHoldersLen > 0\n    ? validLen - 4\n    : validLen\n\n  var i\n  for (i = 0; i < len; i += 4) {\n    tmp =\n      (revLookup[b64.charCodeAt(i)] << 18) |\n      (revLookup[b64.charCodeAt(i + 1)] << 12) |\n      (revLookup[b64.charCodeAt(i + 2)] << 6) |\n      revLookup[b64.charCodeAt(i + 3)]\n    arr[curByte++] = (tmp >> 16) & 0xFF\n    arr[curByte++] = (tmp >> 8) & 0xFF\n    arr[curByte++] = tmp & 0xFF\n  }\n\n  if (placeHoldersLen === 2) {\n    tmp =\n      (revLookup[b64.charCodeAt(i)] << 2) |\n      (revLookup[b64.charCodeAt(i + 1)] >> 4)\n    arr[curByte++] = tmp & 0xFF\n  }\n\n  if (placeHoldersLen === 1) {\n    tmp =\n      (revLookup[b64.charCodeAt(i)] << 10) |\n      (revLookup[b64.charCodeAt(i + 1)] << 4) |\n      (revLookup[b64.charCodeAt(i + 2)] >> 2)\n    arr[curByte++] = (tmp >> 8) & 0xFF\n    arr[curByte++] = tmp & 0xFF\n  }\n\n  return arr\n}\n\nfunction tripletToBase64 (num) {\n  return lookup[num >> 18 & 0x3F] +\n    lookup[num >> 12 & 0x3F] +\n    lookup[num >> 6 & 0x3F] +\n    lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n  var tmp\n  var output = []\n  for (var i = start; i < end; i += 3) {\n    tmp =\n      ((uint8[i] << 16) & 0xFF0000) +\n      ((uint8[i + 1] << 8) & 0xFF00) +\n      (uint8[i + 2] & 0xFF)\n    output.push(tripletToBase64(tmp))\n  }\n  return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n  var tmp\n  var len = uint8.length\n  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n  var parts = []\n  var maxChunkLength = 16383 // must be multiple of 3\n\n  // go through the array every three bytes, we'll deal with trailing stuff later\n  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n    parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n  }\n\n  // pad the end with zeros, but make sure to not forget the extra bytes\n  if (extraBytes === 1) {\n    tmp = uint8[len - 1]\n    parts.push(\n      lookup[tmp >> 2] +\n      lookup[(tmp << 4) & 0x3F] +\n      '=='\n    )\n  } else if (extraBytes === 2) {\n    tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n    parts.push(\n      lookup[tmp >> 10] +\n      lookup[(tmp >> 4) & 0x3F] +\n      lookup[(tmp << 2) & 0x3F] +\n      '='\n    )\n  }\n\n  return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n  var e, m\n  var eLen = (nBytes * 8) - mLen - 1\n  var eMax = (1 << eLen) - 1\n  var eBias = eMax >> 1\n  var nBits = -7\n  var i = isLE ? (nBytes - 1) : 0\n  var d = isLE ? -1 : 1\n  var s = buffer[offset + i]\n\n  i += d\n\n  e = s & ((1 << (-nBits)) - 1)\n  s >>= (-nBits)\n  nBits += eLen\n  for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n  m = e & ((1 << (-nBits)) - 1)\n  e >>= (-nBits)\n  nBits += mLen\n  for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n  if (e === 0) {\n    e = 1 - eBias\n  } else if (e === eMax) {\n    return m ? NaN : ((s ? -1 : 1) * Infinity)\n  } else {\n    m = m + Math.pow(2, mLen)\n    e = e - eBias\n  }\n  return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n  var e, m, c\n  var eLen = (nBytes * 8) - mLen - 1\n  var eMax = (1 << eLen) - 1\n  var eBias = eMax >> 1\n  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n  var i = isLE ? 0 : (nBytes - 1)\n  var d = isLE ? 1 : -1\n  var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n  value = Math.abs(value)\n\n  if (isNaN(value) || value === Infinity) {\n    m = isNaN(value) ? 1 : 0\n    e = eMax\n  } else {\n    e = Math.floor(Math.log(value) / Math.LN2)\n    if (value * (c = Math.pow(2, -e)) < 1) {\n      e--\n      c *= 2\n    }\n    if (e + eBias >= 1) {\n      value += rt / c\n    } else {\n      value += rt * Math.pow(2, 1 - eBias)\n    }\n    if (value * c >= 2) {\n      e++\n      c /= 2\n    }\n\n    if (e + eBias >= eMax) {\n      m = 0\n      e = eMax\n    } else if (e + eBias >= 1) {\n      m = ((value * c) - 1) * Math.pow(2, mLen)\n      e = e + eBias\n    } else {\n      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n      e = 0\n    }\n  }\n\n  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n  e = (e << mLen) | m\n  eLen += mLen\n  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n  buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author   Feross Aboukhadijeh <https://feross.org>\n * @license  MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n  (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n    ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n    : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n *   === true    Use Uint8Array implementation (fastest)\n *   === false   Print warning and recommend using `buffer` v4.x which has an Object\n *               implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n    typeof console.error === 'function') {\n  console.error(\n    'This browser lacks typed array (Uint8Array) support which is required by ' +\n    '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n  )\n}\n\nfunction typedArraySupport () {\n  // Can typed array instances can be augmented?\n  try {\n    const arr = new Uint8Array(1)\n    const proto = { foo: function () { return 42 } }\n    Object.setPrototypeOf(proto, Uint8Array.prototype)\n    Object.setPrototypeOf(arr, proto)\n    return arr.foo() === 42\n  } catch (e) {\n    return false\n  }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n  enumerable: true,\n  get: function () {\n    if (!Buffer.isBuffer(this)) return undefined\n    return this.buffer\n  }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n  enumerable: true,\n  get: function () {\n    if (!Buffer.isBuffer(this)) return undefined\n    return this.byteOffset\n  }\n})\n\nfunction createBuffer (length) {\n  if (length > K_MAX_LENGTH) {\n    throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n  }\n  // Return an augmented `Uint8Array` instance\n  const buf = new Uint8Array(length)\n  Object.setPrototypeOf(buf, Buffer.prototype)\n  return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n  // Common case.\n  if (typeof arg === 'number') {\n    if (typeof encodingOrOffset === 'string') {\n      throw new TypeError(\n        'The \"string\" argument must be of type string. Received type number'\n      )\n    }\n    return allocUnsafe(arg)\n  }\n  return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n  if (typeof value === 'string') {\n    return fromString(value, encodingOrOffset)\n  }\n\n  if (ArrayBuffer.isView(value)) {\n    return fromArrayView(value)\n  }\n\n  if (value == null) {\n    throw new TypeError(\n      'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n      'or Array-like Object. Received type ' + (typeof value)\n    )\n  }\n\n  if (isInstance(value, ArrayBuffer) ||\n      (value && isInstance(value.buffer, ArrayBuffer))) {\n    return fromArrayBuffer(value, encodingOrOffset, length)\n  }\n\n  if (typeof SharedArrayBuffer !== 'undefined' &&\n      (isInstance(value, SharedArrayBuffer) ||\n      (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n    return fromArrayBuffer(value, encodingOrOffset, length)\n  }\n\n  if (typeof value === 'number') {\n    throw new TypeError(\n      'The \"value\" argument must not be of type number. Received type number'\n    )\n  }\n\n  const valueOf = value.valueOf && value.valueOf()\n  if (valueOf != null && valueOf !== value) {\n    return Buffer.from(valueOf, encodingOrOffset, length)\n  }\n\n  const b = fromObject(value)\n  if (b) return b\n\n  if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n      typeof value[Symbol.toPrimitive] === 'function') {\n    return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n  }\n\n  throw new TypeError(\n    'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n    'or Array-like Object. Received type ' + (typeof value)\n  )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n  return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('\"size\" argument must be of type number')\n  } else if (size < 0) {\n    throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n  }\n}\n\nfunction alloc (size, fill, encoding) {\n  assertSize(size)\n  if (size <= 0) {\n    return createBuffer(size)\n  }\n  if (fill !== undefined) {\n    // Only pay attention to encoding if it's a string. This\n    // prevents accidentally sending in a number that would\n    // be interpreted as a start offset.\n    return typeof encoding === 'string'\n      ? createBuffer(size).fill(fill, encoding)\n      : createBuffer(size).fill(fill)\n  }\n  return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n  return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n  assertSize(size)\n  return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n  return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n  return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n  if (typeof encoding !== 'string' || encoding === '') {\n    encoding = 'utf8'\n  }\n\n  if (!Buffer.isEncoding(encoding)) {\n    throw new TypeError('Unknown encoding: ' + encoding)\n  }\n\n  const length = byteLength(string, encoding) | 0\n  let buf = createBuffer(length)\n\n  const actual = buf.write(string, encoding)\n\n  if (actual !== length) {\n    // Writing a hex string, for example, that contains invalid characters will\n    // cause everything after the first invalid character to be ignored. (e.g.\n    // 'abxxcd' will be treated as 'ab')\n    buf = buf.slice(0, actual)\n  }\n\n  return buf\n}\n\nfunction fromArrayLike (array) {\n  const length = array.length < 0 ? 0 : checked(array.length) | 0\n  const buf = createBuffer(length)\n  for (let i = 0; i < length; i += 1) {\n    buf[i] = array[i] & 255\n  }\n  return buf\n}\n\nfunction fromArrayView (arrayView) {\n  if (isInstance(arrayView, Uint8Array)) {\n    const copy = new Uint8Array(arrayView)\n    return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n  }\n  return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n  if (byteOffset < 0 || array.byteLength < byteOffset) {\n    throw new RangeError('\"offset\" is outside of buffer bounds')\n  }\n\n  if (array.byteLength < byteOffset + (length || 0)) {\n    throw new RangeError('\"length\" is outside of buffer bounds')\n  }\n\n  let buf\n  if (byteOffset === undefined && length === undefined) {\n    buf = new Uint8Array(array)\n  } else if (length === undefined) {\n    buf = new Uint8Array(array, byteOffset)\n  } else {\n    buf = new Uint8Array(array, byteOffset, length)\n  }\n\n  // Return an augmented `Uint8Array` instance\n  Object.setPrototypeOf(buf, Buffer.prototype)\n\n  return buf\n}\n\nfunction fromObject (obj) {\n  if (Buffer.isBuffer(obj)) {\n    const len = checked(obj.length) | 0\n    const buf = createBuffer(len)\n\n    if (buf.length === 0) {\n      return buf\n    }\n\n    obj.copy(buf, 0, 0, len)\n    return buf\n  }\n\n  if (obj.length !== undefined) {\n    if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n      return createBuffer(0)\n    }\n    return fromArrayLike(obj)\n  }\n\n  if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n    return fromArrayLike(obj.data)\n  }\n}\n\nfunction checked (length) {\n  // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n  // length is NaN (which is otherwise coerced to zero.)\n  if (length >= K_MAX_LENGTH) {\n    throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n                         'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n  }\n  return length | 0\n}\n\nfunction SlowBuffer (length) {\n  if (+length != length) { // eslint-disable-line eqeqeq\n    length = 0\n  }\n  return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n  return b != null && b._isBuffer === true &&\n    b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n  if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n  if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n  if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n    throw new TypeError(\n      'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n    )\n  }\n\n  if (a === b) return 0\n\n  let x = a.length\n  let y = b.length\n\n  for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n    if (a[i] !== b[i]) {\n      x = a[i]\n      y = b[i]\n      break\n    }\n  }\n\n  if (x < y) return -1\n  if (y < x) return 1\n  return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n  switch (String(encoding).toLowerCase()) {\n    case 'hex':\n    case 'utf8':\n    case 'utf-8':\n    case 'ascii':\n    case 'latin1':\n    case 'binary':\n    case 'base64':\n    case 'ucs2':\n    case 'ucs-2':\n    case 'utf16le':\n    case 'utf-16le':\n      return true\n    default:\n      return false\n  }\n}\n\nBuffer.concat = function concat (list, length) {\n  if (!Array.isArray(list)) {\n    throw new TypeError('\"list\" argument must be an Array of Buffers')\n  }\n\n  if (list.length === 0) {\n    return Buffer.alloc(0)\n  }\n\n  let i\n  if (length === undefined) {\n    length = 0\n    for (i = 0; i < list.length; ++i) {\n      length += list[i].length\n    }\n  }\n\n  const buffer = Buffer.allocUnsafe(length)\n  let pos = 0\n  for (i = 0; i < list.length; ++i) {\n    let buf = list[i]\n    if (isInstance(buf, Uint8Array)) {\n      if (pos + buf.length > buffer.length) {\n        if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n        buf.copy(buffer, pos)\n      } else {\n        Uint8Array.prototype.set.call(\n          buffer,\n          buf,\n          pos\n        )\n      }\n    } else if (!Buffer.isBuffer(buf)) {\n      throw new TypeError('\"list\" argument must be an Array of Buffers')\n    } else {\n      buf.copy(buffer, pos)\n    }\n    pos += buf.length\n  }\n  return buffer\n}\n\nfunction byteLength (string, encoding) {\n  if (Buffer.isBuffer(string)) {\n    return string.length\n  }\n  if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n    return string.byteLength\n  }\n  if (typeof string !== 'string') {\n    throw new TypeError(\n      'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n      'Received type ' + typeof string\n    )\n  }\n\n  const len = string.length\n  const mustMatch = (arguments.length > 2 && arguments[2] === true)\n  if (!mustMatch && len === 0) return 0\n\n  // Use a for loop to avoid recursion\n  let loweredCase = false\n  for (;;) {\n    switch (encoding) {\n      case 'ascii':\n      case 'latin1':\n      case 'binary':\n        return len\n      case 'utf8':\n      case 'utf-8':\n        return utf8ToBytes(string).length\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return len * 2\n      case 'hex':\n        return len >>> 1\n      case 'base64':\n        return base64ToBytes(string).length\n      default:\n        if (loweredCase) {\n          return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n        }\n        encoding = ('' + encoding).toLowerCase()\n        loweredCase = true\n    }\n  }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n  let loweredCase = false\n\n  // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n  // property of a typed array.\n\n  // This behaves neither like String nor Uint8Array in that we set start/end\n  // to their upper/lower bounds if the value passed is out of range.\n  // undefined is handled specially as per ECMA-262 6th Edition,\n  // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n  if (start === undefined || start < 0) {\n    start = 0\n  }\n  // Return early if start > this.length. Done here to prevent potential uint32\n  // coercion fail below.\n  if (start > this.length) {\n    return ''\n  }\n\n  if (end === undefined || end > this.length) {\n    end = this.length\n  }\n\n  if (end <= 0) {\n    return ''\n  }\n\n  // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n  end >>>= 0\n  start >>>= 0\n\n  if (end <= start) {\n    return ''\n  }\n\n  if (!encoding) encoding = 'utf8'\n\n  while (true) {\n    switch (encoding) {\n      case 'hex':\n        return hexSlice(this, start, end)\n\n      case 'utf8':\n      case 'utf-8':\n        return utf8Slice(this, start, end)\n\n      case 'ascii':\n        return asciiSlice(this, start, end)\n\n      case 'latin1':\n      case 'binary':\n        return latin1Slice(this, start, end)\n\n      case 'base64':\n        return base64Slice(this, start, end)\n\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return utf16leSlice(this, start, end)\n\n      default:\n        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n        encoding = (encoding + '').toLowerCase()\n        loweredCase = true\n    }\n  }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n  const i = b[n]\n  b[n] = b[m]\n  b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n  const len = this.length\n  if (len % 2 !== 0) {\n    throw new RangeError('Buffer size must be a multiple of 16-bits')\n  }\n  for (let i = 0; i < len; i += 2) {\n    swap(this, i, i + 1)\n  }\n  return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n  const len = this.length\n  if (len % 4 !== 0) {\n    throw new RangeError('Buffer size must be a multiple of 32-bits')\n  }\n  for (let i = 0; i < len; i += 4) {\n    swap(this, i, i + 3)\n    swap(this, i + 1, i + 2)\n  }\n  return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n  const len = this.length\n  if (len % 8 !== 0) {\n    throw new RangeError('Buffer size must be a multiple of 64-bits')\n  }\n  for (let i = 0; i < len; i += 8) {\n    swap(this, i, i + 7)\n    swap(this, i + 1, i + 6)\n    swap(this, i + 2, i + 5)\n    swap(this, i + 3, i + 4)\n  }\n  return this\n}\n\nBuffer.prototype.toString = function toString () {\n  const length = this.length\n  if (length === 0) return ''\n  if (arguments.length === 0) return utf8Slice(this, 0, length)\n  return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n  if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n  if (this === b) return true\n  return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n  let str = ''\n  const max = exports.INSPECT_MAX_BYTES\n  str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n  if (this.length > max) str += ' ... '\n  return '<Buffer ' + str + '>'\n}\nif (customInspectSymbol) {\n  Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n  if (isInstance(target, Uint8Array)) {\n    target = Buffer.from(target, target.offset, target.byteLength)\n  }\n  if (!Buffer.isBuffer(target)) {\n    throw new TypeError(\n      'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n      'Received type ' + (typeof target)\n    )\n  }\n\n  if (start === undefined) {\n    start = 0\n  }\n  if (end === undefined) {\n    end = target ? target.length : 0\n  }\n  if (thisStart === undefined) {\n    thisStart = 0\n  }\n  if (thisEnd === undefined) {\n    thisEnd = this.length\n  }\n\n  if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n    throw new RangeError('out of range index')\n  }\n\n  if (thisStart >= thisEnd && start >= end) {\n    return 0\n  }\n  if (thisStart >= thisEnd) {\n    return -1\n  }\n  if (start >= end) {\n    return 1\n  }\n\n  start >>>= 0\n  end >>>= 0\n  thisStart >>>= 0\n  thisEnd >>>= 0\n\n  if (this === target) return 0\n\n  let x = thisEnd - thisStart\n  let y = end - start\n  const len = Math.min(x, y)\n\n  const thisCopy = this.slice(thisStart, thisEnd)\n  const targetCopy = target.slice(start, end)\n\n  for (let i = 0; i < len; ++i) {\n    if (thisCopy[i] !== targetCopy[i]) {\n      x = thisCopy[i]\n      y = targetCopy[i]\n      break\n    }\n  }\n\n  if (x < y) return -1\n  if (y < x) return 1\n  return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n  // Empty buffer means no match\n  if (buffer.length === 0) return -1\n\n  // Normalize byteOffset\n  if (typeof byteOffset === 'string') {\n    encoding = byteOffset\n    byteOffset = 0\n  } else if (byteOffset > 0x7fffffff) {\n    byteOffset = 0x7fffffff\n  } else if (byteOffset < -0x80000000) {\n    byteOffset = -0x80000000\n  }\n  byteOffset = +byteOffset // Coerce to Number.\n  if (numberIsNaN(byteOffset)) {\n    // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n    byteOffset = dir ? 0 : (buffer.length - 1)\n  }\n\n  // Normalize byteOffset: negative offsets start from the end of the buffer\n  if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n  if (byteOffset >= buffer.length) {\n    if (dir) return -1\n    else byteOffset = buffer.length - 1\n  } else if (byteOffset < 0) {\n    if (dir) byteOffset = 0\n    else return -1\n  }\n\n  // Normalize val\n  if (typeof val === 'string') {\n    val = Buffer.from(val, encoding)\n  }\n\n  // Finally, search either indexOf (if dir is true) or lastIndexOf\n  if (Buffer.isBuffer(val)) {\n    // Special case: looking for empty string/buffer always fails\n    if (val.length === 0) {\n      return -1\n    }\n    return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n  } else if (typeof val === 'number') {\n    val = val & 0xFF // Search for a byte value [0-255]\n    if (typeof Uint8Array.prototype.indexOf === 'function') {\n      if (dir) {\n        return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n      } else {\n        return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n      }\n    }\n    return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n  }\n\n  throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n  let indexSize = 1\n  let arrLength = arr.length\n  let valLength = val.length\n\n  if (encoding !== undefined) {\n    encoding = String(encoding).toLowerCase()\n    if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n        encoding === 'utf16le' || encoding === 'utf-16le') {\n      if (arr.length < 2 || val.length < 2) {\n        return -1\n      }\n      indexSize = 2\n      arrLength /= 2\n      valLength /= 2\n      byteOffset /= 2\n    }\n  }\n\n  function read (buf, i) {\n    if (indexSize === 1) {\n      return buf[i]\n    } else {\n      return buf.readUInt16BE(i * indexSize)\n    }\n  }\n\n  let i\n  if (dir) {\n    let foundIndex = -1\n    for (i = byteOffset; i < arrLength; i++) {\n      if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n        if (foundIndex === -1) foundIndex = i\n        if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n      } else {\n        if (foundIndex !== -1) i -= i - foundIndex\n        foundIndex = -1\n      }\n    }\n  } else {\n    if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n    for (i = byteOffset; i >= 0; i--) {\n      let found = true\n      for (let j = 0; j < valLength; j++) {\n        if (read(arr, i + j) !== read(val, j)) {\n          found = false\n          break\n        }\n      }\n      if (found) return i\n    }\n  }\n\n  return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n  return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n  return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n  return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n  offset = Number(offset) || 0\n  const remaining = buf.length - offset\n  if (!length) {\n    length = remaining\n  } else {\n    length = Number(length)\n    if (length > remaining) {\n      length = remaining\n    }\n  }\n\n  const strLen = string.length\n\n  if (length > strLen / 2) {\n    length = strLen / 2\n  }\n  let i\n  for (i = 0; i < length; ++i) {\n    const parsed = parseInt(string.substr(i * 2, 2), 16)\n    if (numberIsNaN(parsed)) return i\n    buf[offset + i] = parsed\n  }\n  return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n  return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n  return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n  return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n  return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n  // Buffer#write(string)\n  if (offset === undefined) {\n    encoding = 'utf8'\n    length = this.length\n    offset = 0\n  // Buffer#write(string, encoding)\n  } else if (length === undefined && typeof offset === 'string') {\n    encoding = offset\n    length = this.length\n    offset = 0\n  // Buffer#write(string, offset[, length][, encoding])\n  } else if (isFinite(offset)) {\n    offset = offset >>> 0\n    if (isFinite(length)) {\n      length = length >>> 0\n      if (encoding === undefined) encoding = 'utf8'\n    } else {\n      encoding = length\n      length = undefined\n    }\n  } else {\n    throw new Error(\n      'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n    )\n  }\n\n  const remaining = this.length - offset\n  if (length === undefined || length > remaining) length = remaining\n\n  if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n    throw new RangeError('Attempt to write outside buffer bounds')\n  }\n\n  if (!encoding) encoding = 'utf8'\n\n  let loweredCase = false\n  for (;;) {\n    switch (encoding) {\n      case 'hex':\n        return hexWrite(this, string, offset, length)\n\n      case 'utf8':\n      case 'utf-8':\n        return utf8Write(this, string, offset, length)\n\n      case 'ascii':\n      case 'latin1':\n      case 'binary':\n        return asciiWrite(this, string, offset, length)\n\n      case 'base64':\n        // Warning: maxLength not taken into account in base64Write\n        return base64Write(this, string, offset, length)\n\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return ucs2Write(this, string, offset, length)\n\n      default:\n        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n        encoding = ('' + encoding).toLowerCase()\n        loweredCase = true\n    }\n  }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n  return {\n    type: 'Buffer',\n    data: Array.prototype.slice.call(this._arr || this, 0)\n  }\n}\n\nfunction base64Slice (buf, start, end) {\n  if (start === 0 && end === buf.length) {\n    return base64.fromByteArray(buf)\n  } else {\n    return base64.fromByteArray(buf.slice(start, end))\n  }\n}\n\nfunction utf8Slice (buf, start, end) {\n  end = Math.min(buf.length, end)\n  const res = []\n\n  let i = start\n  while (i < end) {\n    const firstByte = buf[i]\n    let codePoint = null\n    let bytesPerSequence = (firstByte > 0xEF)\n      ? 4\n      : (firstByte > 0xDF)\n          ? 3\n          : (firstByte > 0xBF)\n              ? 2\n              : 1\n\n    if (i + bytesPerSequence <= end) {\n      let secondByte, thirdByte, fourthByte, tempCodePoint\n\n      switch (bytesPerSequence) {\n        case 1:\n          if (firstByte < 0x80) {\n            codePoint = firstByte\n          }\n          break\n        case 2:\n          secondByte = buf[i + 1]\n          if ((secondByte & 0xC0) === 0x80) {\n            tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n            if (tempCodePoint > 0x7F) {\n              codePoint = tempCodePoint\n            }\n          }\n          break\n        case 3:\n          secondByte = buf[i + 1]\n          thirdByte = buf[i + 2]\n          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n            tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n            if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n              codePoint = tempCodePoint\n            }\n          }\n          break\n        case 4:\n          secondByte = buf[i + 1]\n          thirdByte = buf[i + 2]\n          fourthByte = buf[i + 3]\n          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n            tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n            if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n              codePoint = tempCodePoint\n            }\n          }\n      }\n    }\n\n    if (codePoint === null) {\n      // we did not generate a valid codePoint so insert a\n      // replacement char (U+FFFD) and advance only 1 byte\n      codePoint = 0xFFFD\n      bytesPerSequence = 1\n    } else if (codePoint > 0xFFFF) {\n      // encode to utf16 (surrogate pair dance)\n      codePoint -= 0x10000\n      res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n      codePoint = 0xDC00 | codePoint & 0x3FF\n    }\n\n    res.push(codePoint)\n    i += bytesPerSequence\n  }\n\n  return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n  const len = codePoints.length\n  if (len <= MAX_ARGUMENTS_LENGTH) {\n    return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n  }\n\n  // Decode in chunks to avoid \"call stack size exceeded\".\n  let res = ''\n  let i = 0\n  while (i < len) {\n    res += String.fromCharCode.apply(\n      String,\n      codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n    )\n  }\n  return res\n}\n\nfunction asciiSlice (buf, start, end) {\n  let ret = ''\n  end = Math.min(buf.length, end)\n\n  for (let i = start; i < end; ++i) {\n    ret += String.fromCharCode(buf[i] & 0x7F)\n  }\n  return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n  let ret = ''\n  end = Math.min(buf.length, end)\n\n  for (let i = start; i < end; ++i) {\n    ret += String.fromCharCode(buf[i])\n  }\n  return ret\n}\n\nfunction hexSlice (buf, start, end) {\n  const len = buf.length\n\n  if (!start || start < 0) start = 0\n  if (!end || end < 0 || end > len) end = len\n\n  let out = ''\n  for (let i = start; i < end; ++i) {\n    out += hexSliceLookupTable[buf[i]]\n  }\n  return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n  const bytes = buf.slice(start, end)\n  let res = ''\n  // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n  for (let i = 0; i < bytes.length - 1; i += 2) {\n    res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n  }\n  return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n  const len = this.length\n  start = ~~start\n  end = end === undefined ? len : ~~end\n\n  if (start < 0) {\n    start += len\n    if (start < 0) start = 0\n  } else if (start > len) {\n    start = len\n  }\n\n  if (end < 0) {\n    end += len\n    if (end < 0) end = 0\n  } else if (end > len) {\n    end = len\n  }\n\n  if (end < start) end = start\n\n  const newBuf = this.subarray(start, end)\n  // Return an augmented `Uint8Array` instance\n  Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n  return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n  if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n  if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n  offset = offset >>> 0\n  byteLength = byteLength >>> 0\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n  let val = this[offset]\n  let mul = 1\n  let i = 0\n  while (++i < byteLength && (mul *= 0x100)) {\n    val += this[offset + i] * mul\n  }\n\n  return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n  offset = offset >>> 0\n  byteLength = byteLength >>> 0\n  if (!noAssert) {\n    checkOffset(offset, byteLength, this.length)\n  }\n\n  let val = this[offset + --byteLength]\n  let mul = 1\n  while (byteLength > 0 && (mul *= 0x100)) {\n    val += this[offset + --byteLength] * mul\n  }\n\n  return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 1, this.length)\n  return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return ((this[offset]) |\n      (this[offset + 1] << 8) |\n      (this[offset + 2] << 16)) +\n      (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return (this[offset] * 0x1000000) +\n    ((this[offset + 1] << 16) |\n    (this[offset + 2] << 8) |\n    this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n  offset = offset >>> 0\n  validateNumber(offset, 'offset')\n  const first = this[offset]\n  const last = this[offset + 7]\n  if (first === undefined || last === undefined) {\n    boundsError(offset, this.length - 8)\n  }\n\n  const lo = first +\n    this[++offset] * 2 ** 8 +\n    this[++offset] * 2 ** 16 +\n    this[++offset] * 2 ** 24\n\n  const hi = this[++offset] +\n    this[++offset] * 2 ** 8 +\n    this[++offset] * 2 ** 16 +\n    last * 2 ** 24\n\n  return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n  offset = offset >>> 0\n  validateNumber(offset, 'offset')\n  const first = this[offset]\n  const last = this[offset + 7]\n  if (first === undefined || last === undefined) {\n    boundsError(offset, this.length - 8)\n  }\n\n  const hi = first * 2 ** 24 +\n    this[++offset] * 2 ** 16 +\n    this[++offset] * 2 ** 8 +\n    this[++offset]\n\n  const lo = this[++offset] * 2 ** 24 +\n    this[++offset] * 2 ** 16 +\n    this[++offset] * 2 ** 8 +\n    last\n\n  return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n  offset = offset >>> 0\n  byteLength = byteLength >>> 0\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n  let val = this[offset]\n  let mul = 1\n  let i = 0\n  while (++i < byteLength && (mul *= 0x100)) {\n    val += this[offset + i] * mul\n  }\n  mul *= 0x80\n\n  if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n  return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n  offset = offset >>> 0\n  byteLength = byteLength >>> 0\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n  let i = byteLength\n  let mul = 1\n  let val = this[offset + --i]\n  while (i > 0 && (mul *= 0x100)) {\n    val += this[offset + --i] * mul\n  }\n  mul *= 0x80\n\n  if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n  return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 1, this.length)\n  if (!(this[offset] & 0x80)) return (this[offset])\n  return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  const val = this[offset] | (this[offset + 1] << 8)\n  return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  const val = this[offset + 1] | (this[offset] << 8)\n  return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return (this[offset]) |\n    (this[offset + 1] << 8) |\n    (this[offset + 2] << 16) |\n    (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return (this[offset] << 24) |\n    (this[offset + 1] << 16) |\n    (this[offset + 2] << 8) |\n    (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n  offset = offset >>> 0\n  validateNumber(offset, 'offset')\n  const first = this[offset]\n  const last = this[offset + 7]\n  if (first === undefined || last === undefined) {\n    boundsError(offset, this.length - 8)\n  }\n\n  const val = this[offset + 4] +\n    this[offset + 5] * 2 ** 8 +\n    this[offset + 6] * 2 ** 16 +\n    (last << 24) // Overflow\n\n  return (BigInt(val) << BigInt(32)) +\n    BigInt(first +\n    this[++offset] * 2 ** 8 +\n    this[++offset] * 2 ** 16 +\n    this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n  offset = offset >>> 0\n  validateNumber(offset, 'offset')\n  const first = this[offset]\n  const last = this[offset + 7]\n  if (first === undefined || last === undefined) {\n    boundsError(offset, this.length - 8)\n  }\n\n  const val = (first << 24) + // Overflow\n    this[++offset] * 2 ** 16 +\n    this[++offset] * 2 ** 8 +\n    this[++offset]\n\n  return (BigInt(val) << BigInt(32)) +\n    BigInt(this[++offset] * 2 ** 24 +\n    this[++offset] * 2 ** 16 +\n    this[++offset] * 2 ** 8 +\n    last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 4, this.length)\n  return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 4, this.length)\n  return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 8, this.length)\n  return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n  offset = offset >>> 0\n  if (!noAssert) checkOffset(offset, 8, this.length)\n  return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n  if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n  if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n  if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  byteLength = byteLength >>> 0\n  if (!noAssert) {\n    const maxBytes = Math.pow(2, 8 * byteLength) - 1\n    checkInt(this, value, offset, byteLength, maxBytes, 0)\n  }\n\n  let mul = 1\n  let i = 0\n  this[offset] = value & 0xFF\n  while (++i < byteLength && (mul *= 0x100)) {\n    this[offset + i] = (value / mul) & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  byteLength = byteLength >>> 0\n  if (!noAssert) {\n    const maxBytes = Math.pow(2, 8 * byteLength) - 1\n    checkInt(this, value, offset, byteLength, maxBytes, 0)\n  }\n\n  let i = byteLength - 1\n  let mul = 1\n  this[offset + i] = value & 0xFF\n  while (--i >= 0 && (mul *= 0x100)) {\n    this[offset + i] = (value / mul) & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n  this[offset] = (value & 0xff)\n  return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n  this[offset] = (value & 0xff)\n  this[offset + 1] = (value >>> 8)\n  return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n  this[offset] = (value >>> 8)\n  this[offset + 1] = (value & 0xff)\n  return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n  this[offset + 3] = (value >>> 24)\n  this[offset + 2] = (value >>> 16)\n  this[offset + 1] = (value >>> 8)\n  this[offset] = (value & 0xff)\n  return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n  this[offset] = (value >>> 24)\n  this[offset + 1] = (value >>> 16)\n  this[offset + 2] = (value >>> 8)\n  this[offset + 3] = (value & 0xff)\n  return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n  checkIntBI(value, min, max, buf, offset, 7)\n\n  let lo = Number(value & BigInt(0xffffffff))\n  buf[offset++] = lo\n  lo = lo >> 8\n  buf[offset++] = lo\n  lo = lo >> 8\n  buf[offset++] = lo\n  lo = lo >> 8\n  buf[offset++] = lo\n  let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n  buf[offset++] = hi\n  hi = hi >> 8\n  buf[offset++] = hi\n  hi = hi >> 8\n  buf[offset++] = hi\n  hi = hi >> 8\n  buf[offset++] = hi\n  return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n  checkIntBI(value, min, max, buf, offset, 7)\n\n  let lo = Number(value & BigInt(0xffffffff))\n  buf[offset + 7] = lo\n  lo = lo >> 8\n  buf[offset + 6] = lo\n  lo = lo >> 8\n  buf[offset + 5] = lo\n  lo = lo >> 8\n  buf[offset + 4] = lo\n  let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n  buf[offset + 3] = hi\n  hi = hi >> 8\n  buf[offset + 2] = hi\n  hi = hi >> 8\n  buf[offset + 1] = hi\n  hi = hi >> 8\n  buf[offset] = hi\n  return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n  return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n  return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) {\n    const limit = Math.pow(2, (8 * byteLength) - 1)\n\n    checkInt(this, value, offset, byteLength, limit - 1, -limit)\n  }\n\n  let i = 0\n  let mul = 1\n  let sub = 0\n  this[offset] = value & 0xFF\n  while (++i < byteLength && (mul *= 0x100)) {\n    if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n      sub = 1\n    }\n    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) {\n    const limit = Math.pow(2, (8 * byteLength) - 1)\n\n    checkInt(this, value, offset, byteLength, limit - 1, -limit)\n  }\n\n  let i = byteLength - 1\n  let mul = 1\n  let sub = 0\n  this[offset + i] = value & 0xFF\n  while (--i >= 0 && (mul *= 0x100)) {\n    if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n      sub = 1\n    }\n    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n  if (value < 0) value = 0xff + value + 1\n  this[offset] = (value & 0xff)\n  return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n  this[offset] = (value & 0xff)\n  this[offset + 1] = (value >>> 8)\n  return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n  this[offset] = (value >>> 8)\n  this[offset + 1] = (value & 0xff)\n  return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n  this[offset] = (value & 0xff)\n  this[offset + 1] = (value >>> 8)\n  this[offset + 2] = (value >>> 16)\n  this[offset + 3] = (value >>> 24)\n  return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n  if (value < 0) value = 0xffffffff + value + 1\n  this[offset] = (value >>> 24)\n  this[offset + 1] = (value >>> 16)\n  this[offset + 2] = (value >>> 8)\n  this[offset + 3] = (value & 0xff)\n  return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n  return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n  return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n  if (offset + ext > buf.length) throw new RangeError('Index out of range')\n  if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) {\n    checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n  }\n  ieee754.write(buf, value, offset, littleEndian, 23, 4)\n  return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n  return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n  return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n  value = +value\n  offset = offset >>> 0\n  if (!noAssert) {\n    checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n  }\n  ieee754.write(buf, value, offset, littleEndian, 52, 8)\n  return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n  return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n  return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n  if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n  if (!start) start = 0\n  if (!end && end !== 0) end = this.length\n  if (targetStart >= target.length) targetStart = target.length\n  if (!targetStart) targetStart = 0\n  if (end > 0 && end < start) end = start\n\n  // Copy 0 bytes; we're done\n  if (end === start) return 0\n  if (target.length === 0 || this.length === 0) return 0\n\n  // Fatal error conditions\n  if (targetStart < 0) {\n    throw new RangeError('targetStart out of bounds')\n  }\n  if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n  if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n  // Are we oob?\n  if (end > this.length) end = this.length\n  if (target.length - targetStart < end - start) {\n    end = target.length - targetStart + start\n  }\n\n  const len = end - start\n\n  if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n    // Use built-in when available, missing from IE11\n    this.copyWithin(targetStart, start, end)\n  } else {\n    Uint8Array.prototype.set.call(\n      target,\n      this.subarray(start, end),\n      targetStart\n    )\n  }\n\n  return len\n}\n\n// Usage:\n//    buffer.fill(number[, offset[, end]])\n//    buffer.fill(buffer[, offset[, end]])\n//    buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n  // Handle string cases:\n  if (typeof val === 'string') {\n    if (typeof start === 'string') {\n      encoding = start\n      start = 0\n      end = this.length\n    } else if (typeof end === 'string') {\n      encoding = end\n      end = this.length\n    }\n    if (encoding !== undefined && typeof encoding !== 'string') {\n      throw new TypeError('encoding must be a string')\n    }\n    if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n      throw new TypeError('Unknown encoding: ' + encoding)\n    }\n    if (val.length === 1) {\n      const code = val.charCodeAt(0)\n      if ((encoding === 'utf8' && code < 128) ||\n          encoding === 'latin1') {\n        // Fast path: If `val` fits into a single byte, use that numeric value.\n        val = code\n      }\n    }\n  } else if (typeof val === 'number') {\n    val = val & 255\n  } else if (typeof val === 'boolean') {\n    val = Number(val)\n  }\n\n  // Invalid ranges are not set to a default, so can range check early.\n  if (start < 0 || this.length < start || this.length < end) {\n    throw new RangeError('Out of range index')\n  }\n\n  if (end <= start) {\n    return this\n  }\n\n  start = start >>> 0\n  end = end === undefined ? this.length : end >>> 0\n\n  if (!val) val = 0\n\n  let i\n  if (typeof val === 'number') {\n    for (i = start; i < end; ++i) {\n      this[i] = val\n    }\n  } else {\n    const bytes = Buffer.isBuffer(val)\n      ? val\n      : Buffer.from(val, encoding)\n    const len = bytes.length\n    if (len === 0) {\n      throw new TypeError('The value \"' + val +\n        '\" is invalid for argument \"value\"')\n    }\n    for (i = 0; i < end - start; ++i) {\n      this[i + start] = bytes[i % len]\n    }\n  }\n\n  return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n  errors[sym] = class NodeError extends Base {\n    constructor () {\n      super()\n\n      Object.defineProperty(this, 'message', {\n        value: getMessage.apply(this, arguments),\n        writable: true,\n        configurable: true\n      })\n\n      // Add the error code to the name to include it in the stack trace.\n      this.name = `${this.name} [${sym}]`\n      // Access the stack to generate the error message including the error code\n      // from the name.\n      this.stack // eslint-disable-line no-unused-expressions\n      // Reset the name to the actual name.\n      delete this.name\n    }\n\n    get code () {\n      return sym\n    }\n\n    set code (value) {\n      Object.defineProperty(this, 'code', {\n        configurable: true,\n        enumerable: true,\n        value,\n        writable: true\n      })\n    }\n\n    toString () {\n      return `${this.name} [${sym}]: ${this.message}`\n    }\n  }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n  function (name) {\n    if (name) {\n      return `${name} is outside of buffer bounds`\n    }\n\n    return 'Attempt to access memory outside buffer bounds'\n  }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n  function (name, actual) {\n    return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n  }, TypeError)\nE('ERR_OUT_OF_RANGE',\n  function (str, range, input) {\n    let msg = `The value of \"${str}\" is out of range.`\n    let received = input\n    if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n      received = addNumericalSeparator(String(input))\n    } else if (typeof input === 'bigint') {\n      received = String(input)\n      if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n        received = addNumericalSeparator(received)\n      }\n      received += 'n'\n    }\n    msg += ` It must be ${range}. Received ${received}`\n    return msg\n  }, RangeError)\n\nfunction addNumericalSeparator (val) {\n  let res = ''\n  let i = val.length\n  const start = val[0] === '-' ? 1 : 0\n  for (; i >= start + 4; i -= 3) {\n    res = `_${val.slice(i - 3, i)}${res}`\n  }\n  return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n  validateNumber(offset, 'offset')\n  if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n    boundsError(offset, buf.length - (byteLength + 1))\n  }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n  if (value > max || value < min) {\n    const n = typeof min === 'bigint' ? 'n' : ''\n    let range\n    if (byteLength > 3) {\n      if (min === 0 || min === BigInt(0)) {\n        range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n      } else {\n        range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n                `${(byteLength + 1) * 8 - 1}${n}`\n      }\n    } else {\n      range = `>= ${min}${n} and <= ${max}${n}`\n    }\n    throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n  }\n  checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n  if (typeof value !== 'number') {\n    throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n  }\n}\n\nfunction boundsError (value, length, type) {\n  if (Math.floor(value) !== value) {\n    validateNumber(value, type)\n    throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n  }\n\n  if (length < 0) {\n    throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n  }\n\n  throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n                                    `>= ${type ? 1 : 0} and <= ${length}`,\n                                    value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n  // Node takes equal signs as end of the Base64 encoding\n  str = str.split('=')[0]\n  // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n  str = str.trim().replace(INVALID_BASE64_RE, '')\n  // Node converts strings with length < 2 to ''\n  if (str.length < 2) return ''\n  // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n  while (str.length % 4 !== 0) {\n    str = str + '='\n  }\n  return str\n}\n\nfunction utf8ToBytes (string, units) {\n  units = units || Infinity\n  let codePoint\n  const length = string.length\n  let leadSurrogate = null\n  const bytes = []\n\n  for (let i = 0; i < length; ++i) {\n    codePoint = string.charCodeAt(i)\n\n    // is surrogate component\n    if (codePoint > 0xD7FF && codePoint < 0xE000) {\n      // last char was a lead\n      if (!leadSurrogate) {\n        // no lead yet\n        if (codePoint > 0xDBFF) {\n          // unexpected trail\n          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n          continue\n        } else if (i + 1 === length) {\n          // unpaired lead\n          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n          continue\n        }\n\n        // valid lead\n        leadSurrogate = codePoint\n\n        continue\n      }\n\n      // 2 leads in a row\n      if (codePoint < 0xDC00) {\n        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n        leadSurrogate = codePoint\n        continue\n      }\n\n      // valid surrogate pair\n      codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n    } else if (leadSurrogate) {\n      // valid bmp char, but last char was a lead\n      if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n    }\n\n    leadSurrogate = null\n\n    // encode utf8\n    if (codePoint < 0x80) {\n      if ((units -= 1) < 0) break\n      bytes.push(codePoint)\n    } else if (codePoint < 0x800) {\n      if ((units -= 2) < 0) break\n      bytes.push(\n        codePoint >> 0x6 | 0xC0,\n        codePoint & 0x3F | 0x80\n      )\n    } else if (codePoint < 0x10000) {\n      if ((units -= 3) < 0) break\n      bytes.push(\n        codePoint >> 0xC | 0xE0,\n        codePoint >> 0x6 & 0x3F | 0x80,\n        codePoint & 0x3F | 0x80\n      )\n    } else if (codePoint < 0x110000) {\n      if ((units -= 4) < 0) break\n      bytes.push(\n        codePoint >> 0x12 | 0xF0,\n        codePoint >> 0xC & 0x3F | 0x80,\n        codePoint >> 0x6 & 0x3F | 0x80,\n        codePoint & 0x3F | 0x80\n      )\n    } else {\n      throw new Error('Invalid code point')\n    }\n  }\n\n  return bytes\n}\n\nfunction asciiToBytes (str) {\n  const byteArray = []\n  for (let i = 0; i < str.length; ++i) {\n    // Node's code seems to be doing this and not & 0x7F..\n    byteArray.push(str.charCodeAt(i) & 0xFF)\n  }\n  return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n  let c, hi, lo\n  const byteArray = []\n  for (let i = 0; i < str.length; ++i) {\n    if ((units -= 2) < 0) break\n\n    c = str.charCodeAt(i)\n    hi = c >> 8\n    lo = c % 256\n    byteArray.push(lo)\n    byteArray.push(hi)\n  }\n\n  return byteArray\n}\n\nfunction base64ToBytes (str) {\n  return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n  let i\n  for (i = 0; i < length; ++i) {\n    if ((i + offset >= dst.length) || (i >= src.length)) break\n    dst[i + offset] = src[i]\n  }\n  return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n  return obj instanceof type ||\n    (obj != null && obj.constructor != null && obj.constructor.name != null &&\n      obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n  // For IE11 support\n  return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n  const alphabet = '0123456789abcdef'\n  const table = new Array(256)\n  for (let i = 0; i < 16; ++i) {\n    const i16 = i * 16\n    for (let j = 0; j < 16; ++j) {\n      table[i16 + j] = alphabet[i] + alphabet[j]\n    }\n  }\n  return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n  return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n  throw new Error('BigInt not supported')\n}\n","class AsyncEventEmitter {\n    constructor() {\n        this.listenerWrapperMap = new WeakMap();\n        this.listenerMap = {};\n        this.off = this.removeListener;\n    }\n    async emitAsync(eventName, event) {\n        for (const listener of this.listenerMap[eventName] ?? []) {\n            await listener(event, eventName);\n        }\n    }\n    on(eventName, listener) {\n        if (!this.listenerMap[eventName])\n            this.listenerMap[eventName] = [];\n        this.listenerMap[eventName].push(listener);\n        return this;\n    }\n    once(eventName, listener) {\n        const wrappedListener = async (event, eventName) => {\n            try {\n                return await listener(event, eventName);\n            }\n            finally {\n                this.removeListener(eventName, wrappedListener);\n            }\n        };\n        this.listenerWrapperMap.set(listener, wrappedListener);\n        return this.on(eventName, wrappedListener);\n    }\n    removeListener(eventName, listener) {\n        const wrappedListener = this.listenerWrapperMap.get(listener);\n        if (wrappedListener) {\n            this.listenerWrapperMap.delete(listener);\n            if (this.listenerMap[eventName]?.indexOf(wrappedListener) !== -1) {\n                this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(wrappedListener), 1);\n            }\n        }\n        else {\n            if (this.listenerMap[eventName]?.indexOf(listener) !== -1) {\n                this.listenerMap[eventName].splice(this.listenerMap[eventName].indexOf(listener), 1);\n            }\n        }\n        return this;\n    }\n}\n\nexport { AsyncEventEmitter };\n//# sourceMappingURL=async-event-emitter.mjs.map\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-console */\n/** A logger implementation that writes to console */\nconst consoleLogger = {\n    error: console.error,\n    warn: console.warn,\n    info: console.info,\n    verbose: () => { },\n    debug: console.debug,\n};\nconst infoConsoleLogger = {\n    error: console.error,\n    warn: console.warn,\n    info: console.info,\n    verbose: () => { },\n    debug: () => { },\n};\nconst verboseConsoleLogger = {\n    error: console.error,\n    warn: console.warn,\n    info: console.info,\n    verbose: console.trace,\n    debug: console.debug,\n};\nconst warningConsoleLogger = {\n    error: console.error,\n    warn: console.warn,\n    info: () => { },\n    verbose: () => { },\n    debug: () => { },\n};\n/** A logger implementation that does nothing */\nconst nullLogger = {\n    error: function (message, ...optionalParams) { },\n    warn: function (message, ...optionalParams) { },\n    info: function (message, ...optionalParams) { },\n    verbose: function (message, ...optionalParams) { },\n    debug: function (message, ...optionalParams) { },\n};\n\nexport { consoleLogger, infoConsoleLogger, nullLogger, verboseConsoleLogger, warningConsoleLogger };\n//# sourceMappingURL=logging.mjs.map\n","import { AsyncEventEmitter } from './async-event-emitter.mjs';\nimport { nullLogger, consoleLogger } from './logging.mjs';\n\n/** Updatable AlgoKit config */\nclass UpdatableConfig {\n    get populateAppCallResources() {\n        return this.config.populateAppCallResources;\n    }\n    get logger() {\n        return this.config.logger;\n    }\n    get debug() {\n        return this.config.debug;\n    }\n    get projectRoot() {\n        return this.config.projectRoot;\n    }\n    get traceAll() {\n        return this.config.traceAll;\n    }\n    get traceBufferSizeMb() {\n        return this.config.traceBufferSizeMb;\n    }\n    get maxSearchDepth() {\n        return this.config.maxSearchDepth;\n    }\n    get events() {\n        return this.config.events;\n    }\n    /**\n     * Returns the current logger, or the null logger if true is passed in to `returnNullLogger`\n     * @param returnNullLogger Whether or not to return the null logger\n     * @returns The requested logger\n     */\n    getLogger(returnNullLogger) {\n        if (returnNullLogger) {\n            return nullLogger;\n        }\n        return this.logger;\n    }\n    /**\n     * Temporarily run with debug set to true.\n     * @param lambda A lambda expression with code to run with debug config set to true\n     */\n    withDebug(lambda) {\n        const original = this.config.debug;\n        try {\n            this.config.debug = true;\n            lambda();\n        }\n        finally {\n            this.config.debug = original;\n        }\n    }\n    constructor() {\n        this.config = {\n            logger: consoleLogger,\n            debug: false,\n            projectRoot: null,\n            traceAll: false,\n            traceBufferSizeMb: 256,\n            maxSearchDepth: 10,\n            populateAppCallResources: false,\n            events: new AsyncEventEmitter(),\n        };\n    }\n    /**\n     * Update the AlgoKit configuration with your own configuration settings\n     * @param newConfig Partial or complete config to replace\n     */\n    configure(newConfig) {\n        this.config = { ...this.config, ...newConfig };\n    }\n}\n\nexport { UpdatableConfig };\n//# sourceMappingURL=config.mjs.map\n","import { UpdatableConfig } from './types/config.mjs';\n\n/** The AlgoKit config. To update it use the configure method. */\nconst Config = new UpdatableConfig();\n\nexport { Config };\n//# sourceMappingURL=config.mjs.map\n","import { APP_PAGE_MAX_SIZE } from './types/app.mjs';\n\n/**\n * Converts a value which might be a number or a bigint into a number to be used with apis that don't support bigint.\n *\n * Throws an UnsafeConversionError if the conversion would result in an unsafe integer for the Number type\n * @param value\n */\nconst toNumber = (value) => {\n    if (typeof value === 'number')\n        return value;\n    if (value > BigInt(Number.MAX_SAFE_INTEGER)) {\n        throw new UnsafeConversionError(`Cannot convert ${value} to a Number as it is larger than the maximum safe integer the Number type can hold.`);\n    }\n    else if (value < BigInt(Number.MIN_SAFE_INTEGER)) {\n        throw new UnsafeConversionError(`Cannot convert ${value} to a Number as it is smaller than the minimum safe integer the Number type can hold.`);\n    }\n    return Number(value);\n};\nclass UnsafeConversionError extends Error {\n}\n/**\n * Calculates the amount of funds to add to a wallet to bring it up to the minimum spending balance.\n * @param minSpendingBalance The minimum spending balance for the wallet\n * @param currentSpendingBalance The current spending balance for the wallet\n * @param minFundingIncrement The minimum amount of funds that can be added to the wallet\n * @returns The amount of funds to add to the wallet or null if the wallet is already above the minimum spending balance\n */\nconst calculateFundAmount = (minSpendingBalance, currentSpendingBalance, minFundingIncrement) => {\n    if (minSpendingBalance > currentSpendingBalance) {\n        const minFundAmount = minSpendingBalance - currentSpendingBalance;\n        return BigInt(Math.max(Number(minFundAmount), Number(minFundingIncrement)));\n    }\n    else {\n        return null;\n    }\n};\n/**\n * Returns the given array split into chunks of `batchSize` batches.\n * @param array The array to chunk\n * @param batchSize The size of batches to split the array into\n * @returns A generator that yields the array split into chunks of `batchSize` batches\n */\nfunction* chunkArray(array, batchSize) {\n    for (let i = 0; i < array.length; i += batchSize)\n        yield array.slice(i, i + batchSize);\n}\n/**\n * Memoize calls to the given function in an in-memory map.\n * @param fn The function to memoize\n * @returns The memoized function\n */\nconst memoize = (fn) => {\n    const cache = new Map();\n    const cached = function (val) {\n        return cache.has(val) ? cache.get(val) : cache.set(val, fn.call(this, val)) && cache.get(val);\n    };\n    cached.cache = cache;\n    return cached;\n};\nconst binaryStartsWith = (base, startsWith) => {\n    if (startsWith.length > base.length)\n        return false;\n    for (let i = 0; i < startsWith.length; i++) {\n        if (base[i] !== startsWith[i])\n            return false;\n    }\n    return true;\n};\nconst defaultJsonValueReplacer = (key, value) => {\n    if (typeof value === 'bigint') {\n        try {\n            return toNumber(value);\n        }\n        catch {\n            return value.toString();\n        }\n    }\n    return value;\n};\nconst asJson = (value, replacer = defaultJsonValueReplacer, space) => {\n    return JSON.stringify(value, replacer, space);\n};\n/** Calculate minimum number of extra program pages required for provided approval and clear state programs */\nconst calculateExtraProgramPages = (approvalProgram, clearStateProgram) => {\n    return Math.floor((approvalProgram.length + (clearStateProgram?.length ?? 0) - 1) / APP_PAGE_MAX_SIZE);\n};\n\nexport { UnsafeConversionError, asJson, binaryStartsWith, calculateExtraProgramPages, calculateFundAmount, chunkArray, defaultJsonValueReplacer, memoize, toNumber };\n//# sourceMappingURL=util.mjs.map\n","var EventType;\n(function (EventType) {\n    EventType[\"TxnGroupSimulated\"] = \"TxnGroupSimulated\";\n    EventType[\"AppCompiled\"] = \"AppCompiled\";\n})(EventType || (EventType = {}));\n\nexport { EventType };\n//# sourceMappingURL=lifecycle-events.mjs.map\n","import algosdk from 'algosdk';\n\nvar ABIMethod = algosdk.ABIMethod;\n/**\n * Converts an ARC-32 Application Specification to an ARC-56 Contract\n * @param appSpec The ARC-32 Application Specification\n * @returns The ARC-56 Contract\n * @example\n * ```typescript\n * const arc56AppSpec = arc32ToArc56(arc32AppSpec)\n * ```\n */\nfunction arc32ToArc56(appSpec) {\n    const arc32Structs = Object.values(appSpec.hints).flatMap((hint) => Object.entries(hint.structs ?? {}));\n    const structs = Object.fromEntries(arc32Structs.map(([_, struct]) => {\n        const fields = struct.elements.map((e) => ({ name: e[0], type: e[1] }));\n        return [struct.name, fields];\n    }));\n    const hint = (m) => appSpec.hints[new ABIMethod(m).getSignature()];\n    const actions = (m, type) => {\n        // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain\n        return hint(m)?.call_config !== undefined ? callConfigToActions(hint(m)?.call_config, type) : [];\n    };\n    const bareActions = (type) => {\n        return callConfigToActions(appSpec.bare_call_config, type);\n    };\n    const callConfigToActions = (c, type) => {\n        const actions = [];\n        if (c.close_out && ['ALL', type].includes(c.close_out))\n            actions.push('CloseOut');\n        if (c.delete_application && ['ALL', type].includes(c.delete_application))\n            actions.push('DeleteApplication');\n        if (c.no_op && ['ALL', type].includes(c.no_op))\n            actions.push('NoOp');\n        if (c.opt_in && ['ALL', type].includes(c.opt_in))\n            actions.push('OptIn');\n        if (c.update_application && ['ALL', type].includes(c.update_application))\n            actions.push('UpdateApplication');\n        return actions;\n    };\n    const getDefaultArgValue = (type, defaultArg) => {\n        if (!defaultArg)\n            return undefined;\n        if (defaultArg.source === 'abi-method') {\n            return {\n                source: 'method',\n                data: defaultArg.data.name,\n            };\n        }\n        return {\n            source: defaultArg.source === 'constant' ? 'literal' : defaultArg.source === 'global-state' ? 'global' : 'local',\n            data: Buffer.from(typeof defaultArg.data === 'number' ? algosdk.ABIType.from('uint64').encode(defaultArg.data) : defaultArg.data).toString('base64'),\n            type: type === 'string' ? 'AVMString' : type,\n        };\n    };\n    return {\n        arcs: [],\n        name: appSpec.contract.name,\n        desc: appSpec.contract.desc,\n        structs: structs,\n        methods: appSpec.contract.methods.map((m) => ({\n            name: m.name,\n            desc: m.desc,\n            args: m.args.map((a) => ({\n                name: a.name,\n                type: a.type,\n                desc: a.desc,\n                struct: a.name ? hint(m)?.structs?.[a.name]?.name : undefined,\n                defaultValue: getDefaultArgValue(a.type, !a.name ? undefined : hint(m)?.default_arguments?.[a.name]),\n            })),\n            returns: {\n                type: m.returns.type,\n                desc: m.returns.desc,\n                struct: hint(m)?.structs?.output?.name,\n            },\n            events: [],\n            readonly: hint(m)?.read_only,\n            actions: {\n                create: actions(m, 'CREATE'),\n                call: actions(m, 'CALL'),\n            },\n        })),\n        state: {\n            schema: {\n                global: {\n                    ints: appSpec.state.global.num_uints,\n                    bytes: appSpec.state.global.num_byte_slices,\n                },\n                local: {\n                    ints: appSpec.state.local.num_uints,\n                    bytes: appSpec.state.local.num_byte_slices,\n                },\n            },\n            keys: {\n                global: Object.fromEntries(Object.entries(appSpec.schema.global.declared).map((s) => [\n                    s[0],\n                    {\n                        key: Buffer.from(s[1].key, 'utf-8').toString('base64'),\n                        keyType: 'AVMString',\n                        valueType: s[1].type === 'uint64' ? 'AVMUint64' : 'AVMBytes',\n                        desc: s[1].descr,\n                    },\n                ])),\n                local: Object.fromEntries(Object.entries(appSpec.schema.local.declared).map((s) => [\n                    s[0],\n                    {\n                        key: Buffer.from(s[1].key, 'utf-8').toString('base64'),\n                        keyType: 'AVMString',\n                        valueType: s[1].type === 'uint64' ? 'AVMUint64' : 'AVMBytes',\n                        desc: s[1].descr,\n                    },\n                ])),\n                box: {},\n            },\n            maps: {\n                global: {},\n                local: {},\n                box: {},\n            },\n        },\n        source: appSpec.source,\n        bareActions: {\n            create: bareActions('CREATE'),\n            call: bareActions('CALL'),\n        },\n        byteCode: undefined,\n        compilerInfo: undefined,\n        events: undefined,\n        networks: undefined,\n        scratchVariables: undefined,\n        sourceInfo: undefined,\n        templateVariables: undefined,\n    };\n}\n\nexport { arc32ToArc56 };\n//# sourceMappingURL=app-spec.mjs.map\n","const LOGIC_ERROR = /transaction ([A-Z0-9]+): logic eval error: (.*). Details: .*pc=([0-9]+).*/;\n/** Wraps key functionality around processing logic errors */\nclass LogicError extends Error {\n    /** Takes an error message and parses out the details of any logic errors in there.\n     * @param error The error message to parse\n     * @returns The logic error details if any, or undefined\n     */\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    static parseLogicError(error) {\n        const errorMessage = error.message;\n        const res = LOGIC_ERROR.exec(errorMessage);\n        if (res === null || res.length <= 3)\n            return undefined;\n        return {\n            txId: res[1],\n            msg: res[2],\n            desc: errorMessage,\n            pc: parseInt(res[3] ? res[3] : '0'),\n            traces: error.traces,\n        };\n    }\n    /**\n     * Create a new logic error object.\n     * @param errorDetails The details of the logic error\n     * @param program The TEAL source code, split by line\n     * @param getLineForPc The source map of the TEAL source code\n     */\n    constructor(errorDetails, program, getLineForPc) {\n        super();\n        this.lines = 5;\n        this.teal_line = 0;\n        this.led = errorDetails;\n        this.program = program;\n        const line = getLineForPc(errorDetails.pc);\n        this.teal_line = line === undefined ? 0 : line;\n        this.message = `${this.led.msg}. at:${line}. ${this.led.desc}`;\n        if (this.teal_line > 0) {\n            const start = this.teal_line > this.lines ? this.teal_line - this.lines : 0;\n            const stop = program.length > this.teal_line + this.lines ? this.teal_line + this.lines : program.length;\n            const stack_lines = program.slice(start, stop);\n            stack_lines[stack_lines.length / 2] += ' <--- Error';\n            this.stack = stack_lines.join('\\n');\n        }\n    }\n}\n\nexport { LogicError };\n//# sourceMappingURL=logic-error.mjs.map\n","import algosdk, { Address } from 'algosdk';\nimport { Buffer } from 'buffer';\nimport { compileTeal, createApp, updateApp, callApp, getAppGlobalState, getAppLocalState, getAppBoxNames, getAppBoxValue, getAppBoxValueFromABIType } from '../app.mjs';\nimport { replaceDeployTimeControlParams, performTemplateSubstitution, deployApp, getCreatorAppsByName } from '../app-deploy.mjs';\nimport { Config } from '../config.mjs';\nimport { legacySendTransactionBridge } from '../transaction/legacy-bridge.mjs';\nimport { getSenderAddress, encodeTransactionNote } from '../transaction/transaction.mjs';\nimport { asJson, binaryStartsWith } from '../util.mjs';\nimport { UPDATABLE_TEMPLATE_NAME, DELETABLE_TEMPLATE_NAME } from './app.mjs';\nimport { getArc56Method, getArc56ReturnValue, getABITupleFromABIStruct, getABIDecodedValue, getABIEncodedValue } from './app-arc56.mjs';\nimport { arc32ToArc56 } from './app-spec.mjs';\nimport { EventType } from './lifecycle-events.mjs';\nimport { LogicError } from './logic-error.mjs';\n\nvar ABIMethod = algosdk.ABIMethod;\nvar AtomicTransactionComposer = algosdk.AtomicTransactionComposer;\nvar getApplicationAddress = algosdk.getApplicationAddress;\nvar Indexer = algosdk.Indexer;\nvar OnApplicationComplete = algosdk.OnApplicationComplete;\nvar SourceMap = algosdk.ProgramSourceMap;\n/**\n * Determines deploy time control (UPDATABLE, DELETABLE) value by inspecting application specification\n * @param approval TEAL Approval program, not the base64 version found on the appSpec\n * @param appSpec Application Specification\n * @param templateVariableName Template variable\n * @param callConfigKey Call config type\n * @returns true if applicable call config is found, false if not found or undefined if variable not present\n */\nfunction getDeployTimeControl(approval, appSpec, templateVariableName, callConfigKey) {\n    // variable not present, so unknown control value\n    if (!approval.includes(templateVariableName))\n        return undefined;\n    // a bare call for specified CallConfig is present and configured\n    const bareCallConfig = appSpec.bare_call_config[callConfigKey];\n    if (!!bareCallConfig && bareCallConfig !== 'NEVER')\n        return true;\n    // an ABI call for specified CallConfig is present and configured\n    return Object.values(appSpec.hints).some((h) => {\n        const abiCallConfig = h.call_config[callConfigKey];\n        return !!abiCallConfig && abiCallConfig !== 'NEVER';\n    });\n}\nconst BYTE_CBLOCK = 38;\nconst INT_CBLOCK = 32;\n/**\n * Get the offset of the last constant block at the beginning of the program\n * This value is used to calculate the program counter for an ARC56 program that has a pcOffsetMethod of \"cblocks\"\n *\n * @param program The program to parse\n * @returns The PC value of the opcode after the last constant block\n */\nfunction getConstantBlockOffset(program) {\n    const bytes = [...program];\n    const programSize = bytes.length;\n    bytes.shift(); // remove version\n    /** The PC of the opcode after the bytecblock */\n    let bytecblockOffset;\n    /** The PC of the opcode after the intcblock */\n    let intcblockOffset;\n    while (bytes.length > 0) {\n        /** The current byte from the beginning of the byte array */\n        const byte = bytes.shift();\n        // If the byte is a constant block...\n        if (byte === BYTE_CBLOCK || byte === INT_CBLOCK) {\n            const isBytecblock = byte === BYTE_CBLOCK;\n            /** The byte following the opcode is the number of values in the constant block */\n            const valuesRemaining = bytes.shift();\n            // Iterate over all the values in the constant block\n            for (let i = 0; i < valuesRemaining; i++) {\n                if (isBytecblock) {\n                    /** The byte following the opcode is the length of the next element */\n                    const length = bytes.shift();\n                    bytes.splice(0, length);\n                }\n                else {\n                    // intcblock is a uvarint, so we need to keep reading until we find the end (MSB is not set)\n                    while ((bytes.shift() & 0x80) !== 0) {\n                        // Do nothing...\n                    }\n                }\n            }\n            if (isBytecblock)\n                bytecblockOffset = programSize - bytes.length - 1;\n            else\n                intcblockOffset = programSize - bytes.length - 1;\n            if (bytes[0] !== BYTE_CBLOCK && bytes[0] !== INT_CBLOCK) {\n                // if the next opcode isn't a constant block, we're done\n                break;\n            }\n        }\n    }\n    return Math.max(bytecblockOffset ?? 0, intcblockOffset ?? 0);\n}\n/** ARC-56/ARC-32 application client that allows you to manage calls and\n * state for a specific deployed instance of an app (with a known app ID). */\nclass AppClient {\n    /**\n     * Create a new app client.\n     * @param params The parameters to create the app client\n     * @returns The `AppClient` instance\n     * @example\n     * ```typescript\n     * const appClient = new AppClient({\n     *   appId: 12345678n,\n     *   appSpec: appSpec,\n     *   algorand: AlgorandClient.mainNet(),\n     * })\n     */\n    constructor(params) {\n        this._appId = params.appId;\n        this._appAddress = algosdk.getApplicationAddress(this._appId);\n        this._appSpec = AppClient.normaliseAppSpec(params.appSpec);\n        this._appName = params.appName ?? this._appSpec.name;\n        this._algorand = params.algorand;\n        this._defaultSender = typeof params.defaultSender === 'string' ? Address.fromString(params.defaultSender) : params.defaultSender;\n        this._defaultSigner = params.defaultSigner;\n        this._approvalSourceMap = params.approvalSourceMap;\n        this._clearSourceMap = params.clearSourceMap;\n        this._localStateMethods = (address) => this.getStateMethods(() => this.getLocalState(address), () => this._appSpec.state.keys.local, () => this._appSpec.state.maps.local);\n        this._globalStateMethods = this.getStateMethods(() => this.getGlobalState(), () => this._appSpec.state.keys.global, () => this._appSpec.state.maps.global);\n        this._boxStateMethods = this.getBoxMethods();\n        this._paramsMethods = {\n            ...this.getMethodCallParamsMethods(),\n            /** Get parameters to define bare (raw) transactions to the current app */\n            bare: this.getBareParamsMethods(),\n        };\n        this._createTransactionsMethods = {\n            ...this.getMethodCallCreateTransactionMethods(),\n            /** Get transactions for bare (raw) calls to the current app */\n            bare: this.getBareCreateTransactionMethods(),\n        };\n        this._sendMethods = {\n            ...this.getMethodCallSendMethods(),\n            /** Send bare (raw) transactions to the current app */\n            bare: this.getBareSendMethods(),\n        };\n    }\n    /**\n     * Clone this app client with different params\n     *\n     * @param params The params to use for the the cloned app client. Omit a param to keep the original value. Set a param to override the original value. Setting to undefined will clear the original value.\n     * @returns A new app client with the altered params\n     * @example\n     * ```typescript\n     * const appClient2 = appClient.clone({ defaultSender: 'NEW_SENDER_ADDRESS' })\n     * ```\n     */\n    clone(params) {\n        return new AppClient({\n            appId: this._appId,\n            appSpec: this._appSpec,\n            algorand: this._algorand,\n            appName: this._appName,\n            defaultSender: this._defaultSender,\n            defaultSigner: this._defaultSigner,\n            approvalSourceMap: this._approvalSourceMap,\n            clearSourceMap: this._clearSourceMap,\n            ...params,\n        });\n    }\n    /**\n     * Returns a new `AppClient` client, resolving the app by creator address and name\n     * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).\n     * @param params The parameters to create the app client\n     * @returns The `AppClient` instance\n     * @example\n     * ```typescript\n     * const appClient = await AppClient.fromCreatorAndName({\n     *   creatorAddress: 'CREATOR_ADDRESS',\n     *   name: 'APP_NAME',\n     *   appSpec: appSpec,\n     *   algorand: AlgorandClient.mainNet(),\n     * })\n     */\n    static async fromCreatorAndName(params) {\n        const appSpec = AppClient.normaliseAppSpec(params.appSpec);\n        const appLookup = params.appLookupCache ?? (await params.algorand.appDeployer.getCreatorAppsByName(params.creatorAddress, params.ignoreCache));\n        const appMetadata = appLookup.apps[params.appName ?? appSpec.name];\n        if (!appMetadata) {\n            throw new Error(`App not found for creator ${params.creatorAddress} and name ${params.appName ?? appSpec.name}`);\n        }\n        return new AppClient({\n            ...params,\n            algorand: params.algorand,\n            appId: appMetadata.appId,\n        });\n    }\n    /**\n     * Returns an `AppClient` instance for the current network based on\n     * pre-determined network-specific app IDs specified in the ARC-56 app spec.\n     *\n     * If no IDs are in the app spec or the network isn't recognised, an error is thrown.\n     * @param params The parameters to create the app client\n     * @returns The `AppClient` instance\n     * @example\n     * ```typescript\n     * const appClient = await AppClient.fromNetwork({\n     *   appSpec: appSpec,\n     *   algorand: AlgorandClient.mainNet(),\n     * })\n     */\n    static async fromNetwork(params) {\n        const network = await params.algorand.client.network();\n        const appSpec = AppClient.normaliseAppSpec(params.appSpec);\n        const networkNames = [network.genesisHash];\n        if (network.isLocalNet)\n            networkNames.push('localnet');\n        if (network.isTestNet)\n            networkNames.push('testnet');\n        if (network.isMainNet)\n            networkNames.push('mainnet');\n        const availableAppSpecNetworks = Object.keys(appSpec.networks ?? {});\n        const networkIndex = availableAppSpecNetworks.findIndex((n) => networkNames.includes(n));\n        if (networkIndex === -1) {\n            throw new Error(`No app ID found for network ${asJson(networkNames)} in the app spec`);\n        }\n        const appId = BigInt(appSpec.networks[networkIndex].appID);\n        return new AppClient({ ...params, appId, appSpec });\n    }\n    /**\n     * Takes a string or parsed JSON object that could be ARC-32 or ARC-56 format and\n     * normalises it into a parsed ARC-56 contract object.\n     * @param spec The spec to normalise\n     * @returns The normalised ARC-56 contract object\n     * @example\n     * ```typescript\n     * const arc56AppSpec = AppClient.normaliseAppSpec(appSpec)\n     * ```\n     */\n    static normaliseAppSpec(spec) {\n        const parsedSpec = typeof spec === 'string' ? JSON.parse(spec) : spec;\n        const appSpec = 'hints' in parsedSpec ? arc32ToArc56(parsedSpec) : parsedSpec;\n        return appSpec;\n    }\n    /** The ID of the app instance this client is linked to. */\n    get appId() {\n        return this._appId;\n    }\n    /** The app address of the app instance this client is linked to. */\n    get appAddress() {\n        return this._appAddress;\n    }\n    /** The name of the app (from the ARC-32 / ARC-56 app spec or override). */\n    get appName() {\n        return this._appName;\n    }\n    /** The ARC-56 app spec being used */\n    get appSpec() {\n        return this._appSpec;\n    }\n    /** A reference to the underlying `AlgorandClient` this app client is using. */\n    get algorand() {\n        return this._algorand;\n    }\n    /** Get parameters to create transactions for the current app.\n     *\n     * A good mental model for this is that these parameters represent a deferred transaction creation.\n     * @example Create a transaction in the future using Algorand Client\n     * ```typescript\n     * const myMethodCall = appClient.params.call({method: 'my_method', args: [123, 'hello']})\n     * // ...\n     * await algorand.send.AppMethodCall(myMethodCall)\n     * ```\n     * @example Define a nested transaction as an ABI argument\n     * ```typescript\n     * const myMethodCall = appClient.params.call({method: 'my_method', args: [123, 'hello']})\n     * await appClient.send.call({method: 'my_method2', args: [myMethodCall]})\n     * ```\n     */\n    get params() {\n        return this._paramsMethods;\n    }\n    /** Create transactions for the current app */\n    get createTransaction() {\n        return this._createTransactionsMethods;\n    }\n    /** Send transactions to the current app */\n    get send() {\n        return this._sendMethods;\n    }\n    /** Get state (local, global, box) from the current app */\n    get state() {\n        return {\n            /**\n             * Methods to access local state for the current app\n             * @param address The address of the account to get the local state for\n             */\n            local: this._localStateMethods,\n            /**\n             * Methods to access global state for the current app\n             */\n            global: this._globalStateMethods,\n            /**\n             * Methods to access box storage for the current app\n             */\n            box: this._boxStateMethods,\n        };\n    }\n    /**\n     * Funds Algo into the app account for this app.\n     *\n     * An alias for `appClient.send.fundAppAccount(params)`.\n     * @param params The parameters for the funding transaction\n     * @returns The result of the funding\n     * @example\n     * ```typescript\n     * await appClient.fundAppAccount({ amount: algo(1) })\n     * ```\n     */\n    async fundAppAccount(params) {\n        return this.send.fundAppAccount(params);\n    }\n    /**\n     * Returns raw global state for the current app.\n     * @returns The global state\n     * @example\n     * ```typescript\n     * const globalState = await appClient.getGlobalState()\n     * ```\n     */\n    async getGlobalState() {\n        return await this._algorand.app.getGlobalState(this.appId);\n    }\n    /**\n     * Returns raw local state for the given account address.\n     * @param address The address of the account to get the local state for\n     * @returns The local state\n     * @example\n     * ```typescript\n     * const localState = await appClient.getLocalState('ACCOUNT_ADDRESS')\n     * ```\n     */\n    async getLocalState(address) {\n        return await this._algorand.app.getLocalState(this.appId, address);\n    }\n    /**\n     * Returns the names of all current boxes for the current app.\n     * @returns The names of the boxes\n     * @example\n     * ```typescript\n     * const boxNames = await appClient.getBoxNames()\n     * ```\n     */\n    async getBoxNames() {\n        return await this._algorand.app.getBoxNames(this.appId);\n    }\n    /**\n     * Returns the value of the given box for the current app.\n     * @param name The identifier of the box to return\n     * @returns The current box value as a byte array\n     * @example\n     * ```typescript\n     * const boxValue = await appClient.getBoxValue('boxName')\n     * ```\n     */\n    async getBoxValue(name) {\n        return await this._algorand.app.getBoxValue(this.appId, name);\n    }\n    /**\n     * Returns the value of the given box for the current app.\n     * @param name The identifier of the box to return\n     * @param type\n     * @returns The current box value as a byte array\n     * @example\n     * ```typescript\n     * const boxValue = await appClient.getBoxValueFromABIType('boxName', new ABIUintType(32))\n     * ```\n     */\n    async getBoxValueFromABIType(name, type) {\n        return await this._algorand.app.getBoxValueFromABIType({\n            appId: this.appId,\n            boxName: name,\n            type,\n        });\n    }\n    /**\n     * Returns the values of all current boxes for the current app.\n     * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.\n     * @param filter Optional filter to filter which boxes' values are returned\n     * @returns The (name, value) pair of the boxes with values as raw byte arrays\n     * @example\n     * ```typescript\n     * const boxValues = await appClient.getBoxValues()\n     * ```\n     */\n    async getBoxValues(filter) {\n        const names = (await this.getBoxNames()).filter(filter ?? ((_) => true));\n        const values = await this._algorand.app.getBoxValues(this.appId, names.map((name) => name.nameRaw));\n        return names.map((name, i) => ({ name, value: values[i] }));\n    }\n    /**\n     * Returns the values of all current boxes for the current app decoded using an ABI Type.\n     * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.\n     * @param type The ABI type to decode the values with\n     * @param filter Optional filter to filter which boxes' values are returned\n     * @returns The (name, value) pair of the boxes with values as the ABI Value\n     * @example\n     * ```typescript\n     * const boxValues = await appClient.getBoxValuesFromABIType(new ABIUintType(32))\n     * ```\n     */\n    async getBoxValuesFromABIType(type, filter) {\n        const names = (await this.getBoxNames()).filter(filter ?? ((_) => true));\n        const values = await this._algorand.app.getBoxValuesFromABIType({\n            appId: this.appId,\n            boxNames: names.map((name) => name.nameRaw),\n            type,\n        });\n        return names.map((name, i) => ({ name, value: values[i] }));\n    }\n    /**\n     * Takes an error that may include a logic error from a call to the current app and re-exposes the\n     * error to include source code information via the source map and ARC-56 spec.\n     * @param e The error to parse\n     * @param isClearStateProgram Whether or not the code was running the clear state program (defaults to approval program)\n     * @returns The new error, or if there was no logic error or source map then the wrapped error with source details\n     */\n    async exposeLogicError(e, isClearStateProgram) {\n        const pcOffsetMethod = this._appSpec.sourceInfo?.[isClearStateProgram ? 'clear' : 'approval']?.pcOffsetMethod;\n        let program;\n        if (pcOffsetMethod === 'cblocks') {\n            // TODO: Cache this if we deploy the app and it's not updateable\n            const appInfo = await this._algorand.app.getById(this.appId);\n            program = isClearStateProgram ? appInfo.clearStateProgram : appInfo.approvalProgram;\n        }\n        return AppClient.exposeLogicError(e, this._appSpec, {\n            isClearStateProgram,\n            approvalSourceMap: this._approvalSourceMap,\n            clearSourceMap: this._clearSourceMap,\n            program,\n        });\n    }\n    /**\n     * Export the current source maps for the app.\n     * @returns The source maps\n     */\n    exportSourceMaps() {\n        if (!this._approvalSourceMap || !this._clearSourceMap) {\n            throw new Error(\"Unable to export source maps; they haven't been loaded into this client - you need to call create, update, or deploy first\");\n        }\n        return {\n            approvalSourceMap: this._approvalSourceMap,\n            clearSourceMap: this._clearSourceMap,\n        };\n    }\n    /**\n     * Import source maps for the app.\n     * @param sourceMaps The source maps to import\n     */\n    importSourceMaps(sourceMaps) {\n        this._approvalSourceMap = new SourceMap(sourceMaps.approvalSourceMap);\n        this._clearSourceMap = new SourceMap(sourceMaps.clearSourceMap);\n    }\n    /**\n     * Returns the ABI Method spec for the given method string for the app represented by this application client instance\n     * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.\n     * e.g. `my_method` or `my_method(unit64,string)bytes`\n     * @returns A tuple with: [ARC-56 `Method`, algosdk `ABIMethod`]\n     */\n    getABIMethod(methodNameOrSignature) {\n        return getArc56Method(methodNameOrSignature, this._appSpec);\n    }\n    /**\n     * Checks for decode errors on the SendAppTransactionResult and maps the return value to the specified type\n     * on the ARC-56 method, replacing the `return` property with the decoded type.\n     *\n     * If the return type is an ARC-56 struct then the struct will be returned.\n     *\n     * @param result The SendAppTransactionResult to be mapped\n     * @param method The method that was called\n     * @returns The smart contract response with an updated return value\n     */\n    async processMethodCallReturn(result, method) {\n        const resultValue = await result;\n        return { ...resultValue, return: getArc56ReturnValue(resultValue.return, method, this._appSpec.structs) };\n    }\n    /**\n     * Compiles the approval and clear state programs (if TEAL templates provided),\n     * performing any provided deploy-time parameter replacement and stores\n     * the source maps.\n     *\n     * If no TEAL templates provided it will use any byte code provided in the app spec.\n     *\n     * Will store any generated source maps for later use in debugging.\n     * @param compilation Any compilation parameters to use\n     * @returns The compiled code and any compilation results (including source maps)\n     */\n    async compile(compilation) {\n        const result = await AppClient.compile(this._appSpec, this._algorand.app, compilation);\n        if (result.compiledApproval) {\n            this._approvalSourceMap = result.compiledApproval.sourceMap;\n        }\n        if (result.compiledClear) {\n            this._clearSourceMap = result.compiledClear.sourceMap;\n        }\n        return result;\n    }\n    /**\n     * Takes an error that may include a logic error from a call to the current app and re-exposes the\n     * error to include source code information via the source map and ARC-56 spec.\n     * @param e The error to parse\n     * @param appSpec The app spec for the app\n     * @param details Additional information to inform the error\n     * @returns The new error, or if there was no logic error or source map then the wrapped error with source details\n     */\n    static exposeLogicError(e, appSpec, details) {\n        const { isClearStateProgram, approvalSourceMap, clearSourceMap, program } = details;\n        const sourceMap = isClearStateProgram ? clearSourceMap : approvalSourceMap;\n        const errorDetails = LogicError.parseLogicError(e);\n        // Return the error if we don't have a PC\n        if (errorDetails === undefined || errorDetails?.pc === undefined)\n            return e;\n        /** The PC value to find in the ARC56 SourceInfo */\n        let arc56Pc = errorDetails?.pc;\n        const programSourceInfo = isClearStateProgram ? appSpec.sourceInfo?.clear : appSpec.sourceInfo?.approval;\n        /** The offset to apply to the PC if using the cblocks pc offset method */\n        let cblocksOffset = 0;\n        // If the program uses cblocks offset, then we need to adjust the PC accordingly\n        if (programSourceInfo?.pcOffsetMethod === 'cblocks') {\n            if (program === undefined)\n                throw new Error('Program bytes are required to calculate the ARC56 cblocks PC offset');\n            cblocksOffset = getConstantBlockOffset(program);\n            arc56Pc = errorDetails.pc - cblocksOffset;\n        }\n        // Find the source info for this PC and get the error message\n        const sourceInfo = programSourceInfo?.sourceInfo.find((s) => s.pc.includes(arc56Pc));\n        const errorMessage = sourceInfo?.errorMessage;\n        // If we have the source we can display the TEAL in the error message\n        if (appSpec.source) {\n            let getLineForPc = (inputPc) => sourceMap?.getLocationForPc?.(inputPc)?.line;\n            // If the SourceMap is not defined, we need to provide our own function for going from a PC to TEAL based on ARC56 SourceInfo[]\n            if (sourceMap === undefined) {\n                getLineForPc = (inputPc) => {\n                    const teal = programSourceInfo?.sourceInfo.find((s) => s.pc.includes(inputPc - cblocksOffset))?.teal;\n                    if (teal === undefined)\n                        return undefined;\n                    return teal - 1;\n                };\n            }\n            e = new LogicError(errorDetails, Buffer.from(isClearStateProgram ? appSpec.source.clear : appSpec.source.approval, 'base64')\n                .toString()\n                .split('\\n'), getLineForPc);\n        }\n        if (errorMessage) {\n            const appId = asJson(e).match(/(?<=app=)\\d+/)?.[0] || '';\n            const txId = asJson(e).match(/(?<=transaction )\\S+(?=:)/)?.[0];\n            const error = new Error(`Runtime error when executing ${appSpec.name} (appId: ${appId}) in transaction ${txId}: ${errorMessage}`);\n            error.cause = e;\n            return error;\n        }\n        return e;\n    }\n    /**\n     * Compiles the approval and clear state programs (if TEAL templates provided),\n     * performing any provided deploy-time parameter replacement and returns\n     * the compiled code and any compilation results (including source maps).\n     *\n     * If no TEAL templates provided it will use any byte code provided in the app spec.\n     *\n     * Will store any generated source maps for later use in debugging.\n     * @param appSpec The app spec for the app\n     * @param appManager The app manager to use for compilation\n     * @param compilation Any compilation parameters to use\n     * @returns The compiled code and any compilation results (including source maps)\n     */\n    static async compile(appSpec, appManager, compilation) {\n        const { deployTimeParams, updatable, deletable } = compilation ?? {};\n        if (!appSpec.source) {\n            if (!appSpec.byteCode?.approval || !appSpec.byteCode?.clear) {\n                throw new Error(`Attempt to compile app ${appSpec.name} without source or byteCode`);\n            }\n            return {\n                approvalProgram: Buffer.from(appSpec.byteCode.approval, 'base64'),\n                clearStateProgram: Buffer.from(appSpec.byteCode.clear, 'base64'),\n            };\n        }\n        const approvalTemplate = Buffer.from(appSpec.source.approval, 'base64').toString('utf-8');\n        const compiledApproval = await appManager.compileTealTemplate(approvalTemplate, deployTimeParams, {\n            updatable,\n            deletable,\n        });\n        const clearTemplate = Buffer.from(appSpec.source.clear, 'base64').toString('utf-8');\n        const compiledClear = await appManager.compileTealTemplate(clearTemplate, deployTimeParams);\n        if (Config.debug) {\n            await Config.events.emitAsync(EventType.AppCompiled, {\n                sources: [\n                    { compiledTeal: compiledApproval, appName: appSpec.name, fileName: 'approval' },\n                    { compiledTeal: compiledClear, appName: appSpec.name, fileName: 'clear' },\n                ],\n            });\n        }\n        return {\n            approvalProgram: compiledApproval.compiledBase64ToBytes,\n            compiledApproval,\n            clearStateProgram: compiledClear.compiledBase64ToBytes,\n            compiledClear,\n        };\n    }\n    /**\n     * Returns ABI method arguments ready for a method call params object with default values populated\n     * and structs replaced with tuples.\n     *\n     * It does this by replacing any `undefined` values with the equivalent default value from the given ARC-56 app spec.\n     * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.\n     * e.g. `my_method` or `my_method(unit64,string)bytes`\n     * @param args The arguments to the method with `undefined` for any that should be populated with a default value\n     */\n    async getABIArgsWithDefaultValues(methodNameOrSignature, args, sender) {\n        const m = getArc56Method(methodNameOrSignature, this._appSpec);\n        return await Promise.all(args?.map(async (a, i) => {\n            const arg = m.args[i];\n            if (!arg) {\n                throw new Error(`Unexpected arg at position ${i}. ${m.name} only expects ${m.args.length} args`);\n            }\n            if (a !== undefined) {\n                // If a struct then convert to tuple for the underlying call\n                return arg.struct && typeof a === 'object' && !Array.isArray(a)\n                    ? getABITupleFromABIStruct(a, this._appSpec.structs[arg.struct], this._appSpec.structs)\n                    : a;\n            }\n            const defaultValue = arg.defaultValue;\n            if (defaultValue) {\n                switch (defaultValue.source) {\n                    case 'literal':\n                        return getABIDecodedValue(Buffer.from(defaultValue.data, 'base64'), m.method.args[i].defaultValue?.type ?? m.method.args[i].type, this._appSpec.structs);\n                    case 'method': {\n                        const method = this.getABIMethod(defaultValue.data);\n                        const result = await this.send.call({\n                            method: defaultValue.data,\n                            args: method.args.map(() => undefined),\n                            sender,\n                        });\n                        if (result.return === undefined) {\n                            throw new Error('Default value method call did not return a value');\n                        }\n                        if (typeof result.return === 'object' && !(result.return instanceof Uint8Array) && !Array.isArray(result.return)) {\n                            return getABITupleFromABIStruct(result.return, this._appSpec.structs[method.returns.struct], this._appSpec.structs);\n                        }\n                        return result.return;\n                    }\n                    case 'local':\n                    case 'global': {\n                        const state = defaultValue.source === 'global' ? await this.getGlobalState() : await this.getLocalState(sender);\n                        const value = Object.values(state).find((s) => s.keyBase64 === defaultValue.data);\n                        if (!value) {\n                            throw new Error(`Preparing default value for argument ${arg.name ?? `arg${i + 1}`} resulted in the failure: The key '${defaultValue.data}' could not be found in ${defaultValue.source} storage`);\n                        }\n                        return 'valueRaw' in value\n                            ? getABIDecodedValue(value.valueRaw, m.method.args[i].defaultValue?.type ?? m.method.args[i].type, this._appSpec.structs)\n                            : value.value;\n                    }\n                    case 'box': {\n                        const value = await this.getBoxValue(Buffer.from(defaultValue.data, 'base64'));\n                        return getABIDecodedValue(value, m.method.args[i].defaultValue?.type ?? m.method.args[i].type, this._appSpec.structs);\n                    }\n                }\n            }\n            if (!algosdk.abiTypeIsTransaction(arg.type)) {\n                throw new Error(`No value provided for required argument ${arg.name ?? `arg${i + 1}`} in call to method ${m.name}`);\n            }\n        }) ?? []);\n    }\n    getBareParamsMethods() {\n        return {\n            /** Return params for an update call, including deploy-time TEAL template replacements and compilation if provided */\n            update: async (params) => {\n                return this.getBareParams({\n                    ...params,\n                    ...(await this.compile(params)),\n                }, OnApplicationComplete.UpdateApplicationOC);\n            },\n            /** Return params for an opt-in call */\n            optIn: (params) => {\n                return this.getBareParams(params, OnApplicationComplete.OptInOC);\n            },\n            /** Return params for a delete call */\n            delete: (params) => {\n                return this.getBareParams(params, OnApplicationComplete.DeleteApplicationOC);\n            },\n            /** Return params for a clear state call */\n            clearState: (params) => {\n                return this.getBareParams(params, OnApplicationComplete.ClearStateOC);\n            },\n            /** Return params for a close out call */\n            closeOut: (params) => {\n                return this.getBareParams(params, OnApplicationComplete.CloseOutOC);\n            },\n            /** Return params for a call (defaults to no-op) */\n            call: (params) => {\n                return this.getBareParams(params, params?.onComplete ?? OnApplicationComplete.NoOpOC);\n            },\n        };\n    }\n    getBareCreateTransactionMethods() {\n        return {\n            /** Returns a transaction for an update call, including deploy-time TEAL template replacements and compilation if provided */\n            update: async (params) => {\n                return this._algorand.createTransaction.appUpdate(await this.params.bare.update(params));\n            },\n            /** Returns a transaction for an opt-in call */\n            optIn: (params) => {\n                return this._algorand.createTransaction.appCall(this.params.bare.optIn(params));\n            },\n            /** Returns a transaction for a delete call */\n            delete: (params) => {\n                return this._algorand.createTransaction.appDelete(this.params.bare.delete(params));\n            },\n            /** Returns a transaction for a clear state call */\n            clearState: (params) => {\n                return this._algorand.createTransaction.appCall(this.params.bare.clearState(params));\n            },\n            /** Returns a transaction for a close out call */\n            closeOut: (params) => {\n                return this._algorand.createTransaction.appCall(this.params.bare.closeOut(params));\n            },\n            /** Returns a transaction for a call (defaults to no-op) */\n            call: (params) => {\n                return this._algorand.createTransaction.appCall(this.params.bare.call(params));\n            },\n        };\n    }\n    getBareSendMethods() {\n        return {\n            /** Signs and sends an update call, including deploy-time TEAL template replacements and compilation if provided */\n            update: async (params) => {\n                const compiled = await this.compile(params);\n                return {\n                    ...(await this.handleCallErrors(async () => this._algorand.send.appUpdate(await this.params.bare.update(params)))),\n                    ...compiled,\n                };\n            },\n            /** Signs and sends an opt-in call */\n            optIn: (params) => {\n                return this.handleCallErrors(() => this._algorand.send.appCall(this.params.bare.optIn(params)));\n            },\n            /** Signs and sends a delete call */\n            delete: (params) => {\n                return this.handleCallErrors(() => this._algorand.send.appDelete(this.params.bare.delete(params)));\n            },\n            /** Signs and sends a clear state call */\n            clearState: (params) => {\n                return this.handleCallErrors(() => this._algorand.send.appCall(this.params.bare.clearState(params)));\n            },\n            /** Signs and sends a close out call */\n            closeOut: (params) => {\n                return this.handleCallErrors(() => this._algorand.send.appCall(this.params.bare.closeOut(params)));\n            },\n            /** Signs and sends a call (defaults to no-op) */\n            call: (params) => {\n                return this.handleCallErrors(() => this._algorand.send.appCall(this.params.bare.call(params)));\n            },\n        };\n    }\n    getMethodCallParamsMethods() {\n        return {\n            /**\n             * Return params for a payment transaction to fund the app account\n             * @param params The parameters for the fund app accont payment transaction\n             * @returns The parameters which can be used to create a fund app account payment transaction\n             */\n            fundAppAccount: (params) => {\n                return {\n                    ...params,\n                    sender: this.getSender(params.sender),\n                    signer: this.getSigner(params.sender, params.signer),\n                    receiver: this.appAddress,\n                };\n            },\n            /**\n             * Return params for an update ABI call, including deploy-time TEAL template replacements and compilation if provided\n             * @param params The parameters for the update ABI method call\n             * @returns The parameters which can be used to create an update ABI method call\n             */\n            update: async (params) => {\n                return (await this.getABIParams({\n                    ...params,\n                    ...(await this.compile(params)),\n                }, OnApplicationComplete.UpdateApplicationOC));\n            },\n            /**\n             * Return params for an opt-in ABI call\n             * @param params The parameters for the opt-in ABI method call\n             * @returns The parameters which can be used to create an opt-in ABI method call\n             */\n            optIn: async (params) => {\n                return (await this.getABIParams(params, OnApplicationComplete.OptInOC));\n            },\n            /**\n             * Return params for an delete ABI call\n             * @param params The parameters for the delete ABI method call\n             * @returns The parameters which can be used to create a delete ABI method call\n             */\n            delete: async (params) => {\n                return (await this.getABIParams(params, OnApplicationComplete.DeleteApplicationOC));\n            },\n            /** Return params for an close out ABI call\n             * @param params The parameters for the close out ABI method call\n             * @returns The parameters which can be used to create a close out ABI method call\n             */\n            closeOut: async (params) => {\n                return (await this.getABIParams(params, OnApplicationComplete.CloseOutOC));\n            },\n            /** Return params for an ABI call\n             * @param params The parameters for the ABI method call\n             * @returns The parameters which can be used to create an ABI method call\n             */\n            call: async (params) => {\n                return (await this.getABIParams(params, params.onComplete ?? OnApplicationComplete.NoOpOC));\n            },\n        };\n    }\n    getMethodCallSendMethods() {\n        return {\n            /** Sign and send transactions for a payment transaction to fund the app account\n             * @param params The parameters for the fund app account payment transaction\n             * @returns The result of send the fund app account payment transaction\n             */\n            fundAppAccount: (params) => {\n                return this._algorand.send.payment(this.params.fundAppAccount(params));\n            },\n            /**\n             * Sign and send transactions for an update ABI call, including deploy-time TEAL template replacements and compilation if provided\n             * @param params The parameters for the update ABI method call\n             * @returns The result of sending the update ABI method call\n             */\n            update: async (params) => {\n                const compiled = await this.compile(params);\n                return {\n                    ...(await this.handleCallErrors(async () => this.processMethodCallReturn(this._algorand.send.appUpdateMethodCall(await this.params.update({ ...params })), getArc56Method(params.method, this._appSpec)))),\n                    ...compiled,\n                };\n            },\n            /**\n             * Sign and send transactions for an opt-in ABI call\n             * @param params The parameters for the opt-in ABI method call\n             * @returns The result of sending the opt-in ABI method call\n             */\n            optIn: (params) => {\n                return this.handleCallErrors(async () => this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.optIn(params)), getArc56Method(params.method, this._appSpec)));\n            },\n            /**\n             * Sign and send transactions for a delete ABI call\n             * @param params The parameters for the delete ABI method call\n             * @returns The result of sending the delete ABI method call\n             */\n            delete: (params) => {\n                return this.handleCallErrors(async () => this.processMethodCallReturn(this._algorand.send.appDeleteMethodCall(await this.params.delete(params)), getArc56Method(params.method, this._appSpec)));\n            },\n            /**\n             * Sign and send transactions for a close out ABI call\n             * @param params The parameters for the close out ABI method call\n             * @returns The result of sending the close out ABI method call\n             */\n            closeOut: (params) => {\n                return this.handleCallErrors(async () => this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.closeOut(params)), getArc56Method(params.method, this._appSpec)));\n            },\n            /**\n             * Sign and send transactions for a call (defaults to no-op)\n             * @param params The parameters for the ABI method call\n             * @returns The result of sending the ABI method call\n             */\n            call: async (params) => {\n                // Read-only call - do it via simulate\n                if ((params.onComplete === OnApplicationComplete.NoOpOC || !params.onComplete) &&\n                    getArc56Method(params.method, this._appSpec).method.readonly) {\n                    const readonlyParams = {\n                        ...params,\n                    };\n                    // Read-only calls do not require fees to be paid, as they are only simulated on the network.\n                    // Therefore there is no value in calculating the minimum fee needed for a successful app call with inner transactions.\n                    // As a a result we only need to send a single simulate call,\n                    // however to do this successfully we need to ensure fees for the transaction are fully covered using maxFee.\n                    if (params.coverAppCallInnerTransactionFees) {\n                        if (params.maxFee === undefined) {\n                            throw Error(`Please provide a maxFee for the transaction when coverAppCallInnerTransactionFees is enabled.`);\n                        }\n                        readonlyParams.staticFee = params.maxFee;\n                        readonlyParams.extraFee = undefined;\n                    }\n                    try {\n                        const result = await this._algorand\n                            .newGroup()\n                            .addAppCallMethodCall(await this.params.call(readonlyParams))\n                            .simulate({\n                            allowUnnamedResources: params.populateAppCallResources ?? true,\n                            // Simulate calls for a readonly method shouldn't invoke signing\n                            skipSignatures: true,\n                        });\n                        return this.processMethodCallReturn({\n                            ...result,\n                            transaction: result.transactions.at(-1),\n                            confirmation: result.confirmations.at(-1),\n                            // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain\n                            return: (result.returns?.length ?? 0 > 0) ? result.returns?.at(-1) : undefined,\n                        }, getArc56Method(params.method, this._appSpec));\n                    }\n                    catch (e) {\n                        const error = e;\n                        if (params.coverAppCallInnerTransactionFees && error && error.message && error.message.match(/fee too small/)) {\n                            throw Error(`Fees were too small. You may need to increase the transaction maxFee.`);\n                        }\n                        throw e;\n                    }\n                }\n                return this.handleCallErrors(async () => this.processMethodCallReturn(this._algorand.send.appCallMethodCall(await this.params.call(params)), getArc56Method(params.method, this._appSpec)));\n            },\n        };\n    }\n    getMethodCallCreateTransactionMethods() {\n        return {\n            /** Return transaction for a payment transaction to fund the app account\n             * @param params The parameters for the fund app account payment transaction\n             * @returns A transaction which can be used to fund the app account\n             */\n            fundAppAccount: (params) => {\n                return this._algorand.createTransaction.payment(this.params.fundAppAccount(params));\n            },\n            /**\n             * Return transactions for an update ABI call, including deploy-time TEAL template replacements and compilation if provided\n             * @param params The parameters for the update ABI method call\n             * @returns The transactions which can be used to create an update ABI method call\n             */\n            update: async (params) => {\n                return this._algorand.createTransaction.appUpdateMethodCall(await this.params.update(params));\n            },\n            /**\n             * Return transactions for an opt-in ABI call\n             * @param params The parameters for the opt-in ABI method call\n             * @returns The transactions which can be used to create an opt-in ABI method call\n             */\n            optIn: async (params) => {\n                return this._algorand.createTransaction.appCallMethodCall(await this.params.optIn(params));\n            },\n            /**\n             * Return transactions for a delete ABI call\n             * @param params The parameters for the delete ABI method call\n             * @returns The transactions which can be used to create a delete ABI method call\n             */\n            delete: async (params) => {\n                return this._algorand.createTransaction.appDeleteMethodCall(await this.params.delete(params));\n            },\n            /**\n             * Return transactions for a close out ABI call\n             * @param params The parameters for the close out ABI method call\n             * @returns The transactions which can be used to create a close out ABI method call\n             */\n            closeOut: async (params) => {\n                return this._algorand.createTransaction.appCallMethodCall(await this.params.closeOut(params));\n            },\n            /**\n             * Return transactions for an ABI call (defaults to no-op)\n             * @param params The parameters for the ABI method call\n             * @returns The transactions which can be used to create an ABI method call\n             */\n            call: async (params) => {\n                return this._algorand.createTransaction.appCallMethodCall(await this.params.call(params));\n            },\n        };\n    }\n    /** Returns the sender for a call, using the provided sender or using the `defaultSender`\n     * if none provided and throws an error if neither provided */\n    getSender(sender) {\n        if (!sender && !this._defaultSender) {\n            throw new Error(`No sender provided and no default sender present in app client for call to app ${this._appName}`);\n        }\n        return typeof sender === 'string' ? Address.fromString(sender) : (sender ?? this._defaultSender);\n    }\n    /** Returns the signer for a call, using the provided signer or the `defaultSigner`\n     * if no signer was provided and the sender resolves to the default sender, the call will use default signer\n     * or `undefined` otherwise (so the signer is resolved from `AlgorandClient`) */\n    getSigner(sender, signer) {\n        return signer ?? (!sender || sender === this._defaultSender ? this._defaultSigner : undefined);\n    }\n    getBareParams(params, onComplete) {\n        return {\n            ...params,\n            appId: this._appId,\n            sender: this.getSender(params?.sender),\n            signer: this.getSigner(params?.sender, params?.signer),\n            onComplete,\n        };\n    }\n    async getABIParams(params, onComplete) {\n        const sender = this.getSender(params.sender);\n        const method = getArc56Method(params.method, this._appSpec);\n        const args = await this.getABIArgsWithDefaultValues(params.method, params.args, sender);\n        return {\n            ...params,\n            appId: this._appId,\n            sender: sender,\n            signer: this.getSigner(params.sender, params.signer),\n            method,\n            onComplete,\n            args,\n        };\n    }\n    /** Make the given call and catch any errors, augmenting with debugging information before re-throwing. */\n    async handleCallErrors(call) {\n        try {\n            return await call();\n        }\n        catch (e) {\n            const logicError = await this.exposeLogicError(e);\n            if (logicError instanceof LogicError) {\n                let currentLine = logicError.teal_line - logicError.lines - 1;\n                const stackWithLines = logicError.stack\n                    ?.split('\\n')\n                    .map((line) => `${(currentLine += 1)}: ${line}`)\n                    .join('\\n');\n                Config.logger.error(`${logicError.message}\\n\\n${stackWithLines}`);\n            }\n            throw logicError;\n        }\n    }\n    getBoxMethods() {\n        // eslint-disable-next-line @typescript-eslint/no-this-alias\n        const that = this;\n        const stateMethods = {\n            /**\n             * Returns all single-key state values in a record keyed by the key name and the value a decoded ABI value.\n             */\n            getAll: async () => {\n                return Object.fromEntries(await Promise.all(Object.keys(that._appSpec.state.keys.box).map(async (key) => [key, await stateMethods.getValue(key)])));\n            },\n            /**\n             * Returns a single state value for the current app with the value a decoded ABI value.\n             * @param name The name of the state value to retrieve the value for\n             * @returns\n             */\n            getValue: async (name) => {\n                const metadata = that._appSpec.state.keys.box[name];\n                const value = await that.getBoxValue(Buffer.from(metadata.key, 'base64'));\n                return getABIDecodedValue(value, metadata.valueType, that._appSpec.structs);\n            },\n            /**\n             *\n             * @param mapName The name of the map to read from\n             * @param key The key within the map (without any map prefix) as either a Buffer with the bytes or a value\n             *  that will be converted to bytes by encoding it using the specified ABI key type\n             *  in the ARC-56 spec\n             */\n            // eslint-disable-next-line @typescript-eslint/no-explicit-any\n            getMapValue: async (mapName, key) => {\n                const metadata = that._appSpec.state.maps.box[mapName];\n                const prefix = Buffer.from(metadata.prefix ?? '', 'base64');\n                const encodedKey = Buffer.concat([prefix, getABIEncodedValue(key, metadata.keyType, that._appSpec.structs)]);\n                const base64Key = Buffer.from(encodedKey).toString('base64');\n                const value = await that.getBoxValue(Buffer.from(base64Key, 'base64'));\n                return getABIDecodedValue(value, metadata.valueType, that._appSpec.structs);\n            },\n            /**\n             *\n             * @param mapName The name of the map to read from\n             * @param key The key within the map as either a Buffer with the bytes or a value\n             *  that will be converted to bytes by encoding it using the specified ABI key type\n             *  in the ARC-56 spec\n             * @param appState\n             */\n            getMap: async (mapName) => {\n                const metadata = that._appSpec.state.maps.box[mapName];\n                const prefix = Buffer.from(metadata.prefix ?? '', 'base64');\n                const boxNames = await that.getBoxNames();\n                return new Map(await Promise.all(boxNames\n                    .filter((b) => binaryStartsWith(b.nameRaw, prefix))\n                    .map(async (b) => {\n                    const encodedKey = Buffer.concat([prefix, b.nameRaw]);\n                    const base64Key = Buffer.from(encodedKey).toString('base64');\n                    return [\n                        getABIDecodedValue(b.nameRaw.slice(prefix.length), metadata.keyType, that._appSpec.structs),\n                        getABIDecodedValue(await that.getBoxValue(Buffer.from(base64Key, 'base64')), metadata.valueType, that._appSpec.structs),\n                    ];\n                })));\n            },\n        };\n        return stateMethods;\n    }\n    getStateMethods(stateGetter, keyGetter, mapGetter) {\n        // eslint-disable-next-line @typescript-eslint/no-this-alias\n        const that = this;\n        const stateMethods = {\n            /**\n             * Returns all single-key state values in a record keyed by the key name and the value a decoded ABI value.\n             */\n            getAll: async () => {\n                const appState = await stateGetter();\n                return Object.fromEntries(await Promise.all(Object.keys(keyGetter()).map(async (key) => [key, await stateMethods.getValue(key, appState)])));\n            },\n            /**\n             * Returns a single state value for the current app with the value a decoded ABI value.\n             * @param name The name of the state value to retrieve the value for\n             * @param appState Optional cached value of the current state\n             * @returns\n             */\n            getValue: async (name, appState) => {\n                const state = Object.values(appState ?? (await stateGetter()));\n                const metadata = keyGetter()[name];\n                const value = state.find((s) => s.keyBase64 === metadata.key);\n                if (value && 'valueRaw' in value) {\n                    return getABIDecodedValue(value.valueRaw, metadata.valueType, that._appSpec.structs);\n                }\n                return value?.value;\n            },\n            /**\n             * Returns a single value from the given map for the current app with the value a decoded ABI value.\n             * @param mapName The name of the map to read from\n             * @param key The key within the map (without any map prefix) as either a Buffer with the bytes or a value\n             *  that will be converted to bytes by encoding it using the specified ABI key type\n             *  in the ARC-56 spec\n             * @param appState Optional cached value of the current state\n             */\n            // eslint-disable-next-line @typescript-eslint/no-explicit-any\n            getMapValue: async (mapName, key, appState) => {\n                const state = Object.values(appState ?? (await stateGetter()));\n                const metadata = mapGetter()[mapName];\n                const prefix = Buffer.from(metadata.prefix ?? '', 'base64');\n                const encodedKey = Buffer.concat([prefix, getABIEncodedValue(key, metadata.keyType, that._appSpec.structs)]);\n                const base64Key = Buffer.from(encodedKey).toString('base64');\n                const value = state.find((s) => s.keyBase64 === base64Key);\n                if (value && 'valueRaw' in value) {\n                    return getABIDecodedValue(value.valueRaw, metadata.valueType, that._appSpec.structs);\n                }\n                return value?.value;\n            },\n            /**\n             * Returns all map values for the given map.\n             * @param mapName The name of the map to read from\n             * @param appState Optional cached value of the current state\n             * @returns A map of all key-value pairs in the map as a `Record<string, ABIValue>`\n             */\n            getMap: async (mapName) => {\n                const state = Object.values(await stateGetter());\n                const metadata = mapGetter()[mapName];\n                const prefix = Buffer.from(metadata.prefix ?? '', 'base64');\n                return new Map(state\n                    .filter((s) => binaryStartsWith(s.keyRaw, prefix))\n                    .map((s) => {\n                    const key = s.keyRaw.slice(prefix.length);\n                    return [\n                        getABIDecodedValue(key, metadata.keyType, this._appSpec.structs),\n                        getABIDecodedValue('valueRaw' in s ? s.valueRaw : s.value, metadata.valueType, this._appSpec.structs),\n                    ];\n                }));\n            },\n        };\n        return stateMethods;\n    }\n}\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or\n * `algorand.client.getAppClientByCreatorAndName`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n * Application client - a class that wraps an ARC-0032 app spec and provides high productivity methods to deploy and call the app */\nclass ApplicationClient {\n    /**\n     * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or\n     * `algorand.client.getAppClientByCreatorAndName`.\n     * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n     * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n     *\n     * Create a new ApplicationClient instance\n     * @param appDetails The details of the app\n     * @param algod An algod instance\n     */\n    constructor(appDetails, algod) {\n        const { app, sender, params, deployTimeParams, ...appIdentifier } = appDetails;\n        this.algod = algod;\n        this.appSpec = typeof app == 'string' ? JSON.parse(app) : app;\n        this._appName = appIdentifier.name ?? this.appSpec.contract.name;\n        this.deployTimeParams = deployTimeParams;\n        if (appIdentifier.resolveBy === 'id') {\n            if (appIdentifier.id < 0) {\n                throw new Error(`Attempt to create application client with invalid app id of ${appIdentifier.id}`);\n            }\n            this._appId = appIdentifier.id;\n        }\n        else {\n            this._appId = 0;\n            this._creator = appIdentifier.creatorAddress?.toString();\n            if (appIdentifier.findExistingUsing instanceof Indexer) {\n                this.indexer = appIdentifier.findExistingUsing;\n            }\n            else {\n                if (appIdentifier.findExistingUsing.creator !== this._creator) {\n                    throw new Error(`Attempt to create application client with invalid existingDeployments against a different creator (${appIdentifier.findExistingUsing.creator}) instead of expected creator ${this._creator}`);\n                }\n                this.existingDeployments = appIdentifier.findExistingUsing;\n            }\n        }\n        this._appAddress = algosdk.getApplicationAddress(this._appId).toString();\n        this.sender = sender;\n        this.params = params;\n    }\n    /**\n     * @deprecated Use `AppClient.compile()` instead.\n     *\n     * Compiles the approval and clear state programs and sets up the source map.\n     * @param compilation The deploy-time parameters for the compilation\n     * @returns The compiled approval and clear state programs\n     */\n    async compile(compilation) {\n        const { deployTimeParams, updatable, deletable } = compilation ?? {};\n        const approvalTemplate = Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');\n        const approval = replaceDeployTimeControlParams(performTemplateSubstitution(approvalTemplate, deployTimeParams ?? this.deployTimeParams), {\n            updatable,\n            deletable,\n        });\n        const approvalCompiled = await compileTeal(approval, this.algod);\n        this._approvalSourceMap = approvalCompiled?.sourceMap;\n        const clearTemplate = Buffer.from(this.appSpec.source.clear, 'base64').toString('utf-8');\n        const clear = performTemplateSubstitution(clearTemplate, deployTimeParams ?? this.deployTimeParams);\n        const clearCompiled = await compileTeal(clear, this.algod);\n        this._clearSourceMap = clearCompiled?.sourceMap;\n        if (Config.debug) {\n            await Config.events.emitAsync(EventType.AppCompiled, {\n                sources: [\n                    { compiledTeal: approvalCompiled, appName: this._appName, fileName: 'approval' },\n                    { compiledTeal: clearCompiled, appName: this._appName, fileName: 'clear' },\n                ],\n            });\n        }\n        return { approvalCompiled, clearCompiled };\n    }\n    /**\n     * Export the current source maps for the app.\n     * @returns The source maps\n     */\n    exportSourceMaps() {\n        if (!this._approvalSourceMap || !this._clearSourceMap) {\n            throw new Error(\"Unable to export source maps; they haven't been loaded into this client - you need to call create, update, or deploy first\");\n        }\n        return {\n            approvalSourceMap: this._approvalSourceMap,\n            clearSourceMap: this._clearSourceMap,\n        };\n    }\n    /**\n     * Import source maps for the app.\n     * @param sourceMaps The source maps to import\n     */\n    importSourceMaps(sourceMaps) {\n        this._approvalSourceMap = new SourceMap(sourceMaps.approvalSourceMap);\n        this._clearSourceMap = new SourceMap(sourceMaps.clearSourceMap);\n    }\n    /**\n     * @deprecated Use `deploy` from an `AppFactory` instance instead.\n     *\n     * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.\n     *\n     * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md\n     *\n     * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.\n     *\n     * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.\n     * @param deploy Deployment details\n     * @returns The metadata and transaction result(s) of the deployment, or just the metadata if it didn't need to issue transactions\n     */\n    async deploy(deploy) {\n        const { schema, sender: deploySender, version, allowUpdate, allowDelete, sendParams, createArgs, createOnCompleteAction, updateArgs, deleteArgs, ...deployArgs } = deploy ?? {};\n        if (this._appId !== 0) {\n            throw new Error(`Attempt to deploy app which already has an app id of ${this._appId}`);\n        }\n        const sender = deploySender ?? this.sender;\n        if (!sender) {\n            throw new Error('No sender provided, unable to deploy app');\n        }\n        const from = sender ?? this.sender;\n        if (!this._creator) {\n            throw new Error(\"Attempt to `deploy` a contract without specifying `resolveBy: 'creatorAndName'` in the constructor\");\n        }\n        if (this._creator !== getSenderAddress(from)) {\n            throw new Error(`Attempt to deploy contract with a sender address (${getSenderAddress(from)}) that differs from the given creator address for this application client: ${this._creator}`);\n        }\n        const approval = Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');\n        const compilation = {\n            deployTimeParams: deployArgs.deployTimeParams,\n            updatable: allowUpdate !== undefined\n                ? allowUpdate\n                : getDeployTimeControl(approval, this.appSpec, UPDATABLE_TEMPLATE_NAME, 'update_application'),\n            deletable: allowDelete !== undefined\n                ? allowDelete\n                : getDeployTimeControl(approval, this.appSpec, DELETABLE_TEMPLATE_NAME, 'delete_application'),\n        };\n        const { approvalCompiled, clearCompiled } = await this.compile(compilation);\n        try {\n            await this.getAppReference();\n            const result = await deployApp({\n                from: sender,\n                approvalProgram: approvalCompiled.compiledBase64ToBytes,\n                clearStateProgram: clearCompiled.compiledBase64ToBytes,\n                metadata: {\n                    name: this._appName,\n                    version: version ?? '1.0',\n                    updatable: compilation.updatable,\n                    deletable: compilation.deletable,\n                },\n                schema: {\n                    globalByteSlices: this.appSpec.state.global.num_byte_slices,\n                    globalInts: this.appSpec.state.global.num_uints,\n                    localByteSlices: this.appSpec.state.local.num_byte_slices,\n                    localInts: this.appSpec.state.local.num_uints,\n                    ...schema,\n                },\n                transactionParams: this.params,\n                ...(sendParams ?? {}),\n                existingDeployments: this.existingDeployments,\n                createArgs: await this.getCallArgs(createArgs, sender),\n                createOnCompleteAction: createOnCompleteAction,\n                updateArgs: await this.getCallArgs(updateArgs, sender),\n                deleteArgs: await this.getCallArgs(deleteArgs, sender),\n                ...deployArgs,\n            }, this.algod, this.indexer);\n            // Nothing needed to happen\n            if (result.operationPerformed === 'nothing') {\n                return result;\n            }\n            if (!this.existingDeployments) {\n                throw new Error('Expected existingDeployments to be present');\n            }\n            const { transaction, confirmation, operationPerformed, ...appMetadata } = result;\n            this.existingDeployments = {\n                creator: this.existingDeployments.creator,\n                apps: { ...this.existingDeployments.apps, [this._appName]: appMetadata },\n            };\n            return { ...result, ...{ compiledApproval: approvalCompiled, compiledClear: clearCompiled } };\n        }\n        catch (e) {\n            throw this.exposeLogicError(e);\n        }\n    }\n    /**\n     * @deprecated Use `create` from an `AppFactory` instance instead.\n     *\n     * Creates a smart contract app, returns the details of the created app.\n     * @param create The parameters to create the app with\n     * @returns The details of the created app, or the transaction to create it if `skipSending` and the compilation result\n     */\n    async create(create) {\n        const { sender: createSender, note, sendParams, deployTimeParams, updatable, deletable, onCompleteAction, schema, ...args } = create ?? {};\n        if (this._appId !== 0) {\n            throw new Error(`Attempt to create app which already has an app id of ${this._appId}`);\n        }\n        const sender = createSender ?? this.sender;\n        if (!sender) {\n            throw new Error('No sender provided, unable to create app');\n        }\n        const { approvalCompiled, clearCompiled } = await this.compile(create);\n        try {\n            const result = await createApp({\n                from: sender,\n                approvalProgram: approvalCompiled.compiledBase64ToBytes,\n                clearStateProgram: clearCompiled.compiledBase64ToBytes,\n                schema: {\n                    globalByteSlices: this.appSpec.state.global.num_byte_slices,\n                    globalInts: this.appSpec.state.global.num_uints,\n                    localByteSlices: this.appSpec.state.local.num_byte_slices,\n                    localInts: this.appSpec.state.local.num_uints,\n                    ...schema,\n                },\n                onCompleteAction,\n                args: await this.getCallArgs(args, sender),\n                note: note,\n                transactionParams: this.params,\n                ...(sendParams ?? {}),\n            }, this.algod);\n            if (result.confirmation) {\n                this._appId = result.confirmation.applicationIndex;\n                this._appAddress = getApplicationAddress(this._appId).toString();\n            }\n            return { ...result, ...{ compiledApproval: approvalCompiled, compiledClear: clearCompiled } };\n        }\n        catch (e) {\n            throw await this.exposeLogicError(e);\n        }\n    }\n    /**\n     * @deprecated Use `appClient.send.update` or `appClient.createTransaction.update` from an `AppClient` instance instead.\n     *\n     * Updates the smart contract app.\n     * @param update The parameters to update the app with\n     * @returns The transaction send result and the compilation result\n     */\n    async update(update) {\n        const { sender: updateSender, note, sendParams, deployTimeParams, updatable, deletable, ...args } = update ?? {};\n        if (this._appId === 0) {\n            throw new Error(`Attempt to update app which doesn't have an app id defined`);\n        }\n        const sender = updateSender ?? this.sender;\n        if (!sender) {\n            throw new Error('No sender provided, unable to create app');\n        }\n        const { approvalCompiled, clearCompiled } = await this.compile(update);\n        try {\n            const result = await updateApp({\n                appId: this._appId,\n                from: sender,\n                approvalProgram: approvalCompiled.compiledBase64ToBytes,\n                clearStateProgram: clearCompiled.compiledBase64ToBytes,\n                args: await this.getCallArgs(args, sender),\n                note: note,\n                transactionParams: this.params,\n                ...(sendParams ?? {}),\n            }, this.algod);\n            return { ...result, ...{ compiledApproval: approvalCompiled, compiledClear: clearCompiled } };\n        }\n        catch (e) {\n            throw await this.exposeLogicError(e);\n        }\n    }\n    /**\n     * @deprecated Use `appClient.send.call` or `appClient.createTransaction.call` from an `AppClient` instance instead.\n     *\n     * Issues a no_op (normal) call to the app.\n     * @param call The call details.\n     * @returns The result of the call\n     */\n    async call(call) {\n        if (\n        // ABI call\n        call?.method &&\n            // We aren't skipping the send\n            !call.sendParams?.skipSending &&\n            // There isn't an ATC passed in\n            !call.sendParams?.atc &&\n            // The method is readonly\n            this.appSpec.hints[this.getABIMethodSignature(this.getABIMethod(call.method))].read_only) {\n            const atc = new AtomicTransactionComposer();\n            await this.callOfType({ ...call, sendParams: { ...call.sendParams, atc } }, 'no_op');\n            const result = await atc.simulate(this.algod);\n            if (result.simulateResponse.txnGroups.some((group) => group.failureMessage)) {\n                throw new Error(result.simulateResponse.txnGroups.find((x) => x.failureMessage)?.failureMessage);\n            }\n            const txns = atc.buildGroup();\n            return {\n                transaction: txns[txns.length - 1].txn,\n                confirmation: result.simulateResponse.txnGroups[0].txnResults.at(-1)?.txnResult,\n                confirmations: result.simulateResponse.txnGroups[0].txnResults.map((t) => t.txnResult),\n                transactions: txns.map((t) => t.txn),\n                return: (result.methodResults?.length ?? 0 > 0) ? result.methodResults[result.methodResults.length - 1] : undefined,\n            };\n        }\n        return await this.callOfType(call, 'no_op');\n    }\n    /**\n     * @deprecated Use `appClient.send.optIn` or `appClient.createTransaction.optIn` from an `AppClient` instance instead.\n     *\n     * Issues a opt_in call to the app.\n     * @param call The call details.\n     * @returns The result of the call\n     */\n    async optIn(call) {\n        return await this.callOfType(call, 'opt_in');\n    }\n    /**\n     * @deprecated Use `appClient.send.closeOut` or `appClient.createTransaction.closeOut` from an `AppClient` instance instead.\n     *\n     * Issues a close_out call to the app.\n     * @param call The call details.\n     * @returns The result of the call\n     */\n    async closeOut(call) {\n        return await this.callOfType(call, 'close_out');\n    }\n    /**\n     * @deprecated Use `appClient.send.clearState` or `appClient.createTransaction.clearState` from an `AppClient` instance instead.\n     *\n     * Issues a clear_state call to the app.\n     * @param call The call details.\n     * @returns The result of the call\n     */\n    async clearState(call) {\n        return await this.callOfType(call, 'clear_state');\n    }\n    /**\n     * @deprecated Use `appClient.send.delete` or `appClient.createTransaction.delete` from an `AppClient` instance instead.\n     *\n     * Issues a delete_application call to the app.\n     * @param call The call details.\n     * @returns The result of the call\n     */\n    async delete(call) {\n        return await this.callOfType(call, 'delete_application');\n    }\n    /**\n     * @deprecated Use `appClient.send.call` or `appClient.createTransaction.call` from an `AppClient` instance instead.\n     *\n     * Issues a call to the app with the given call type.\n     * @param call The call details.\n     * @param callType The call type\n     * @returns The result of the call\n     */\n    async callOfType(call = {}, callType) {\n        const { sender: callSender, note, sendParams, ...args } = call;\n        const sender = callSender ?? this.sender;\n        if (!sender) {\n            throw new Error('No sender provided, unable to call app');\n        }\n        const appMetadata = await this.getAppReference();\n        if (appMetadata.appId === 0) {\n            throw new Error(`Attempt to call an app that can't be found '${this._appName}' for creator '${this._creator}'.`);\n        }\n        try {\n            return await callApp({\n                appId: appMetadata.appId,\n                callType: callType,\n                from: sender,\n                args: await this.getCallArgs(args, sender),\n                note: note,\n                transactionParams: this.params,\n                ...(sendParams ?? {}),\n            }, this.algod);\n        }\n        catch (e) {\n            throw this.exposeLogicError(e);\n        }\n    }\n    /**\n     * Funds Algo into the app account for this app.\n     * @param fund The parameters for the funding or the funding amount\n     * @returns The result of the funding\n     */\n    async fundAppAccount(fund) {\n        const { amount, sender, note, sendParams } = 'microAlgos' in fund ? { amount: fund } : fund;\n        if (!sender && !this.sender) {\n            throw new Error('No sender provided, unable to call app');\n        }\n        const ref = await this.getAppReference();\n        return legacySendTransactionBridge(this.algod, sender ?? this.sender, sendParams ?? {}, {\n            receiver: ref.appAddress,\n            sender: getSenderAddress(sender ?? this.sender),\n            amount: amount,\n            note: encodeTransactionNote(note),\n        }, (c) => c.payment, (c) => c.payment, this.params);\n    }\n    /**\n     * Returns global state for the current app.\n     * @returns The global state\n     */\n    async getGlobalState() {\n        const appRef = await this.getAppReference();\n        if (appRef.appId === 0) {\n            throw new Error('No app has been created yet, unable to get global state');\n        }\n        return getAppGlobalState(appRef.appId, this.algod);\n    }\n    /**\n     * Returns local state for the given account / account address.\n     * @returns The global state\n     */\n    async getLocalState(account) {\n        const appRef = await this.getAppReference();\n        if (appRef.appId === 0) {\n            throw new Error('No app has been created yet, unable to get global state');\n        }\n        return getAppLocalState(appRef.appId, account, this.algod);\n    }\n    /**\n     * Returns the names of all current boxes for the current app.\n     * @returns The names of the boxes\n     */\n    async getBoxNames() {\n        const appRef = await this.getAppReference();\n        if (appRef.appId === 0) {\n            throw new Error('No app has been created yet, unable to get global state');\n        }\n        return await getAppBoxNames(appRef.appId, this.algod);\n    }\n    /**\n     * Returns the value of the given box for the current app.\n     * @param name The name of the box to return either as a string, binary array or `BoxName`\n     * @returns The current box value as a byte array\n     */\n    async getBoxValue(name) {\n        const appRef = await this.getAppReference();\n        if (appRef.appId === 0) {\n            throw new Error('No app has been created yet, unable to get global state');\n        }\n        return await getAppBoxValue(appRef.appId, name, this.algod);\n    }\n    /**\n     * Returns the value of the given box for the current app.\n     * @param name The name of the box to return either as a string, binary array or `BoxName`\n     * @param type\n     * @returns The current box value as a byte array\n     */\n    async getBoxValueFromABIType(name, type) {\n        const appRef = await this.getAppReference();\n        if (appRef.appId === 0) {\n            throw new Error('No app has been created yet, unable to get global state');\n        }\n        return await getAppBoxValueFromABIType({ appId: appRef.appId, boxName: name, type }, this.algod);\n    }\n    /**\n     * Returns the values of all current boxes for the current app.\n     * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.\n     * @param filter Optional filter to filter which boxes' values are returned\n     * @returns The (name, value) pair of the boxes with values as raw byte arrays\n     */\n    async getBoxValues(filter) {\n        const appRef = await this.getAppReference();\n        if (appRef.appId === 0) {\n            throw new Error('No app has been created yet, unable to get global state');\n        }\n        const names = await this.getBoxNames();\n        return await Promise.all(names\n            .filter(filter ?? ((_) => true))\n            .map(async (boxName) => ({ name: boxName, value: await getAppBoxValue(appRef.appId, boxName, this.algod) })));\n    }\n    /**\n     * Returns the values of all current boxes for the current app decoded using an ABI Type.\n     * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.\n     * @param type The ABI type to decode the values with\n     * @param filter Optional filter to filter which boxes' values are returned\n     * @returns The (name, value) pair of the boxes with values as the ABI Value\n     */\n    async getBoxValuesFromABIType(type, filter) {\n        const appRef = await this.getAppReference();\n        if (appRef.appId === 0) {\n            throw new Error('No app has been created yet, unable to get global state');\n        }\n        const names = await this.getBoxNames();\n        return await Promise.all(names.filter(filter ?? ((_) => true)).map(async (boxName) => ({\n            name: boxName,\n            value: await getAppBoxValueFromABIType({ appId: appRef.appId, boxName, type }, this.algod),\n        })));\n    }\n    /**\n     * @deprecated Use `appClient.params.*` from an `AppClient` instance instead.\n     *\n     * Returns the arguments for an app call for the given ABI method or raw method specification.\n     * @param args The call args specific to this application client\n     * @param sender The sender of this call. Will be used to fetch any default argument values if applicable\n     * @returns The call args ready to pass into an app call\n     */\n    async getCallArgs(args, sender) {\n        if (!args) {\n            return undefined;\n        }\n        if (args.method) {\n            const abiMethod = this.getABIMethodParams(args.method);\n            if (!abiMethod) {\n                throw new Error(`Attempt to call ABI method ${args.method}, but it wasn't found`);\n            }\n            const methodSignature = this.getABIMethodSignature(abiMethod);\n            return {\n                ...args,\n                method: abiMethod,\n                methodArgs: await Promise.all(args.methodArgs.map(async (arg, index) => {\n                    if (arg !== undefined)\n                        return arg;\n                    const argName = abiMethod.args[index].name;\n                    const defaultValueStrategy = argName && this.appSpec.hints?.[methodSignature]?.default_arguments?.[argName];\n                    if (!defaultValueStrategy)\n                        throw new Error(`Argument at position ${index} with the name ${argName} is undefined and does not have a default value strategy`);\n                    switch (defaultValueStrategy.source) {\n                        case 'constant':\n                            return defaultValueStrategy.data;\n                        case 'abi-method': {\n                            const method = defaultValueStrategy.data;\n                            const result = await this.callOfType({\n                                method: this.getABIMethodSignature(method),\n                                methodArgs: method.args.map(() => undefined),\n                                sender,\n                            }, 'no_op');\n                            return result.return?.returnValue;\n                        }\n                        case 'local-state':\n                        case 'global-state': {\n                            const state = defaultValueStrategy.source === 'global-state' ? await this.getGlobalState() : await this.getLocalState(sender);\n                            const key = defaultValueStrategy.data;\n                            if (key in state) {\n                                return state[key].value;\n                            }\n                            else {\n                                throw new Error(`Preparing default value for argument at position ${index} with the name ${argName} resulted in the failure: The key '${key}' could not be found in ${defaultValueStrategy.source}`);\n                            }\n                        }\n                    }\n                })),\n            };\n        }\n        else {\n            return args;\n        }\n    }\n    /**\n     * @deprecated Use `appClient.getABIMethod` instead.\n     *\n     * Returns the ABI Method parameters for the given method name string for the app represented by this application client instance\n     * @param method Either the name of the method or the ABI method spec definition string\n     * @returns The ABI method params for the given method\n     */\n    getABIMethodParams(method) {\n        if (!method.includes('(')) {\n            const methods = this.appSpec.contract.methods.filter((m) => m.name === method);\n            if (methods.length > 1) {\n                throw new Error(`Received a call to method ${method} in contract ${this._appName}, but this resolved to multiple methods; please pass in an ABI signature instead: ${methods\n                    .map(this.getABIMethodSignature)\n                    .join(', ')}`);\n            }\n            return methods[0];\n        }\n        return this.appSpec.contract.methods.find((m) => this.getABIMethodSignature(m) === method);\n    }\n    /**\n     * Returns the ABI Method for the given method name string for the app represented by this application client instance\n     * @param method Either the name of the method or the ABI method spec definition string\n     * @returns The ABI method for the given method\n     */\n    getABIMethod(method) {\n        const methodParams = this.getABIMethodParams(method);\n        return methodParams ? new ABIMethod(methodParams) : undefined;\n    }\n    /**\n     * @deprecated Use `appClient.appId` and `appClient.appAddress` from an `AppClient` instance instead.\n     *\n     * Gets the reference information for the current application instance.\n     * `appId` will be 0 if it can't find an app.\n     * @returns The app reference, or if deployed using the `deploy` method, the app metadata too\n     */\n    async getAppReference() {\n        if (!this.existingDeployments && this._creator) {\n            this.existingDeployments = await getCreatorAppsByName(this._creator, this.indexer);\n        }\n        if (this.existingDeployments && this._appId === 0) {\n            const app = this.existingDeployments.apps[this._appName];\n            if (!app) {\n                return {\n                    appId: 0,\n                    appAddress: getApplicationAddress(0).toString(),\n                };\n            }\n            return app;\n        }\n        return {\n            appId: this._appId,\n            appAddress: this._appAddress,\n        };\n    }\n    /**\n     * Takes an error that may include a logic error from a smart contract call and re-exposes the error to include source code information via the source map.\n     * This is automatically used within `ApplicationClient` but if you pass `skipSending: true` e.g. if doing a group transaction\n     *  then you can use this in a try/catch block to get better debugging information.\n     * @param e The error to parse\n     * @param isClear Whether or not the code was running the clear state program\n     * @returns The new error, or if there was no logic error or source map then the wrapped error with source details\n     */\n    exposeLogicError(e, isClear) {\n        if ((!isClear && this._approvalSourceMap == undefined) || (isClear && this._clearSourceMap == undefined))\n            return e;\n        const errorDetails = LogicError.parseLogicError(e);\n        if (errorDetails !== undefined)\n            return new LogicError(errorDetails, Buffer.from(isClear ? this.appSpec.source.clear : this.appSpec.source.approval, 'base64')\n                .toString()\n                .split('\\n'), (pc) => (isClear ? this._clearSourceMap : this._approvalSourceMap)?.getLocationForPc(pc)?.line);\n        else\n            return e;\n    }\n    getABIMethodSignature(method) {\n        return 'getSignature' in method ? method.getSignature() : new ABIMethod(method).getSignature();\n    }\n}\n\nexport { AppClient, ApplicationClient };\n//# sourceMappingURL=app-client.mjs.map\n","/* eslint-disable */\n/**\n * This file was automatically generated by @algorandfoundation/algokit-client-generator.\n * DO NOT MODIFY IT BY HAND.\n * requires: @algorandfoundation/algokit-utils: ^7\n */\nimport { AlgorandClientInterface } from '@algorandfoundation/algokit-utils/types/algorand-client-interface'\nimport { ABIReturn, AppReturn, SendAppTransactionResult } from '@algorandfoundation/algokit-utils/types/app'\nimport { Arc56Contract, getArc56ReturnValue, getABIStructFromABITuple } from '@algorandfoundation/algokit-utils/types/app-arc56'\nimport {\n  AppClient as _AppClient,\n  AppClientMethodCallParams,\n  AppClientParams,\n  AppClientBareCallParams,\n  CallOnComplete,\n  AppClientCompilationParams,\n  ResolveAppClientByCreatorAndName,\n  ResolveAppClientByNetwork,\n  CloneAppClientParams,\n} from '@algorandfoundation/algokit-utils/types/app-client'\nimport { AppFactory as _AppFactory, AppFactoryAppClientParams, AppFactoryResolveAppClientByCreatorAndNameParams, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'\nimport { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions, RawSimulateOptions, SkipSignaturesSimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'\nimport { SendParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'\nimport { Address, encodeAddress, modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'\nimport SimulateResponse = modelsv2.SimulateResponse\n\nexport const APP_SPEC: Arc56Contract = {\"name\":\"NFDInstance\",\"desc\":\"\",\"methods\":[{\"name\":\"createApplication\",\"args\":[{\"name\":\"nfdName\",\"type\":\"string\"},{\"name\":\"seller\",\"type\":\"address\"},{\"name\":\"buyer\",\"type\":\"address\"},{\"name\":\"purchaseAmount\",\"type\":\"uint64\"},{\"name\":\"expTime\",\"type\":\"uint64\"},{\"name\":\"commission1Addr\",\"type\":\"address\"},{\"name\":\"commission1Pct\",\"type\":\"uint64\"},{\"name\":\"commission2Addr\",\"type\":\"address\"},{\"name\":\"commission2Pct\",\"type\":\"uint64\"},{\"name\":\"segmentRootAppId\",\"type\":\"uint64\"},{\"name\":\"segmentRootCommissionAddr\",\"type\":\"address\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[\"NoOp\"],\"call\":[]}},{\"name\":\"updateApplication\",\"args\":[{\"name\":\"versionNum\",\"type\":\"string\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"UpdateApplication\"]}},{\"name\":\"gas\",\"args\":[],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"mintAsa\",\"args\":[{\"name\":\"nfdName\",\"type\":\"string\"},{\"name\":\"url\",\"type\":\"string\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"deleteFields\",\"args\":[{\"name\":\"fieldNames\",\"type\":\"byte[][]\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"updateSegmentCount\",\"args\":[{\"name\":\"childNfdName\",\"type\":\"string\"},{\"name\":\"childNfdAppID\",\"type\":\"uint64\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"getFieldUpdateCost\",\"readonly\":true,\"args\":[{\"name\":\"fieldAndVals\",\"type\":\"byte[][]\"}],\"returns\":{\"type\":\"uint64\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"updateFields\",\"args\":[{\"name\":\"fieldAndVals\",\"type\":\"byte[][]\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"readField\",\"readonly\":true,\"args\":[{\"name\":\"fieldName\",\"type\":\"byte[]\"}],\"returns\":{\"type\":\"byte[]\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"offerForSale\",\"args\":[{\"name\":\"sellAmount\",\"type\":\"uint64\"},{\"name\":\"reservedFor\",\"type\":\"address\"}],\"returns\":{\"type\":\"void\"},\"events\":[{\"name\":\"nfd_offerForSale\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"seller\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint64\"},{\"name\":\"reservedFor\",\"type\":\"address\"}],\"desc\":\"\"}],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"cancelSale\",\"args\":[],\"returns\":{\"type\":\"void\"},\"events\":[{\"name\":\"nfd_saleCancelled\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"}],\"desc\":\"\"}],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"postOffer\",\"args\":[{\"name\":\"offer\",\"type\":\"uint64\"},{\"name\":\"note\",\"type\":\"string\"}],\"returns\":{\"type\":\"void\"},\"events\":[{\"name\":\"nfd_postedOffer\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"sender\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint64\"},{\"name\":\"note\",\"type\":\"string\"}],\"desc\":\"\"}],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"mintPayout\",\"args\":[{\"name\":\"oneYearPrice\",\"type\":\"uint64\"},{\"name\":\"segmentPlatformCostInAlgo\",\"type\":\"uint64\"}],\"returns\":{\"type\":\"(uint64,address,uint64,address,uint64)\",\"struct\":\"PayoutInfo\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"purchase\",\"args\":[{\"name\":\"payment\",\"type\":\"pay\"}],\"returns\":{\"type\":\"void\"},\"events\":[{\"name\":\"nfd_purchased\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"seller\",\"type\":\"address\"},{\"name\":\"buyer\",\"type\":\"address\"},{\"name\":\"sellAmount\",\"type\":\"uint64\"},{\"name\":\"offerAmount\",\"type\":\"uint64\"},{\"name\":\"overpaymentRefund\",\"type\":\"uint64\"},{\"name\":\"convFeeAddr\",\"type\":\"address\"},{\"name\":\"convFeeAmount\",\"type\":\"uint64\"}],\"desc\":\"\"}],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"isAddressInField\",\"readonly\":true,\"args\":[{\"name\":\"fieldName\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"address\"}],\"returns\":{\"type\":\"bool\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"getRenewPrice\",\"readonly\":true,\"args\":[],\"returns\":{\"type\":\"uint64\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"updateHash\",\"args\":[{\"name\":\"hash\",\"type\":\"byte[]\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"contractLock\",\"args\":[{\"name\":\"lock\",\"type\":\"bool\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"segmentLock\",\"args\":[{\"name\":\"lock\",\"type\":\"bool\"},{\"name\":\"usdPrice\",\"type\":\"uint64\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"vaultOptInLock\",\"args\":[{\"name\":\"lock\",\"type\":\"bool\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"vaultOptIn\",\"args\":[{\"name\":\"assets\",\"type\":\"uint64[]\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"vaultSend\",\"args\":[{\"name\":\"amount\",\"type\":\"uint64\"},{\"name\":\"receiver\",\"type\":\"address\"},{\"name\":\"note\",\"type\":\"string\"},{\"name\":\"asset\",\"type\":\"uint64\"},{\"name\":\"otherAssets\",\"type\":\"uint64[]\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"renew\",\"desc\":\"Renew adds more time to an existing NFDs expiration, or renews it if expired.\\n\\n\\nAs part of v2-v3 upgrade, the NFDs are converted from lifetime NFDs to renewal NFDs. The v2 contract is upgraded\\nto v3, then renew is called on the (now v3) nfd to turn it into a renewal (note the if curExpiration === 0 check)\\n\\n\\nIf already renewal, then it extends the current expiration time by the time specified (minimum 1 yr) (365 / price paid * mint price)\\nExpirations can never be more than NFD_MAX_EXPIRATION_DAYS days in the future.\\n\\n\\nIF the NFD is expired:\\n    x The current owner can take it back over at base price - and NFD metadata doesn't have to be cleared - they\\n    get it back as-is.\\n    x If not current owner, then the price goes from high of base price * 10,000 down to base price over 24 hrs where\\n    'buyer' has to pay at least that price.  The NFD MUST ALREADY HAVE ITS METADATA CLEARED!\",\"args\":[{\"name\":\"payment\",\"type\":\"pay\",\"desc\":\"The payment transaction from which the renewal period is determined..\"}],\"returns\":{\"type\":\"void\"},\"events\":[{\"name\":\"nfd_saleCancelled\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"}],\"desc\":\"\"},{\"name\":\"nfd_renewed\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"origOwner\",\"type\":\"address\"},{\"name\":\"buyer\",\"type\":\"address\"},{\"name\":\"priceOneYear\",\"type\":\"uint64\"},{\"name\":\"renewAmount\",\"type\":\"uint64\"},{\"name\":\"expTime\",\"type\":\"uint64\"}],\"desc\":\"\"}],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"setPrimaryAddress\",\"args\":[{\"name\":\"fieldName\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"address\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"registryAddingVerifiedAddress\",\"desc\":\"Approved call from registry instructing us to move the specified u.cav.xx field and add to the specified\\nverified field.\",\"args\":[{\"name\":\"fieldBeingVerified\",\"type\":\"string\",\"desc\":\"- MUST START with u.cav. (!)\\ngets 'added' to 'set' in next arg - must be fixed-sized bytes\"},{\"name\":\"fieldSetName\",\"type\":\"string\",\"desc\":\"(must BE v.ca[...].as)\"}],\"returns\":{\"type\":\"bool\",\"desc\":\"true if added or already present, false otherwise\"},\"events\":[{\"name\":\"nfd_addressLinked\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"address\"}],\"desc\":\"\"}],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"registryRemovingVerifiedAddress\",\"desc\":\"Approved call from registry instructing us to REMOVE an address from the specified verified address set\",\"args\":[{\"name\":\"fieldBeingChanged\",\"type\":\"string\",\"desc\":\"The field being changed in the address registry.\"},{\"name\":\"address\",\"type\":\"address\",\"desc\":\"The address to be removed from the field.\"},{\"name\":\"mbrRefundDest\",\"type\":\"address\",\"desc\":\"the address to send reclaimed MBR (if any)\\n boolean - true if valid removed\"}],\"returns\":{\"type\":\"bool\"},\"events\":[{\"name\":\"nfd_addressUnlinked\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"address\"}],\"desc\":\"\"}],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}}],\"events\":[{\"name\":\"nfd_offerForSale\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"seller\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint64\"},{\"name\":\"reservedFor\",\"type\":\"address\"}],\"desc\":\"\"},{\"name\":\"nfd_saleCancelled\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"}],\"desc\":\"\"},{\"name\":\"nfd_postedOffer\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"sender\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint64\"},{\"name\":\"note\",\"type\":\"string\"}],\"desc\":\"\"},{\"name\":\"nfd_purchased\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"seller\",\"type\":\"address\"},{\"name\":\"buyer\",\"type\":\"address\"},{\"name\":\"sellAmount\",\"type\":\"uint64\"},{\"name\":\"offerAmount\",\"type\":\"uint64\"},{\"name\":\"overpaymentRefund\",\"type\":\"uint64\"},{\"name\":\"convFeeAddr\",\"type\":\"address\"},{\"name\":\"convFeeAmount\",\"type\":\"uint64\"}],\"desc\":\"\"},{\"name\":\"nfd_renewed\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"origOwner\",\"type\":\"address\"},{\"name\":\"buyer\",\"type\":\"address\"},{\"name\":\"priceOneYear\",\"type\":\"uint64\"},{\"name\":\"renewAmount\",\"type\":\"uint64\"},{\"name\":\"expTime\",\"type\":\"uint64\"}],\"desc\":\"\"},{\"name\":\"nfd_addressLinked\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"address\"}],\"desc\":\"\"},{\"name\":\"nfd_addressUnlinked\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"address\"}],\"desc\":\"\"}],\"arcs\":[4,56],\"structs\":{\"PayoutInfo\":[{\"name\":\"amountToSeller\",\"type\":\"uint64\"},{\"name\":\"commissionAddress\",\"type\":\"address\"},{\"name\":\"amountToCommission\",\"type\":\"uint64\"},{\"name\":\"segmentRootOwner\",\"type\":\"address\"},{\"name\":\"amountToSegmentRoot\",\"type\":\"uint64\"}]},\"state\":{\"schema\":{\"global\":{\"bytes\":30,\"ints\":0},\"local\":{\"bytes\":0,\"ints\":0}},\"keys\":{\"global\":{},\"local\":{},\"box\":{}},\"maps\":{\"global\":{\"globalState\":{\"keyType\":\"AVMBytes\",\"valueType\":\"AVMBytes\"}},\"local\":{},\"box\":{\"boxes\":{\"keyType\":\"AVMBytes\",\"valueType\":\"AVMBytes\"}}}},\"bareActions\":{\"create\":[],\"call\":[]},\"sourceInfo\":{\"approval\":{\"sourceInfo\":[{\"teal\":25,\"source\":\"contracts/NFDInstance.algo.ts:17\",\"errorMessage\":\"The requested action is not implemented in this contract. Are you using the correct OnComplete? Did you set your app ID?\",\"pc\":[36]},{\"teal\":37,\"source\":\"contracts/NFDInstance.algo.ts:43\",\"errorMessage\":\"argument 0 (segmentRootCommissionAddr) for createApplication must be a address\",\"pc\":[44]},{\"teal\":55,\"source\":\"contracts/NFDInstance.algo.ts:40\",\"errorMessage\":\"argument 3 (commission2Addr) for createApplication must be a address\",\"pc\":[60]},{\"teal\":69,\"source\":\"contracts/NFDInstance.algo.ts:38\",\"errorMessage\":\"argument 5 (commission1Addr) for createApplication must be a address\",\"pc\":[72]},{\"teal\":87,\"source\":\"contracts/NFDInstance.algo.ts:35\",\"errorMessage\":\"argument 8 (buyer) for createApplication must be a address\",\"pc\":[88]},{\"teal\":97,\"source\":\"contracts/NFDInstance.algo.ts:34\",\"errorMessage\":\"argument 9 (seller) for createApplication must be a address\",\"pc\":[96]},{\"teal\":122,\"source\":\"contracts/NFDInstance.algo.ts:45\",\"errorMessage\":\"caller must be NFD registry!\",\"pc\":[117]},{\"teal\":224,\"source\":\"contracts/NFDInstance.algo.ts:60\",\"errorMessage\":\"commission must be between 1 and 50%\",\"pc\":[217]},{\"teal\":262,\"source\":\"contracts/NFDInstance.algo.ts:64\",\"errorMessage\":\"commission must be between 1 and 50%\",\"pc\":[251]},{\"teal\":370,\"source\":\"contracts/NFDInstance.algo.ts:90\",\"errorMessage\":\"parent commission address must be set if parent app id is set and parent is unlocked\",\"pc\":[382]},{\"teal\":384,\"source\":\"contracts/NFDInstance.algo.ts:97\",\"errorMessage\":\"the segment commission agent should be the parent nfd's seller\",\"pc\":[393]},{\"teal\":420,\"source\":\"contracts/NFDInstance.algo.ts:110\",\"errorMessage\":\"contract must be unlocked to upgrade\",\"pc\":[420]},{\"teal\":429,\"source\":\"contracts/NFDInstance.algo.ts:113\",\"errorMessage\":\"caller must be NFD registry!\",\"pc\":[426]},{\"teal\":459,\"source\":\"contracts/NFDInstance.algo.ts:120\",\"errorMessage\":\"can't still be in minting state\",\"pc\":[449]},{\"teal\":481,\"source\":\"contracts/NFDInstance.algo.ts:125\",\"errorMessage\":\"NFD can't be expired for these v1/v2 operations\",\"pc\":[467]},{\"teal\":677,\"source\":\"contracts/NFDInstance.algo.ts:180\",\"errorMessage\":\"unknown method\",\"pc\":[731]},{\"teal\":721,\"source\":\"contracts/NFDInstance.algo.ts:190\",\"errorMessage\":\"caller must be NFD registry!\",\"pc\":[768]},{\"teal\":942,\"source\":\"contracts/NFDInstance.algo.ts:224\",\"errorMessage\":\"field not removable or no permissions to remove\",\"pc\":[959]},{\"teal\":950,\"source\":\"contracts/NFDInstance.algo.ts:225\",\"errorMessage\":\"box value does not exist: this.boxes(name).size\",\"pc\":[963]},{\"teal\":1075,\"source\":\"contracts/NFDInstance.algo.ts:244\",\"errorMessage\":\"field not removable or no permissions to remove\",\"pc\":[1067]},{\"teal\":1130,\"source\":\"contracts/NFDInstance.algo.ts:258\",\"errorMessage\":\"caller must be NFD registry!\",\"pc\":[1111]},{\"teal\":1144,\"source\":\"contracts/NFDInstance.algo.ts:259\",\"errorMessage\":\"child NFD MUST still be in pre-claim state!\",\"pc\":[1121]},{\"teal\":1172,\"source\":\"contracts/NFDInstance.algo.ts:266\",\"errorMessage\":\"passed in child name must match name in created nfd state\",\"pc\":[1144]},{\"teal\":1209,\"source\":\"contracts/NFDInstance.algo.ts:276\",\"errorMessage\":\"parent must be suffix of child\",\"pc\":[1177]},{\"teal\":1381,\"source\":\"contracts/NFDInstance.algo.ts:298\",\"errorMessage\":\"box value does not exist: this.boxes(name).size\",\"pc\":[1346]},{\"teal\":1423,\"source\":\"contracts/NFDInstance.algo.ts:307\",\"errorMessage\":\"box value does not exist: this.boxes(name).size\",\"pc\":[1386]},{\"teal\":1537,\"source\":\"contracts/NFDInstance.algo.ts:323\",\"errorMessage\":\"can't update fields if NFD expired\",\"pc\":[1487]},{\"teal\":1644,\"source\":\"contracts/NFDInstance.algo.ts:333\",\"errorMessage\":\"invalid update call by registry\",\"pc\":[1615]},{\"teal\":1738,\"source\":\"contracts/NFDInstance.algo.ts:340\",\"errorMessage\":\"field not updatable or no permissions to update\",\"pc\":[1717]},{\"teal\":1799,\"source\":\"contracts/NFDInstance.algo.ts:353\",\"errorMessage\":\"can't update fields if NFD expired\",\"pc\":[1763]},{\"teal\":1844,\"source\":\"contracts/NFDInstance.algo.ts:359\",\"errorMessage\":\"field not updatable or no permissions to update\",\"pc\":[1803]},{\"teal\":1953,\"source\":\"contracts/NFDInstance.algo.ts:379\",\"errorMessage\":\"must be user-defined or verified field to fetch\",\"pc\":[1902]},{\"teal\":1971,\"source\":\"contracts/NFDInstance.algo.ts:384\",\"errorMessage\":\"box value does not exist: this.boxes(fieldName).value\",\"pc\":[1914]},{\"teal\":2005,\"source\":\"contracts/NFDInstance.algo.ts:392\",\"errorMessage\":\"box value does not exist: this.boxes(boxName).value\",\"pc\":[1944]},{\"teal\":2057,\"source\":\"contracts/NFDInstance.algo.ts:400\",\"errorMessage\":\"box value does not exist: this.boxes(boxName).value\",\"pc\":[1994]},{\"teal\":2093,\"source\":\"contracts/NFDInstance.algo.ts:407\",\"errorMessage\":\"argument 0 (reservedFor) for offerForSale must be a address\",\"pc\":[2021]},{\"teal\":2117,\"source\":\"contracts/NFDInstance.algo.ts:408\",\"errorMessage\":\"can't sell if NFD expired\",\"pc\":[2039]},{\"teal\":2165,\"source\":\"contracts/NFDInstance.algo.ts:419\",\"errorMessage\":\"can only be sold if no user-defined or verified properties remain\",\"pc\":[2089]},{\"teal\":2185,\"source\":\"contracts/NFDInstance.algo.ts:423\",\"errorMessage\":\"must be sold for at least MIN amount\",\"pc\":[2106]},{\"teal\":2323,\"source\":\"contracts/NFDInstance.algo.ts:465\",\"errorMessage\":\"can't update fields if NFD expired\",\"pc\":[2252]},{\"teal\":2340,\"source\":\"contracts/NFDInstance.algo.ts:467\",\"errorMessage\":\"must be for sale\",\"pc\":[2265]},{\"teal\":2484,\"source\":\"contracts/NFDInstance.algo.ts:492\",\"errorMessage\":\"caller must be NFD registry!\",\"pc\":[2420]},{\"teal\":2751,\"source\":\"contracts/NFDInstance.algo.ts:573\",\"errorMessage\":\"argument 0 (payment) for purchase must be a pay transaction\",\"pc\":[2652]},{\"teal\":2782,\"source\":\"contracts/NFDInstance.algo.ts:575\",\"errorMessage\":\"can't be expired\",\"pc\":[2677]},{\"teal\":2789,\"source\":\"contracts/NFDInstance.algo.ts:576\",\"errorMessage\":\"must be for sale\",\"pc\":[2681]},{\"teal\":2830,\"source\":\"contracts/NFDInstance.algo.ts:583\",\"errorMessage\":\"payment sender must be same as purchase caller\",\"pc\":[2733]},{\"teal\":2853,\"source\":\"contracts/NFDInstance.algo.ts:586\",\"errorMessage\":\"Reserved owner set, but sender isn't the reserved address\",\"pc\":[2749]},{\"teal\":2900,\"source\":\"contracts/NFDInstance.algo.ts:604\",\"errorMessage\":\"offer must be at least min amount\",\"pc\":[2795]},{\"teal\":2910,\"source\":\"contracts/NFDInstance.algo.ts:607\",\"errorMessage\":\"offer must be at least sell amount\",\"pc\":[2801]},{\"teal\":2935,\"source\":\"contracts/NFDInstance.algo.ts:614\",\"errorMessage\":\"transaction verification failed: {\\\"txn\\\":\\\"payment\\\",\\\"field\\\":\\\"amount\\\",\\\"expected\\\":\\\"origOfferamt\\\"}\",\"pc\":[2823]},{\"teal\":2944,\"source\":\"contracts/NFDInstance.algo.ts:614\",\"errorMessage\":\"transaction verification failed: {\\\"txn\\\":\\\"payment\\\",\\\"field\\\":\\\"receiver\\\",\\\"expected\\\":\\\"this.app.address\\\"}\",\"pc\":[2831]},{\"teal\":3406,\"source\":\"contracts/NFDInstance.algo.ts:730\",\"errorMessage\":\"argument 0 (address) for isAddressInField must be a address\",\"pc\":[3291]},{\"teal\":3458,\"source\":\"contracts/NFDInstance.algo.ts:735\",\"errorMessage\":\"box value does not exist: this.boxes(fieldName).value\",\"pc\":[3336]},{\"teal\":3711,\"source\":\"contracts/NFDInstance.algo.ts:856\",\"errorMessage\":\"must pass 32-byte hash that isn't 0\",\"pc\":[3553]},{\"teal\":3729,\"source\":\"contracts/NFDInstance.algo.ts:861\",\"errorMessage\":\"only txnlab or owner can request an nfd nft hash update\",\"pc\":[3567]},{\"teal\":3782,\"source\":\"contracts/NFDInstance.algo.ts:876\",\"errorMessage\":\"argument 0 (lock) for contractLock must be a bool\",\"pc\":[3603]},{\"teal\":3835,\"source\":\"contracts/NFDInstance.algo.ts:884\",\"errorMessage\":\"argument 1 (lock) for segmentLock must be a bool\",\"pc\":[3649]},{\"teal\":3930,\"source\":\"contracts/NFDInstance.algo.ts:895\",\"errorMessage\":\"amount must be at least NFD_MIN_SEGMENT_USD dollars in algo\",\"pc\":[3732]},{\"teal\":3952,\"source\":\"contracts/NFDInstance.algo.ts:907\",\"errorMessage\":\"argument 0 (lock) for vaultOptInLock must be a bool\",\"pc\":[3747]},{\"teal\":4032,\"source\":\"contracts/NFDInstance.algo.ts:925\",\"errorMessage\":\"sender must be owner when vault locked\",\"pc\":[3812]},{\"teal\":4042,\"source\":\"contracts/NFDInstance.algo.ts:931\",\"errorMessage\":\"part of opt-in for new asset, must have prior txn paying MBR\",\"pc\":[3817]},{\"teal\":4061,\"source\":\"contracts/NFDInstance.algo.ts:933\",\"errorMessage\":\"transaction verification failed: {\\\"txn\\\":\\\"this.txnGroup[this.txn.groupIndex - 1]\\\",\\\"field\\\":\\\"typeEnum\\\",\\\"expected\\\":\\\"pay\\\"}\",\"pc\":[3830]},{\"teal\":4070,\"source\":\"contracts/NFDInstance.algo.ts:934\",\"errorMessage\":\"transaction verification failed: {\\\"txn\\\":\\\"this.txnGroup[this.txn.groupIndex - 1]\\\",\\\"field\\\":\\\"receiver\\\",\\\"expected\\\":\\\"this.app.address\\\"}\",\"pc\":[3838]},{\"teal\":4084,\"source\":\"contracts/NFDInstance.algo.ts:935\",\"errorMessage\":\"transaction verification failed: {\\\"txn\\\":\\\"this.txnGroup[this.txn.groupIndex - 1]\\\",\\\"field\\\":\\\"amount\\\",\\\"expected\\\":\\\"100_000 * assets.length\\\"}\",\"pc\":[3853]},{\"teal\":4198,\"source\":\"contracts/NFDInstance.algo.ts:958\",\"errorMessage\":\"argument 3 (receiver) for vaultSend must be a address\",\"pc\":[3954]},{\"teal\":4247,\"source\":\"contracts/NFDInstance.algo.ts:968\",\"errorMessage\":\"can't specify other assets if sending algo from vault\",\"pc\":[3994]},{\"teal\":4329,\"source\":\"contracts/NFDInstance.algo.ts:980\",\"errorMessage\":\"can only send one asset if amount == 0\",\"pc\":[4061]},{\"teal\":4402,\"source\":\"contracts/NFDInstance.algo.ts:993\",\"errorMessage\":\"receiver must be owner\",\"pc\":[4128]},{\"teal\":4537,\"source\":\"contracts/NFDInstance.algo.ts:1029\",\"errorMessage\":\"argument 0 (payment) for renew must be a pay transaction\",\"pc\":[4237]},{\"teal\":4577,\"source\":\"contracts/NFDInstance.algo.ts:1030\",\"errorMessage\":\"transaction verification failed: {\\\"txn\\\":\\\"payment\\\",\\\"field\\\":\\\"receiver\\\",\\\"expected\\\":\\\"this.app.address\\\"}\",\"pc\":[4256]},{\"teal\":4706,\"source\":\"contracts/NFDInstance.algo.ts:1052\",\"errorMessage\":\"can't claim expired nfd unless all metadata is cleared\",\"pc\":[4386]},{\"teal\":4719,\"source\":\"contracts/NFDInstance.algo.ts:1058\",\"errorMessage\":\"must pay at least minimum renewal price\",\"pc\":[4394]},{\"teal\":4892,\"source\":\"contracts/NFDInstance.algo.ts:1098\",\"errorMessage\":\"global state value does not exist: parentAppId.globalState(NFD_KEY_OWNER)\",\"pc\":[4550]},{\"teal\":5039,\"source\":\"contracts/NFDInstance.algo.ts:1137\",\"errorMessage\":\"argument 0 (address) for setPrimaryAddress must be a address\",\"pc\":[4716]},{\"teal\":5126,\"source\":\"contracts/NFDInstance.algo.ts:1156\",\"errorMessage\":\"caller must be NFD registry!\",\"pc\":[4802]},{\"teal\":5140,\"source\":\"contracts/NFDInstance.algo.ts:1158\",\"errorMessage\":\"field being verified MUST START with u.cav\",\"pc\":[4820]},{\"teal\":5150,\"source\":\"contracts/NFDInstance.algo.ts:1159\",\"errorMessage\":\"destination field MUST START with v.ca[....]\",\"pc\":[4829]},{\"teal\":5165,\"source\":\"contracts/NFDInstance.algo.ts:1160\",\"errorMessage\":\"destination field must end END with .as\",\"pc\":[4844]},{\"teal\":5178,\"source\":\"contracts/NFDInstance.algo.ts:1161\",\"errorMessage\":\"referenced field to add as verified address must have value in box storage\",\"pc\":[4850]},{\"teal\":5193,\"source\":\"contracts/NFDInstance.algo.ts:1167\",\"errorMessage\":\"box value does not exist: this.boxes(fieldBeingVerified).value\",\"pc\":[4859]},{\"teal\":5253,\"source\":\"contracts/NFDInstance.algo.ts:1187\",\"errorMessage\":\"argument 0 (mbrRefundDest) for registryRemovingVerifiedAddress must be a address\",\"pc\":[4924]},{\"teal\":5263,\"source\":\"contracts/NFDInstance.algo.ts:1187\",\"errorMessage\":\"argument 1 (address) for registryRemovingVerifiedAddress must be a address\",\"pc\":[4932]},{\"teal\":5302,\"source\":\"contracts/NFDInstance.algo.ts:1188\",\"errorMessage\":\"caller must be NFD registry!\",\"pc\":[4962]},{\"teal\":5318,\"source\":\"contracts/NFDInstance.algo.ts:1191\",\"errorMessage\":\"can't be for sale\",\"pc\":[4974]},{\"teal\":5329,\"source\":\"contracts/NFDInstance.algo.ts:1193\",\"errorMessage\":\"verified field MUST START with v.ca[....]\",\"pc\":[4983]},{\"teal\":5347,\"source\":\"contracts/NFDInstance.algo.ts:1194\",\"errorMessage\":\"verified field must end END with .as\",\"pc\":[4998]},{\"teal\":5362,\"source\":\"contracts/NFDInstance.algo.ts:1200\",\"errorMessage\":\"box value does not exist: this.boxes(fieldBeingChanged).size\",\"pc\":[5007]},{\"teal\":5542,\"source\":\"contracts/NFDInstance.algo.ts:1247\",\"errorMessage\":\"sender must be owner\",\"pc\":[5175]},{\"teal\":5552,\"source\":\"contracts/NFDInstance.algo.ts:1250\",\"errorMessage\":\"part of opt-in for new asset, must have prior txn paying MBR\",\"pc\":[5180]},{\"teal\":5571,\"source\":\"contracts/NFDInstance.algo.ts:1252\",\"errorMessage\":\"transaction verification failed: {\\\"txn\\\":\\\"this.txnGroup[this.txn.groupIndex - 1]\\\",\\\"field\\\":\\\"typeEnum\\\",\\\"expected\\\":\\\"pay\\\"}\",\"pc\":[5193]},{\"teal\":5580,\"source\":\"contracts/NFDInstance.algo.ts:1253\",\"errorMessage\":\"transaction verification failed: {\\\"txn\\\":\\\"this.txnGroup[this.txn.groupIndex - 1]\\\",\\\"field\\\":\\\"receiver\\\",\\\"expected\\\":\\\"this.app.address\\\"}\",\"pc\":[5201]},{\"teal\":5593,\"source\":\"contracts/NFDInstance.algo.ts:1254\",\"errorMessage\":\"transaction verification failed: {\\\"txn\\\":\\\"this.txnGroup[this.txn.groupIndex - 1]\\\",\\\"field\\\":\\\"amount\\\",\\\"expected\\\":\\\"100_000 * (this.txn.numAppArgs - 1)\\\"}\",\"pc\":[5214]},{\"teal\":5730,\"source\":\"contracts/NFDInstance.algo.ts:1280\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(appId).globalState(key)\",\"pc\":[5317]},{\"teal\":5796,\"source\":\"contracts/NFDInstance.algo.ts:1313\",\"errorMessage\":\"internal fields can never be deleted\",\"pc\":[5371]},{\"teal\":5820,\"source\":\"contracts/NFDInstance.algo.ts:1320\",\"errorMessage\":\"must be owned\",\"pc\":[5388]},{\"teal\":5836,\"source\":\"contracts/NFDInstance.algo.ts:1323\",\"errorMessage\":\"can't be for sale\",\"pc\":[5400]},{\"teal\":5920,\"source\":\"contracts/NFDInstance.algo.ts:1357\",\"errorMessage\":\"internal fields can never be updated\",\"pc\":[5471]},{\"teal\":5977,\"source\":\"contracts/NFDInstance.algo.ts:1365\",\"errorMessage\":\"must be owned\",\"pc\":[5526]},{\"teal\":5985,\"source\":\"contracts/NFDInstance.algo.ts:1366\",\"errorMessage\":\"can't be for sale\",\"pc\":[5531]},{\"teal\":5995,\"source\":\"contracts/NFDInstance.algo.ts:1367\",\"errorMessage\":\"sender must be owner\",\"pc\":[5537]},{\"teal\":6031,\"source\":\"contracts/NFDInstance.algo.ts:1375\",\"errorMessage\":\"updating v.caAlgo field isn't allowed via regular field update\",\"pc\":[5567]},{\"teal\":6176,\"source\":\"contracts/NFDInstance.algo.ts:1426\",\"errorMessage\":\"can't be for sale\",\"pc\":[5688]},{\"teal\":6184,\"source\":\"contracts/NFDInstance.algo.ts:1427\",\"errorMessage\":\"can't be expired\",\"pc\":[5693]},{\"teal\":6296,\"source\":\"contracts/NFDInstance.algo.ts:1454\",\"errorMessage\":\"max expiration exceeded parameters defined by registry\",\"pc\":[5778]},{\"teal\":6529,\"source\":\"contracts/NFDInstance.algo.ts:1508\",\"errorMessage\":\"box value does not exist: this.boxes(key).value\",\"pc\":[5946]},{\"teal\":6547,\"source\":\"contracts/NFDInstance.algo.ts:1512\",\"errorMessage\":\"address 'set' should already have at least two values\",\"pc\":[5961]},{\"teal\":6629,\"source\":\"contracts/NFDInstance.algo.ts:1528\",\"errorMessage\":\"address must be found in set in order to move it\",\"pc\":[6029]},{\"teal\":6712,\"source\":\"contracts/NFDInstance.algo.ts:1552\",\"errorMessage\":\"box value does not exist: this.boxes(key).value\",\"pc\":[6095]},{\"teal\":6733,\"source\":\"contracts/NFDInstance.algo.ts:1555\",\"errorMessage\":\"existing set must be multiple of key being added\",\"pc\":[6114]},{\"teal\":6869,\"source\":\"contracts/NFDInstance.algo.ts:1586\",\"errorMessage\":\"box value does not exist: this.boxes(key).value\",\"pc\":[6221]},{\"teal\":7078,\"source\":\"contracts/NFDInstance.algo.ts:1624\",\"errorMessage\":\"sender must be owner\",\"pc\":[6390]},{\"teal\":7087,\"source\":\"contracts/NFDInstance.algo.ts:17\",\"errorMessage\":\"this contract does not implement the given ABI method for create NoOp\",\"pc\":[6405]},{\"teal\":7128,\"source\":\"contracts/NFDInstance.algo.ts:17\",\"errorMessage\":\"this contract does not implement the given ABI method for call UpdateApplication\",\"pc\":[6621]}],\"pcOffsetMethod\":\"cblocks\"},\"clear\":{\"sourceInfo\":[],\"pcOffsetMethod\":\"none\"}},\"templateVariables\":{\"adminAsaId\":{\"type\":\"uint64\"},\"registryAppId\":{\"type\":\"uint64\"}},\"scratchVariables\":{\"adminAsaId\":{\"type\":\"uint64\",\"slot\":200},\"registryAppId\":{\"type\":\"uint64\",\"slot\":201}},\"compilerInfo\":{\"compiler\":\"algod\",\"compilerVersion\":{\"major\":3,\"minor\":27,\"patch\":237217,\"commitHash\":\"0bc3d7e4\"}}} as unknown as Arc56Contract\n\n/**\n * A state record containing binary data\n */\nexport interface BinaryState {\n  /**\n   * Gets the state value as a Uint8Array\n   */\n  asByteArray(): Uint8Array | undefined\n  /**\n   * Gets the state value as a string\n   */\n  asString(): string | undefined\n}\n\nclass BinaryStateValue implements BinaryState {\n  constructor(private value: Uint8Array | undefined) {}\n\n  asByteArray(): Uint8Array | undefined {\n    return this.value\n  }\n\n  asString(): string | undefined {\n    return this.value !== undefined ? Buffer.from(this.value).toString('utf-8') : undefined\n  }\n}\n\n/**\n * Expands types for IntelliSense so they are more human readable\n * See https://stackoverflow.com/a/69288824\n */\nexport type Expand<T> = T extends (...args: infer A) => infer R\n  ? (...args: Expand<A>) => Expand<R>\n  : T extends infer O\n    ? { [K in keyof O]: O[K] }\n    : never\n\n\n// Type definitions for ARC-56 structs\n\nexport type PayoutInfo = {\n  amountToSeller: bigint,\n  commissionAddress: string,\n  amountToCommission: bigint,\n  segmentRootOwner: string,\n  amountToSegmentRoot: bigint\n}\n\n\n/**\n * Converts the ABI tuple representation of a PayoutInfo to the struct representation\n */\nexport function PayoutInfoFromTuple(abiTuple: [bigint, string, bigint, string, bigint]) {\n  return getABIStructFromABITuple(abiTuple, APP_SPEC.structs.PayoutInfo, APP_SPEC.structs) as PayoutInfo\n}\n\n/**\n * Deploy-time template variables\n */\nexport type TemplateVariables = {\n  adminAsaId: bigint,\n  registryAppId: bigint,\n}\n\n/**\n * The argument types for the NfdInstance contract\n */\nexport type NfdInstanceArgs = {\n  /**\n   * The object representation of the arguments for each method\n   */\n  obj: {\n    'createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void': {\n      nfdName: string\n      seller: string\n      buyer: string\n      purchaseAmount: bigint | number\n      expTime: bigint | number\n      commission1Addr: string\n      commission1Pct: bigint | number\n      commission2Addr: string\n      commission2Pct: bigint | number\n      segmentRootAppId: bigint | number\n      segmentRootCommissionAddr: string\n    }\n    'updateApplication(string)void': {\n      versionNum: string\n    }\n    'gas()void': Record<string, never>\n    'mintAsa(string,string)void': {\n      nfdName: string\n      url: string\n    }\n    'deleteFields(byte[][])void': {\n      fieldNames: Uint8Array[]\n    }\n    'updateSegmentCount(string,uint64)void': {\n      childNfdName: string\n      childNfdAppId: bigint | number\n    }\n    'getFieldUpdateCost(byte[][])uint64': {\n      fieldAndVals: Uint8Array[]\n    }\n    'updateFields(byte[][])void': {\n      fieldAndVals: Uint8Array[]\n    }\n    'readField(byte[])byte[]': {\n      fieldName: Uint8Array\n    }\n    'offerForSale(uint64,address)void': {\n      sellAmount: bigint | number\n      reservedFor: string\n    }\n    'cancelSale()void': Record<string, never>\n    'postOffer(uint64,string)void': {\n      offer: bigint | number\n      note: string\n    }\n    'mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)': {\n      oneYearPrice: bigint | number\n      segmentPlatformCostInAlgo: bigint | number\n    }\n    'purchase(pay)void': {\n      payment: AppMethodCallTransactionArgument\n    }\n    'isAddressInField(string,address)bool': {\n      fieldName: string\n      address: string\n    }\n    'getRenewPrice()uint64': Record<string, never>\n    'updateHash(byte[])void': {\n      hash: Uint8Array\n    }\n    'contractLock(bool)void': {\n      lock: boolean\n    }\n    'segmentLock(bool,uint64)void': {\n      lock: boolean\n      usdPrice: bigint | number\n    }\n    'vaultOptInLock(bool)void': {\n      lock: boolean\n    }\n    'vaultOptIn(uint64[])void': {\n      assets: bigint[] | number[]\n    }\n    'vaultSend(uint64,address,string,uint64,uint64[])void': {\n      amount: bigint | number\n      receiver: string\n      note: string\n      asset: bigint | number\n      otherAssets: bigint[] | number[]\n    }\n    'renew(pay)void': {\n      /**\n       * The payment transaction from which the renewal period is determined..\n       */\n      payment: AppMethodCallTransactionArgument\n    }\n    'setPrimaryAddress(string,address)void': {\n      fieldName: string\n      address: string\n    }\n    'registryAddingVerifiedAddress(string,string)bool': {\n      /**\n      * - MUST START with u.cav. (!)\n      gets 'added' to 'set' in next arg - must be fixed-sized bytes\n\n       */\n      fieldBeingVerified: string\n      /**\n       * (must BE v.ca[...].as)\n       */\n      fieldSetName: string\n    }\n    'registryRemovingVerifiedAddress(string,address,address)bool': {\n      /**\n       * The field being changed in the address registry.\n       */\n      fieldBeingChanged: string\n      /**\n       * The address to be removed from the field.\n       */\n      address: string\n      /**\n      * the address to send reclaimed MBR (if any)\n      boolean - true if valid removed\n\n       */\n      mbrRefundDest: string\n    }\n  }\n  /**\n   * The tuple representation of the arguments for each method\n   */\n  tuple: {\n    'createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void': [nfdName: string, seller: string, buyer: string, purchaseAmount: bigint | number, expTime: bigint | number, commission1Addr: string, commission1Pct: bigint | number, commission2Addr: string, commission2Pct: bigint | number, segmentRootAppId: bigint | number, segmentRootCommissionAddr: string]\n    'updateApplication(string)void': [versionNum: string]\n    'gas()void': []\n    'mintAsa(string,string)void': [nfdName: string, url: string]\n    'deleteFields(byte[][])void': [fieldNames: Uint8Array[]]\n    'updateSegmentCount(string,uint64)void': [childNfdName: string, childNfdAppId: bigint | number]\n    'getFieldUpdateCost(byte[][])uint64': [fieldAndVals: Uint8Array[]]\n    'updateFields(byte[][])void': [fieldAndVals: Uint8Array[]]\n    'readField(byte[])byte[]': [fieldName: Uint8Array]\n    'offerForSale(uint64,address)void': [sellAmount: bigint | number, reservedFor: string]\n    'cancelSale()void': []\n    'postOffer(uint64,string)void': [offer: bigint | number, note: string]\n    'mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)': [oneYearPrice: bigint | number, segmentPlatformCostInAlgo: bigint | number]\n    'purchase(pay)void': [payment: AppMethodCallTransactionArgument]\n    'isAddressInField(string,address)bool': [fieldName: string, address: string]\n    'getRenewPrice()uint64': []\n    'updateHash(byte[])void': [hash: Uint8Array]\n    'contractLock(bool)void': [lock: boolean]\n    'segmentLock(bool,uint64)void': [lock: boolean, usdPrice: bigint | number]\n    'vaultOptInLock(bool)void': [lock: boolean]\n    'vaultOptIn(uint64[])void': [assets: bigint[] | number[]]\n    'vaultSend(uint64,address,string,uint64,uint64[])void': [amount: bigint | number, receiver: string, note: string, asset: bigint | number, otherAssets: bigint[] | number[]]\n    'renew(pay)void': [payment: AppMethodCallTransactionArgument]\n    'setPrimaryAddress(string,address)void': [fieldName: string, address: string]\n    'registryAddingVerifiedAddress(string,string)bool': [fieldBeingVerified: string, fieldSetName: string]\n    'registryRemovingVerifiedAddress(string,address,address)bool': [fieldBeingChanged: string, address: string, mbrRefundDest: string]\n  }\n}\n\n/**\n * The return type for each method\n */\nexport type NfdInstanceReturns = {\n  'createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void': void\n  'updateApplication(string)void': void\n  'gas()void': void\n  'mintAsa(string,string)void': void\n  'deleteFields(byte[][])void': void\n  'updateSegmentCount(string,uint64)void': void\n  'getFieldUpdateCost(byte[][])uint64': bigint\n  'updateFields(byte[][])void': void\n  'readField(byte[])byte[]': Uint8Array\n  'offerForSale(uint64,address)void': void\n  'cancelSale()void': void\n  'postOffer(uint64,string)void': void\n  'mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)': PayoutInfo\n  'purchase(pay)void': void\n  'isAddressInField(string,address)bool': boolean\n  'getRenewPrice()uint64': bigint\n  'updateHash(byte[])void': void\n  'contractLock(bool)void': void\n  'segmentLock(bool,uint64)void': void\n  'vaultOptInLock(bool)void': void\n  'vaultOptIn(uint64[])void': void\n  'vaultSend(uint64,address,string,uint64,uint64[])void': void\n  'renew(pay)void': void\n  'setPrimaryAddress(string,address)void': void\n  'registryAddingVerifiedAddress(string,string)bool': boolean\n  'registryRemovingVerifiedAddress(string,address,address)bool': boolean\n}\n\n/**\n * Defines the types of available calls and state of the NfdInstance smart contract.\n */\nexport type NfdInstanceTypes = {\n  /**\n   * Maps method signatures / names to their argument and return types.\n   */\n  methods:\n    & Record<'createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void' | 'createApplication', {\n      argsObj: NfdInstanceArgs['obj']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void']\n      argsTuple: NfdInstanceArgs['tuple']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void']\n      returns: NfdInstanceReturns['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void']\n    }>\n    & Record<'updateApplication(string)void' | 'updateApplication', {\n      argsObj: NfdInstanceArgs['obj']['updateApplication(string)void']\n      argsTuple: NfdInstanceArgs['tuple']['updateApplication(string)void']\n      returns: NfdInstanceReturns['updateApplication(string)void']\n    }>\n    & Record<'gas()void' | 'gas', {\n      argsObj: NfdInstanceArgs['obj']['gas()void']\n      argsTuple: NfdInstanceArgs['tuple']['gas()void']\n      returns: NfdInstanceReturns['gas()void']\n    }>\n    & Record<'mintAsa(string,string)void' | 'mintAsa', {\n      argsObj: NfdInstanceArgs['obj']['mintAsa(string,string)void']\n      argsTuple: NfdInstanceArgs['tuple']['mintAsa(string,string)void']\n      returns: NfdInstanceReturns['mintAsa(string,string)void']\n    }>\n    & Record<'deleteFields(byte[][])void' | 'deleteFields', {\n      argsObj: NfdInstanceArgs['obj']['deleteFields(byte[][])void']\n      argsTuple: NfdInstanceArgs['tuple']['deleteFields(byte[][])void']\n      returns: NfdInstanceReturns['deleteFields(byte[][])void']\n    }>\n    & Record<'updateSegmentCount(string,uint64)void' | 'updateSegmentCount', {\n      argsObj: NfdInstanceArgs['obj']['updateSegmentCount(string,uint64)void']\n      argsTuple: NfdInstanceArgs['tuple']['updateSegmentCount(string,uint64)void']\n      returns: NfdInstanceReturns['updateSegmentCount(string,uint64)void']\n    }>\n    & Record<'getFieldUpdateCost(byte[][])uint64' | 'getFieldUpdateCost', {\n      argsObj: NfdInstanceArgs['obj']['getFieldUpdateCost(byte[][])uint64']\n      argsTuple: NfdInstanceArgs['tuple']['getFieldUpdateCost(byte[][])uint64']\n      returns: NfdInstanceReturns['getFieldUpdateCost(byte[][])uint64']\n    }>\n    & Record<'updateFields(byte[][])void' | 'updateFields', {\n      argsObj: NfdInstanceArgs['obj']['updateFields(byte[][])void']\n      argsTuple: NfdInstanceArgs['tuple']['updateFields(byte[][])void']\n      returns: NfdInstanceReturns['updateFields(byte[][])void']\n    }>\n    & Record<'readField(byte[])byte[]' | 'readField', {\n      argsObj: NfdInstanceArgs['obj']['readField(byte[])byte[]']\n      argsTuple: NfdInstanceArgs['tuple']['readField(byte[])byte[]']\n      returns: NfdInstanceReturns['readField(byte[])byte[]']\n    }>\n    & Record<'offerForSale(uint64,address)void' | 'offerForSale', {\n      argsObj: NfdInstanceArgs['obj']['offerForSale(uint64,address)void']\n      argsTuple: NfdInstanceArgs['tuple']['offerForSale(uint64,address)void']\n      returns: NfdInstanceReturns['offerForSale(uint64,address)void']\n    }>\n    & Record<'cancelSale()void' | 'cancelSale', {\n      argsObj: NfdInstanceArgs['obj']['cancelSale()void']\n      argsTuple: NfdInstanceArgs['tuple']['cancelSale()void']\n      returns: NfdInstanceReturns['cancelSale()void']\n    }>\n    & Record<'postOffer(uint64,string)void' | 'postOffer', {\n      argsObj: NfdInstanceArgs['obj']['postOffer(uint64,string)void']\n      argsTuple: NfdInstanceArgs['tuple']['postOffer(uint64,string)void']\n      returns: NfdInstanceReturns['postOffer(uint64,string)void']\n    }>\n    & Record<'mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)' | 'mintPayout', {\n      argsObj: NfdInstanceArgs['obj']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)']\n      argsTuple: NfdInstanceArgs['tuple']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)']\n      returns: NfdInstanceReturns['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)']\n    }>\n    & Record<'purchase(pay)void' | 'purchase', {\n      argsObj: NfdInstanceArgs['obj']['purchase(pay)void']\n      argsTuple: NfdInstanceArgs['tuple']['purchase(pay)void']\n      returns: NfdInstanceReturns['purchase(pay)void']\n    }>\n    & Record<'isAddressInField(string,address)bool' | 'isAddressInField', {\n      argsObj: NfdInstanceArgs['obj']['isAddressInField(string,address)bool']\n      argsTuple: NfdInstanceArgs['tuple']['isAddressInField(string,address)bool']\n      returns: NfdInstanceReturns['isAddressInField(string,address)bool']\n    }>\n    & Record<'getRenewPrice()uint64' | 'getRenewPrice', {\n      argsObj: NfdInstanceArgs['obj']['getRenewPrice()uint64']\n      argsTuple: NfdInstanceArgs['tuple']['getRenewPrice()uint64']\n      returns: NfdInstanceReturns['getRenewPrice()uint64']\n    }>\n    & Record<'updateHash(byte[])void' | 'updateHash', {\n      argsObj: NfdInstanceArgs['obj']['updateHash(byte[])void']\n      argsTuple: NfdInstanceArgs['tuple']['updateHash(byte[])void']\n      returns: NfdInstanceReturns['updateHash(byte[])void']\n    }>\n    & Record<'contractLock(bool)void' | 'contractLock', {\n      argsObj: NfdInstanceArgs['obj']['contractLock(bool)void']\n      argsTuple: NfdInstanceArgs['tuple']['contractLock(bool)void']\n      returns: NfdInstanceReturns['contractLock(bool)void']\n    }>\n    & Record<'segmentLock(bool,uint64)void' | 'segmentLock', {\n      argsObj: NfdInstanceArgs['obj']['segmentLock(bool,uint64)void']\n      argsTuple: NfdInstanceArgs['tuple']['segmentLock(bool,uint64)void']\n      returns: NfdInstanceReturns['segmentLock(bool,uint64)void']\n    }>\n    & Record<'vaultOptInLock(bool)void' | 'vaultOptInLock', {\n      argsObj: NfdInstanceArgs['obj']['vaultOptInLock(bool)void']\n      argsTuple: NfdInstanceArgs['tuple']['vaultOptInLock(bool)void']\n      returns: NfdInstanceReturns['vaultOptInLock(bool)void']\n    }>\n    & Record<'vaultOptIn(uint64[])void' | 'vaultOptIn', {\n      argsObj: NfdInstanceArgs['obj']['vaultOptIn(uint64[])void']\n      argsTuple: NfdInstanceArgs['tuple']['vaultOptIn(uint64[])void']\n      returns: NfdInstanceReturns['vaultOptIn(uint64[])void']\n    }>\n    & Record<'vaultSend(uint64,address,string,uint64,uint64[])void' | 'vaultSend', {\n      argsObj: NfdInstanceArgs['obj']['vaultSend(uint64,address,string,uint64,uint64[])void']\n      argsTuple: NfdInstanceArgs['tuple']['vaultSend(uint64,address,string,uint64,uint64[])void']\n      returns: NfdInstanceReturns['vaultSend(uint64,address,string,uint64,uint64[])void']\n    }>\n    & Record<'renew(pay)void' | 'renew', {\n      argsObj: NfdInstanceArgs['obj']['renew(pay)void']\n      argsTuple: NfdInstanceArgs['tuple']['renew(pay)void']\n      returns: NfdInstanceReturns['renew(pay)void']\n    }>\n    & Record<'setPrimaryAddress(string,address)void' | 'setPrimaryAddress', {\n      argsObj: NfdInstanceArgs['obj']['setPrimaryAddress(string,address)void']\n      argsTuple: NfdInstanceArgs['tuple']['setPrimaryAddress(string,address)void']\n      returns: NfdInstanceReturns['setPrimaryAddress(string,address)void']\n    }>\n    & Record<'registryAddingVerifiedAddress(string,string)bool' | 'registryAddingVerifiedAddress', {\n      argsObj: NfdInstanceArgs['obj']['registryAddingVerifiedAddress(string,string)bool']\n      argsTuple: NfdInstanceArgs['tuple']['registryAddingVerifiedAddress(string,string)bool']\n      /**\n       * true if added or already present, false otherwise\n       */\n      returns: NfdInstanceReturns['registryAddingVerifiedAddress(string,string)bool']\n    }>\n    & Record<'registryRemovingVerifiedAddress(string,address,address)bool' | 'registryRemovingVerifiedAddress', {\n      argsObj: NfdInstanceArgs['obj']['registryRemovingVerifiedAddress(string,address,address)bool']\n      argsTuple: NfdInstanceArgs['tuple']['registryRemovingVerifiedAddress(string,address,address)bool']\n      returns: NfdInstanceReturns['registryRemovingVerifiedAddress(string,address,address)bool']\n    }>\n  /**\n   * Defines the shape of the state of the application.\n   */\n  state: {\n    global: {\n      keys: {}\n      maps: {\n        globalState: Map<Uint8Array | string, Uint8Array>\n      }\n    }\n    box: {\n      keys: {}\n      maps: {\n        boxes: Map<Uint8Array | string, Uint8Array>\n      }\n    }\n  }\n}\n\n/**\n * Defines the possible abi call signatures.\n */\nexport type NfdInstanceSignatures = keyof NfdInstanceTypes['methods']\n/**\n * Defines the possible abi call signatures for methods that return a non-void value.\n */\nexport type NfdInstanceNonVoidMethodSignatures = keyof NfdInstanceTypes['methods'] extends infer T ? T extends keyof NfdInstanceTypes['methods'] ? MethodReturn<T> extends void ? never : T  : never : never\n/**\n * Defines an object containing all relevant parameters for a single call to the contract.\n */\nexport type CallParams<TArgs> = Expand<\n  Omit<AppClientMethodCallParams, 'method' | 'args' | 'onComplete'> &\n    {\n      /** The args for the ABI method call, either as an ordered array or an object */\n      args: Expand<TArgs>\n    }\n>\n/**\n * Maps a method signature from the NfdInstance smart contract to the method's arguments in either tuple or struct form\n */\nexport type MethodArgs<TSignature extends NfdInstanceSignatures> = NfdInstanceTypes['methods'][TSignature]['argsObj' | 'argsTuple']\n/**\n * Maps a method signature from the NfdInstance smart contract to the method's return type\n */\nexport type MethodReturn<TSignature extends NfdInstanceSignatures> = NfdInstanceTypes['methods'][TSignature]['returns']\n\n/**\n * Defines the shape of the keyed global state of the application.\n */\nexport type GlobalKeysState = NfdInstanceTypes['state']['global']['keys']\n\n/**\n * Defines the shape of the keyed box state of the application.\n */\nexport type BoxKeysState = NfdInstanceTypes['state']['box']['keys']\n\n\n/**\n * Defines supported create method params for this smart contract\n */\nexport type NfdInstanceCreateCallParams =\n  | Expand<CallParams<NfdInstanceArgs['obj']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void'] | NfdInstanceArgs['tuple']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void']> & {method: 'createApplication'} & {onComplete?: OnApplicationComplete.NoOpOC} & CreateSchema>\n  | Expand<CallParams<NfdInstanceArgs['obj']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void'] | NfdInstanceArgs['tuple']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void']> & {method: 'createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void'} & {onComplete?: OnApplicationComplete.NoOpOC} & CreateSchema>\n/**\n * Defines supported update method params for this smart contract\n */\nexport type NfdInstanceUpdateCallParams =\n  | Expand<CallParams<NfdInstanceArgs['obj']['updateApplication(string)void'] | NfdInstanceArgs['tuple']['updateApplication(string)void']> & {method: 'updateApplication'}>\n  | Expand<CallParams<NfdInstanceArgs['obj']['updateApplication(string)void'] | NfdInstanceArgs['tuple']['updateApplication(string)void']> & {method: 'updateApplication(string)void'}>\n/**\n * Defines arguments required for the deploy method.\n */\nexport type NfdInstanceDeployParams = Expand<Omit<AppFactoryDeployParams, 'createParams' | 'updateParams' | 'deleteParams'> & {\n  /**\n   * Create transaction parameters to use if a create needs to be issued as part of deployment; use `method` to define ABI call (if available) or leave out for a bare call (if available)\n   */\n  createParams?: NfdInstanceCreateCallParams\n  /**\n   * Update transaction parameters to use if a create needs to be issued as part of deployment; use `method` to define ABI call (if available) or leave out for a bare call (if available)\n   */\n  updateParams?: NfdInstanceUpdateCallParams\n}>\n\n\n/**\n * Exposes methods for constructing `AppClient` params objects for ABI calls to the NfdInstance smart contract\n */\nexport abstract class NfdInstanceParamsFactory {\n  /**\n   * Gets available create ABI call param factories\n   */\n  static get create() {\n    return {\n      _resolveByMethod<TParams extends NfdInstanceCreateCallParams & {method: string}>(params: TParams) {\n        switch(params.method) {\n          case 'createApplication':\n          case 'createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void':\n            return NfdInstanceParamsFactory.create.createApplication(params)\n        }\n        throw new Error(`Unknown ' + verb + ' method`)\n      },\n\n      /**\n       * Constructs create ABI call params for the NFDInstance smart contract using the createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void ABI method\n       *\n       * @param params Parameters for the call\n       * @returns An `AppClientMethodCallParams` object for the call\n       */\n      createApplication(params: CallParams<NfdInstanceArgs['obj']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void'] | NfdInstanceArgs['tuple']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void']> & AppClientCompilationParams & {onComplete?: OnApplicationComplete.NoOpOC}): AppClientMethodCallParams & AppClientCompilationParams & {onComplete?: OnApplicationComplete.NoOpOC} {\n        return {\n          ...params,\n          method: 'createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void' as const,\n          args: Array.isArray(params.args) ? params.args : [params.args.nfdName, params.args.seller, params.args.buyer, params.args.purchaseAmount, params.args.expTime, params.args.commission1Addr, params.args.commission1Pct, params.args.commission2Addr, params.args.commission2Pct, params.args.segmentRootAppId, params.args.segmentRootCommissionAddr],\n        }\n      },\n    }\n  }\n\n  /**\n   * Gets available update ABI call param factories\n   */\n  static get update() {\n    return {\n      _resolveByMethod<TParams extends NfdInstanceUpdateCallParams & {method: string}>(params: TParams) {\n        switch(params.method) {\n          case 'updateApplication':\n          case 'updateApplication(string)void':\n            return NfdInstanceParamsFactory.update.updateApplication(params)\n        }\n        throw new Error(`Unknown ' + verb + ' method`)\n      },\n\n      /**\n       * Constructs update ABI call params for the NFDInstance smart contract using the updateApplication(string)void ABI method\n       *\n       * @param params Parameters for the call\n       * @returns An `AppClientMethodCallParams` object for the call\n       */\n      updateApplication(params: CallParams<NfdInstanceArgs['obj']['updateApplication(string)void'] | NfdInstanceArgs['tuple']['updateApplication(string)void']> & AppClientCompilationParams): AppClientMethodCallParams & AppClientCompilationParams {\n        return {\n          ...params,\n          method: 'updateApplication(string)void' as const,\n          args: Array.isArray(params.args) ? params.args : [params.args.versionNum],\n        }\n      },\n    }\n  }\n\n  /**\n   * Constructs a no op call for the gas()void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static gas(params: CallParams<NfdInstanceArgs['obj']['gas()void'] | NfdInstanceArgs['tuple']['gas()void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'gas()void' as const,\n      args: Array.isArray(params.args) ? params.args : [],\n    }\n  }\n  /**\n   * Constructs a no op call for the mintAsa(string,string)void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static mintAsa(params: CallParams<NfdInstanceArgs['obj']['mintAsa(string,string)void'] | NfdInstanceArgs['tuple']['mintAsa(string,string)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'mintAsa(string,string)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.nfdName, params.args.url],\n    }\n  }\n  /**\n   * Constructs a no op call for the deleteFields(byte[][])void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static deleteFields(params: CallParams<NfdInstanceArgs['obj']['deleteFields(byte[][])void'] | NfdInstanceArgs['tuple']['deleteFields(byte[][])void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'deleteFields(byte[][])void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.fieldNames],\n    }\n  }\n  /**\n   * Constructs a no op call for the updateSegmentCount(string,uint64)void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static updateSegmentCount(params: CallParams<NfdInstanceArgs['obj']['updateSegmentCount(string,uint64)void'] | NfdInstanceArgs['tuple']['updateSegmentCount(string,uint64)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'updateSegmentCount(string,uint64)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.childNfdName, params.args.childNfdAppId],\n    }\n  }\n  /**\n   * Constructs a no op call for the getFieldUpdateCost(byte[][])uint64 ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static getFieldUpdateCost(params: CallParams<NfdInstanceArgs['obj']['getFieldUpdateCost(byte[][])uint64'] | NfdInstanceArgs['tuple']['getFieldUpdateCost(byte[][])uint64']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'getFieldUpdateCost(byte[][])uint64' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.fieldAndVals],\n    }\n  }\n  /**\n   * Constructs a no op call for the updateFields(byte[][])void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static updateFields(params: CallParams<NfdInstanceArgs['obj']['updateFields(byte[][])void'] | NfdInstanceArgs['tuple']['updateFields(byte[][])void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'updateFields(byte[][])void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.fieldAndVals],\n    }\n  }\n  /**\n   * Constructs a no op call for the readField(byte[])byte[] ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static readField(params: CallParams<NfdInstanceArgs['obj']['readField(byte[])byte[]'] | NfdInstanceArgs['tuple']['readField(byte[])byte[]']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'readField(byte[])byte[]' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.fieldName],\n    }\n  }\n  /**\n   * Constructs a no op call for the offerForSale(uint64,address)void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static offerForSale(params: CallParams<NfdInstanceArgs['obj']['offerForSale(uint64,address)void'] | NfdInstanceArgs['tuple']['offerForSale(uint64,address)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'offerForSale(uint64,address)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.sellAmount, params.args.reservedFor],\n    }\n  }\n  /**\n   * Constructs a no op call for the cancelSale()void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static cancelSale(params: CallParams<NfdInstanceArgs['obj']['cancelSale()void'] | NfdInstanceArgs['tuple']['cancelSale()void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'cancelSale()void' as const,\n      args: Array.isArray(params.args) ? params.args : [],\n    }\n  }\n  /**\n   * Constructs a no op call for the postOffer(uint64,string)void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static postOffer(params: CallParams<NfdInstanceArgs['obj']['postOffer(uint64,string)void'] | NfdInstanceArgs['tuple']['postOffer(uint64,string)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'postOffer(uint64,string)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.offer, params.args.note],\n    }\n  }\n  /**\n   * Constructs a no op call for the mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64) ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static mintPayout(params: CallParams<NfdInstanceArgs['obj']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)'] | NfdInstanceArgs['tuple']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.oneYearPrice, params.args.segmentPlatformCostInAlgo],\n    }\n  }\n  /**\n   * Constructs a no op call for the purchase(pay)void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static purchase(params: CallParams<NfdInstanceArgs['obj']['purchase(pay)void'] | NfdInstanceArgs['tuple']['purchase(pay)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'purchase(pay)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.payment],\n    }\n  }\n  /**\n   * Constructs a no op call for the isAddressInField(string,address)bool ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static isAddressInField(params: CallParams<NfdInstanceArgs['obj']['isAddressInField(string,address)bool'] | NfdInstanceArgs['tuple']['isAddressInField(string,address)bool']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'isAddressInField(string,address)bool' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.fieldName, params.args.address],\n    }\n  }\n  /**\n   * Constructs a no op call for the getRenewPrice()uint64 ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static getRenewPrice(params: CallParams<NfdInstanceArgs['obj']['getRenewPrice()uint64'] | NfdInstanceArgs['tuple']['getRenewPrice()uint64']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'getRenewPrice()uint64' as const,\n      args: Array.isArray(params.args) ? params.args : [],\n    }\n  }\n  /**\n   * Constructs a no op call for the updateHash(byte[])void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static updateHash(params: CallParams<NfdInstanceArgs['obj']['updateHash(byte[])void'] | NfdInstanceArgs['tuple']['updateHash(byte[])void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'updateHash(byte[])void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.hash],\n    }\n  }\n  /**\n   * Constructs a no op call for the contractLock(bool)void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static contractLock(params: CallParams<NfdInstanceArgs['obj']['contractLock(bool)void'] | NfdInstanceArgs['tuple']['contractLock(bool)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'contractLock(bool)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.lock],\n    }\n  }\n  /**\n   * Constructs a no op call for the segmentLock(bool,uint64)void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static segmentLock(params: CallParams<NfdInstanceArgs['obj']['segmentLock(bool,uint64)void'] | NfdInstanceArgs['tuple']['segmentLock(bool,uint64)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'segmentLock(bool,uint64)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.lock, params.args.usdPrice],\n    }\n  }\n  /**\n   * Constructs a no op call for the vaultOptInLock(bool)void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static vaultOptInLock(params: CallParams<NfdInstanceArgs['obj']['vaultOptInLock(bool)void'] | NfdInstanceArgs['tuple']['vaultOptInLock(bool)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'vaultOptInLock(bool)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.lock],\n    }\n  }\n  /**\n   * Constructs a no op call for the vaultOptIn(uint64[])void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static vaultOptIn(params: CallParams<NfdInstanceArgs['obj']['vaultOptIn(uint64[])void'] | NfdInstanceArgs['tuple']['vaultOptIn(uint64[])void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'vaultOptIn(uint64[])void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.assets],\n    }\n  }\n  /**\n   * Constructs a no op call for the vaultSend(uint64,address,string,uint64,uint64[])void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static vaultSend(params: CallParams<NfdInstanceArgs['obj']['vaultSend(uint64,address,string,uint64,uint64[])void'] | NfdInstanceArgs['tuple']['vaultSend(uint64,address,string,uint64,uint64[])void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'vaultSend(uint64,address,string,uint64,uint64[])void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.amount, params.args.receiver, params.args.note, params.args.asset, params.args.otherAssets],\n    }\n  }\n  /**\n   * Constructs a no op call for the renew(pay)void ABI method\n   *\n  * Renew adds more time to an existing NFDs expiration, or renews it if expired.\n  \n  \n  As part of v2-v3 upgrade, the NFDs are converted from lifetime NFDs to renewal NFDs. The v2 contract is upgraded\n  to v3, then renew is called on the (now v3) nfd to turn it into a renewal (note the if curExpiration === 0 check)\n  \n  \n  If already renewal, then it extends the current expiration time by the time specified (minimum 1 yr) (365 / price paid * mint price)\n  Expirations can never be more than NFD_MAX_EXPIRATION_DAYS days in the future.\n  \n  \n  IF the NFD is expired:\n     x The current owner can take it back over at base price - and NFD metadata doesn't have to be cleared - they\n     get it back as-is.\n     x If not current owner, then the price goes from high of base price * 10,000 down to base price over 24 hrs where\n     'buyer' has to pay at least that price.  The NFD MUST ALREADY HAVE ITS METADATA CLEARED!\n\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static renew(params: CallParams<NfdInstanceArgs['obj']['renew(pay)void'] | NfdInstanceArgs['tuple']['renew(pay)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'renew(pay)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.payment],\n    }\n  }\n  /**\n   * Constructs a no op call for the setPrimaryAddress(string,address)void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static setPrimaryAddress(params: CallParams<NfdInstanceArgs['obj']['setPrimaryAddress(string,address)void'] | NfdInstanceArgs['tuple']['setPrimaryAddress(string,address)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'setPrimaryAddress(string,address)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.fieldName, params.args.address],\n    }\n  }\n  /**\n   * Constructs a no op call for the registryAddingVerifiedAddress(string,string)bool ABI method\n   *\n  * Approved call from registry instructing us to move the specified u.cav.xx field and add to the specified\n  verified field.\n\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static registryAddingVerifiedAddress(params: CallParams<NfdInstanceArgs['obj']['registryAddingVerifiedAddress(string,string)bool'] | NfdInstanceArgs['tuple']['registryAddingVerifiedAddress(string,string)bool']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'registryAddingVerifiedAddress(string,string)bool' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.fieldBeingVerified, params.args.fieldSetName],\n    }\n  }\n  /**\n   * Constructs a no op call for the registryRemovingVerifiedAddress(string,address,address)bool ABI method\n   *\n   * Approved call from registry instructing us to REMOVE an address from the specified verified address set\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static registryRemovingVerifiedAddress(params: CallParams<NfdInstanceArgs['obj']['registryRemovingVerifiedAddress(string,address,address)bool'] | NfdInstanceArgs['tuple']['registryRemovingVerifiedAddress(string,address,address)bool']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'registryRemovingVerifiedAddress(string,address,address)bool' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.fieldBeingChanged, params.args.address, params.args.mbrRefundDest],\n    }\n  }\n}\n\n/**\n * A factory to create and deploy one or more instance of the NFDInstance smart contract and to create one or more app clients to interact with those (or other) app instances\n */\nexport class NfdInstanceFactory {\n  /**\n   * The underlying `AppFactory` for when you want to have more flexibility\n   */\n  public readonly appFactory: _AppFactory\n\n  /**\n   * Creates a new instance of `NfdInstanceFactory`\n   *\n   * @param params The parameters to initialise the app factory with\n   */\n  constructor(params: Omit<AppFactoryParams, 'appSpec'>) {\n    this.appFactory = new _AppFactory({\n      ...params,\n      appSpec: APP_SPEC,\n    })\n  }\n  \n  /** The name of the app (from the ARC-32 / ARC-56 app spec or override). */\n  public get appName() {\n    return this.appFactory.appName\n  }\n  \n  /** The ARC-56 app spec being used */\n  get appSpec() {\n    return APP_SPEC\n  }\n  \n  /** A reference to the underlying `AlgorandClient` this app factory is using. */\n  public get algorand(): AlgorandClientInterface {\n    return this.appFactory.algorand\n  }\n  \n  /**\n   * Returns a new `AppClient` client for an app instance of the given ID.\n   *\n   * Automatically populates appName, defaultSender and source maps from the factory\n   * if not specified in the params.\n   * @param params The parameters to create the app client\n   * @returns The `AppClient`\n   */\n  public getAppClientById(params: AppFactoryAppClientParams) {\n    return new NfdInstanceClient(this.appFactory.getAppClientById(params))\n  }\n  \n  /**\n   * Returns a new `AppClient` client, resolving the app by creator address and name\n   * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).\n   *\n   * Automatically populates appName, defaultSender and source maps from the factory\n   * if not specified in the params.\n   * @param params The parameters to create the app client\n   * @returns The `AppClient`\n   */\n  public async getAppClientByCreatorAndName(\n    params: AppFactoryResolveAppClientByCreatorAndNameParams,\n  ) {\n    return new NfdInstanceClient(await this.appFactory.getAppClientByCreatorAndName(params))\n  }\n\n  /**\n   * Idempotently deploys the NFDInstance smart contract.\n   *\n   * @param params The arguments for the contract calls and any additional parameters for the call\n   * @returns The deployment result\n   */\n  public async deploy(params: NfdInstanceDeployParams = {}) {\n    const result = await this.appFactory.deploy({\n      ...params,\n      createParams: params.createParams?.method ? NfdInstanceParamsFactory.create._resolveByMethod(params.createParams) : params.createParams ? params.createParams as (NfdInstanceCreateCallParams & { args: Uint8Array[] }) : undefined,\n      updateParams: params.updateParams?.method ? NfdInstanceParamsFactory.update._resolveByMethod(params.updateParams) : params.updateParams ? params.updateParams as (NfdInstanceUpdateCallParams & { args: Uint8Array[] }) : undefined,\n    })\n    return { result: result.result, appClient: new NfdInstanceClient(result.appClient) }\n  }\n\n  /**\n   * Get parameters to create transactions (create and deploy related calls) for the current app. A good mental model for this is that these parameters represent a deferred transaction creation.\n   */\n  readonly params = {\n    /**\n     * Gets available create methods\n     */\n    create: {\n      /**\n       * Creates a new instance of the NFDInstance smart contract using the createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The create params\n       */\n      createApplication: (params: CallParams<NfdInstanceArgs['obj']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void'] | NfdInstanceArgs['tuple']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void']> & AppClientCompilationParams & CreateSchema & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n        return this.appFactory.params.create(NfdInstanceParamsFactory.create.createApplication(params))\n      },\n    },\n\n    /**\n     * Gets available deployUpdate methods\n     */\n    deployUpdate: {\n      /**\n       * Updates an existing instance of the NFDInstance smart contract using the updateApplication(string)void ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The deployUpdate params\n       */\n      updateApplication: (params: CallParams<NfdInstanceArgs['obj']['updateApplication(string)void'] | NfdInstanceArgs['tuple']['updateApplication(string)void']> & AppClientCompilationParams) => {\n        return this.appFactory.params.deployUpdate(NfdInstanceParamsFactory.update.updateApplication(params))\n      },\n    },\n\n  }\n\n  /**\n   * Create transactions for the current app\n   */\n  readonly createTransaction = {\n    /**\n     * Gets available create methods\n     */\n    create: {\n      /**\n       * Creates a new instance of the NFDInstance smart contract using the createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The create transaction\n       */\n      createApplication: (params: CallParams<NfdInstanceArgs['obj']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void'] | NfdInstanceArgs['tuple']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void']> & AppClientCompilationParams & CreateSchema & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n        return this.appFactory.createTransaction.create(NfdInstanceParamsFactory.create.createApplication(params))\n      },\n    },\n\n  }\n\n  /**\n   * Send calls to the current app\n   */\n  readonly send = {\n    /**\n     * Gets available create methods\n     */\n    create: {\n      /**\n       * Creates a new instance of the NFDInstance smart contract using an ABI method call using the createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The create result\n       */\n      createApplication: async (params: CallParams<NfdInstanceArgs['obj']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void'] | NfdInstanceArgs['tuple']['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void']> & AppClientCompilationParams & CreateSchema & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n        const result = await this.appFactory.send.create(NfdInstanceParamsFactory.create.createApplication(params))\n        return { result: { ...result.result, return: result.result.return as unknown as (undefined | NfdInstanceReturns['createApplication(string,address,address,uint64,uint64,address,uint64,address,uint64,uint64,address)void']) }, appClient: new NfdInstanceClient(result.appClient) }\n      },\n    },\n\n  }\n\n}\n/**\n * A client to make calls to the NFDInstance smart contract\n */\nexport class NfdInstanceClient {\n  /**\n   * The underlying `AppClient` for when you want to have more flexibility\n   */\n  public readonly appClient: _AppClient\n\n  /**\n   * Creates a new instance of `NfdInstanceClient`\n   *\n   * @param appClient An `AppClient` instance which has been created with the NfdInstance app spec\n   */\n  constructor(appClient: _AppClient)\n  /**\n   * Creates a new instance of `NfdInstanceClient`\n   *\n   * @param params The parameters to initialise the app client with\n   */\n  constructor(params: Omit<AppClientParams, 'appSpec'>)\n  constructor(appClientOrParams: _AppClient | Omit<AppClientParams, 'appSpec'>) {\n    this.appClient = appClientOrParams instanceof _AppClient ? appClientOrParams : new _AppClient({\n      ...appClientOrParams,\n      appSpec: APP_SPEC,\n    })\n  }\n  \n  /**\n   * Checks for decode errors on the given return value and maps the return value to the return type for the given method\n   * @returns The typed return value or undefined if there was no value\n   */\n  decodeReturnValue<TSignature extends NfdInstanceNonVoidMethodSignatures>(method: TSignature, returnValue: ABIReturn | undefined) {\n    return returnValue !== undefined ? getArc56ReturnValue<MethodReturn<TSignature>>(returnValue, this.appClient.getABIMethod(method), APP_SPEC.structs) : undefined\n  }\n  \n  /**\n   * Returns a new `NfdInstanceClient` client, resolving the app by creator address and name\n   * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).\n   * @param params The parameters to create the app client\n   */\n  public static async fromCreatorAndName(params: Omit<ResolveAppClientByCreatorAndName, 'appSpec'>): Promise<NfdInstanceClient> {\n    return new NfdInstanceClient(await _AppClient.fromCreatorAndName({...params, appSpec: APP_SPEC}))\n  }\n  \n  /**\n   * Returns an `NfdInstanceClient` instance for the current network based on\n   * pre-determined network-specific app IDs specified in the ARC-56 app spec.\n   *\n   * If no IDs are in the app spec or the network isn't recognised, an error is thrown.\n   * @param params The parameters to create the app client\n   */\n  static async fromNetwork(\n    params: Omit<ResolveAppClientByNetwork, 'appSpec'>\n  ): Promise<NfdInstanceClient> {\n    return new NfdInstanceClient(await _AppClient.fromNetwork({...params, appSpec: APP_SPEC}))\n  }\n  \n  /** The ID of the app instance this client is linked to. */\n  public get appId() {\n    return this.appClient.appId\n  }\n  \n  /** The app address of the app instance this client is linked to. */\n  public get appAddress() {\n    return this.appClient.appAddress\n  }\n  \n  /** The name of the app. */\n  public get appName() {\n    return this.appClient.appName\n  }\n  \n  /** The ARC-56 app spec being used */\n  public get appSpec() {\n    return this.appClient.appSpec\n  }\n  \n  /** A reference to the underlying `AlgorandClient` this app client is using. */\n  public get algorand(): AlgorandClientInterface {\n    return this.appClient.algorand\n  }\n\n  /**\n   * Get parameters to create transactions for the current app. A good mental model for this is that these parameters represent a deferred transaction creation.\n   */\n  readonly params = {\n    /**\n     * Gets available update methods\n     */\n    update: {\n      /**\n       * Updates an existing instance of the NFDInstance smart contract using the `updateApplication(string)void` ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The update params\n       */\n      updateApplication: (params: CallParams<NfdInstanceArgs['obj']['updateApplication(string)void'] | NfdInstanceArgs['tuple']['updateApplication(string)void']> & AppClientCompilationParams) => {\n        return this.appClient.params.update(NfdInstanceParamsFactory.update.updateApplication(params))\n      },\n\n    },\n\n    /**\n     * Makes a clear_state call to an existing instance of the NFDInstance smart contract.\n     *\n     * @param params The params for the bare (raw) call\n     * @returns The clearState result\n     */\n    clearState: (params?: Expand<AppClientBareCallParams>) => {\n      return this.appClient.params.bare.clearState(params)\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `gas()void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    gas: (params: CallParams<NfdInstanceArgs['obj']['gas()void'] | NfdInstanceArgs['tuple']['gas()void']> & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.gas(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `mintAsa(string,string)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    mintAsa: (params: CallParams<NfdInstanceArgs['obj']['mintAsa(string,string)void'] | NfdInstanceArgs['tuple']['mintAsa(string,string)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.mintAsa(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `deleteFields(byte[][])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    deleteFields: (params: CallParams<NfdInstanceArgs['obj']['deleteFields(byte[][])void'] | NfdInstanceArgs['tuple']['deleteFields(byte[][])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.deleteFields(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `updateSegmentCount(string,uint64)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    updateSegmentCount: (params: CallParams<NfdInstanceArgs['obj']['updateSegmentCount(string,uint64)void'] | NfdInstanceArgs['tuple']['updateSegmentCount(string,uint64)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.updateSegmentCount(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `getFieldUpdateCost(byte[][])uint64` ABI method.\n     * \n     * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    getFieldUpdateCost: (params: CallParams<NfdInstanceArgs['obj']['getFieldUpdateCost(byte[][])uint64'] | NfdInstanceArgs['tuple']['getFieldUpdateCost(byte[][])uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.getFieldUpdateCost(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `updateFields(byte[][])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    updateFields: (params: CallParams<NfdInstanceArgs['obj']['updateFields(byte[][])void'] | NfdInstanceArgs['tuple']['updateFields(byte[][])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.updateFields(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `readField(byte[])byte[]` ABI method.\n     * \n     * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    readField: (params: CallParams<NfdInstanceArgs['obj']['readField(byte[])byte[]'] | NfdInstanceArgs['tuple']['readField(byte[])byte[]']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.readField(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `offerForSale(uint64,address)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    offerForSale: (params: CallParams<NfdInstanceArgs['obj']['offerForSale(uint64,address)void'] | NfdInstanceArgs['tuple']['offerForSale(uint64,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.offerForSale(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `cancelSale()void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    cancelSale: (params: CallParams<NfdInstanceArgs['obj']['cancelSale()void'] | NfdInstanceArgs['tuple']['cancelSale()void']> & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.cancelSale(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `postOffer(uint64,string)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    postOffer: (params: CallParams<NfdInstanceArgs['obj']['postOffer(uint64,string)void'] | NfdInstanceArgs['tuple']['postOffer(uint64,string)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.postOffer(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    mintPayout: (params: CallParams<NfdInstanceArgs['obj']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)'] | NfdInstanceArgs['tuple']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.mintPayout(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `purchase(pay)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    purchase: (params: CallParams<NfdInstanceArgs['obj']['purchase(pay)void'] | NfdInstanceArgs['tuple']['purchase(pay)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.purchase(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `isAddressInField(string,address)bool` ABI method.\n     * \n     * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    isAddressInField: (params: CallParams<NfdInstanceArgs['obj']['isAddressInField(string,address)bool'] | NfdInstanceArgs['tuple']['isAddressInField(string,address)bool']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.isAddressInField(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `getRenewPrice()uint64` ABI method.\n     * \n     * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    getRenewPrice: (params: CallParams<NfdInstanceArgs['obj']['getRenewPrice()uint64'] | NfdInstanceArgs['tuple']['getRenewPrice()uint64']> & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.getRenewPrice(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `updateHash(byte[])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    updateHash: (params: CallParams<NfdInstanceArgs['obj']['updateHash(byte[])void'] | NfdInstanceArgs['tuple']['updateHash(byte[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.updateHash(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `contractLock(bool)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    contractLock: (params: CallParams<NfdInstanceArgs['obj']['contractLock(bool)void'] | NfdInstanceArgs['tuple']['contractLock(bool)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.contractLock(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `segmentLock(bool,uint64)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    segmentLock: (params: CallParams<NfdInstanceArgs['obj']['segmentLock(bool,uint64)void'] | NfdInstanceArgs['tuple']['segmentLock(bool,uint64)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.segmentLock(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `vaultOptInLock(bool)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    vaultOptInLock: (params: CallParams<NfdInstanceArgs['obj']['vaultOptInLock(bool)void'] | NfdInstanceArgs['tuple']['vaultOptInLock(bool)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.vaultOptInLock(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `vaultOptIn(uint64[])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    vaultOptIn: (params: CallParams<NfdInstanceArgs['obj']['vaultOptIn(uint64[])void'] | NfdInstanceArgs['tuple']['vaultOptIn(uint64[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.vaultOptIn(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `vaultSend(uint64,address,string,uint64,uint64[])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    vaultSend: (params: CallParams<NfdInstanceArgs['obj']['vaultSend(uint64,address,string,uint64,uint64[])void'] | NfdInstanceArgs['tuple']['vaultSend(uint64,address,string,uint64,uint64[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.vaultSend(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `renew(pay)void` ABI method.\n     *\n    * Renew adds more time to an existing NFDs expiration, or renews it if expired.\n    \n    \n    As part of v2-v3 upgrade, the NFDs are converted from lifetime NFDs to renewal NFDs. The v2 contract is upgraded\n    to v3, then renew is called on the (now v3) nfd to turn it into a renewal (note the if curExpiration === 0 check)\n    \n    \n    If already renewal, then it extends the current expiration time by the time specified (minimum 1 yr) (365 / price paid * mint price)\n    Expirations can never be more than NFD_MAX_EXPIRATION_DAYS days in the future.\n    \n    \n    IF the NFD is expired:\n       x The current owner can take it back over at base price - and NFD metadata doesn't have to be cleared - they\n       get it back as-is.\n       x If not current owner, then the price goes from high of base price * 10,000 down to base price over 24 hrs where\n       'buyer' has to pay at least that price.  The NFD MUST ALREADY HAVE ITS METADATA CLEARED!\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    renew: (params: CallParams<NfdInstanceArgs['obj']['renew(pay)void'] | NfdInstanceArgs['tuple']['renew(pay)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.renew(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `setPrimaryAddress(string,address)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    setPrimaryAddress: (params: CallParams<NfdInstanceArgs['obj']['setPrimaryAddress(string,address)void'] | NfdInstanceArgs['tuple']['setPrimaryAddress(string,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.setPrimaryAddress(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `registryAddingVerifiedAddress(string,string)bool` ABI method.\n     *\n    * Approved call from registry instructing us to move the specified u.cav.xx field and add to the specified\n    verified field.\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params: true if added or already present, false otherwise\n     */\n    registryAddingVerifiedAddress: (params: CallParams<NfdInstanceArgs['obj']['registryAddingVerifiedAddress(string,string)bool'] | NfdInstanceArgs['tuple']['registryAddingVerifiedAddress(string,string)bool']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.registryAddingVerifiedAddress(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `registryRemovingVerifiedAddress(string,address,address)bool` ABI method.\n     *\n     * Approved call from registry instructing us to REMOVE an address from the specified verified address set\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    registryRemovingVerifiedAddress: (params: CallParams<NfdInstanceArgs['obj']['registryRemovingVerifiedAddress(string,address,address)bool'] | NfdInstanceArgs['tuple']['registryRemovingVerifiedAddress(string,address,address)bool']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdInstanceParamsFactory.registryRemovingVerifiedAddress(params))\n    },\n\n  }\n\n  /**\n   * Create transactions for the current app\n   */\n  readonly createTransaction = {\n    /**\n     * Gets available update methods\n     */\n    update: {\n      /**\n       * Updates an existing instance of the NFDInstance smart contract using the `updateApplication(string)void` ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The update transaction\n       */\n      updateApplication: (params: CallParams<NfdInstanceArgs['obj']['updateApplication(string)void'] | NfdInstanceArgs['tuple']['updateApplication(string)void']> & AppClientCompilationParams) => {\n        return this.appClient.createTransaction.update(NfdInstanceParamsFactory.update.updateApplication(params))\n      },\n\n    },\n\n    /**\n     * Makes a clear_state call to an existing instance of the NFDInstance smart contract.\n     *\n     * @param params The params for the bare (raw) call\n     * @returns The clearState result\n     */\n    clearState: (params?: Expand<AppClientBareCallParams>) => {\n      return this.appClient.createTransaction.bare.clearState(params)\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `gas()void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    gas: (params: CallParams<NfdInstanceArgs['obj']['gas()void'] | NfdInstanceArgs['tuple']['gas()void']> & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.gas(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `mintAsa(string,string)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    mintAsa: (params: CallParams<NfdInstanceArgs['obj']['mintAsa(string,string)void'] | NfdInstanceArgs['tuple']['mintAsa(string,string)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.mintAsa(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `deleteFields(byte[][])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    deleteFields: (params: CallParams<NfdInstanceArgs['obj']['deleteFields(byte[][])void'] | NfdInstanceArgs['tuple']['deleteFields(byte[][])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.deleteFields(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `updateSegmentCount(string,uint64)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    updateSegmentCount: (params: CallParams<NfdInstanceArgs['obj']['updateSegmentCount(string,uint64)void'] | NfdInstanceArgs['tuple']['updateSegmentCount(string,uint64)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.updateSegmentCount(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `getFieldUpdateCost(byte[][])uint64` ABI method.\n     * \n     * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    getFieldUpdateCost: (params: CallParams<NfdInstanceArgs['obj']['getFieldUpdateCost(byte[][])uint64'] | NfdInstanceArgs['tuple']['getFieldUpdateCost(byte[][])uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.getFieldUpdateCost(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `updateFields(byte[][])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    updateFields: (params: CallParams<NfdInstanceArgs['obj']['updateFields(byte[][])void'] | NfdInstanceArgs['tuple']['updateFields(byte[][])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.updateFields(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `readField(byte[])byte[]` ABI method.\n     * \n     * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    readField: (params: CallParams<NfdInstanceArgs['obj']['readField(byte[])byte[]'] | NfdInstanceArgs['tuple']['readField(byte[])byte[]']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.readField(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `offerForSale(uint64,address)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    offerForSale: (params: CallParams<NfdInstanceArgs['obj']['offerForSale(uint64,address)void'] | NfdInstanceArgs['tuple']['offerForSale(uint64,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.offerForSale(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `cancelSale()void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    cancelSale: (params: CallParams<NfdInstanceArgs['obj']['cancelSale()void'] | NfdInstanceArgs['tuple']['cancelSale()void']> & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.cancelSale(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `postOffer(uint64,string)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    postOffer: (params: CallParams<NfdInstanceArgs['obj']['postOffer(uint64,string)void'] | NfdInstanceArgs['tuple']['postOffer(uint64,string)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.postOffer(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    mintPayout: (params: CallParams<NfdInstanceArgs['obj']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)'] | NfdInstanceArgs['tuple']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.mintPayout(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `purchase(pay)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    purchase: (params: CallParams<NfdInstanceArgs['obj']['purchase(pay)void'] | NfdInstanceArgs['tuple']['purchase(pay)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.purchase(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `isAddressInField(string,address)bool` ABI method.\n     * \n     * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    isAddressInField: (params: CallParams<NfdInstanceArgs['obj']['isAddressInField(string,address)bool'] | NfdInstanceArgs['tuple']['isAddressInField(string,address)bool']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.isAddressInField(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `getRenewPrice()uint64` ABI method.\n     * \n     * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    getRenewPrice: (params: CallParams<NfdInstanceArgs['obj']['getRenewPrice()uint64'] | NfdInstanceArgs['tuple']['getRenewPrice()uint64']> & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.getRenewPrice(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `updateHash(byte[])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    updateHash: (params: CallParams<NfdInstanceArgs['obj']['updateHash(byte[])void'] | NfdInstanceArgs['tuple']['updateHash(byte[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.updateHash(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `contractLock(bool)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    contractLock: (params: CallParams<NfdInstanceArgs['obj']['contractLock(bool)void'] | NfdInstanceArgs['tuple']['contractLock(bool)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.contractLock(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `segmentLock(bool,uint64)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    segmentLock: (params: CallParams<NfdInstanceArgs['obj']['segmentLock(bool,uint64)void'] | NfdInstanceArgs['tuple']['segmentLock(bool,uint64)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.segmentLock(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `vaultOptInLock(bool)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    vaultOptInLock: (params: CallParams<NfdInstanceArgs['obj']['vaultOptInLock(bool)void'] | NfdInstanceArgs['tuple']['vaultOptInLock(bool)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.vaultOptInLock(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `vaultOptIn(uint64[])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    vaultOptIn: (params: CallParams<NfdInstanceArgs['obj']['vaultOptIn(uint64[])void'] | NfdInstanceArgs['tuple']['vaultOptIn(uint64[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.vaultOptIn(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `vaultSend(uint64,address,string,uint64,uint64[])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    vaultSend: (params: CallParams<NfdInstanceArgs['obj']['vaultSend(uint64,address,string,uint64,uint64[])void'] | NfdInstanceArgs['tuple']['vaultSend(uint64,address,string,uint64,uint64[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.vaultSend(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `renew(pay)void` ABI method.\n     *\n    * Renew adds more time to an existing NFDs expiration, or renews it if expired.\n    \n    \n    As part of v2-v3 upgrade, the NFDs are converted from lifetime NFDs to renewal NFDs. The v2 contract is upgraded\n    to v3, then renew is called on the (now v3) nfd to turn it into a renewal (note the if curExpiration === 0 check)\n    \n    \n    If already renewal, then it extends the current expiration time by the time specified (minimum 1 yr) (365 / price paid * mint price)\n    Expirations can never be more than NFD_MAX_EXPIRATION_DAYS days in the future.\n    \n    \n    IF the NFD is expired:\n       x The current owner can take it back over at base price - and NFD metadata doesn't have to be cleared - they\n       get it back as-is.\n       x If not current owner, then the price goes from high of base price * 10,000 down to base price over 24 hrs where\n       'buyer' has to pay at least that price.  The NFD MUST ALREADY HAVE ITS METADATA CLEARED!\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    renew: (params: CallParams<NfdInstanceArgs['obj']['renew(pay)void'] | NfdInstanceArgs['tuple']['renew(pay)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.renew(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `setPrimaryAddress(string,address)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    setPrimaryAddress: (params: CallParams<NfdInstanceArgs['obj']['setPrimaryAddress(string,address)void'] | NfdInstanceArgs['tuple']['setPrimaryAddress(string,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.setPrimaryAddress(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `registryAddingVerifiedAddress(string,string)bool` ABI method.\n     *\n    * Approved call from registry instructing us to move the specified u.cav.xx field and add to the specified\n    verified field.\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction: true if added or already present, false otherwise\n     */\n    registryAddingVerifiedAddress: (params: CallParams<NfdInstanceArgs['obj']['registryAddingVerifiedAddress(string,string)bool'] | NfdInstanceArgs['tuple']['registryAddingVerifiedAddress(string,string)bool']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.registryAddingVerifiedAddress(params))\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `registryRemovingVerifiedAddress(string,address,address)bool` ABI method.\n     *\n     * Approved call from registry instructing us to REMOVE an address from the specified verified address set\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    registryRemovingVerifiedAddress: (params: CallParams<NfdInstanceArgs['obj']['registryRemovingVerifiedAddress(string,address,address)bool'] | NfdInstanceArgs['tuple']['registryRemovingVerifiedAddress(string,address,address)bool']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdInstanceParamsFactory.registryRemovingVerifiedAddress(params))\n    },\n\n  }\n\n  /**\n   * Send calls to the current app\n   */\n  readonly send = {\n    /**\n     * Gets available update methods\n     */\n    update: {\n      /**\n       * Updates an existing instance of the NFDInstance smart contract using the `updateApplication(string)void` ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The update result\n       */\n      updateApplication: async (params: CallParams<NfdInstanceArgs['obj']['updateApplication(string)void'] | NfdInstanceArgs['tuple']['updateApplication(string)void']> & AppClientCompilationParams & SendParams) => {\n        const result = await this.appClient.send.update(NfdInstanceParamsFactory.update.updateApplication(params))\n        return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['updateApplication(string)void'])}\n      },\n\n    },\n\n    /**\n     * Makes a clear_state call to an existing instance of the NFDInstance smart contract.\n     *\n     * @param params The params for the bare (raw) call\n     * @returns The clearState result\n     */\n    clearState: (params?: Expand<AppClientBareCallParams & SendParams>) => {\n      return this.appClient.send.bare.clearState(params)\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `gas()void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    gas: async (params: CallParams<NfdInstanceArgs['obj']['gas()void'] | NfdInstanceArgs['tuple']['gas()void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.gas(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['gas()void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `mintAsa(string,string)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    mintAsa: async (params: CallParams<NfdInstanceArgs['obj']['mintAsa(string,string)void'] | NfdInstanceArgs['tuple']['mintAsa(string,string)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.mintAsa(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['mintAsa(string,string)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `deleteFields(byte[][])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    deleteFields: async (params: CallParams<NfdInstanceArgs['obj']['deleteFields(byte[][])void'] | NfdInstanceArgs['tuple']['deleteFields(byte[][])void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.deleteFields(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['deleteFields(byte[][])void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `updateSegmentCount(string,uint64)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    updateSegmentCount: async (params: CallParams<NfdInstanceArgs['obj']['updateSegmentCount(string,uint64)void'] | NfdInstanceArgs['tuple']['updateSegmentCount(string,uint64)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.updateSegmentCount(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['updateSegmentCount(string,uint64)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `getFieldUpdateCost(byte[][])uint64` ABI method.\n     * \n     * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    getFieldUpdateCost: async (params: CallParams<NfdInstanceArgs['obj']['getFieldUpdateCost(byte[][])uint64'] | NfdInstanceArgs['tuple']['getFieldUpdateCost(byte[][])uint64']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.getFieldUpdateCost(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['getFieldUpdateCost(byte[][])uint64'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `updateFields(byte[][])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    updateFields: async (params: CallParams<NfdInstanceArgs['obj']['updateFields(byte[][])void'] | NfdInstanceArgs['tuple']['updateFields(byte[][])void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.updateFields(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['updateFields(byte[][])void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `readField(byte[])byte[]` ABI method.\n     * \n     * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    readField: async (params: CallParams<NfdInstanceArgs['obj']['readField(byte[])byte[]'] | NfdInstanceArgs['tuple']['readField(byte[])byte[]']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.readField(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['readField(byte[])byte[]'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `offerForSale(uint64,address)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    offerForSale: async (params: CallParams<NfdInstanceArgs['obj']['offerForSale(uint64,address)void'] | NfdInstanceArgs['tuple']['offerForSale(uint64,address)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.offerForSale(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['offerForSale(uint64,address)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `cancelSale()void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    cancelSale: async (params: CallParams<NfdInstanceArgs['obj']['cancelSale()void'] | NfdInstanceArgs['tuple']['cancelSale()void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.cancelSale(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['cancelSale()void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `postOffer(uint64,string)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    postOffer: async (params: CallParams<NfdInstanceArgs['obj']['postOffer(uint64,string)void'] | NfdInstanceArgs['tuple']['postOffer(uint64,string)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.postOffer(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['postOffer(uint64,string)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    mintPayout: async (params: CallParams<NfdInstanceArgs['obj']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)'] | NfdInstanceArgs['tuple']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.mintPayout(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `purchase(pay)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    purchase: async (params: CallParams<NfdInstanceArgs['obj']['purchase(pay)void'] | NfdInstanceArgs['tuple']['purchase(pay)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.purchase(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['purchase(pay)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `isAddressInField(string,address)bool` ABI method.\n     * \n     * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    isAddressInField: async (params: CallParams<NfdInstanceArgs['obj']['isAddressInField(string,address)bool'] | NfdInstanceArgs['tuple']['isAddressInField(string,address)bool']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.isAddressInField(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['isAddressInField(string,address)bool'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `getRenewPrice()uint64` ABI method.\n     * \n     * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    getRenewPrice: async (params: CallParams<NfdInstanceArgs['obj']['getRenewPrice()uint64'] | NfdInstanceArgs['tuple']['getRenewPrice()uint64']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.getRenewPrice(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['getRenewPrice()uint64'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `updateHash(byte[])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    updateHash: async (params: CallParams<NfdInstanceArgs['obj']['updateHash(byte[])void'] | NfdInstanceArgs['tuple']['updateHash(byte[])void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.updateHash(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['updateHash(byte[])void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `contractLock(bool)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    contractLock: async (params: CallParams<NfdInstanceArgs['obj']['contractLock(bool)void'] | NfdInstanceArgs['tuple']['contractLock(bool)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.contractLock(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['contractLock(bool)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `segmentLock(bool,uint64)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    segmentLock: async (params: CallParams<NfdInstanceArgs['obj']['segmentLock(bool,uint64)void'] | NfdInstanceArgs['tuple']['segmentLock(bool,uint64)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.segmentLock(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['segmentLock(bool,uint64)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `vaultOptInLock(bool)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    vaultOptInLock: async (params: CallParams<NfdInstanceArgs['obj']['vaultOptInLock(bool)void'] | NfdInstanceArgs['tuple']['vaultOptInLock(bool)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.vaultOptInLock(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['vaultOptInLock(bool)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `vaultOptIn(uint64[])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    vaultOptIn: async (params: CallParams<NfdInstanceArgs['obj']['vaultOptIn(uint64[])void'] | NfdInstanceArgs['tuple']['vaultOptIn(uint64[])void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.vaultOptIn(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['vaultOptIn(uint64[])void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `vaultSend(uint64,address,string,uint64,uint64[])void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    vaultSend: async (params: CallParams<NfdInstanceArgs['obj']['vaultSend(uint64,address,string,uint64,uint64[])void'] | NfdInstanceArgs['tuple']['vaultSend(uint64,address,string,uint64,uint64[])void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.vaultSend(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['vaultSend(uint64,address,string,uint64,uint64[])void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `renew(pay)void` ABI method.\n     *\n    * Renew adds more time to an existing NFDs expiration, or renews it if expired.\n    \n    \n    As part of v2-v3 upgrade, the NFDs are converted from lifetime NFDs to renewal NFDs. The v2 contract is upgraded\n    to v3, then renew is called on the (now v3) nfd to turn it into a renewal (note the if curExpiration === 0 check)\n    \n    \n    If already renewal, then it extends the current expiration time by the time specified (minimum 1 yr) (365 / price paid * mint price)\n    Expirations can never be more than NFD_MAX_EXPIRATION_DAYS days in the future.\n    \n    \n    IF the NFD is expired:\n       x The current owner can take it back over at base price - and NFD metadata doesn't have to be cleared - they\n       get it back as-is.\n       x If not current owner, then the price goes from high of base price * 10,000 down to base price over 24 hrs where\n       'buyer' has to pay at least that price.  The NFD MUST ALREADY HAVE ITS METADATA CLEARED!\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    renew: async (params: CallParams<NfdInstanceArgs['obj']['renew(pay)void'] | NfdInstanceArgs['tuple']['renew(pay)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.renew(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['renew(pay)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `setPrimaryAddress(string,address)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    setPrimaryAddress: async (params: CallParams<NfdInstanceArgs['obj']['setPrimaryAddress(string,address)void'] | NfdInstanceArgs['tuple']['setPrimaryAddress(string,address)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.setPrimaryAddress(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['setPrimaryAddress(string,address)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `registryAddingVerifiedAddress(string,string)bool` ABI method.\n     *\n    * Approved call from registry instructing us to move the specified u.cav.xx field and add to the specified\n    verified field.\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result: true if added or already present, false otherwise\n     */\n    registryAddingVerifiedAddress: async (params: CallParams<NfdInstanceArgs['obj']['registryAddingVerifiedAddress(string,string)bool'] | NfdInstanceArgs['tuple']['registryAddingVerifiedAddress(string,string)bool']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.registryAddingVerifiedAddress(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['registryAddingVerifiedAddress(string,string)bool'])}\n    },\n\n    /**\n     * Makes a call to the NFDInstance smart contract using the `registryRemovingVerifiedAddress(string,address,address)bool` ABI method.\n     *\n     * Approved call from registry instructing us to REMOVE an address from the specified verified address set\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    registryRemovingVerifiedAddress: async (params: CallParams<NfdInstanceArgs['obj']['registryRemovingVerifiedAddress(string,address,address)bool'] | NfdInstanceArgs['tuple']['registryRemovingVerifiedAddress(string,address,address)bool']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdInstanceParamsFactory.registryRemovingVerifiedAddress(params))\n      return {...result, return: result.return as unknown as (undefined | NfdInstanceReturns['registryRemovingVerifiedAddress(string,address,address)bool'])}\n    },\n\n  }\n\n  /**\n   * Clone this app client with different params\n   *\n   * @param params The params to use for the the cloned app client. Omit a param to keep the original value. Set a param to override the original value. Setting to undefined will clear the original value.\n   * @returns A new app client with the altered params\n   */\n  public clone(params: CloneAppClientParams) {\n    return new NfdInstanceClient(this.appClient.clone(params))\n  }\n\n  /**\n   * Makes a readonly (simulated) call to the NFDInstance smart contract using the `getFieldUpdateCost(byte[][])uint64` ABI method.\n   * \n   * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n   *\n   * @param params The params for the smart contract call\n   * @returns The call result\n   */\n  async getFieldUpdateCost(params: CallParams<NfdInstanceArgs['obj']['getFieldUpdateCost(byte[][])uint64'] | NfdInstanceArgs['tuple']['getFieldUpdateCost(byte[][])uint64']>) {\n    const result = await this.appClient.send.call(NfdInstanceParamsFactory.getFieldUpdateCost(params))\n    return result.return as unknown as NfdInstanceReturns['getFieldUpdateCost(byte[][])uint64']\n  }\n\n  /**\n   * Makes a readonly (simulated) call to the NFDInstance smart contract using the `readField(byte[])byte[]` ABI method.\n   * \n   * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n   *\n   * @param params The params for the smart contract call\n   * @returns The call result\n   */\n  async readField(params: CallParams<NfdInstanceArgs['obj']['readField(byte[])byte[]'] | NfdInstanceArgs['tuple']['readField(byte[])byte[]']>) {\n    const result = await this.appClient.send.call(NfdInstanceParamsFactory.readField(params))\n    return result.return as unknown as NfdInstanceReturns['readField(byte[])byte[]']\n  }\n\n  /**\n   * Makes a readonly (simulated) call to the NFDInstance smart contract using the `isAddressInField(string,address)bool` ABI method.\n   * \n   * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n   *\n   * @param params The params for the smart contract call\n   * @returns The call result\n   */\n  async isAddressInField(params: CallParams<NfdInstanceArgs['obj']['isAddressInField(string,address)bool'] | NfdInstanceArgs['tuple']['isAddressInField(string,address)bool']>) {\n    const result = await this.appClient.send.call(NfdInstanceParamsFactory.isAddressInField(params))\n    return result.return as unknown as NfdInstanceReturns['isAddressInField(string,address)bool']\n  }\n\n  /**\n   * Makes a readonly (simulated) call to the NFDInstance smart contract using the `getRenewPrice()uint64` ABI method.\n   * \n   * This method is a readonly method; calling it with onComplete of NoOp will result in a simulated transaction rather than a real transaction.\n   *\n   * @param params The params for the smart contract call\n   * @returns The call result\n   */\n  async getRenewPrice(params: CallParams<NfdInstanceArgs['obj']['getRenewPrice()uint64'] | NfdInstanceArgs['tuple']['getRenewPrice()uint64']> = {args: []}) {\n    const result = await this.appClient.send.call(NfdInstanceParamsFactory.getRenewPrice(params))\n    return result.return as unknown as NfdInstanceReturns['getRenewPrice()uint64']\n  }\n\n  /**\n   * Methods to access state for the current NFDInstance app\n   */\n  state = {\n    /**\n     * Methods to access global state for the current NFDInstance app\n     */\n    global: {\n      /**\n       * Get all current keyed values from global state\n       */\n      getAll: async (): Promise<Partial<Expand<GlobalKeysState>>> => {\n        const result = await this.appClient.state.global.getAll()\n        return {\n        }\n      },\n      /**\n       * Get values from the globalState map in global state\n       */\n      globalState: {\n        /**\n         * Get all current values of the globalState map in global state\n         */\n        getMap: async (): Promise<Map<Uint8Array, Uint8Array>> => { return (await this.appClient.state.global.getMap(\"globalState\")) as Map<Uint8Array, Uint8Array> },\n        /**\n         * Get a current value of the globalState map by key from global state\n         */\n        value: async (key: Uint8Array | string): Promise<Uint8Array | undefined> => { return await this.appClient.state.global.getMapValue(\"globalState\", key) as Uint8Array | undefined },\n      },\n    },\n    /**\n     * Methods to access box state for the current NFDInstance app\n     */\n    box: {\n      /**\n       * Get all current keyed values from box state\n       */\n      getAll: async (): Promise<Partial<Expand<BoxKeysState>>> => {\n        const result = await this.appClient.state.box.getAll()\n        return {\n        }\n      },\n      /**\n       * Get values from the boxes map in box state\n       */\n      boxes: {\n        /**\n         * Get all current values of the boxes map in box state\n         */\n        getMap: async (): Promise<Map<Uint8Array, Uint8Array>> => { return (await this.appClient.state.box.getMap(\"boxes\")) as Map<Uint8Array, Uint8Array> },\n        /**\n         * Get a current value of the boxes map by key from box state\n         */\n        value: async (key: Uint8Array | string): Promise<Uint8Array | undefined> => { return await this.appClient.state.box.getMapValue(\"boxes\", key) as Uint8Array | undefined },\n      },\n    },\n  }\n\n  public newGroup(): NfdInstanceComposer {\n    const client = this\n    const composer = this.algorand.newGroup()\n    let promiseChain:Promise<unknown> = Promise.resolve()\n    const resultMappers: Array<undefined | ((x: ABIReturn | undefined) => any)> = []\n    return {\n      /**\n       * Add a gas()void method call against the NFDInstance contract\n       */\n      gas(params: CallParams<NfdInstanceArgs['obj']['gas()void'] | NfdInstanceArgs['tuple']['gas()void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.gas(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a mintAsa(string,string)void method call against the NFDInstance contract\n       */\n      mintAsa(params: CallParams<NfdInstanceArgs['obj']['mintAsa(string,string)void'] | NfdInstanceArgs['tuple']['mintAsa(string,string)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.mintAsa(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a deleteFields(byte[][])void method call against the NFDInstance contract\n       */\n      deleteFields(params: CallParams<NfdInstanceArgs['obj']['deleteFields(byte[][])void'] | NfdInstanceArgs['tuple']['deleteFields(byte[][])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.deleteFields(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a updateSegmentCount(string,uint64)void method call against the NFDInstance contract\n       */\n      updateSegmentCount(params: CallParams<NfdInstanceArgs['obj']['updateSegmentCount(string,uint64)void'] | NfdInstanceArgs['tuple']['updateSegmentCount(string,uint64)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.updateSegmentCount(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a getFieldUpdateCost(byte[][])uint64 method call against the NFDInstance contract\n       */\n      getFieldUpdateCost(params: CallParams<NfdInstanceArgs['obj']['getFieldUpdateCost(byte[][])uint64'] | NfdInstanceArgs['tuple']['getFieldUpdateCost(byte[][])uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.getFieldUpdateCost(params)))\n        resultMappers.push((v) => client.decodeReturnValue('getFieldUpdateCost(byte[][])uint64', v))\n        return this\n      },\n      /**\n       * Add a updateFields(byte[][])void method call against the NFDInstance contract\n       */\n      updateFields(params: CallParams<NfdInstanceArgs['obj']['updateFields(byte[][])void'] | NfdInstanceArgs['tuple']['updateFields(byte[][])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.updateFields(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a readField(byte[])byte[] method call against the NFDInstance contract\n       */\n      readField(params: CallParams<NfdInstanceArgs['obj']['readField(byte[])byte[]'] | NfdInstanceArgs['tuple']['readField(byte[])byte[]']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.readField(params)))\n        resultMappers.push((v) => client.decodeReturnValue('readField(byte[])byte[]', v))\n        return this\n      },\n      /**\n       * Add a offerForSale(uint64,address)void method call against the NFDInstance contract\n       */\n      offerForSale(params: CallParams<NfdInstanceArgs['obj']['offerForSale(uint64,address)void'] | NfdInstanceArgs['tuple']['offerForSale(uint64,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.offerForSale(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a cancelSale()void method call against the NFDInstance contract\n       */\n      cancelSale(params: CallParams<NfdInstanceArgs['obj']['cancelSale()void'] | NfdInstanceArgs['tuple']['cancelSale()void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.cancelSale(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a postOffer(uint64,string)void method call against the NFDInstance contract\n       */\n      postOffer(params: CallParams<NfdInstanceArgs['obj']['postOffer(uint64,string)void'] | NfdInstanceArgs['tuple']['postOffer(uint64,string)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.postOffer(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64) method call against the NFDInstance contract\n       */\n      mintPayout(params: CallParams<NfdInstanceArgs['obj']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)'] | NfdInstanceArgs['tuple']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.mintPayout(params)))\n        resultMappers.push((v) => client.decodeReturnValue('mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)', v))\n        return this\n      },\n      /**\n       * Add a purchase(pay)void method call against the NFDInstance contract\n       */\n      purchase(params: CallParams<NfdInstanceArgs['obj']['purchase(pay)void'] | NfdInstanceArgs['tuple']['purchase(pay)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.purchase(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a isAddressInField(string,address)bool method call against the NFDInstance contract\n       */\n      isAddressInField(params: CallParams<NfdInstanceArgs['obj']['isAddressInField(string,address)bool'] | NfdInstanceArgs['tuple']['isAddressInField(string,address)bool']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.isAddressInField(params)))\n        resultMappers.push((v) => client.decodeReturnValue('isAddressInField(string,address)bool', v))\n        return this\n      },\n      /**\n       * Add a getRenewPrice()uint64 method call against the NFDInstance contract\n       */\n      getRenewPrice(params: CallParams<NfdInstanceArgs['obj']['getRenewPrice()uint64'] | NfdInstanceArgs['tuple']['getRenewPrice()uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.getRenewPrice(params)))\n        resultMappers.push((v) => client.decodeReturnValue('getRenewPrice()uint64', v))\n        return this\n      },\n      /**\n       * Add a updateHash(byte[])void method call against the NFDInstance contract\n       */\n      updateHash(params: CallParams<NfdInstanceArgs['obj']['updateHash(byte[])void'] | NfdInstanceArgs['tuple']['updateHash(byte[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.updateHash(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a contractLock(bool)void method call against the NFDInstance contract\n       */\n      contractLock(params: CallParams<NfdInstanceArgs['obj']['contractLock(bool)void'] | NfdInstanceArgs['tuple']['contractLock(bool)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.contractLock(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a segmentLock(bool,uint64)void method call against the NFDInstance contract\n       */\n      segmentLock(params: CallParams<NfdInstanceArgs['obj']['segmentLock(bool,uint64)void'] | NfdInstanceArgs['tuple']['segmentLock(bool,uint64)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.segmentLock(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a vaultOptInLock(bool)void method call against the NFDInstance contract\n       */\n      vaultOptInLock(params: CallParams<NfdInstanceArgs['obj']['vaultOptInLock(bool)void'] | NfdInstanceArgs['tuple']['vaultOptInLock(bool)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.vaultOptInLock(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a vaultOptIn(uint64[])void method call against the NFDInstance contract\n       */\n      vaultOptIn(params: CallParams<NfdInstanceArgs['obj']['vaultOptIn(uint64[])void'] | NfdInstanceArgs['tuple']['vaultOptIn(uint64[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.vaultOptIn(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a vaultSend(uint64,address,string,uint64,uint64[])void method call against the NFDInstance contract\n       */\n      vaultSend(params: CallParams<NfdInstanceArgs['obj']['vaultSend(uint64,address,string,uint64,uint64[])void'] | NfdInstanceArgs['tuple']['vaultSend(uint64,address,string,uint64,uint64[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.vaultSend(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a renew(pay)void method call against the NFDInstance contract\n       */\n      renew(params: CallParams<NfdInstanceArgs['obj']['renew(pay)void'] | NfdInstanceArgs['tuple']['renew(pay)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.renew(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a setPrimaryAddress(string,address)void method call against the NFDInstance contract\n       */\n      setPrimaryAddress(params: CallParams<NfdInstanceArgs['obj']['setPrimaryAddress(string,address)void'] | NfdInstanceArgs['tuple']['setPrimaryAddress(string,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.setPrimaryAddress(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a registryAddingVerifiedAddress(string,string)bool method call against the NFDInstance contract\n       */\n      registryAddingVerifiedAddress(params: CallParams<NfdInstanceArgs['obj']['registryAddingVerifiedAddress(string,string)bool'] | NfdInstanceArgs['tuple']['registryAddingVerifiedAddress(string,string)bool']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.registryAddingVerifiedAddress(params)))\n        resultMappers.push((v) => client.decodeReturnValue('registryAddingVerifiedAddress(string,string)bool', v))\n        return this\n      },\n      /**\n       * Add a registryRemovingVerifiedAddress(string,address,address)bool method call against the NFDInstance contract\n       */\n      registryRemovingVerifiedAddress(params: CallParams<NfdInstanceArgs['obj']['registryRemovingVerifiedAddress(string,address,address)bool'] | NfdInstanceArgs['tuple']['registryRemovingVerifiedAddress(string,address,address)bool']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.registryRemovingVerifiedAddress(params)))\n        resultMappers.push((v) => client.decodeReturnValue('registryRemovingVerifiedAddress(string,address,address)bool', v))\n        return this\n      },\n      get update() {\n        return {\n          updateApplication: (params: CallParams<NfdInstanceArgs['obj']['updateApplication(string)void'] | NfdInstanceArgs['tuple']['updateApplication(string)void']> & AppClientCompilationParams) => {\n            promiseChain = promiseChain.then(async () => composer.addAppUpdateMethodCall(await client.params.update.updateApplication(params)))\n            resultMappers.push(undefined)\n            return this\n          },\n        }\n      },\n      /**\n       * Add a clear state call to the NFDInstance contract\n       */\n      clearState(params: AppClientBareCallParams) {\n        promiseChain = promiseChain.then(() => composer.addAppCall(client.params.clearState(params)))\n        return this\n      },\n      addTransaction(txn: Transaction, signer?: TransactionSigner) {\n        promiseChain = promiseChain.then(() => composer.addTransaction(txn, signer))\n        return this\n      },\n      async composer() {\n        await promiseChain\n        return composer\n      },\n      async simulate(options?: SimulateOptions) {\n        await promiseChain\n        const result = await (!options ? composer.simulate() : composer.simulate(options))\n        return {\n          ...result,\n          returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)\n        }\n      },\n      async send(params?: SendParams) {\n        await promiseChain\n        const result = await composer.send(params)\n        return {\n          ...result,\n          returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)\n        }\n      }\n    } as unknown as NfdInstanceComposer\n  }\n}\nexport type NfdInstanceComposer<TReturns extends [...any[]] = []> = {\n  /**\n   * Calls the gas()void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  gas(params?: CallParams<NfdInstanceArgs['obj']['gas()void'] | NfdInstanceArgs['tuple']['gas()void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['gas()void'] | undefined]>\n\n  /**\n   * Calls the mintAsa(string,string)void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  mintAsa(params?: CallParams<NfdInstanceArgs['obj']['mintAsa(string,string)void'] | NfdInstanceArgs['tuple']['mintAsa(string,string)void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['mintAsa(string,string)void'] | undefined]>\n\n  /**\n   * Calls the deleteFields(byte[][])void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  deleteFields(params?: CallParams<NfdInstanceArgs['obj']['deleteFields(byte[][])void'] | NfdInstanceArgs['tuple']['deleteFields(byte[][])void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['deleteFields(byte[][])void'] | undefined]>\n\n  /**\n   * Calls the updateSegmentCount(string,uint64)void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  updateSegmentCount(params?: CallParams<NfdInstanceArgs['obj']['updateSegmentCount(string,uint64)void'] | NfdInstanceArgs['tuple']['updateSegmentCount(string,uint64)void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['updateSegmentCount(string,uint64)void'] | undefined]>\n\n  /**\n   * Calls the getFieldUpdateCost(byte[][])uint64 ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  getFieldUpdateCost(params?: CallParams<NfdInstanceArgs['obj']['getFieldUpdateCost(byte[][])uint64'] | NfdInstanceArgs['tuple']['getFieldUpdateCost(byte[][])uint64']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['getFieldUpdateCost(byte[][])uint64'] | undefined]>\n\n  /**\n   * Calls the updateFields(byte[][])void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  updateFields(params?: CallParams<NfdInstanceArgs['obj']['updateFields(byte[][])void'] | NfdInstanceArgs['tuple']['updateFields(byte[][])void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['updateFields(byte[][])void'] | undefined]>\n\n  /**\n   * Calls the readField(byte[])byte[] ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  readField(params?: CallParams<NfdInstanceArgs['obj']['readField(byte[])byte[]'] | NfdInstanceArgs['tuple']['readField(byte[])byte[]']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['readField(byte[])byte[]'] | undefined]>\n\n  /**\n   * Calls the offerForSale(uint64,address)void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  offerForSale(params?: CallParams<NfdInstanceArgs['obj']['offerForSale(uint64,address)void'] | NfdInstanceArgs['tuple']['offerForSale(uint64,address)void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['offerForSale(uint64,address)void'] | undefined]>\n\n  /**\n   * Calls the cancelSale()void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  cancelSale(params?: CallParams<NfdInstanceArgs['obj']['cancelSale()void'] | NfdInstanceArgs['tuple']['cancelSale()void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['cancelSale()void'] | undefined]>\n\n  /**\n   * Calls the postOffer(uint64,string)void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  postOffer(params?: CallParams<NfdInstanceArgs['obj']['postOffer(uint64,string)void'] | NfdInstanceArgs['tuple']['postOffer(uint64,string)void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['postOffer(uint64,string)void'] | undefined]>\n\n  /**\n   * Calls the mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64) ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  mintPayout(params?: CallParams<NfdInstanceArgs['obj']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)'] | NfdInstanceArgs['tuple']['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['mintPayout(uint64,uint64)(uint64,address,uint64,address,uint64)'] | undefined]>\n\n  /**\n   * Calls the purchase(pay)void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  purchase(params?: CallParams<NfdInstanceArgs['obj']['purchase(pay)void'] | NfdInstanceArgs['tuple']['purchase(pay)void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['purchase(pay)void'] | undefined]>\n\n  /**\n   * Calls the isAddressInField(string,address)bool ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  isAddressInField(params?: CallParams<NfdInstanceArgs['obj']['isAddressInField(string,address)bool'] | NfdInstanceArgs['tuple']['isAddressInField(string,address)bool']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['isAddressInField(string,address)bool'] | undefined]>\n\n  /**\n   * Calls the getRenewPrice()uint64 ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  getRenewPrice(params?: CallParams<NfdInstanceArgs['obj']['getRenewPrice()uint64'] | NfdInstanceArgs['tuple']['getRenewPrice()uint64']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['getRenewPrice()uint64'] | undefined]>\n\n  /**\n   * Calls the updateHash(byte[])void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  updateHash(params?: CallParams<NfdInstanceArgs['obj']['updateHash(byte[])void'] | NfdInstanceArgs['tuple']['updateHash(byte[])void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['updateHash(byte[])void'] | undefined]>\n\n  /**\n   * Calls the contractLock(bool)void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  contractLock(params?: CallParams<NfdInstanceArgs['obj']['contractLock(bool)void'] | NfdInstanceArgs['tuple']['contractLock(bool)void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['contractLock(bool)void'] | undefined]>\n\n  /**\n   * Calls the segmentLock(bool,uint64)void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  segmentLock(params?: CallParams<NfdInstanceArgs['obj']['segmentLock(bool,uint64)void'] | NfdInstanceArgs['tuple']['segmentLock(bool,uint64)void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['segmentLock(bool,uint64)void'] | undefined]>\n\n  /**\n   * Calls the vaultOptInLock(bool)void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  vaultOptInLock(params?: CallParams<NfdInstanceArgs['obj']['vaultOptInLock(bool)void'] | NfdInstanceArgs['tuple']['vaultOptInLock(bool)void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['vaultOptInLock(bool)void'] | undefined]>\n\n  /**\n   * Calls the vaultOptIn(uint64[])void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  vaultOptIn(params?: CallParams<NfdInstanceArgs['obj']['vaultOptIn(uint64[])void'] | NfdInstanceArgs['tuple']['vaultOptIn(uint64[])void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['vaultOptIn(uint64[])void'] | undefined]>\n\n  /**\n   * Calls the vaultSend(uint64,address,string,uint64,uint64[])void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  vaultSend(params?: CallParams<NfdInstanceArgs['obj']['vaultSend(uint64,address,string,uint64,uint64[])void'] | NfdInstanceArgs['tuple']['vaultSend(uint64,address,string,uint64,uint64[])void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['vaultSend(uint64,address,string,uint64,uint64[])void'] | undefined]>\n\n  /**\n   * Calls the renew(pay)void ABI method.\n   *\n  * Renew adds more time to an existing NFDs expiration, or renews it if expired.\n  \n  \n  As part of v2-v3 upgrade, the NFDs are converted from lifetime NFDs to renewal NFDs. The v2 contract is upgraded\n  to v3, then renew is called on the (now v3) nfd to turn it into a renewal (note the if curExpiration === 0 check)\n  \n  \n  If already renewal, then it extends the current expiration time by the time specified (minimum 1 yr) (365 / price paid * mint price)\n  Expirations can never be more than NFD_MAX_EXPIRATION_DAYS days in the future.\n  \n  \n  IF the NFD is expired:\n     x The current owner can take it back over at base price - and NFD metadata doesn't have to be cleared - they\n     get it back as-is.\n     x If not current owner, then the price goes from high of base price * 10,000 down to base price over 24 hrs where\n     'buyer' has to pay at least that price.  The NFD MUST ALREADY HAVE ITS METADATA CLEARED!\n\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  renew(params?: CallParams<NfdInstanceArgs['obj']['renew(pay)void'] | NfdInstanceArgs['tuple']['renew(pay)void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['renew(pay)void'] | undefined]>\n\n  /**\n   * Calls the setPrimaryAddress(string,address)void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  setPrimaryAddress(params?: CallParams<NfdInstanceArgs['obj']['setPrimaryAddress(string,address)void'] | NfdInstanceArgs['tuple']['setPrimaryAddress(string,address)void']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['setPrimaryAddress(string,address)void'] | undefined]>\n\n  /**\n   * Calls the registryAddingVerifiedAddress(string,string)bool ABI method.\n   *\n  * Approved call from registry instructing us to move the specified u.cav.xx field and add to the specified\n  verified field.\n\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  registryAddingVerifiedAddress(params?: CallParams<NfdInstanceArgs['obj']['registryAddingVerifiedAddress(string,string)bool'] | NfdInstanceArgs['tuple']['registryAddingVerifiedAddress(string,string)bool']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['registryAddingVerifiedAddress(string,string)bool'] | undefined]>\n\n  /**\n   * Calls the registryRemovingVerifiedAddress(string,address,address)bool ABI method.\n   *\n   * Approved call from registry instructing us to REMOVE an address from the specified verified address set\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  registryRemovingVerifiedAddress(params?: CallParams<NfdInstanceArgs['obj']['registryRemovingVerifiedAddress(string,address,address)bool'] | NfdInstanceArgs['tuple']['registryRemovingVerifiedAddress(string,address,address)bool']>): NfdInstanceComposer<[...TReturns, NfdInstanceReturns['registryRemovingVerifiedAddress(string,address,address)bool'] | undefined]>\n\n  /**\n   * Makes a clear_state call to an existing instance of the NFDInstance smart contract.\n   *\n   * @param args The arguments for the bare call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  clearState(params?: AppClientBareCallParams): NfdInstanceComposer<[...TReturns, undefined]>\n\n  /**\n   * Adds a transaction to the composer\n   *\n   * @param txn A transaction to add to the transaction group\n   * @param signer The optional signer to use when signing this transaction.\n   */\n  addTransaction(txn: Transaction, signer?: TransactionSigner): NfdInstanceComposer<TReturns>\n  /**\n   * Returns the underlying AtomicTransactionComposer instance\n   */\n  composer(): Promise<TransactionComposer>\n  /**\n   * Simulates the transaction group and returns the result\n   */\n  simulate(): Promise<NfdInstanceComposerResults<TReturns> & { simulateResponse: SimulateResponse }>\n  simulate(options: SkipSignaturesSimulateOptions): Promise<NfdInstanceComposerResults<TReturns> & { simulateResponse: SimulateResponse }>\n  simulate(options: RawSimulateOptions): Promise<NfdInstanceComposerResults<TReturns> & { simulateResponse: SimulateResponse }>\n  /**\n   * Sends the transaction group to the network and returns the results\n   */\n  send(params?: SendParams): Promise<NfdInstanceComposerResults<TReturns>>\n}\nexport type NfdInstanceComposerResults<TReturns extends [...any[]]> = Expand<SendAtomicTransactionComposerResults & {\n  returns: TReturns\n}>\n\n","/* eslint-disable */\n/**\n * This file was automatically generated by @algorandfoundation/algokit-client-generator.\n * DO NOT MODIFY IT BY HAND.\n * requires: @algorandfoundation/algokit-utils: ^7\n */\nimport { AlgorandClientInterface } from '@algorandfoundation/algokit-utils/types/algorand-client-interface'\nimport { ABIReturn, AppReturn, SendAppTransactionResult } from '@algorandfoundation/algokit-utils/types/app'\nimport { Arc56Contract, getArc56ReturnValue, getABIStructFromABITuple } from '@algorandfoundation/algokit-utils/types/app-arc56'\nimport {\n  AppClient as _AppClient,\n  AppClientMethodCallParams,\n  AppClientParams,\n  AppClientBareCallParams,\n  CallOnComplete,\n  AppClientCompilationParams,\n  ResolveAppClientByCreatorAndName,\n  ResolveAppClientByNetwork,\n  CloneAppClientParams,\n} from '@algorandfoundation/algokit-utils/types/app-client'\nimport { AppFactory as _AppFactory, AppFactoryAppClientParams, AppFactoryResolveAppClientByCreatorAndNameParams, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'\nimport { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions, RawSimulateOptions, SkipSignaturesSimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'\nimport { SendParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'\nimport { Address, encodeAddress, modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'\nimport SimulateResponse = modelsv2.SimulateResponse\n\nexport const APP_SPEC: Arc56Contract = {\"name\":\"NFDRegistry\",\"desc\":\"\",\"methods\":[{\"name\":\"updateApplication\",\"args\":[],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"UpdateApplication\"]}},{\"name\":\"gas\",\"args\":[],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"getPrice\",\"desc\":\"Returns the price for a given NFD (single year), the max # of years allowed (Name for Display),\\nand extra algo required to cover MBR when purchasing.\",\"args\":[{\"name\":\"nfdName\",\"type\":\"string\",\"desc\":\"The NFD name for which to retrieve the price.\"},{\"name\":\"caller\",\"type\":\"address\",\"desc\":\"the address this request is on behalf of (since an nfd contract might call us it\\nneeds to be able to pass on the request on behalf of ITS caller - ie: getting price for an expired nfd will be\\ndifferent if its owner ir asking.\\n PriceInfo Type containing the price, carry cost, etc.\"}],\"returns\":{\"type\":\"(uint64,uint64,bool,bool,bool)\",\"struct\":\"PriceInfo\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"getConstraints\",\"args\":[],\"returns\":{\"type\":\"(uint64,uint64,uint64,address,uint64,uint64,uint64)\",\"struct\":\"Constraints\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"getNfdMbrCost\",\"desc\":\"Returns the MBR amounts needed to MINT an nfd.\\nThis value needs to be added to purchase price in mintNfd call.\\ngetPrice() returns it though.\",\"args\":[{\"name\":\"nfdName\",\"type\":\"string\"}],\"returns\":{\"type\":\"uint64\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"getNfdLinkOnMintExtraMbrCost\",\"args\":[{\"name\":\"address\",\"type\":\"address\"}],\"returns\":{\"type\":\"(uint64,uint64)\",\"struct\":\"LinkOnMintExtraMbrCosts\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"mintNfd\",\"desc\":\"Mint an NFD (NFT) and create a new NFD instance.\",\"args\":[{\"name\":\"purchaseTxn\",\"type\":\"pay\",\"desc\":\"The payment transaction covering the purchase amount of the nfd\"},{\"name\":\"nfdName\",\"type\":\"string\",\"desc\":\"The name of the NFD to mint\"},{\"name\":\"reservedFor\",\"type\":\"address\",\"desc\":\"The address that will own the NFD once minted (so you can buy for someone else)\"},{\"name\":\"linkOnMint\",\"type\":\"bool\",\"desc\":\"whether to auto-link the address (reserved for MUST MATCH payer!) at mint\\n uint64 - The ID of the newly created NFD instance.\"}],\"returns\":{\"type\":\"uint64\"},\"events\":[{\"name\":\"nfdRegistry_minted\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"priceOneYear\",\"type\":\"uint64\"},{\"name\":\"paidAmount\",\"type\":\"uint64\"},{\"name\":\"carryCost\",\"type\":\"uint64\"},{\"name\":\"seller\",\"type\":\"address\"},{\"name\":\"buyer\",\"type\":\"address\"},{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"expTime\",\"type\":\"uint64\"},{\"name\":\"amountToSeller\",\"type\":\"uint64\"},{\"name\":\"commissionAddress\",\"type\":\"address\"},{\"name\":\"amountToCommission\",\"type\":\"uint64\"},{\"name\":\"segmentRootOwner\",\"type\":\"address\"},{\"name\":\"amountToSegmentRoot\",\"type\":\"uint64\"}],\"desc\":\"\"}],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"linkNfdAddress\",\"args\":[{\"name\":\"nfdName\",\"type\":\"string\"},{\"name\":\"nfdAppId\",\"type\":\"uint64\"},{\"name\":\"addrToVerify\",\"type\":\"address\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"unlinkNfdAddress\",\"args\":[{\"name\":\"nfdName\",\"type\":\"string\"},{\"name\":\"nfdAppId\",\"type\":\"uint64\"},{\"name\":\"addrToUnlink\",\"type\":\"address\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"ownershipAssign\",\"args\":[{\"name\":\"nfdName\",\"type\":\"string\"},{\"name\":\"nfdAppId\",\"type\":\"uint64\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"ownershipChanged\",\"desc\":\"This method is triggered when the ownership of an NFD (Non-Fungible Domain) changes.\\nIt is called by the NFD via the purchase method.  It can also be called by TxnLab admin for older 3.3\\nNFDs when it detects purchased events for 3.3\",\"args\":[{\"name\":\"nfdName\",\"type\":\"string\",\"desc\":\"The name of the NFD.\"},{\"name\":\"nfdAppId\",\"type\":\"uint64\",\"desc\":\"The unique application ID of the NFD.\"},{\"name\":\"seller\",\"type\":\"address\",\"desc\":\"The address of the prior owner (seller) of the nfd\"},{\"name\":\"buyer\",\"type\":\"address\",\"desc\":\"The address of the new owner of the NFD.\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"setAddressPrimaryNfd\",\"desc\":\"Makes the specified NFD the 'first' NFD in the reverse-address set so its the primary NFD for this address.\\nThe NFD must be valid, and the sender must be the address (or nfd owner if vault).  The NFD wouldn't already be\\nin the reverse-lookup set if it wasn't already valid.\",\"args\":[{\"name\":\"nfdName\",\"type\":\"string\"},{\"name\":\"nfdAppId\",\"type\":\"uint64\"},{\"name\":\"addrBeingModified\",\"type\":\"address\"}],\"returns\":{\"type\":\"void\"},\"events\":[{\"name\":\"nfdRegistry_addressPrimaryNfdChanged\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"address\"}],\"desc\":\"\"}],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"upgradeNfd\",\"args\":[{\"name\":\"nfdName\",\"type\":\"string\"}],\"returns\":{\"type\":\"string\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"isValidNfdAppId\",\"args\":[{\"name\":\"nfdName\",\"type\":\"string\"},{\"name\":\"nfdAppId\",\"type\":\"uint64\"}],\"returns\":{\"type\":\"bool\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"getNameAppId\",\"args\":[{\"name\":\"nfdName\",\"type\":\"string\"}],\"returns\":{\"type\":\"uint64\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"getAddressAppIds\",\"args\":[{\"name\":\"lookupAddress\",\"type\":\"address\"}],\"returns\":{\"type\":\"uint64[]\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"nfdContractInit\",\"desc\":\"Initializes the NFD contract bytecode into the registry\",\"args\":[{\"name\":\"version\",\"type\":\"string\",\"desc\":\"The version of the contract.\"},{\"name\":\"size\",\"type\":\"uint64\",\"desc\":\"exact byte size of contract to load\"},{\"name\":\"clearCode\",\"type\":\"byte[]\",\"desc\":\"bytes of clear code\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"nfdContractLoad\",\"desc\":\"Loads contract data into the  box at the specified offset.\",\"args\":[{\"name\":\"version\",\"type\":\"string\",\"desc\":\"The version of the contract.\"},{\"name\":\"offset\",\"type\":\"uint64\",\"desc\":\"The offset at which to replace the contract data within the box.\"},{\"name\":\"data\",\"type\":\"byte[]\",\"desc\":\"The contract data to be loaded.\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"nfdContractCommit\",\"desc\":\"Commit a new version of the contract.\",\"args\":[{\"name\":\"version\",\"type\":\"string\",\"desc\":\"The version number of the contract to be committed.\"}],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"usdInMicroAlgo\",\"args\":[{\"name\":\"usdCost\",\"type\":\"uint64\"}],\"returns\":{\"type\":\"uint64\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"costToAddToAddress\",\"desc\":\"Returns the cost to add an NFD to the reverse-lookup data\",\"args\":[{\"name\":\"lookupAddress\",\"type\":\"address\",\"desc\":\"The address to add the NFD app id to\"}],\"returns\":{\"type\":\"uint64\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"calcFuturePrice\",\"desc\":\"Calculates the future price based on the current price and the number of years.\",\"args\":[{\"name\":\"curPrice\",\"type\":\"uint64\",\"desc\":\"The current price in USD (in decimals). For example, if the current price is $2.00, the value should be 200.\"},{\"name\":\"forTime\",\"type\":\"uint64\",\"desc\":\"The timestamp to calc the future price based on - ie: 1 year past 'go live date' the price would have inflated by 1 year.\\n\\n\\n uint64 The future price calculated based on the current price and the specified number of years.\"}],\"returns\":{\"type\":\"uint64\"},\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"createApplication\",\"args\":[],\"returns\":{\"type\":\"void\"},\"actions\":{\"create\":[\"NoOp\"],\"call\":[]}}],\"events\":[{\"name\":\"nfdRegistry_minted\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"priceOneYear\",\"type\":\"uint64\"},{\"name\":\"paidAmount\",\"type\":\"uint64\"},{\"name\":\"carryCost\",\"type\":\"uint64\"},{\"name\":\"seller\",\"type\":\"address\"},{\"name\":\"buyer\",\"type\":\"address\"},{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"expTime\",\"type\":\"uint64\"},{\"name\":\"amountToSeller\",\"type\":\"uint64\"},{\"name\":\"commissionAddress\",\"type\":\"address\"},{\"name\":\"amountToCommission\",\"type\":\"uint64\"},{\"name\":\"segmentRootOwner\",\"type\":\"address\"},{\"name\":\"amountToSegmentRoot\",\"type\":\"uint64\"}],\"desc\":\"\"},{\"name\":\"nfdRegistry_addressPrimaryNfdChanged\",\"args\":[{\"name\":\"appId\",\"type\":\"uint64\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"address\"}],\"desc\":\"\"}],\"arcs\":[4,56],\"structs\":{\"PriceInfo\":[{\"name\":\"oneYearPrice\",\"type\":\"uint64\"},{\"name\":\"carryCost\",\"type\":\"uint64\"},{\"name\":\"exists\",\"type\":\"bool\"},{\"name\":\"isExpired\",\"type\":\"bool\"},{\"name\":\"inAuction\",\"type\":\"bool\"}],\"Constraints\":[{\"name\":\"segmentPlatformCostInUsd\",\"type\":\"uint64\"},{\"name\":\"segmentPlatformCostInAlgo\",\"type\":\"uint64\"},{\"name\":\"maxYearsAllowed\",\"type\":\"uint64\"},{\"name\":\"treasuryAddress\",\"type\":\"address\"},{\"name\":\"expiredAuctionDuration\",\"type\":\"uint64\"},{\"name\":\"expiredStartingPrice\",\"type\":\"uint64\"},{\"name\":\"maxMintCarryCost\",\"type\":\"uint64\"}],\"LinkOnMintExtraMbrCosts\":[{\"name\":\"linkingNfdMbrCost\",\"type\":\"uint64\"},{\"name\":\"linkingRegistryMbrCost\",\"type\":\"uint64\"}]},\"state\":{\"schema\":{\"global\":{\"bytes\":0,\"ints\":0},\"local\":{\"bytes\":16,\"ints\":0}},\"keys\":{\"global\":{},\"local\":{},\"box\":{}},\"maps\":{\"global\":{},\"local\":{\"localState\":{\"keyType\":\"AVMBytes\",\"valueType\":\"AVMBytes\"}},\"box\":{\"boxes\":{\"keyType\":\"AVMBytes\",\"valueType\":\"AVMBytes\"}}}},\"bareActions\":{\"create\":[],\"call\":[]},\"sourceInfo\":{\"approval\":{\"sourceInfo\":[{\"teal\":25,\"source\":\"contracts/NFDRegistry.algo.ts:51\",\"errorMessage\":\"The requested action is not implemented in this contract. Are you using the correct OnComplete? Did you set your app ID?\",\"pc\":[35]},{\"teal\":414,\"source\":\"contracts/NFDRegistry.algo.ts:179\",\"errorMessage\":\"invalid\",\"pc\":[516]},{\"teal\":510,\"source\":\"contracts/NFDRegistry.algo.ts:198\",\"errorMessage\":\"invalid method\",\"pc\":[637]},{\"teal\":514,\"source\":\"contracts/NFDRegistry.algo.ts:200\",\"errorMessage\":\"unknown method\",\"pc\":[638]},{\"teal\":542,\"source\":\"contracts/NFDRegistry.algo.ts:216\",\"errorMessage\":\"argument 0 (caller) for getPrice must be a address\",\"pc\":[658]},{\"teal\":736,\"source\":\"contracts/NFDRegistry.algo.ts:256\",\"errorMessage\":\"argument 0 (address) for getNfdLinkOnMintExtraMbrCost must be a address\",\"pc\":[909]},{\"teal\":780,\"source\":\"contracts/NFDRegistry.algo.ts:272\",\"errorMessage\":\"argument 0 (linkOnMint) for mintNfd must be a bool\",\"pc\":[947]},{\"teal\":792,\"source\":\"contracts/NFDRegistry.algo.ts:272\",\"errorMessage\":\"argument 1 (reservedFor) for mintNfd must be a address\",\"pc\":[958]},{\"teal\":808,\"source\":\"contracts/NFDRegistry.algo.ts:272\",\"errorMessage\":\"argument 3 (purchaseTxn) for mintNfd must be a pay transaction\",\"pc\":[974]},{\"teal\":843,\"source\":\"contracts/NFDRegistry.algo.ts:273\",\"errorMessage\":\"transaction verification failed: {\\\"txn\\\":\\\"purchaseTxn\\\",\\\"field\\\":\\\"receiver\\\",\\\"expected\\\":\\\"this.app.address\\\"}\",\"pc\":[996]},{\"teal\":931,\"source\":\"contracts/NFDRegistry.algo.ts:290\",\"errorMessage\":\"parent nfd/id must be found\",\"pc\":[1085]},{\"teal\":951,\"source\":\"contracts/NFDRegistry.algo.ts:294\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(parentAppId).globalState(NFD_KEY_SELLER)\",\"pc\":[1114]},{\"teal\":968,\"source\":\"contracts/NFDRegistry.algo.ts:298\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(parentAppId).globalState(NFD_KEY_OWNER)\",\"pc\":[1128]},{\"teal\":972,\"source\":\"contracts/NFDRegistry.algo.ts:297\",\"errorMessage\":\"only owner of root can mint segments if segments are locked\",\"pc\":[1130]},{\"teal\":996,\"source\":\"contracts/NFDRegistry.algo.ts:306\",\"errorMessage\":\"price can never be 0\",\"pc\":[1154]},{\"teal\":1052,\"source\":\"contracts/NFDRegistry.algo.ts:315\",\"errorMessage\":\"if linking on mint, the buyer MUST be who will be the owner (reservedFor)\",\"pc\":[1208]},{\"teal\":1081,\"source\":\"contracts/NFDRegistry.algo.ts:322\",\"errorMessage\":\"payment transaction must be at least enough to cover 30 days of nfd cost + carry cost\",\"pc\":[1232]},{\"teal\":1090,\"source\":\"contracts/NFDRegistry.algo.ts:330\",\"errorMessage\":\"box value does not exist: this.boxes(REGISTRY_CONTRACT_BOX_CURRENT_CONTRACT).value\",\"pc\":[1236]},{\"teal\":1103,\"source\":\"contracts/NFDRegistry.algo.ts:333\",\"errorMessage\":\"box value does not exist: this.boxes(REGISTRY_CONTRACT_BOX_CURRENT_CONTRACT).value\",\"pc\":[1244]},{\"teal\":1115,\"source\":\"contracts/NFDRegistry.algo.ts:335\",\"errorMessage\":\"box value does not exist: this.boxes(concat(REGISTRY_CONTRACT_BOX_CLEAR_NAMEPREFIX, currentContractVer)).value\",\"pc\":[1254]},{\"teal\":1124,\"source\":\"contracts/NFDRegistry.algo.ts:336\",\"errorMessage\":\"box value does not exist: this.boxes(approvProgName).size\",\"pc\":[1260]},{\"teal\":1470,\"source\":\"contracts/NFDRegistry.algo.ts:425\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(parentAppId).globalState(NFD_KEY_VERSION)\",\"pc\":[1602]},{\"teal\":1475,\"source\":\"contracts/NFDRegistry.algo.ts:424\",\"errorMessage\":\"nfd root not 3.x must be version 2.12 in order for segment minting to succeed\",\"pc\":[1610]},{\"teal\":1768,\"source\":\"contracts/NFDRegistry.algo.ts:479\",\"errorMessage\":\"argument 0 (addrToVerify) for linkNfdAddress must be a address\",\"pc\":[1967]},{\"teal\":1804,\"source\":\"contracts/NFDRegistry.algo.ts:481\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(nfdAppId).globalState(NFD_KEY_OWNER)\",\"pc\":[1999]},{\"teal\":1814,\"source\":\"contracts/NFDRegistry.algo.ts:483\",\"errorMessage\":\"referenced NFD name/id must be valid\",\"pc\":[2009]},{\"teal\":1834,\"source\":\"contracts/NFDRegistry.algo.ts:489\",\"errorMessage\":\"verifying vault account, sender must be NFD owner\",\"pc\":[2026]},{\"teal\":1845,\"source\":\"contracts/NFDRegistry.algo.ts:492\",\"errorMessage\":\"app call sender must match address being added/removed\",\"pc\":[2035]},{\"teal\":1859,\"source\":\"contracts/NFDRegistry.algo.ts:495\",\"errorMessage\":\"nfd verified caAlgo.0.as must contain address being added/removed\",\"pc\":[2045]},{\"teal\":1878,\"source\":\"contracts/NFDRegistry.algo.ts:510\",\"errorMessage\":\"should add nfd to reverse address\",\"pc\":[2064]},{\"teal\":1899,\"source\":\"contracts/NFDRegistry.algo.ts:520\",\"errorMessage\":\"argument 0 (addrToUnlink) for unlinkNfdAddress must be a address\",\"pc\":[2083]},{\"teal\":1929,\"source\":\"contracts/NFDRegistry.algo.ts:521\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(nfdAppId).globalState(NFD_KEY_OWNER)\",\"pc\":[2108]},{\"teal\":1939,\"source\":\"contracts/NFDRegistry.algo.ts:523\",\"errorMessage\":\"referenced NFD name/id must be valid\",\"pc\":[2118]},{\"teal\":1969,\"source\":\"contracts/NFDRegistry.algo.ts:529\",\"errorMessage\":\"Sender unlinking must be NFD owner OR address removing itself\",\"pc\":[2148]},{\"teal\":1983,\"source\":\"contracts/NFDRegistry.algo.ts:534\",\"errorMessage\":\"nfd verified caAlgo.0.as must contain address being removed\",\"pc\":[2158]},{\"teal\":2085,\"source\":\"contracts/NFDRegistry.algo.ts:558\",\"errorMessage\":\"referenced NFD name/id must be valid\",\"pc\":[2257]},{\"teal\":2098,\"source\":\"contracts/NFDRegistry.algo.ts:560\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(nfdAppId).globalState(NFD_KEY_OWNER)\",\"pc\":[2264]},{\"teal\":2128,\"source\":\"contracts/NFDRegistry.algo.ts:579\",\"errorMessage\":\"argument 0 (buyer) for ownershipChanged must be a address\",\"pc\":[2291]},{\"teal\":2138,\"source\":\"contracts/NFDRegistry.algo.ts:579\",\"errorMessage\":\"argument 1 (seller) for ownershipChanged must be a address\",\"pc\":[2300]},{\"teal\":2191,\"source\":\"contracts/NFDRegistry.algo.ts:583\",\"errorMessage\":\"referenced NFD name/id must be valid\",\"pc\":[2337]},{\"teal\":2201,\"source\":\"contracts/NFDRegistry.algo.ts:584\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(nfdAppId).globalState(NFD_KEY_VERSION)\",\"pc\":[2343]},{\"teal\":2216,\"source\":\"contracts/NFDRegistry.algo.ts:586\",\"errorMessage\":\"only txnlab can call this method to backfill ownership, 3.4+ handles it by calling from the nfd itself\",\"pc\":[2358]},{\"teal\":2266,\"source\":\"contracts/NFDRegistry.algo.ts:609\",\"errorMessage\":\"argument 0 (addrBeingModified) for setAddressPrimaryNfd must be a address\",\"pc\":[2406]},{\"teal\":2302,\"source\":\"contracts/NFDRegistry.algo.ts:610\",\"errorMessage\":\"referenced NFD name/id must be valid\",\"pc\":[2433]},{\"teal\":2311,\"source\":\"contracts/NFDRegistry.algo.ts:611\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(nfdAppId).globalState(NFD_KEY_OWNER)\",\"pc\":[2438]},{\"teal\":2332,\"source\":\"contracts/NFDRegistry.algo.ts:617\",\"errorMessage\":\"if changing primary nfd for vault account, sender must be NFD owner\",\"pc\":[2457]},{\"teal\":2346,\"source\":\"contracts/NFDRegistry.algo.ts:620\",\"errorMessage\":\"app call sender must match address being updated to change primary NFD\",\"pc\":[2466]},{\"teal\":2428,\"source\":\"contracts/NFDRegistry.algo.ts:641\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(nfdAppId).globalState(NFD_KEY_OWNER)\",\"pc\":[2558]},{\"teal\":2438,\"source\":\"contracts/NFDRegistry.algo.ts:642\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(nfdAppId).globalState(NFD_KEY_NAME)\",\"pc\":[2566]},{\"teal\":2459,\"source\":\"contracts/NFDRegistry.algo.ts:643\",\"errorMessage\":\"only NFD owner or TxnLab can upgrade NFD\",\"pc\":[2586]},{\"teal\":2476,\"source\":\"contracts/NFDRegistry.algo.ts:652\",\"errorMessage\":\"box value does not exist: this.boxes(REGISTRY_CONTRACT_BOX_CURRENT_CONTRACT).value\",\"pc\":[2598]},{\"teal\":2489,\"source\":\"contracts/NFDRegistry.algo.ts:654\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(nfdAppId).globalState(NFD_KEY_VERSION)\",\"pc\":[2606]},{\"teal\":2494,\"source\":\"contracts/NFDRegistry.algo.ts:653\",\"errorMessage\":\"contract already at this version\",\"pc\":[2610]},{\"teal\":2506,\"source\":\"contracts/NFDRegistry.algo.ts:659\",\"errorMessage\":\"box value does not exist: this.boxes(REGISTRY_CONTRACT_BOX_CURRENT_CONTRACT).value\",\"pc\":[2616]},{\"teal\":2518,\"source\":\"contracts/NFDRegistry.algo.ts:661\",\"errorMessage\":\"box value does not exist: this.boxes(concat(REGISTRY_CONTRACT_BOX_CLEAR_NAMEPREFIX, currentContractVer)).value\",\"pc\":[2626]},{\"teal\":2527,\"source\":\"contracts/NFDRegistry.algo.ts:662\",\"errorMessage\":\"box value does not exist: this.boxes(approvProgName).size\",\"pc\":[2632]},{\"teal\":2730,\"source\":\"contracts/NFDRegistry.algo.ts:697\",\"errorMessage\":\"box value does not exist: this.boxes(boxName).value\",\"pc\":[2809]},{\"teal\":2768,\"source\":\"contracts/NFDRegistry.algo.ts:702\",\"errorMessage\":\"argument 0 (lookupAddress) for getAddressAppIds must be a address\",\"pc\":[2837]},{\"teal\":2827,\"source\":\"contracts/NFDRegistry.algo.ts:708\",\"errorMessage\":\"box value does not exist: this.boxes(boxName).value\",\"pc\":[2888]},{\"teal\":3056,\"source\":\"contracts/NFDRegistry.algo.ts:758\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(this.algoUsdOracleAppId).globalState('ts')\",\"pc\":[3084]},{\"teal\":3066,\"source\":\"contracts/NFDRegistry.algo.ts:759\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(this.algoUsdOracleAppId).globalState('decimals')\",\"pc\":[3100]},{\"teal\":3076,\"source\":\"contracts/NFDRegistry.algo.ts:760\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(this.algoUsdOracleAppId).globalState('price')\",\"pc\":[3113]},{\"teal\":3141,\"source\":\"contracts/NFDRegistry.algo.ts:777\",\"errorMessage\":\"argument 0 (lookupAddress) for costToAddToAddress must be a address\",\"pc\":[3195]},{\"teal\":3383,\"source\":\"contracts/NFDRegistry.algo.ts:847\",\"errorMessage\":\"box value does not exist: this.boxes(key).value\",\"pc\":[3429]},{\"teal\":3494,\"source\":\"contracts/NFDRegistry.algo.ts:864\",\"errorMessage\":\"box value does not exist: this.boxes(key).value\",\"pc\":[3516]},{\"teal\":3900,\"source\":\"contracts/NFDRegistry.algo.ts:965\",\"errorMessage\":\"box value does not exist: this.boxes(boxName).value\",\"pc\":[3918]},{\"teal\":3922,\"source\":\"contracts/NFDRegistry.algo.ts:974\",\"errorMessage\":\"must be existing v1 name\",\"pc\":[3935]},{\"teal\":3932,\"source\":\"contracts/NFDRegistry.algo.ts:979\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(btoi(this.txn.applicationArgs![2])).globalState(REGISTRY_KEY_ASAID)\",\"pc\":[3950]},{\"teal\":4106,\"source\":\"contracts/NFDRegistry.algo.ts:1032\",\"errorMessage\":\"NFD already exists with this name\",\"pc\":[4102]},{\"teal\":4134,\"source\":\"contracts/NFDRegistry.algo.ts:1038\",\"errorMessage\":\"NFD has already been minted!\",\"pc\":[4122]},{\"teal\":4206,\"source\":\"contracts/NFDRegistry.algo.ts:1055\",\"errorMessage\":\"box value does not exist: this.boxes(key).value\",\"pc\":[4184]},{\"teal\":4224,\"source\":\"contracts/NFDRegistry.algo.ts:1059\",\"errorMessage\":\"int (appid) 'set' should already have at least two values\",\"pc\":[4198]},{\"teal\":4307,\"source\":\"contracts/NFDRegistry.algo.ts:1073\",\"errorMessage\":\"int (app id) must be found in set in order to move it\",\"pc\":[4267]},{\"teal\":4363,\"source\":\"contracts/NFDRegistry.algo.ts:1084\",\"errorMessage\":\"box value does not exist: this.boxes(key).value\",\"pc\":[4311]},{\"teal\":4742,\"source\":\"contracts/NFDRegistry.algo.ts:1166\",\"errorMessage\":\"if not at least 6 chars can't be valid - minimum length to have .algo\",\"pc\":[4637]},{\"teal\":4756,\"source\":\"contracts/NFDRegistry.algo.ts:1167\",\"errorMessage\":\"string must end w/ .algo\",\"pc\":[4656]},{\"teal\":4851,\"source\":\"contracts/NFDRegistry.algo.ts:1182\",\"errorMessage\":\"must be 1-27 chars in nfd root or segment name\",\"pc\":[4739]},{\"teal\":4895,\"source\":\"contracts/NFDRegistry.algo.ts:1185\",\"errorMessage\":\"must be 1-27 chars and at end of string\",\"pc\":[4781]},{\"teal\":4900,\"source\":\"contracts/NFDRegistry.algo.ts:1190\",\"errorMessage\":\"too many '.' chars in name\",\"pc\":[4785]},{\"teal\":4949,\"source\":\"contracts/NFDRegistry.algo.ts:1198\",\"errorMessage\":\"invalid character in name\",\"pc\":[4836]},{\"teal\":5089,\"source\":\"contracts/NFDRegistry.algo.ts:1219\",\"errorMessage\":\"box value does not exist: this.boxes(boxName).value\",\"pc\":[4971]},{\"teal\":5160,\"source\":\"contracts/NFDRegistry.algo.ts:1232\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(appId).globalState(key)\",\"pc\":[5031]},{\"teal\":5192,\"source\":\"contracts/NFDRegistry.algo.ts:1239\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(appId).globalState(key)\",\"pc\":[5054]},{\"teal\":5258,\"source\":\"contracts/NFDRegistry.algo.ts:1272\",\"errorMessage\":\"parent nfd/id must be found\",\"pc\":[5095]},{\"teal\":5325,\"source\":\"contracts/NFDRegistry.algo.ts:1287\",\"errorMessage\":\"segment mint cost must be at least NFD_MIN_SEGMENT_USD\",\"pc\":[5178]},{\"teal\":5426,\"source\":\"contracts/NFDRegistry.algo.ts:1309\",\"errorMessage\":\"invalid cost calc\",\"pc\":[5284]},{\"teal\":5476,\"source\":\"contracts/NFDRegistry.algo.ts:1320\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(nfdAppId).globalState(NFD_KEY_OWNER)\",\"pc\":[5327]},{\"teal\":5633,\"source\":\"contracts/NFDRegistry.algo.ts:1351\",\"errorMessage\":\"price always needs to be at least 1 algo\",\"pc\":[5480]},{\"teal\":6086,\"source\":\"contracts/NFDRegistry.algo.ts:1456\",\"errorMessage\":\"lsig has to have i.appid localstate\",\"pc\":[5951]},{\"teal\":6159,\"source\":\"contracts/NFDRegistry.algo.ts:1479\",\"errorMessage\":\"box value does not exist: this.boxes(boxName).value\",\"pc\":[6024]},{\"teal\":6168,\"source\":\"contracts/NFDRegistry.algo.ts:1480\",\"errorMessage\":\"box value does not exist: this.boxes(boxName).size\",\"pc\":[6030]},{\"teal\":6227,\"source\":\"contracts/NFDRegistry.algo.ts:1487\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(nfdAppId).globalState(NFD_KEY_NAME)\",\"pc\":[6076]},{\"teal\":6306,\"source\":\"contracts/NFDRegistry.algo.ts:1505\",\"errorMessage\":\"max expiration exceeded parameters defined by registry\",\"pc\":[6138]},{\"teal\":6333,\"source\":\"contracts/NFDRegistry.algo.ts:1513\",\"errorMessage\":\"global state value does not exist: AppID.fromUint64(appId).globalState(NFD_KEY_VERSION)\",\"pc\":[6155]},{\"teal\":6364,\"source\":\"contracts/NFDRegistry.algo.ts:51\",\"errorMessage\":\"this contract does not implement the given ABI method for create NoOp\",\"pc\":[6198]}],\"pcOffsetMethod\":\"cblocks\"},\"clear\":{\"sourceInfo\":[],\"pcOffsetMethod\":\"none\"}},\"templateVariables\":{\"adminAsaId\":{\"type\":\"uint64\"},\"nfdTreasuryAddr\":{\"type\":\"address\"},\"nfdCommission1Addr\":{\"type\":\"address\"},\"nfdCommission1Rate\":{\"type\":\"uint64\"},\"algoUsdOracleAppId\":{\"type\":\"uint64\"},\"developmentAllowShortMints\":{\"type\":\"uint64\"}},\"scratchVariables\":{\"adminAsaId\":{\"type\":\"uint64\",\"slot\":200},\"nfdTreasuryAddr\":{\"type\":\"address\",\"slot\":201},\"nfdCommission1Addr\":{\"type\":\"address\",\"slot\":202},\"nfdCommission1Rate\":{\"type\":\"uint64\",\"slot\":203},\"algoUsdOracleAppId\":{\"type\":\"uint64\",\"slot\":204},\"developmentAllowShortMints\":{\"type\":\"uint64\",\"slot\":205}},\"compilerInfo\":{\"compiler\":\"algod\",\"compilerVersion\":{\"major\":3,\"minor\":27,\"patch\":237217,\"commitHash\":\"0bc3d7e4\"}}} as unknown as Arc56Contract\n\n/**\n * A state record containing binary data\n */\nexport interface BinaryState {\n  /**\n   * Gets the state value as a Uint8Array\n   */\n  asByteArray(): Uint8Array | undefined\n  /**\n   * Gets the state value as a string\n   */\n  asString(): string | undefined\n}\n\nclass BinaryStateValue implements BinaryState {\n  constructor(private value: Uint8Array | undefined) {}\n\n  asByteArray(): Uint8Array | undefined {\n    return this.value\n  }\n\n  asString(): string | undefined {\n    return this.value !== undefined ? Buffer.from(this.value).toString('utf-8') : undefined\n  }\n}\n\n/**\n * Expands types for IntelliSense so they are more human readable\n * See https://stackoverflow.com/a/69288824\n */\nexport type Expand<T> = T extends (...args: infer A) => infer R\n  ? (...args: Expand<A>) => Expand<R>\n  : T extends infer O\n    ? { [K in keyof O]: O[K] }\n    : never\n\n\n// Type definitions for ARC-56 structs\n\nexport type PriceInfo = {\n  oneYearPrice: bigint,\n  carryCost: bigint,\n  exists: boolean,\n  isExpired: boolean,\n  inAuction: boolean\n}\n\n\n/**\n * Converts the ABI tuple representation of a PriceInfo to the struct representation\n */\nexport function PriceInfoFromTuple(abiTuple: [bigint, bigint, boolean, boolean, boolean]) {\n  return getABIStructFromABITuple(abiTuple, APP_SPEC.structs.PriceInfo, APP_SPEC.structs) as PriceInfo\n}\n\nexport type Constraints = {\n  segmentPlatformCostInUsd: bigint,\n  segmentPlatformCostInAlgo: bigint,\n  maxYearsAllowed: bigint,\n  treasuryAddress: string,\n  expiredAuctionDuration: bigint,\n  expiredStartingPrice: bigint,\n  maxMintCarryCost: bigint\n}\n\n\n/**\n * Converts the ABI tuple representation of a Constraints to the struct representation\n */\nexport function ConstraintsFromTuple(abiTuple: [bigint, bigint, bigint, string, bigint, bigint, bigint]) {\n  return getABIStructFromABITuple(abiTuple, APP_SPEC.structs.Constraints, APP_SPEC.structs) as Constraints\n}\n\nexport type LinkOnMintExtraMbrCosts = {\n  linkingNfdMbrCost: bigint,\n  linkingRegistryMbrCost: bigint\n}\n\n\n/**\n * Converts the ABI tuple representation of a LinkOnMintExtraMbrCosts to the struct representation\n */\nexport function LinkOnMintExtraMbrCostsFromTuple(abiTuple: [bigint, bigint]) {\n  return getABIStructFromABITuple(abiTuple, APP_SPEC.structs.LinkOnMintExtraMbrCosts, APP_SPEC.structs) as LinkOnMintExtraMbrCosts\n}\n\n/**\n * Deploy-time template variables\n */\nexport type TemplateVariables = {\n  adminAsaId: bigint,\n  nfdTreasuryAddr: string,\n  nfdCommission1Addr: string,\n  nfdCommission1Rate: bigint,\n  algoUsdOracleAppId: bigint,\n  developmentAllowShortMints: bigint,\n}\n\n/**\n * The argument types for the NfdRegistry contract\n */\nexport type NfdRegistryArgs = {\n  /**\n   * The object representation of the arguments for each method\n   */\n  obj: {\n    'updateApplication()void': Record<string, never>\n    'gas()void': Record<string, never>\n    'getPrice(string,address)(uint64,uint64,bool,bool,bool)': {\n      /**\n       * The NFD name for which to retrieve the price.\n       */\n      nfdName: string\n      /**\n      * the address this request is on behalf of (since an nfd contract might call us it\n      needs to be able to pass on the request on behalf of ITS caller - ie: getting price for an expired nfd will be\n      different if its owner ir asking.\n      PriceInfo Type containing the price, carry cost, etc.\n\n       */\n      caller: string\n    }\n    'getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)': Record<string, never>\n    'getNfdMbrCost(string)uint64': {\n      nfdName: string\n    }\n    'getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)': {\n      address: string\n    }\n    'mintNfd(pay,string,address,bool)uint64': {\n      /**\n       * The payment transaction covering the purchase amount of the nfd\n       */\n      purchaseTxn: AppMethodCallTransactionArgument\n      /**\n       * The name of the NFD to mint\n       */\n      nfdName: string\n      /**\n       * The address that will own the NFD once minted (so you can buy for someone else)\n       */\n      reservedFor: string\n      /**\n      * whether to auto-link the address (reserved for MUST MATCH payer!) at mint\n      uint64 - The ID of the newly created NFD instance.\n\n       */\n      linkOnMint: boolean\n    }\n    'linkNfdAddress(string,uint64,address)void': {\n      nfdName: string\n      nfdAppId: bigint | number\n      addrToVerify: string\n    }\n    'unlinkNfdAddress(string,uint64,address)void': {\n      nfdName: string\n      nfdAppId: bigint | number\n      addrToUnlink: string\n    }\n    'ownershipAssign(string,uint64)void': {\n      nfdName: string\n      nfdAppId: bigint | number\n    }\n    'ownershipChanged(string,uint64,address,address)void': {\n      /**\n       * The name of the NFD.\n       */\n      nfdName: string\n      /**\n       * The unique application ID of the NFD.\n       */\n      nfdAppId: bigint | number\n      /**\n       * The address of the prior owner (seller) of the nfd\n       */\n      seller: string\n      /**\n       * The address of the new owner of the NFD.\n       */\n      buyer: string\n    }\n    'setAddressPrimaryNfd(string,uint64,address)void': {\n      nfdName: string\n      nfdAppId: bigint | number\n      addrBeingModified: string\n    }\n    'upgradeNfd(string)string': {\n      nfdName: string\n    }\n    'isValidNfdAppId(string,uint64)bool': {\n      nfdName: string\n      nfdAppId: bigint | number\n    }\n    'getNameAppId(string)uint64': {\n      nfdName: string\n    }\n    'getAddressAppIds(address)uint64[]': {\n      lookupAddress: string\n    }\n    'nfdContractInit(string,uint64,byte[])void': {\n      /**\n       * The version of the contract.\n       */\n      version: string\n      /**\n       * exact byte size of contract to load\n       */\n      size: bigint | number\n      /**\n       * bytes of clear code\n       */\n      clearCode: Uint8Array\n    }\n    'nfdContractLoad(string,uint64,byte[])void': {\n      /**\n       * The version of the contract.\n       */\n      version: string\n      /**\n       * The offset at which to replace the contract data within the box.\n       */\n      offset: bigint | number\n      /**\n       * The contract data to be loaded.\n       */\n      data: Uint8Array\n    }\n    'nfdContractCommit(string)void': {\n      /**\n       * The version number of the contract to be committed.\n       */\n      version: string\n    }\n    'usdInMicroAlgo(uint64)uint64': {\n      usdCost: bigint | number\n    }\n    'costToAddToAddress(address)uint64': {\n      /**\n       * The address to add the NFD app id to\n       */\n      lookupAddress: string\n    }\n    'calcFuturePrice(uint64,uint64)uint64': {\n      /**\n       * The current price in USD (in decimals). For example, if the current price is $2.00, the value should be 200.\n       */\n      curPrice: bigint | number\n      /**\n      * The timestamp to calc the future price based on - ie: 1 year past 'go live date' the price would have inflated by 1 year.\n      \n      \n      uint64 The future price calculated based on the current price and the specified number of years.\n\n       */\n      forTime: bigint | number\n    }\n    'createApplication()void': Record<string, never>\n  }\n  /**\n   * The tuple representation of the arguments for each method\n   */\n  tuple: {\n    'updateApplication()void': []\n    'gas()void': []\n    'getPrice(string,address)(uint64,uint64,bool,bool,bool)': [nfdName: string, caller: string]\n    'getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)': []\n    'getNfdMbrCost(string)uint64': [nfdName: string]\n    'getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)': [address: string]\n    'mintNfd(pay,string,address,bool)uint64': [purchaseTxn: AppMethodCallTransactionArgument, nfdName: string, reservedFor: string, linkOnMint: boolean]\n    'linkNfdAddress(string,uint64,address)void': [nfdName: string, nfdAppId: bigint | number, addrToVerify: string]\n    'unlinkNfdAddress(string,uint64,address)void': [nfdName: string, nfdAppId: bigint | number, addrToUnlink: string]\n    'ownershipAssign(string,uint64)void': [nfdName: string, nfdAppId: bigint | number]\n    'ownershipChanged(string,uint64,address,address)void': [nfdName: string, nfdAppId: bigint | number, seller: string, buyer: string]\n    'setAddressPrimaryNfd(string,uint64,address)void': [nfdName: string, nfdAppId: bigint | number, addrBeingModified: string]\n    'upgradeNfd(string)string': [nfdName: string]\n    'isValidNfdAppId(string,uint64)bool': [nfdName: string, nfdAppId: bigint | number]\n    'getNameAppId(string)uint64': [nfdName: string]\n    'getAddressAppIds(address)uint64[]': [lookupAddress: string]\n    'nfdContractInit(string,uint64,byte[])void': [version: string, size: bigint | number, clearCode: Uint8Array]\n    'nfdContractLoad(string,uint64,byte[])void': [version: string, offset: bigint | number, data: Uint8Array]\n    'nfdContractCommit(string)void': [version: string]\n    'usdInMicroAlgo(uint64)uint64': [usdCost: bigint | number]\n    'costToAddToAddress(address)uint64': [lookupAddress: string]\n    'calcFuturePrice(uint64,uint64)uint64': [curPrice: bigint | number, forTime: bigint | number]\n    'createApplication()void': []\n  }\n}\n\n/**\n * The return type for each method\n */\nexport type NfdRegistryReturns = {\n  'updateApplication()void': void\n  'gas()void': void\n  'getPrice(string,address)(uint64,uint64,bool,bool,bool)': PriceInfo\n  'getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)': Constraints\n  'getNfdMbrCost(string)uint64': bigint\n  'getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)': LinkOnMintExtraMbrCosts\n  'mintNfd(pay,string,address,bool)uint64': bigint\n  'linkNfdAddress(string,uint64,address)void': void\n  'unlinkNfdAddress(string,uint64,address)void': void\n  'ownershipAssign(string,uint64)void': void\n  'ownershipChanged(string,uint64,address,address)void': void\n  'setAddressPrimaryNfd(string,uint64,address)void': void\n  'upgradeNfd(string)string': string\n  'isValidNfdAppId(string,uint64)bool': boolean\n  'getNameAppId(string)uint64': bigint\n  'getAddressAppIds(address)uint64[]': bigint[]\n  'nfdContractInit(string,uint64,byte[])void': void\n  'nfdContractLoad(string,uint64,byte[])void': void\n  'nfdContractCommit(string)void': void\n  'usdInMicroAlgo(uint64)uint64': bigint\n  'costToAddToAddress(address)uint64': bigint\n  'calcFuturePrice(uint64,uint64)uint64': bigint\n  'createApplication()void': void\n}\n\n/**\n * Defines the types of available calls and state of the NfdRegistry smart contract.\n */\nexport type NfdRegistryTypes = {\n  /**\n   * Maps method signatures / names to their argument and return types.\n   */\n  methods:\n    & Record<'updateApplication()void' | 'updateApplication', {\n      argsObj: NfdRegistryArgs['obj']['updateApplication()void']\n      argsTuple: NfdRegistryArgs['tuple']['updateApplication()void']\n      returns: NfdRegistryReturns['updateApplication()void']\n    }>\n    & Record<'gas()void' | 'gas', {\n      argsObj: NfdRegistryArgs['obj']['gas()void']\n      argsTuple: NfdRegistryArgs['tuple']['gas()void']\n      returns: NfdRegistryReturns['gas()void']\n    }>\n    & Record<'getPrice(string,address)(uint64,uint64,bool,bool,bool)' | 'getPrice', {\n      argsObj: NfdRegistryArgs['obj']['getPrice(string,address)(uint64,uint64,bool,bool,bool)']\n      argsTuple: NfdRegistryArgs['tuple']['getPrice(string,address)(uint64,uint64,bool,bool,bool)']\n      returns: NfdRegistryReturns['getPrice(string,address)(uint64,uint64,bool,bool,bool)']\n    }>\n    & Record<'getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)' | 'getConstraints', {\n      argsObj: NfdRegistryArgs['obj']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)']\n      argsTuple: NfdRegistryArgs['tuple']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)']\n      returns: NfdRegistryReturns['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)']\n    }>\n    & Record<'getNfdMbrCost(string)uint64' | 'getNfdMbrCost', {\n      argsObj: NfdRegistryArgs['obj']['getNfdMbrCost(string)uint64']\n      argsTuple: NfdRegistryArgs['tuple']['getNfdMbrCost(string)uint64']\n      returns: NfdRegistryReturns['getNfdMbrCost(string)uint64']\n    }>\n    & Record<'getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)' | 'getNfdLinkOnMintExtraMbrCost', {\n      argsObj: NfdRegistryArgs['obj']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)']\n      argsTuple: NfdRegistryArgs['tuple']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)']\n      returns: NfdRegistryReturns['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)']\n    }>\n    & Record<'mintNfd(pay,string,address,bool)uint64' | 'mintNfd', {\n      argsObj: NfdRegistryArgs['obj']['mintNfd(pay,string,address,bool)uint64']\n      argsTuple: NfdRegistryArgs['tuple']['mintNfd(pay,string,address,bool)uint64']\n      returns: NfdRegistryReturns['mintNfd(pay,string,address,bool)uint64']\n    }>\n    & Record<'linkNfdAddress(string,uint64,address)void' | 'linkNfdAddress', {\n      argsObj: NfdRegistryArgs['obj']['linkNfdAddress(string,uint64,address)void']\n      argsTuple: NfdRegistryArgs['tuple']['linkNfdAddress(string,uint64,address)void']\n      returns: NfdRegistryReturns['linkNfdAddress(string,uint64,address)void']\n    }>\n    & Record<'unlinkNfdAddress(string,uint64,address)void' | 'unlinkNfdAddress', {\n      argsObj: NfdRegistryArgs['obj']['unlinkNfdAddress(string,uint64,address)void']\n      argsTuple: NfdRegistryArgs['tuple']['unlinkNfdAddress(string,uint64,address)void']\n      returns: NfdRegistryReturns['unlinkNfdAddress(string,uint64,address)void']\n    }>\n    & Record<'ownershipAssign(string,uint64)void' | 'ownershipAssign', {\n      argsObj: NfdRegistryArgs['obj']['ownershipAssign(string,uint64)void']\n      argsTuple: NfdRegistryArgs['tuple']['ownershipAssign(string,uint64)void']\n      returns: NfdRegistryReturns['ownershipAssign(string,uint64)void']\n    }>\n    & Record<'ownershipChanged(string,uint64,address,address)void' | 'ownershipChanged', {\n      argsObj: NfdRegistryArgs['obj']['ownershipChanged(string,uint64,address,address)void']\n      argsTuple: NfdRegistryArgs['tuple']['ownershipChanged(string,uint64,address,address)void']\n      returns: NfdRegistryReturns['ownershipChanged(string,uint64,address,address)void']\n    }>\n    & Record<'setAddressPrimaryNfd(string,uint64,address)void' | 'setAddressPrimaryNfd', {\n      argsObj: NfdRegistryArgs['obj']['setAddressPrimaryNfd(string,uint64,address)void']\n      argsTuple: NfdRegistryArgs['tuple']['setAddressPrimaryNfd(string,uint64,address)void']\n      returns: NfdRegistryReturns['setAddressPrimaryNfd(string,uint64,address)void']\n    }>\n    & Record<'upgradeNfd(string)string' | 'upgradeNfd', {\n      argsObj: NfdRegistryArgs['obj']['upgradeNfd(string)string']\n      argsTuple: NfdRegistryArgs['tuple']['upgradeNfd(string)string']\n      returns: NfdRegistryReturns['upgradeNfd(string)string']\n    }>\n    & Record<'isValidNfdAppId(string,uint64)bool' | 'isValidNfdAppId', {\n      argsObj: NfdRegistryArgs['obj']['isValidNfdAppId(string,uint64)bool']\n      argsTuple: NfdRegistryArgs['tuple']['isValidNfdAppId(string,uint64)bool']\n      returns: NfdRegistryReturns['isValidNfdAppId(string,uint64)bool']\n    }>\n    & Record<'getNameAppId(string)uint64' | 'getNameAppId', {\n      argsObj: NfdRegistryArgs['obj']['getNameAppId(string)uint64']\n      argsTuple: NfdRegistryArgs['tuple']['getNameAppId(string)uint64']\n      returns: NfdRegistryReturns['getNameAppId(string)uint64']\n    }>\n    & Record<'getAddressAppIds(address)uint64[]' | 'getAddressAppIds', {\n      argsObj: NfdRegistryArgs['obj']['getAddressAppIds(address)uint64[]']\n      argsTuple: NfdRegistryArgs['tuple']['getAddressAppIds(address)uint64[]']\n      returns: NfdRegistryReturns['getAddressAppIds(address)uint64[]']\n    }>\n    & Record<'nfdContractInit(string,uint64,byte[])void' | 'nfdContractInit', {\n      argsObj: NfdRegistryArgs['obj']['nfdContractInit(string,uint64,byte[])void']\n      argsTuple: NfdRegistryArgs['tuple']['nfdContractInit(string,uint64,byte[])void']\n      returns: NfdRegistryReturns['nfdContractInit(string,uint64,byte[])void']\n    }>\n    & Record<'nfdContractLoad(string,uint64,byte[])void' | 'nfdContractLoad', {\n      argsObj: NfdRegistryArgs['obj']['nfdContractLoad(string,uint64,byte[])void']\n      argsTuple: NfdRegistryArgs['tuple']['nfdContractLoad(string,uint64,byte[])void']\n      returns: NfdRegistryReturns['nfdContractLoad(string,uint64,byte[])void']\n    }>\n    & Record<'nfdContractCommit(string)void' | 'nfdContractCommit', {\n      argsObj: NfdRegistryArgs['obj']['nfdContractCommit(string)void']\n      argsTuple: NfdRegistryArgs['tuple']['nfdContractCommit(string)void']\n      returns: NfdRegistryReturns['nfdContractCommit(string)void']\n    }>\n    & Record<'usdInMicroAlgo(uint64)uint64' | 'usdInMicroAlgo', {\n      argsObj: NfdRegistryArgs['obj']['usdInMicroAlgo(uint64)uint64']\n      argsTuple: NfdRegistryArgs['tuple']['usdInMicroAlgo(uint64)uint64']\n      returns: NfdRegistryReturns['usdInMicroAlgo(uint64)uint64']\n    }>\n    & Record<'costToAddToAddress(address)uint64' | 'costToAddToAddress', {\n      argsObj: NfdRegistryArgs['obj']['costToAddToAddress(address)uint64']\n      argsTuple: NfdRegistryArgs['tuple']['costToAddToAddress(address)uint64']\n      returns: NfdRegistryReturns['costToAddToAddress(address)uint64']\n    }>\n    & Record<'calcFuturePrice(uint64,uint64)uint64' | 'calcFuturePrice', {\n      argsObj: NfdRegistryArgs['obj']['calcFuturePrice(uint64,uint64)uint64']\n      argsTuple: NfdRegistryArgs['tuple']['calcFuturePrice(uint64,uint64)uint64']\n      returns: NfdRegistryReturns['calcFuturePrice(uint64,uint64)uint64']\n    }>\n    & Record<'createApplication()void' | 'createApplication', {\n      argsObj: NfdRegistryArgs['obj']['createApplication()void']\n      argsTuple: NfdRegistryArgs['tuple']['createApplication()void']\n      returns: NfdRegistryReturns['createApplication()void']\n    }>\n  /**\n   * Defines the shape of the state of the application.\n   */\n  state: {\n    local: {\n      keys: {}\n      maps: {\n        localState: Map<Uint8Array | string, Uint8Array>\n      }\n    }\n    box: {\n      keys: {}\n      maps: {\n        boxes: Map<Uint8Array | string, Uint8Array>\n      }\n    }\n  }\n}\n\n/**\n * Defines the possible abi call signatures.\n */\nexport type NfdRegistrySignatures = keyof NfdRegistryTypes['methods']\n/**\n * Defines the possible abi call signatures for methods that return a non-void value.\n */\nexport type NfdRegistryNonVoidMethodSignatures = keyof NfdRegistryTypes['methods'] extends infer T ? T extends keyof NfdRegistryTypes['methods'] ? MethodReturn<T> extends void ? never : T  : never : never\n/**\n * Defines an object containing all relevant parameters for a single call to the contract.\n */\nexport type CallParams<TArgs> = Expand<\n  Omit<AppClientMethodCallParams, 'method' | 'args' | 'onComplete'> &\n    {\n      /** The args for the ABI method call, either as an ordered array or an object */\n      args: Expand<TArgs>\n    }\n>\n/**\n * Maps a method signature from the NfdRegistry smart contract to the method's arguments in either tuple or struct form\n */\nexport type MethodArgs<TSignature extends NfdRegistrySignatures> = NfdRegistryTypes['methods'][TSignature]['argsObj' | 'argsTuple']\n/**\n * Maps a method signature from the NfdRegistry smart contract to the method's return type\n */\nexport type MethodReturn<TSignature extends NfdRegistrySignatures> = NfdRegistryTypes['methods'][TSignature]['returns']\n\n/**\n * Defines the shape of the keyed local state of the application.\n */\nexport type LocalKeysState = NfdRegistryTypes['state']['local']['keys']\n\n/**\n * Defines the shape of the keyed box state of the application.\n */\nexport type BoxKeysState = NfdRegistryTypes['state']['box']['keys']\n\n\n/**\n * Defines supported create method params for this smart contract\n */\nexport type NfdRegistryCreateCallParams =\n  | Expand<CallParams<NfdRegistryArgs['obj']['createApplication()void'] | NfdRegistryArgs['tuple']['createApplication()void']> & {method: 'createApplication'} & {onComplete?: OnApplicationComplete.NoOpOC} & CreateSchema>\n  | Expand<CallParams<NfdRegistryArgs['obj']['createApplication()void'] | NfdRegistryArgs['tuple']['createApplication()void']> & {method: 'createApplication()void'} & {onComplete?: OnApplicationComplete.NoOpOC} & CreateSchema>\n/**\n * Defines supported update method params for this smart contract\n */\nexport type NfdRegistryUpdateCallParams =\n  | Expand<CallParams<NfdRegistryArgs['obj']['updateApplication()void'] | NfdRegistryArgs['tuple']['updateApplication()void']> & {method: 'updateApplication'}>\n  | Expand<CallParams<NfdRegistryArgs['obj']['updateApplication()void'] | NfdRegistryArgs['tuple']['updateApplication()void']> & {method: 'updateApplication()void'}>\n/**\n * Defines arguments required for the deploy method.\n */\nexport type NfdRegistryDeployParams = Expand<Omit<AppFactoryDeployParams, 'createParams' | 'updateParams' | 'deleteParams'> & {\n  /**\n   * Create transaction parameters to use if a create needs to be issued as part of deployment; use `method` to define ABI call (if available) or leave out for a bare call (if available)\n   */\n  createParams?: NfdRegistryCreateCallParams\n  /**\n   * Update transaction parameters to use if a create needs to be issued as part of deployment; use `method` to define ABI call (if available) or leave out for a bare call (if available)\n   */\n  updateParams?: NfdRegistryUpdateCallParams\n}>\n\n\n/**\n * Exposes methods for constructing `AppClient` params objects for ABI calls to the NfdRegistry smart contract\n */\nexport abstract class NfdRegistryParamsFactory {\n  /**\n   * Gets available create ABI call param factories\n   */\n  static get create() {\n    return {\n      _resolveByMethod<TParams extends NfdRegistryCreateCallParams & {method: string}>(params: TParams) {\n        switch(params.method) {\n          case 'createApplication':\n          case 'createApplication()void':\n            return NfdRegistryParamsFactory.create.createApplication(params)\n        }\n        throw new Error(`Unknown ' + verb + ' method`)\n      },\n\n      /**\n       * Constructs create ABI call params for the NFDRegistry smart contract using the createApplication()void ABI method\n       *\n       * @param params Parameters for the call\n       * @returns An `AppClientMethodCallParams` object for the call\n       */\n      createApplication(params: CallParams<NfdRegistryArgs['obj']['createApplication()void'] | NfdRegistryArgs['tuple']['createApplication()void']> & AppClientCompilationParams & {onComplete?: OnApplicationComplete.NoOpOC}): AppClientMethodCallParams & AppClientCompilationParams & {onComplete?: OnApplicationComplete.NoOpOC} {\n        return {\n          ...params,\n          method: 'createApplication()void' as const,\n          args: Array.isArray(params.args) ? params.args : [],\n        }\n      },\n    }\n  }\n\n  /**\n   * Gets available update ABI call param factories\n   */\n  static get update() {\n    return {\n      _resolveByMethod<TParams extends NfdRegistryUpdateCallParams & {method: string}>(params: TParams) {\n        switch(params.method) {\n          case 'updateApplication':\n          case 'updateApplication()void':\n            return NfdRegistryParamsFactory.update.updateApplication(params)\n        }\n        throw new Error(`Unknown ' + verb + ' method`)\n      },\n\n      /**\n       * Constructs update ABI call params for the NFDRegistry smart contract using the updateApplication()void ABI method\n       *\n       * @param params Parameters for the call\n       * @returns An `AppClientMethodCallParams` object for the call\n       */\n      updateApplication(params: CallParams<NfdRegistryArgs['obj']['updateApplication()void'] | NfdRegistryArgs['tuple']['updateApplication()void']> & AppClientCompilationParams): AppClientMethodCallParams & AppClientCompilationParams {\n        return {\n          ...params,\n          method: 'updateApplication()void' as const,\n          args: Array.isArray(params.args) ? params.args : [],\n        }\n      },\n    }\n  }\n\n  /**\n   * Constructs a no op call for the gas()void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static gas(params: CallParams<NfdRegistryArgs['obj']['gas()void'] | NfdRegistryArgs['tuple']['gas()void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'gas()void' as const,\n      args: Array.isArray(params.args) ? params.args : [],\n    }\n  }\n  /**\n   * Constructs a no op call for the getPrice(string,address)(uint64,uint64,bool,bool,bool) ABI method\n   *\n  * Returns the price for a given NFD (single year), the max # of years allowed (Name for Display),\n  and extra algo required to cover MBR when purchasing.\n\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static getPrice(params: CallParams<NfdRegistryArgs['obj']['getPrice(string,address)(uint64,uint64,bool,bool,bool)'] | NfdRegistryArgs['tuple']['getPrice(string,address)(uint64,uint64,bool,bool,bool)']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'getPrice(string,address)(uint64,uint64,bool,bool,bool)' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.nfdName, params.args.caller],\n    }\n  }\n  /**\n   * Constructs a no op call for the getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64) ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static getConstraints(params: CallParams<NfdRegistryArgs['obj']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)'] | NfdRegistryArgs['tuple']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)' as const,\n      args: Array.isArray(params.args) ? params.args : [],\n    }\n  }\n  /**\n   * Constructs a no op call for the getNfdMbrCost(string)uint64 ABI method\n   *\n  * Returns the MBR amounts needed to MINT an nfd.\n  This value needs to be added to purchase price in mintNfd call.\n  getPrice() returns it though.\n\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static getNfdMbrCost(params: CallParams<NfdRegistryArgs['obj']['getNfdMbrCost(string)uint64'] | NfdRegistryArgs['tuple']['getNfdMbrCost(string)uint64']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'getNfdMbrCost(string)uint64' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.nfdName],\n    }\n  }\n  /**\n   * Constructs a no op call for the getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64) ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static getNfdLinkOnMintExtraMbrCost(params: CallParams<NfdRegistryArgs['obj']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)'] | NfdRegistryArgs['tuple']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.address],\n    }\n  }\n  /**\n   * Constructs a no op call for the mintNfd(pay,string,address,bool)uint64 ABI method\n   *\n   * Mint an NFD (NFT) and create a new NFD instance.\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static mintNfd(params: CallParams<NfdRegistryArgs['obj']['mintNfd(pay,string,address,bool)uint64'] | NfdRegistryArgs['tuple']['mintNfd(pay,string,address,bool)uint64']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'mintNfd(pay,string,address,bool)uint64' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.purchaseTxn, params.args.nfdName, params.args.reservedFor, params.args.linkOnMint],\n    }\n  }\n  /**\n   * Constructs a no op call for the linkNfdAddress(string,uint64,address)void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static linkNfdAddress(params: CallParams<NfdRegistryArgs['obj']['linkNfdAddress(string,uint64,address)void'] | NfdRegistryArgs['tuple']['linkNfdAddress(string,uint64,address)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'linkNfdAddress(string,uint64,address)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.nfdName, params.args.nfdAppId, params.args.addrToVerify],\n    }\n  }\n  /**\n   * Constructs a no op call for the unlinkNfdAddress(string,uint64,address)void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static unlinkNfdAddress(params: CallParams<NfdRegistryArgs['obj']['unlinkNfdAddress(string,uint64,address)void'] | NfdRegistryArgs['tuple']['unlinkNfdAddress(string,uint64,address)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'unlinkNfdAddress(string,uint64,address)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.nfdName, params.args.nfdAppId, params.args.addrToUnlink],\n    }\n  }\n  /**\n   * Constructs a no op call for the ownershipAssign(string,uint64)void ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static ownershipAssign(params: CallParams<NfdRegistryArgs['obj']['ownershipAssign(string,uint64)void'] | NfdRegistryArgs['tuple']['ownershipAssign(string,uint64)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'ownershipAssign(string,uint64)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.nfdName, params.args.nfdAppId],\n    }\n  }\n  /**\n   * Constructs a no op call for the ownershipChanged(string,uint64,address,address)void ABI method\n   *\n  * This method is triggered when the ownership of an NFD (Non-Fungible Domain) changes.\n  It is called by the NFD via the purchase method.  It can also be called by TxnLab admin for older 3.3\n  NFDs when it detects purchased events for 3.3\n\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static ownershipChanged(params: CallParams<NfdRegistryArgs['obj']['ownershipChanged(string,uint64,address,address)void'] | NfdRegistryArgs['tuple']['ownershipChanged(string,uint64,address,address)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'ownershipChanged(string,uint64,address,address)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.nfdName, params.args.nfdAppId, params.args.seller, params.args.buyer],\n    }\n  }\n  /**\n   * Constructs a no op call for the setAddressPrimaryNfd(string,uint64,address)void ABI method\n   *\n  * Makes the specified NFD the 'first' NFD in the reverse-address set so its the primary NFD for this address.\n  The NFD must be valid, and the sender must be the address (or nfd owner if vault).  The NFD wouldn't already be\n  in the reverse-lookup set if it wasn't already valid.\n\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static setAddressPrimaryNfd(params: CallParams<NfdRegistryArgs['obj']['setAddressPrimaryNfd(string,uint64,address)void'] | NfdRegistryArgs['tuple']['setAddressPrimaryNfd(string,uint64,address)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'setAddressPrimaryNfd(string,uint64,address)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.nfdName, params.args.nfdAppId, params.args.addrBeingModified],\n    }\n  }\n  /**\n   * Constructs a no op call for the upgradeNfd(string)string ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static upgradeNfd(params: CallParams<NfdRegistryArgs['obj']['upgradeNfd(string)string'] | NfdRegistryArgs['tuple']['upgradeNfd(string)string']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'upgradeNfd(string)string' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.nfdName],\n    }\n  }\n  /**\n   * Constructs a no op call for the isValidNfdAppId(string,uint64)bool ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static isValidNfdAppId(params: CallParams<NfdRegistryArgs['obj']['isValidNfdAppId(string,uint64)bool'] | NfdRegistryArgs['tuple']['isValidNfdAppId(string,uint64)bool']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'isValidNfdAppId(string,uint64)bool' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.nfdName, params.args.nfdAppId],\n    }\n  }\n  /**\n   * Constructs a no op call for the getNameAppId(string)uint64 ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static getNameAppId(params: CallParams<NfdRegistryArgs['obj']['getNameAppId(string)uint64'] | NfdRegistryArgs['tuple']['getNameAppId(string)uint64']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'getNameAppId(string)uint64' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.nfdName],\n    }\n  }\n  /**\n   * Constructs a no op call for the getAddressAppIds(address)uint64[] ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static getAddressAppIds(params: CallParams<NfdRegistryArgs['obj']['getAddressAppIds(address)uint64[]'] | NfdRegistryArgs['tuple']['getAddressAppIds(address)uint64[]']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'getAddressAppIds(address)uint64[]' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.lookupAddress],\n    }\n  }\n  /**\n   * Constructs a no op call for the nfdContractInit(string,uint64,byte[])void ABI method\n   *\n   * Initializes the NFD contract bytecode into the registry\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static nfdContractInit(params: CallParams<NfdRegistryArgs['obj']['nfdContractInit(string,uint64,byte[])void'] | NfdRegistryArgs['tuple']['nfdContractInit(string,uint64,byte[])void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'nfdContractInit(string,uint64,byte[])void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.version, params.args.size, params.args.clearCode],\n    }\n  }\n  /**\n   * Constructs a no op call for the nfdContractLoad(string,uint64,byte[])void ABI method\n   *\n   * Loads contract data into the  box at the specified offset.\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static nfdContractLoad(params: CallParams<NfdRegistryArgs['obj']['nfdContractLoad(string,uint64,byte[])void'] | NfdRegistryArgs['tuple']['nfdContractLoad(string,uint64,byte[])void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'nfdContractLoad(string,uint64,byte[])void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.version, params.args.offset, params.args.data],\n    }\n  }\n  /**\n   * Constructs a no op call for the nfdContractCommit(string)void ABI method\n   *\n   * Commit a new version of the contract.\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static nfdContractCommit(params: CallParams<NfdRegistryArgs['obj']['nfdContractCommit(string)void'] | NfdRegistryArgs['tuple']['nfdContractCommit(string)void']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'nfdContractCommit(string)void' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.version],\n    }\n  }\n  /**\n   * Constructs a no op call for the usdInMicroAlgo(uint64)uint64 ABI method\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static usdInMicroAlgo(params: CallParams<NfdRegistryArgs['obj']['usdInMicroAlgo(uint64)uint64'] | NfdRegistryArgs['tuple']['usdInMicroAlgo(uint64)uint64']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'usdInMicroAlgo(uint64)uint64' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.usdCost],\n    }\n  }\n  /**\n   * Constructs a no op call for the costToAddToAddress(address)uint64 ABI method\n   *\n   * Returns the cost to add an NFD to the reverse-lookup data\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static costToAddToAddress(params: CallParams<NfdRegistryArgs['obj']['costToAddToAddress(address)uint64'] | NfdRegistryArgs['tuple']['costToAddToAddress(address)uint64']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'costToAddToAddress(address)uint64' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.lookupAddress],\n    }\n  }\n  /**\n   * Constructs a no op call for the calcFuturePrice(uint64,uint64)uint64 ABI method\n   *\n   * Calculates the future price based on the current price and the number of years.\n   *\n   * @param params Parameters for the call\n   * @returns An `AppClientMethodCallParams` object for the call\n   */\n  static calcFuturePrice(params: CallParams<NfdRegistryArgs['obj']['calcFuturePrice(uint64,uint64)uint64'] | NfdRegistryArgs['tuple']['calcFuturePrice(uint64,uint64)uint64']> & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n    return {\n      ...params,\n      method: 'calcFuturePrice(uint64,uint64)uint64' as const,\n      args: Array.isArray(params.args) ? params.args : [params.args.curPrice, params.args.forTime],\n    }\n  }\n}\n\n/**\n * A factory to create and deploy one or more instance of the NFDRegistry smart contract and to create one or more app clients to interact with those (or other) app instances\n */\nexport class NfdRegistryFactory {\n  /**\n   * The underlying `AppFactory` for when you want to have more flexibility\n   */\n  public readonly appFactory: _AppFactory\n\n  /**\n   * Creates a new instance of `NfdRegistryFactory`\n   *\n   * @param params The parameters to initialise the app factory with\n   */\n  constructor(params: Omit<AppFactoryParams, 'appSpec'>) {\n    this.appFactory = new _AppFactory({\n      ...params,\n      appSpec: APP_SPEC,\n    })\n  }\n  \n  /** The name of the app (from the ARC-32 / ARC-56 app spec or override). */\n  public get appName() {\n    return this.appFactory.appName\n  }\n  \n  /** The ARC-56 app spec being used */\n  get appSpec() {\n    return APP_SPEC\n  }\n  \n  /** A reference to the underlying `AlgorandClient` this app factory is using. */\n  public get algorand(): AlgorandClientInterface {\n    return this.appFactory.algorand\n  }\n  \n  /**\n   * Returns a new `AppClient` client for an app instance of the given ID.\n   *\n   * Automatically populates appName, defaultSender and source maps from the factory\n   * if not specified in the params.\n   * @param params The parameters to create the app client\n   * @returns The `AppClient`\n   */\n  public getAppClientById(params: AppFactoryAppClientParams) {\n    return new NfdRegistryClient(this.appFactory.getAppClientById(params))\n  }\n  \n  /**\n   * Returns a new `AppClient` client, resolving the app by creator address and name\n   * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).\n   *\n   * Automatically populates appName, defaultSender and source maps from the factory\n   * if not specified in the params.\n   * @param params The parameters to create the app client\n   * @returns The `AppClient`\n   */\n  public async getAppClientByCreatorAndName(\n    params: AppFactoryResolveAppClientByCreatorAndNameParams,\n  ) {\n    return new NfdRegistryClient(await this.appFactory.getAppClientByCreatorAndName(params))\n  }\n\n  /**\n   * Idempotently deploys the NFDRegistry smart contract.\n   *\n   * @param params The arguments for the contract calls and any additional parameters for the call\n   * @returns The deployment result\n   */\n  public async deploy(params: NfdRegistryDeployParams = {}) {\n    const result = await this.appFactory.deploy({\n      ...params,\n      createParams: params.createParams?.method ? NfdRegistryParamsFactory.create._resolveByMethod(params.createParams) : params.createParams ? params.createParams as (NfdRegistryCreateCallParams & { args: Uint8Array[] }) : undefined,\n      updateParams: params.updateParams?.method ? NfdRegistryParamsFactory.update._resolveByMethod(params.updateParams) : params.updateParams ? params.updateParams as (NfdRegistryUpdateCallParams & { args: Uint8Array[] }) : undefined,\n    })\n    return { result: result.result, appClient: new NfdRegistryClient(result.appClient) }\n  }\n\n  /**\n   * Get parameters to create transactions (create and deploy related calls) for the current app. A good mental model for this is that these parameters represent a deferred transaction creation.\n   */\n  readonly params = {\n    /**\n     * Gets available create methods\n     */\n    create: {\n      /**\n       * Creates a new instance of the NFDRegistry smart contract using the createApplication()void ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The create params\n       */\n      createApplication: (params: CallParams<NfdRegistryArgs['obj']['createApplication()void'] | NfdRegistryArgs['tuple']['createApplication()void']> & AppClientCompilationParams & CreateSchema & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n        return this.appFactory.params.create(NfdRegistryParamsFactory.create.createApplication(params))\n      },\n    },\n\n    /**\n     * Gets available deployUpdate methods\n     */\n    deployUpdate: {\n      /**\n       * Updates an existing instance of the NFDRegistry smart contract using the updateApplication()void ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The deployUpdate params\n       */\n      updateApplication: (params: CallParams<NfdRegistryArgs['obj']['updateApplication()void'] | NfdRegistryArgs['tuple']['updateApplication()void']> & AppClientCompilationParams = {args: []}) => {\n        return this.appFactory.params.deployUpdate(NfdRegistryParamsFactory.update.updateApplication(params))\n      },\n    },\n\n  }\n\n  /**\n   * Create transactions for the current app\n   */\n  readonly createTransaction = {\n    /**\n     * Gets available create methods\n     */\n    create: {\n      /**\n       * Creates a new instance of the NFDRegistry smart contract using the createApplication()void ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The create transaction\n       */\n      createApplication: (params: CallParams<NfdRegistryArgs['obj']['createApplication()void'] | NfdRegistryArgs['tuple']['createApplication()void']> & AppClientCompilationParams & CreateSchema & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n        return this.appFactory.createTransaction.create(NfdRegistryParamsFactory.create.createApplication(params))\n      },\n    },\n\n  }\n\n  /**\n   * Send calls to the current app\n   */\n  readonly send = {\n    /**\n     * Gets available create methods\n     */\n    create: {\n      /**\n       * Creates a new instance of the NFDRegistry smart contract using an ABI method call using the createApplication()void ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The create result\n       */\n      createApplication: async (params: CallParams<NfdRegistryArgs['obj']['createApplication()void'] | NfdRegistryArgs['tuple']['createApplication()void']> & AppClientCompilationParams & CreateSchema & SendParams & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n        const result = await this.appFactory.send.create(NfdRegistryParamsFactory.create.createApplication(params))\n        return { result: { ...result.result, return: result.result.return as unknown as (undefined | NfdRegistryReturns['createApplication()void']) }, appClient: new NfdRegistryClient(result.appClient) }\n      },\n    },\n\n  }\n\n}\n/**\n * A client to make calls to the NFDRegistry smart contract\n */\nexport class NfdRegistryClient {\n  /**\n   * The underlying `AppClient` for when you want to have more flexibility\n   */\n  public readonly appClient: _AppClient\n\n  /**\n   * Creates a new instance of `NfdRegistryClient`\n   *\n   * @param appClient An `AppClient` instance which has been created with the NfdRegistry app spec\n   */\n  constructor(appClient: _AppClient)\n  /**\n   * Creates a new instance of `NfdRegistryClient`\n   *\n   * @param params The parameters to initialise the app client with\n   */\n  constructor(params: Omit<AppClientParams, 'appSpec'>)\n  constructor(appClientOrParams: _AppClient | Omit<AppClientParams, 'appSpec'>) {\n    this.appClient = appClientOrParams instanceof _AppClient ? appClientOrParams : new _AppClient({\n      ...appClientOrParams,\n      appSpec: APP_SPEC,\n    })\n  }\n  \n  /**\n   * Checks for decode errors on the given return value and maps the return value to the return type for the given method\n   * @returns The typed return value or undefined if there was no value\n   */\n  decodeReturnValue<TSignature extends NfdRegistryNonVoidMethodSignatures>(method: TSignature, returnValue: ABIReturn | undefined) {\n    return returnValue !== undefined ? getArc56ReturnValue<MethodReturn<TSignature>>(returnValue, this.appClient.getABIMethod(method), APP_SPEC.structs) : undefined\n  }\n  \n  /**\n   * Returns a new `NfdRegistryClient` client, resolving the app by creator address and name\n   * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).\n   * @param params The parameters to create the app client\n   */\n  public static async fromCreatorAndName(params: Omit<ResolveAppClientByCreatorAndName, 'appSpec'>): Promise<NfdRegistryClient> {\n    return new NfdRegistryClient(await _AppClient.fromCreatorAndName({...params, appSpec: APP_SPEC}))\n  }\n  \n  /**\n   * Returns an `NfdRegistryClient` instance for the current network based on\n   * pre-determined network-specific app IDs specified in the ARC-56 app spec.\n   *\n   * If no IDs are in the app spec or the network isn't recognised, an error is thrown.\n   * @param params The parameters to create the app client\n   */\n  static async fromNetwork(\n    params: Omit<ResolveAppClientByNetwork, 'appSpec'>\n  ): Promise<NfdRegistryClient> {\n    return new NfdRegistryClient(await _AppClient.fromNetwork({...params, appSpec: APP_SPEC}))\n  }\n  \n  /** The ID of the app instance this client is linked to. */\n  public get appId() {\n    return this.appClient.appId\n  }\n  \n  /** The app address of the app instance this client is linked to. */\n  public get appAddress() {\n    return this.appClient.appAddress\n  }\n  \n  /** The name of the app. */\n  public get appName() {\n    return this.appClient.appName\n  }\n  \n  /** The ARC-56 app spec being used */\n  public get appSpec() {\n    return this.appClient.appSpec\n  }\n  \n  /** A reference to the underlying `AlgorandClient` this app client is using. */\n  public get algorand(): AlgorandClientInterface {\n    return this.appClient.algorand\n  }\n\n  /**\n   * Get parameters to create transactions for the current app. A good mental model for this is that these parameters represent a deferred transaction creation.\n   */\n  readonly params = {\n    /**\n     * Gets available update methods\n     */\n    update: {\n      /**\n       * Updates an existing instance of the NFDRegistry smart contract using the `updateApplication()void` ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The update params\n       */\n      updateApplication: (params: CallParams<NfdRegistryArgs['obj']['updateApplication()void'] | NfdRegistryArgs['tuple']['updateApplication()void']> & AppClientCompilationParams = {args: []}) => {\n        return this.appClient.params.update(NfdRegistryParamsFactory.update.updateApplication(params))\n      },\n\n    },\n\n    /**\n     * Makes a clear_state call to an existing instance of the NFDRegistry smart contract.\n     *\n     * @param params The params for the bare (raw) call\n     * @returns The clearState result\n     */\n    clearState: (params?: Expand<AppClientBareCallParams>) => {\n      return this.appClient.params.bare.clearState(params)\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `gas()void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    gas: (params: CallParams<NfdRegistryArgs['obj']['gas()void'] | NfdRegistryArgs['tuple']['gas()void']> & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.gas(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getPrice(string,address)(uint64,uint64,bool,bool,bool)` ABI method.\n     *\n    * Returns the price for a given NFD (single year), the max # of years allowed (Name for Display),\n    and extra algo required to cover MBR when purchasing.\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    getPrice: (params: CallParams<NfdRegistryArgs['obj']['getPrice(string,address)(uint64,uint64,bool,bool,bool)'] | NfdRegistryArgs['tuple']['getPrice(string,address)(uint64,uint64,bool,bool,bool)']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.getPrice(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    getConstraints: (params: CallParams<NfdRegistryArgs['obj']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)'] | NfdRegistryArgs['tuple']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)']> & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.getConstraints(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getNfdMbrCost(string)uint64` ABI method.\n     *\n    * Returns the MBR amounts needed to MINT an nfd.\n    This value needs to be added to purchase price in mintNfd call.\n    getPrice() returns it though.\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    getNfdMbrCost: (params: CallParams<NfdRegistryArgs['obj']['getNfdMbrCost(string)uint64'] | NfdRegistryArgs['tuple']['getNfdMbrCost(string)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.getNfdMbrCost(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    getNfdLinkOnMintExtraMbrCost: (params: CallParams<NfdRegistryArgs['obj']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)'] | NfdRegistryArgs['tuple']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.getNfdLinkOnMintExtraMbrCost(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `mintNfd(pay,string,address,bool)uint64` ABI method.\n     *\n     * Mint an NFD (NFT) and create a new NFD instance.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    mintNfd: (params: CallParams<NfdRegistryArgs['obj']['mintNfd(pay,string,address,bool)uint64'] | NfdRegistryArgs['tuple']['mintNfd(pay,string,address,bool)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.mintNfd(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `linkNfdAddress(string,uint64,address)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    linkNfdAddress: (params: CallParams<NfdRegistryArgs['obj']['linkNfdAddress(string,uint64,address)void'] | NfdRegistryArgs['tuple']['linkNfdAddress(string,uint64,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.linkNfdAddress(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `unlinkNfdAddress(string,uint64,address)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    unlinkNfdAddress: (params: CallParams<NfdRegistryArgs['obj']['unlinkNfdAddress(string,uint64,address)void'] | NfdRegistryArgs['tuple']['unlinkNfdAddress(string,uint64,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.unlinkNfdAddress(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `ownershipAssign(string,uint64)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    ownershipAssign: (params: CallParams<NfdRegistryArgs['obj']['ownershipAssign(string,uint64)void'] | NfdRegistryArgs['tuple']['ownershipAssign(string,uint64)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.ownershipAssign(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `ownershipChanged(string,uint64,address,address)void` ABI method.\n     *\n    * This method is triggered when the ownership of an NFD (Non-Fungible Domain) changes.\n    It is called by the NFD via the purchase method.  It can also be called by TxnLab admin for older 3.3\n    NFDs when it detects purchased events for 3.3\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    ownershipChanged: (params: CallParams<NfdRegistryArgs['obj']['ownershipChanged(string,uint64,address,address)void'] | NfdRegistryArgs['tuple']['ownershipChanged(string,uint64,address,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.ownershipChanged(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `setAddressPrimaryNfd(string,uint64,address)void` ABI method.\n     *\n    * Makes the specified NFD the 'first' NFD in the reverse-address set so its the primary NFD for this address.\n    The NFD must be valid, and the sender must be the address (or nfd owner if vault).  The NFD wouldn't already be\n    in the reverse-lookup set if it wasn't already valid.\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    setAddressPrimaryNfd: (params: CallParams<NfdRegistryArgs['obj']['setAddressPrimaryNfd(string,uint64,address)void'] | NfdRegistryArgs['tuple']['setAddressPrimaryNfd(string,uint64,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.setAddressPrimaryNfd(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `upgradeNfd(string)string` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    upgradeNfd: (params: CallParams<NfdRegistryArgs['obj']['upgradeNfd(string)string'] | NfdRegistryArgs['tuple']['upgradeNfd(string)string']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.upgradeNfd(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `isValidNfdAppId(string,uint64)bool` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    isValidNfdAppId: (params: CallParams<NfdRegistryArgs['obj']['isValidNfdAppId(string,uint64)bool'] | NfdRegistryArgs['tuple']['isValidNfdAppId(string,uint64)bool']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.isValidNfdAppId(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getNameAppId(string)uint64` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    getNameAppId: (params: CallParams<NfdRegistryArgs['obj']['getNameAppId(string)uint64'] | NfdRegistryArgs['tuple']['getNameAppId(string)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.getNameAppId(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getAddressAppIds(address)uint64[]` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    getAddressAppIds: (params: CallParams<NfdRegistryArgs['obj']['getAddressAppIds(address)uint64[]'] | NfdRegistryArgs['tuple']['getAddressAppIds(address)uint64[]']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.getAddressAppIds(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `nfdContractInit(string,uint64,byte[])void` ABI method.\n     *\n     * Initializes the NFD contract bytecode into the registry\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    nfdContractInit: (params: CallParams<NfdRegistryArgs['obj']['nfdContractInit(string,uint64,byte[])void'] | NfdRegistryArgs['tuple']['nfdContractInit(string,uint64,byte[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.nfdContractInit(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `nfdContractLoad(string,uint64,byte[])void` ABI method.\n     *\n     * Loads contract data into the  box at the specified offset.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    nfdContractLoad: (params: CallParams<NfdRegistryArgs['obj']['nfdContractLoad(string,uint64,byte[])void'] | NfdRegistryArgs['tuple']['nfdContractLoad(string,uint64,byte[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.nfdContractLoad(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `nfdContractCommit(string)void` ABI method.\n     *\n     * Commit a new version of the contract.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    nfdContractCommit: (params: CallParams<NfdRegistryArgs['obj']['nfdContractCommit(string)void'] | NfdRegistryArgs['tuple']['nfdContractCommit(string)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.nfdContractCommit(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `usdInMicroAlgo(uint64)uint64` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    usdInMicroAlgo: (params: CallParams<NfdRegistryArgs['obj']['usdInMicroAlgo(uint64)uint64'] | NfdRegistryArgs['tuple']['usdInMicroAlgo(uint64)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.usdInMicroAlgo(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `costToAddToAddress(address)uint64` ABI method.\n     *\n     * Returns the cost to add an NFD to the reverse-lookup data\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    costToAddToAddress: (params: CallParams<NfdRegistryArgs['obj']['costToAddToAddress(address)uint64'] | NfdRegistryArgs['tuple']['costToAddToAddress(address)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.costToAddToAddress(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `calcFuturePrice(uint64,uint64)uint64` ABI method.\n     *\n     * Calculates the future price based on the current price and the number of years.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call params\n     */\n    calcFuturePrice: (params: CallParams<NfdRegistryArgs['obj']['calcFuturePrice(uint64,uint64)uint64'] | NfdRegistryArgs['tuple']['calcFuturePrice(uint64,uint64)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.params.call(NfdRegistryParamsFactory.calcFuturePrice(params))\n    },\n\n  }\n\n  /**\n   * Create transactions for the current app\n   */\n  readonly createTransaction = {\n    /**\n     * Gets available update methods\n     */\n    update: {\n      /**\n       * Updates an existing instance of the NFDRegistry smart contract using the `updateApplication()void` ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The update transaction\n       */\n      updateApplication: (params: CallParams<NfdRegistryArgs['obj']['updateApplication()void'] | NfdRegistryArgs['tuple']['updateApplication()void']> & AppClientCompilationParams = {args: []}) => {\n        return this.appClient.createTransaction.update(NfdRegistryParamsFactory.update.updateApplication(params))\n      },\n\n    },\n\n    /**\n     * Makes a clear_state call to an existing instance of the NFDRegistry smart contract.\n     *\n     * @param params The params for the bare (raw) call\n     * @returns The clearState result\n     */\n    clearState: (params?: Expand<AppClientBareCallParams>) => {\n      return this.appClient.createTransaction.bare.clearState(params)\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `gas()void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    gas: (params: CallParams<NfdRegistryArgs['obj']['gas()void'] | NfdRegistryArgs['tuple']['gas()void']> & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.gas(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getPrice(string,address)(uint64,uint64,bool,bool,bool)` ABI method.\n     *\n    * Returns the price for a given NFD (single year), the max # of years allowed (Name for Display),\n    and extra algo required to cover MBR when purchasing.\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    getPrice: (params: CallParams<NfdRegistryArgs['obj']['getPrice(string,address)(uint64,uint64,bool,bool,bool)'] | NfdRegistryArgs['tuple']['getPrice(string,address)(uint64,uint64,bool,bool,bool)']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.getPrice(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    getConstraints: (params: CallParams<NfdRegistryArgs['obj']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)'] | NfdRegistryArgs['tuple']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)']> & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.getConstraints(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getNfdMbrCost(string)uint64` ABI method.\n     *\n    * Returns the MBR amounts needed to MINT an nfd.\n    This value needs to be added to purchase price in mintNfd call.\n    getPrice() returns it though.\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    getNfdMbrCost: (params: CallParams<NfdRegistryArgs['obj']['getNfdMbrCost(string)uint64'] | NfdRegistryArgs['tuple']['getNfdMbrCost(string)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.getNfdMbrCost(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    getNfdLinkOnMintExtraMbrCost: (params: CallParams<NfdRegistryArgs['obj']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)'] | NfdRegistryArgs['tuple']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.getNfdLinkOnMintExtraMbrCost(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `mintNfd(pay,string,address,bool)uint64` ABI method.\n     *\n     * Mint an NFD (NFT) and create a new NFD instance.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    mintNfd: (params: CallParams<NfdRegistryArgs['obj']['mintNfd(pay,string,address,bool)uint64'] | NfdRegistryArgs['tuple']['mintNfd(pay,string,address,bool)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.mintNfd(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `linkNfdAddress(string,uint64,address)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    linkNfdAddress: (params: CallParams<NfdRegistryArgs['obj']['linkNfdAddress(string,uint64,address)void'] | NfdRegistryArgs['tuple']['linkNfdAddress(string,uint64,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.linkNfdAddress(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `unlinkNfdAddress(string,uint64,address)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    unlinkNfdAddress: (params: CallParams<NfdRegistryArgs['obj']['unlinkNfdAddress(string,uint64,address)void'] | NfdRegistryArgs['tuple']['unlinkNfdAddress(string,uint64,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.unlinkNfdAddress(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `ownershipAssign(string,uint64)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    ownershipAssign: (params: CallParams<NfdRegistryArgs['obj']['ownershipAssign(string,uint64)void'] | NfdRegistryArgs['tuple']['ownershipAssign(string,uint64)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.ownershipAssign(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `ownershipChanged(string,uint64,address,address)void` ABI method.\n     *\n    * This method is triggered when the ownership of an NFD (Non-Fungible Domain) changes.\n    It is called by the NFD via the purchase method.  It can also be called by TxnLab admin for older 3.3\n    NFDs when it detects purchased events for 3.3\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    ownershipChanged: (params: CallParams<NfdRegistryArgs['obj']['ownershipChanged(string,uint64,address,address)void'] | NfdRegistryArgs['tuple']['ownershipChanged(string,uint64,address,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.ownershipChanged(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `setAddressPrimaryNfd(string,uint64,address)void` ABI method.\n     *\n    * Makes the specified NFD the 'first' NFD in the reverse-address set so its the primary NFD for this address.\n    The NFD must be valid, and the sender must be the address (or nfd owner if vault).  The NFD wouldn't already be\n    in the reverse-lookup set if it wasn't already valid.\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    setAddressPrimaryNfd: (params: CallParams<NfdRegistryArgs['obj']['setAddressPrimaryNfd(string,uint64,address)void'] | NfdRegistryArgs['tuple']['setAddressPrimaryNfd(string,uint64,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.setAddressPrimaryNfd(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `upgradeNfd(string)string` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    upgradeNfd: (params: CallParams<NfdRegistryArgs['obj']['upgradeNfd(string)string'] | NfdRegistryArgs['tuple']['upgradeNfd(string)string']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.upgradeNfd(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `isValidNfdAppId(string,uint64)bool` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    isValidNfdAppId: (params: CallParams<NfdRegistryArgs['obj']['isValidNfdAppId(string,uint64)bool'] | NfdRegistryArgs['tuple']['isValidNfdAppId(string,uint64)bool']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.isValidNfdAppId(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getNameAppId(string)uint64` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    getNameAppId: (params: CallParams<NfdRegistryArgs['obj']['getNameAppId(string)uint64'] | NfdRegistryArgs['tuple']['getNameAppId(string)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.getNameAppId(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getAddressAppIds(address)uint64[]` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    getAddressAppIds: (params: CallParams<NfdRegistryArgs['obj']['getAddressAppIds(address)uint64[]'] | NfdRegistryArgs['tuple']['getAddressAppIds(address)uint64[]']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.getAddressAppIds(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `nfdContractInit(string,uint64,byte[])void` ABI method.\n     *\n     * Initializes the NFD contract bytecode into the registry\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    nfdContractInit: (params: CallParams<NfdRegistryArgs['obj']['nfdContractInit(string,uint64,byte[])void'] | NfdRegistryArgs['tuple']['nfdContractInit(string,uint64,byte[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.nfdContractInit(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `nfdContractLoad(string,uint64,byte[])void` ABI method.\n     *\n     * Loads contract data into the  box at the specified offset.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    nfdContractLoad: (params: CallParams<NfdRegistryArgs['obj']['nfdContractLoad(string,uint64,byte[])void'] | NfdRegistryArgs['tuple']['nfdContractLoad(string,uint64,byte[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.nfdContractLoad(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `nfdContractCommit(string)void` ABI method.\n     *\n     * Commit a new version of the contract.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    nfdContractCommit: (params: CallParams<NfdRegistryArgs['obj']['nfdContractCommit(string)void'] | NfdRegistryArgs['tuple']['nfdContractCommit(string)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.nfdContractCommit(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `usdInMicroAlgo(uint64)uint64` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    usdInMicroAlgo: (params: CallParams<NfdRegistryArgs['obj']['usdInMicroAlgo(uint64)uint64'] | NfdRegistryArgs['tuple']['usdInMicroAlgo(uint64)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.usdInMicroAlgo(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `costToAddToAddress(address)uint64` ABI method.\n     *\n     * Returns the cost to add an NFD to the reverse-lookup data\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    costToAddToAddress: (params: CallParams<NfdRegistryArgs['obj']['costToAddToAddress(address)uint64'] | NfdRegistryArgs['tuple']['costToAddToAddress(address)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.costToAddToAddress(params))\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `calcFuturePrice(uint64,uint64)uint64` ABI method.\n     *\n     * Calculates the future price based on the current price and the number of years.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call transaction\n     */\n    calcFuturePrice: (params: CallParams<NfdRegistryArgs['obj']['calcFuturePrice(uint64,uint64)uint64'] | NfdRegistryArgs['tuple']['calcFuturePrice(uint64,uint64)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      return this.appClient.createTransaction.call(NfdRegistryParamsFactory.calcFuturePrice(params))\n    },\n\n  }\n\n  /**\n   * Send calls to the current app\n   */\n  readonly send = {\n    /**\n     * Gets available update methods\n     */\n    update: {\n      /**\n       * Updates an existing instance of the NFDRegistry smart contract using the `updateApplication()void` ABI method.\n       *\n       * @param params The params for the smart contract call\n       * @returns The update result\n       */\n      updateApplication: async (params: CallParams<NfdRegistryArgs['obj']['updateApplication()void'] | NfdRegistryArgs['tuple']['updateApplication()void']> & AppClientCompilationParams & SendParams = {args: []}) => {\n        const result = await this.appClient.send.update(NfdRegistryParamsFactory.update.updateApplication(params))\n        return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['updateApplication()void'])}\n      },\n\n    },\n\n    /**\n     * Makes a clear_state call to an existing instance of the NFDRegistry smart contract.\n     *\n     * @param params The params for the bare (raw) call\n     * @returns The clearState result\n     */\n    clearState: (params?: Expand<AppClientBareCallParams & SendParams>) => {\n      return this.appClient.send.bare.clearState(params)\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `gas()void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    gas: async (params: CallParams<NfdRegistryArgs['obj']['gas()void'] | NfdRegistryArgs['tuple']['gas()void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.gas(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['gas()void'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getPrice(string,address)(uint64,uint64,bool,bool,bool)` ABI method.\n     *\n    * Returns the price for a given NFD (single year), the max # of years allowed (Name for Display),\n    and extra algo required to cover MBR when purchasing.\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    getPrice: async (params: CallParams<NfdRegistryArgs['obj']['getPrice(string,address)(uint64,uint64,bool,bool,bool)'] | NfdRegistryArgs['tuple']['getPrice(string,address)(uint64,uint64,bool,bool,bool)']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.getPrice(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['getPrice(string,address)(uint64,uint64,bool,bool,bool)'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    getConstraints: async (params: CallParams<NfdRegistryArgs['obj']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)'] | NfdRegistryArgs['tuple']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC} = {args: []}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.getConstraints(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getNfdMbrCost(string)uint64` ABI method.\n     *\n    * Returns the MBR amounts needed to MINT an nfd.\n    This value needs to be added to purchase price in mintNfd call.\n    getPrice() returns it though.\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    getNfdMbrCost: async (params: CallParams<NfdRegistryArgs['obj']['getNfdMbrCost(string)uint64'] | NfdRegistryArgs['tuple']['getNfdMbrCost(string)uint64']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.getNfdMbrCost(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['getNfdMbrCost(string)uint64'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    getNfdLinkOnMintExtraMbrCost: async (params: CallParams<NfdRegistryArgs['obj']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)'] | NfdRegistryArgs['tuple']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.getNfdLinkOnMintExtraMbrCost(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `mintNfd(pay,string,address,bool)uint64` ABI method.\n     *\n     * Mint an NFD (NFT) and create a new NFD instance.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    mintNfd: async (params: CallParams<NfdRegistryArgs['obj']['mintNfd(pay,string,address,bool)uint64'] | NfdRegistryArgs['tuple']['mintNfd(pay,string,address,bool)uint64']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.mintNfd(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['mintNfd(pay,string,address,bool)uint64'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `linkNfdAddress(string,uint64,address)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    linkNfdAddress: async (params: CallParams<NfdRegistryArgs['obj']['linkNfdAddress(string,uint64,address)void'] | NfdRegistryArgs['tuple']['linkNfdAddress(string,uint64,address)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.linkNfdAddress(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['linkNfdAddress(string,uint64,address)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `unlinkNfdAddress(string,uint64,address)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    unlinkNfdAddress: async (params: CallParams<NfdRegistryArgs['obj']['unlinkNfdAddress(string,uint64,address)void'] | NfdRegistryArgs['tuple']['unlinkNfdAddress(string,uint64,address)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.unlinkNfdAddress(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['unlinkNfdAddress(string,uint64,address)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `ownershipAssign(string,uint64)void` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    ownershipAssign: async (params: CallParams<NfdRegistryArgs['obj']['ownershipAssign(string,uint64)void'] | NfdRegistryArgs['tuple']['ownershipAssign(string,uint64)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.ownershipAssign(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['ownershipAssign(string,uint64)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `ownershipChanged(string,uint64,address,address)void` ABI method.\n     *\n    * This method is triggered when the ownership of an NFD (Non-Fungible Domain) changes.\n    It is called by the NFD via the purchase method.  It can also be called by TxnLab admin for older 3.3\n    NFDs when it detects purchased events for 3.3\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    ownershipChanged: async (params: CallParams<NfdRegistryArgs['obj']['ownershipChanged(string,uint64,address,address)void'] | NfdRegistryArgs['tuple']['ownershipChanged(string,uint64,address,address)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.ownershipChanged(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['ownershipChanged(string,uint64,address,address)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `setAddressPrimaryNfd(string,uint64,address)void` ABI method.\n     *\n    * Makes the specified NFD the 'first' NFD in the reverse-address set so its the primary NFD for this address.\n    The NFD must be valid, and the sender must be the address (or nfd owner if vault).  The NFD wouldn't already be\n    in the reverse-lookup set if it wasn't already valid.\n\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    setAddressPrimaryNfd: async (params: CallParams<NfdRegistryArgs['obj']['setAddressPrimaryNfd(string,uint64,address)void'] | NfdRegistryArgs['tuple']['setAddressPrimaryNfd(string,uint64,address)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.setAddressPrimaryNfd(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['setAddressPrimaryNfd(string,uint64,address)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `upgradeNfd(string)string` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    upgradeNfd: async (params: CallParams<NfdRegistryArgs['obj']['upgradeNfd(string)string'] | NfdRegistryArgs['tuple']['upgradeNfd(string)string']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.upgradeNfd(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['upgradeNfd(string)string'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `isValidNfdAppId(string,uint64)bool` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    isValidNfdAppId: async (params: CallParams<NfdRegistryArgs['obj']['isValidNfdAppId(string,uint64)bool'] | NfdRegistryArgs['tuple']['isValidNfdAppId(string,uint64)bool']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.isValidNfdAppId(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['isValidNfdAppId(string,uint64)bool'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getNameAppId(string)uint64` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    getNameAppId: async (params: CallParams<NfdRegistryArgs['obj']['getNameAppId(string)uint64'] | NfdRegistryArgs['tuple']['getNameAppId(string)uint64']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.getNameAppId(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['getNameAppId(string)uint64'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `getAddressAppIds(address)uint64[]` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    getAddressAppIds: async (params: CallParams<NfdRegistryArgs['obj']['getAddressAppIds(address)uint64[]'] | NfdRegistryArgs['tuple']['getAddressAppIds(address)uint64[]']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.getAddressAppIds(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['getAddressAppIds(address)uint64[]'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `nfdContractInit(string,uint64,byte[])void` ABI method.\n     *\n     * Initializes the NFD contract bytecode into the registry\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    nfdContractInit: async (params: CallParams<NfdRegistryArgs['obj']['nfdContractInit(string,uint64,byte[])void'] | NfdRegistryArgs['tuple']['nfdContractInit(string,uint64,byte[])void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.nfdContractInit(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['nfdContractInit(string,uint64,byte[])void'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `nfdContractLoad(string,uint64,byte[])void` ABI method.\n     *\n     * Loads contract data into the  box at the specified offset.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    nfdContractLoad: async (params: CallParams<NfdRegistryArgs['obj']['nfdContractLoad(string,uint64,byte[])void'] | NfdRegistryArgs['tuple']['nfdContractLoad(string,uint64,byte[])void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.nfdContractLoad(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['nfdContractLoad(string,uint64,byte[])void'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `nfdContractCommit(string)void` ABI method.\n     *\n     * Commit a new version of the contract.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    nfdContractCommit: async (params: CallParams<NfdRegistryArgs['obj']['nfdContractCommit(string)void'] | NfdRegistryArgs['tuple']['nfdContractCommit(string)void']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.nfdContractCommit(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['nfdContractCommit(string)void'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `usdInMicroAlgo(uint64)uint64` ABI method.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    usdInMicroAlgo: async (params: CallParams<NfdRegistryArgs['obj']['usdInMicroAlgo(uint64)uint64'] | NfdRegistryArgs['tuple']['usdInMicroAlgo(uint64)uint64']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.usdInMicroAlgo(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['usdInMicroAlgo(uint64)uint64'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `costToAddToAddress(address)uint64` ABI method.\n     *\n     * Returns the cost to add an NFD to the reverse-lookup data\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    costToAddToAddress: async (params: CallParams<NfdRegistryArgs['obj']['costToAddToAddress(address)uint64'] | NfdRegistryArgs['tuple']['costToAddToAddress(address)uint64']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.costToAddToAddress(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['costToAddToAddress(address)uint64'])}\n    },\n\n    /**\n     * Makes a call to the NFDRegistry smart contract using the `calcFuturePrice(uint64,uint64)uint64` ABI method.\n     *\n     * Calculates the future price based on the current price and the number of years.\n     *\n     * @param params The params for the smart contract call\n     * @returns The call result\n     */\n    calcFuturePrice: async (params: CallParams<NfdRegistryArgs['obj']['calcFuturePrice(uint64,uint64)uint64'] | NfdRegistryArgs['tuple']['calcFuturePrice(uint64,uint64)uint64']> & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n      const result = await this.appClient.send.call(NfdRegistryParamsFactory.calcFuturePrice(params))\n      return {...result, return: result.return as unknown as (undefined | NfdRegistryReturns['calcFuturePrice(uint64,uint64)uint64'])}\n    },\n\n  }\n\n  /**\n   * Clone this app client with different params\n   *\n   * @param params The params to use for the the cloned app client. Omit a param to keep the original value. Set a param to override the original value. Setting to undefined will clear the original value.\n   * @returns A new app client with the altered params\n   */\n  public clone(params: CloneAppClientParams) {\n    return new NfdRegistryClient(this.appClient.clone(params))\n  }\n\n  /**\n   * Methods to access state for the current NFDRegistry app\n   */\n  state = {\n    /**\n     * Methods to access local state for the current NFDRegistry app\n     */\n    local: (address: string | Address) => {\n      const encodedAddress = typeof address === 'string' ? address : encodeAddress(address.publicKey)\n      return {\n        /**\n         * Get all current keyed values from local state\n         */\n        getAll: async (): Promise<Partial<Expand<LocalKeysState>>> => {\n          const result = await this.appClient.state.local(encodedAddress).getAll()\n          return {\n          }\n        },\n        /**\n         * Get values from the localState map in local state\n         */\n        localState: {\n          /**\n           * Get all current values of the localState map in local state\n           */\n          getMap: async (): Promise<Map<Uint8Array, Uint8Array>> => { return (await this.appClient.state.local(encodedAddress).getMap(\"localState\")) as Map<Uint8Array, Uint8Array> },\n          /**\n           * Get a current value of the localState map by key from local state\n           */\n          value: async (key: Uint8Array | string): Promise<Uint8Array | undefined> => { return await this.appClient.state.local(encodedAddress).getMapValue(\"localState\", key) as Uint8Array | undefined },\n        },\n      }\n    },\n    /**\n     * Methods to access box state for the current NFDRegistry app\n     */\n    box: {\n      /**\n       * Get all current keyed values from box state\n       */\n      getAll: async (): Promise<Partial<Expand<BoxKeysState>>> => {\n        const result = await this.appClient.state.box.getAll()\n        return {\n        }\n      },\n      /**\n       * Get values from the boxes map in box state\n       */\n      boxes: {\n        /**\n         * Get all current values of the boxes map in box state\n         */\n        getMap: async (): Promise<Map<Uint8Array, Uint8Array>> => { return (await this.appClient.state.box.getMap(\"boxes\")) as Map<Uint8Array, Uint8Array> },\n        /**\n         * Get a current value of the boxes map by key from box state\n         */\n        value: async (key: Uint8Array | string): Promise<Uint8Array | undefined> => { return await this.appClient.state.box.getMapValue(\"boxes\", key) as Uint8Array | undefined },\n      },\n    },\n  }\n\n  public newGroup(): NfdRegistryComposer {\n    const client = this\n    const composer = this.algorand.newGroup()\n    let promiseChain:Promise<unknown> = Promise.resolve()\n    const resultMappers: Array<undefined | ((x: ABIReturn | undefined) => any)> = []\n    return {\n      /**\n       * Add a gas()void method call against the NFDRegistry contract\n       */\n      gas(params: CallParams<NfdRegistryArgs['obj']['gas()void'] | NfdRegistryArgs['tuple']['gas()void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.gas(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a getPrice(string,address)(uint64,uint64,bool,bool,bool) method call against the NFDRegistry contract\n       */\n      getPrice(params: CallParams<NfdRegistryArgs['obj']['getPrice(string,address)(uint64,uint64,bool,bool,bool)'] | NfdRegistryArgs['tuple']['getPrice(string,address)(uint64,uint64,bool,bool,bool)']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.getPrice(params)))\n        resultMappers.push((v) => client.decodeReturnValue('getPrice(string,address)(uint64,uint64,bool,bool,bool)', v))\n        return this\n      },\n      /**\n       * Add a getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64) method call against the NFDRegistry contract\n       */\n      getConstraints(params: CallParams<NfdRegistryArgs['obj']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)'] | NfdRegistryArgs['tuple']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.getConstraints(params)))\n        resultMappers.push((v) => client.decodeReturnValue('getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)', v))\n        return this\n      },\n      /**\n       * Add a getNfdMbrCost(string)uint64 method call against the NFDRegistry contract\n       */\n      getNfdMbrCost(params: CallParams<NfdRegistryArgs['obj']['getNfdMbrCost(string)uint64'] | NfdRegistryArgs['tuple']['getNfdMbrCost(string)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.getNfdMbrCost(params)))\n        resultMappers.push((v) => client.decodeReturnValue('getNfdMbrCost(string)uint64', v))\n        return this\n      },\n      /**\n       * Add a getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64) method call against the NFDRegistry contract\n       */\n      getNfdLinkOnMintExtraMbrCost(params: CallParams<NfdRegistryArgs['obj']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)'] | NfdRegistryArgs['tuple']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.getNfdLinkOnMintExtraMbrCost(params)))\n        resultMappers.push((v) => client.decodeReturnValue('getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)', v))\n        return this\n      },\n      /**\n       * Add a mintNfd(pay,string,address,bool)uint64 method call against the NFDRegistry contract\n       */\n      mintNfd(params: CallParams<NfdRegistryArgs['obj']['mintNfd(pay,string,address,bool)uint64'] | NfdRegistryArgs['tuple']['mintNfd(pay,string,address,bool)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.mintNfd(params)))\n        resultMappers.push((v) => client.decodeReturnValue('mintNfd(pay,string,address,bool)uint64', v))\n        return this\n      },\n      /**\n       * Add a linkNfdAddress(string,uint64,address)void method call against the NFDRegistry contract\n       */\n      linkNfdAddress(params: CallParams<NfdRegistryArgs['obj']['linkNfdAddress(string,uint64,address)void'] | NfdRegistryArgs['tuple']['linkNfdAddress(string,uint64,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.linkNfdAddress(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a unlinkNfdAddress(string,uint64,address)void method call against the NFDRegistry contract\n       */\n      unlinkNfdAddress(params: CallParams<NfdRegistryArgs['obj']['unlinkNfdAddress(string,uint64,address)void'] | NfdRegistryArgs['tuple']['unlinkNfdAddress(string,uint64,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.unlinkNfdAddress(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a ownershipAssign(string,uint64)void method call against the NFDRegistry contract\n       */\n      ownershipAssign(params: CallParams<NfdRegistryArgs['obj']['ownershipAssign(string,uint64)void'] | NfdRegistryArgs['tuple']['ownershipAssign(string,uint64)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.ownershipAssign(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a ownershipChanged(string,uint64,address,address)void method call against the NFDRegistry contract\n       */\n      ownershipChanged(params: CallParams<NfdRegistryArgs['obj']['ownershipChanged(string,uint64,address,address)void'] | NfdRegistryArgs['tuple']['ownershipChanged(string,uint64,address,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.ownershipChanged(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a setAddressPrimaryNfd(string,uint64,address)void method call against the NFDRegistry contract\n       */\n      setAddressPrimaryNfd(params: CallParams<NfdRegistryArgs['obj']['setAddressPrimaryNfd(string,uint64,address)void'] | NfdRegistryArgs['tuple']['setAddressPrimaryNfd(string,uint64,address)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.setAddressPrimaryNfd(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a upgradeNfd(string)string method call against the NFDRegistry contract\n       */\n      upgradeNfd(params: CallParams<NfdRegistryArgs['obj']['upgradeNfd(string)string'] | NfdRegistryArgs['tuple']['upgradeNfd(string)string']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.upgradeNfd(params)))\n        resultMappers.push((v) => client.decodeReturnValue('upgradeNfd(string)string', v))\n        return this\n      },\n      /**\n       * Add a isValidNfdAppId(string,uint64)bool method call against the NFDRegistry contract\n       */\n      isValidNfdAppId(params: CallParams<NfdRegistryArgs['obj']['isValidNfdAppId(string,uint64)bool'] | NfdRegistryArgs['tuple']['isValidNfdAppId(string,uint64)bool']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.isValidNfdAppId(params)))\n        resultMappers.push((v) => client.decodeReturnValue('isValidNfdAppId(string,uint64)bool', v))\n        return this\n      },\n      /**\n       * Add a getNameAppId(string)uint64 method call against the NFDRegistry contract\n       */\n      getNameAppId(params: CallParams<NfdRegistryArgs['obj']['getNameAppId(string)uint64'] | NfdRegistryArgs['tuple']['getNameAppId(string)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.getNameAppId(params)))\n        resultMappers.push((v) => client.decodeReturnValue('getNameAppId(string)uint64', v))\n        return this\n      },\n      /**\n       * Add a getAddressAppIds(address)uint64[] method call against the NFDRegistry contract\n       */\n      getAddressAppIds(params: CallParams<NfdRegistryArgs['obj']['getAddressAppIds(address)uint64[]'] | NfdRegistryArgs['tuple']['getAddressAppIds(address)uint64[]']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.getAddressAppIds(params)))\n        resultMappers.push((v) => client.decodeReturnValue('getAddressAppIds(address)uint64[]', v))\n        return this\n      },\n      /**\n       * Add a nfdContractInit(string,uint64,byte[])void method call against the NFDRegistry contract\n       */\n      nfdContractInit(params: CallParams<NfdRegistryArgs['obj']['nfdContractInit(string,uint64,byte[])void'] | NfdRegistryArgs['tuple']['nfdContractInit(string,uint64,byte[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.nfdContractInit(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a nfdContractLoad(string,uint64,byte[])void method call against the NFDRegistry contract\n       */\n      nfdContractLoad(params: CallParams<NfdRegistryArgs['obj']['nfdContractLoad(string,uint64,byte[])void'] | NfdRegistryArgs['tuple']['nfdContractLoad(string,uint64,byte[])void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.nfdContractLoad(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a nfdContractCommit(string)void method call against the NFDRegistry contract\n       */\n      nfdContractCommit(params: CallParams<NfdRegistryArgs['obj']['nfdContractCommit(string)void'] | NfdRegistryArgs['tuple']['nfdContractCommit(string)void']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.nfdContractCommit(params)))\n        resultMappers.push(undefined)\n        return this\n      },\n      /**\n       * Add a usdInMicroAlgo(uint64)uint64 method call against the NFDRegistry contract\n       */\n      usdInMicroAlgo(params: CallParams<NfdRegistryArgs['obj']['usdInMicroAlgo(uint64)uint64'] | NfdRegistryArgs['tuple']['usdInMicroAlgo(uint64)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.usdInMicroAlgo(params)))\n        resultMappers.push((v) => client.decodeReturnValue('usdInMicroAlgo(uint64)uint64', v))\n        return this\n      },\n      /**\n       * Add a costToAddToAddress(address)uint64 method call against the NFDRegistry contract\n       */\n      costToAddToAddress(params: CallParams<NfdRegistryArgs['obj']['costToAddToAddress(address)uint64'] | NfdRegistryArgs['tuple']['costToAddToAddress(address)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.costToAddToAddress(params)))\n        resultMappers.push((v) => client.decodeReturnValue('costToAddToAddress(address)uint64', v))\n        return this\n      },\n      /**\n       * Add a calcFuturePrice(uint64,uint64)uint64 method call against the NFDRegistry contract\n       */\n      calcFuturePrice(params: CallParams<NfdRegistryArgs['obj']['calcFuturePrice(uint64,uint64)uint64'] | NfdRegistryArgs['tuple']['calcFuturePrice(uint64,uint64)uint64']> & {onComplete?: OnApplicationComplete.NoOpOC}) {\n        promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.calcFuturePrice(params)))\n        resultMappers.push((v) => client.decodeReturnValue('calcFuturePrice(uint64,uint64)uint64', v))\n        return this\n      },\n      get update() {\n        return {\n          updateApplication: (params: CallParams<NfdRegistryArgs['obj']['updateApplication()void'] | NfdRegistryArgs['tuple']['updateApplication()void']> & AppClientCompilationParams) => {\n            promiseChain = promiseChain.then(async () => composer.addAppUpdateMethodCall(await client.params.update.updateApplication(params)))\n            resultMappers.push(undefined)\n            return this\n          },\n        }\n      },\n      /**\n       * Add a clear state call to the NFDRegistry contract\n       */\n      clearState(params: AppClientBareCallParams) {\n        promiseChain = promiseChain.then(() => composer.addAppCall(client.params.clearState(params)))\n        return this\n      },\n      addTransaction(txn: Transaction, signer?: TransactionSigner) {\n        promiseChain = promiseChain.then(() => composer.addTransaction(txn, signer))\n        return this\n      },\n      async composer() {\n        await promiseChain\n        return composer\n      },\n      async simulate(options?: SimulateOptions) {\n        await promiseChain\n        const result = await (!options ? composer.simulate() : composer.simulate(options))\n        return {\n          ...result,\n          returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)\n        }\n      },\n      async send(params?: SendParams) {\n        await promiseChain\n        const result = await composer.send(params)\n        return {\n          ...result,\n          returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)\n        }\n      }\n    } as unknown as NfdRegistryComposer\n  }\n}\nexport type NfdRegistryComposer<TReturns extends [...any[]] = []> = {\n  /**\n   * Calls the gas()void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  gas(params?: CallParams<NfdRegistryArgs['obj']['gas()void'] | NfdRegistryArgs['tuple']['gas()void']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['gas()void'] | undefined]>\n\n  /**\n   * Calls the getPrice(string,address)(uint64,uint64,bool,bool,bool) ABI method.\n   *\n  * Returns the price for a given NFD (single year), the max # of years allowed (Name for Display),\n  and extra algo required to cover MBR when purchasing.\n\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  getPrice(params?: CallParams<NfdRegistryArgs['obj']['getPrice(string,address)(uint64,uint64,bool,bool,bool)'] | NfdRegistryArgs['tuple']['getPrice(string,address)(uint64,uint64,bool,bool,bool)']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['getPrice(string,address)(uint64,uint64,bool,bool,bool)'] | undefined]>\n\n  /**\n   * Calls the getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64) ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  getConstraints(params?: CallParams<NfdRegistryArgs['obj']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)'] | NfdRegistryArgs['tuple']['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['getConstraints()(uint64,uint64,uint64,address,uint64,uint64,uint64)'] | undefined]>\n\n  /**\n   * Calls the getNfdMbrCost(string)uint64 ABI method.\n   *\n  * Returns the MBR amounts needed to MINT an nfd.\n  This value needs to be added to purchase price in mintNfd call.\n  getPrice() returns it though.\n\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  getNfdMbrCost(params?: CallParams<NfdRegistryArgs['obj']['getNfdMbrCost(string)uint64'] | NfdRegistryArgs['tuple']['getNfdMbrCost(string)uint64']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['getNfdMbrCost(string)uint64'] | undefined]>\n\n  /**\n   * Calls the getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64) ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  getNfdLinkOnMintExtraMbrCost(params?: CallParams<NfdRegistryArgs['obj']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)'] | NfdRegistryArgs['tuple']['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['getNfdLinkOnMintExtraMbrCost(address)(uint64,uint64)'] | undefined]>\n\n  /**\n   * Calls the mintNfd(pay,string,address,bool)uint64 ABI method.\n   *\n   * Mint an NFD (NFT) and create a new NFD instance.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  mintNfd(params?: CallParams<NfdRegistryArgs['obj']['mintNfd(pay,string,address,bool)uint64'] | NfdRegistryArgs['tuple']['mintNfd(pay,string,address,bool)uint64']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['mintNfd(pay,string,address,bool)uint64'] | undefined]>\n\n  /**\n   * Calls the linkNfdAddress(string,uint64,address)void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  linkNfdAddress(params?: CallParams<NfdRegistryArgs['obj']['linkNfdAddress(string,uint64,address)void'] | NfdRegistryArgs['tuple']['linkNfdAddress(string,uint64,address)void']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['linkNfdAddress(string,uint64,address)void'] | undefined]>\n\n  /**\n   * Calls the unlinkNfdAddress(string,uint64,address)void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  unlinkNfdAddress(params?: CallParams<NfdRegistryArgs['obj']['unlinkNfdAddress(string,uint64,address)void'] | NfdRegistryArgs['tuple']['unlinkNfdAddress(string,uint64,address)void']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['unlinkNfdAddress(string,uint64,address)void'] | undefined]>\n\n  /**\n   * Calls the ownershipAssign(string,uint64)void ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  ownershipAssign(params?: CallParams<NfdRegistryArgs['obj']['ownershipAssign(string,uint64)void'] | NfdRegistryArgs['tuple']['ownershipAssign(string,uint64)void']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['ownershipAssign(string,uint64)void'] | undefined]>\n\n  /**\n   * Calls the ownershipChanged(string,uint64,address,address)void ABI method.\n   *\n  * This method is triggered when the ownership of an NFD (Non-Fungible Domain) changes.\n  It is called by the NFD via the purchase method.  It can also be called by TxnLab admin for older 3.3\n  NFDs when it detects purchased events for 3.3\n\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  ownershipChanged(params?: CallParams<NfdRegistryArgs['obj']['ownershipChanged(string,uint64,address,address)void'] | NfdRegistryArgs['tuple']['ownershipChanged(string,uint64,address,address)void']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['ownershipChanged(string,uint64,address,address)void'] | undefined]>\n\n  /**\n   * Calls the setAddressPrimaryNfd(string,uint64,address)void ABI method.\n   *\n  * Makes the specified NFD the 'first' NFD in the reverse-address set so its the primary NFD for this address.\n  The NFD must be valid, and the sender must be the address (or nfd owner if vault).  The NFD wouldn't already be\n  in the reverse-lookup set if it wasn't already valid.\n\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  setAddressPrimaryNfd(params?: CallParams<NfdRegistryArgs['obj']['setAddressPrimaryNfd(string,uint64,address)void'] | NfdRegistryArgs['tuple']['setAddressPrimaryNfd(string,uint64,address)void']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['setAddressPrimaryNfd(string,uint64,address)void'] | undefined]>\n\n  /**\n   * Calls the upgradeNfd(string)string ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  upgradeNfd(params?: CallParams<NfdRegistryArgs['obj']['upgradeNfd(string)string'] | NfdRegistryArgs['tuple']['upgradeNfd(string)string']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['upgradeNfd(string)string'] | undefined]>\n\n  /**\n   * Calls the isValidNfdAppId(string,uint64)bool ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  isValidNfdAppId(params?: CallParams<NfdRegistryArgs['obj']['isValidNfdAppId(string,uint64)bool'] | NfdRegistryArgs['tuple']['isValidNfdAppId(string,uint64)bool']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['isValidNfdAppId(string,uint64)bool'] | undefined]>\n\n  /**\n   * Calls the getNameAppId(string)uint64 ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  getNameAppId(params?: CallParams<NfdRegistryArgs['obj']['getNameAppId(string)uint64'] | NfdRegistryArgs['tuple']['getNameAppId(string)uint64']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['getNameAppId(string)uint64'] | undefined]>\n\n  /**\n   * Calls the getAddressAppIds(address)uint64[] ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  getAddressAppIds(params?: CallParams<NfdRegistryArgs['obj']['getAddressAppIds(address)uint64[]'] | NfdRegistryArgs['tuple']['getAddressAppIds(address)uint64[]']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['getAddressAppIds(address)uint64[]'] | undefined]>\n\n  /**\n   * Calls the nfdContractInit(string,uint64,byte[])void ABI method.\n   *\n   * Initializes the NFD contract bytecode into the registry\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  nfdContractInit(params?: CallParams<NfdRegistryArgs['obj']['nfdContractInit(string,uint64,byte[])void'] | NfdRegistryArgs['tuple']['nfdContractInit(string,uint64,byte[])void']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['nfdContractInit(string,uint64,byte[])void'] | undefined]>\n\n  /**\n   * Calls the nfdContractLoad(string,uint64,byte[])void ABI method.\n   *\n   * Loads contract data into the  box at the specified offset.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  nfdContractLoad(params?: CallParams<NfdRegistryArgs['obj']['nfdContractLoad(string,uint64,byte[])void'] | NfdRegistryArgs['tuple']['nfdContractLoad(string,uint64,byte[])void']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['nfdContractLoad(string,uint64,byte[])void'] | undefined]>\n\n  /**\n   * Calls the nfdContractCommit(string)void ABI method.\n   *\n   * Commit a new version of the contract.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  nfdContractCommit(params?: CallParams<NfdRegistryArgs['obj']['nfdContractCommit(string)void'] | NfdRegistryArgs['tuple']['nfdContractCommit(string)void']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['nfdContractCommit(string)void'] | undefined]>\n\n  /**\n   * Calls the usdInMicroAlgo(uint64)uint64 ABI method.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  usdInMicroAlgo(params?: CallParams<NfdRegistryArgs['obj']['usdInMicroAlgo(uint64)uint64'] | NfdRegistryArgs['tuple']['usdInMicroAlgo(uint64)uint64']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['usdInMicroAlgo(uint64)uint64'] | undefined]>\n\n  /**\n   * Calls the costToAddToAddress(address)uint64 ABI method.\n   *\n   * Returns the cost to add an NFD to the reverse-lookup data\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  costToAddToAddress(params?: CallParams<NfdRegistryArgs['obj']['costToAddToAddress(address)uint64'] | NfdRegistryArgs['tuple']['costToAddToAddress(address)uint64']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['costToAddToAddress(address)uint64'] | undefined]>\n\n  /**\n   * Calls the calcFuturePrice(uint64,uint64)uint64 ABI method.\n   *\n   * Calculates the future price based on the current price and the number of years.\n   *\n   * @param args The arguments for the contract call\n   * @param params Any additional parameters for the call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  calcFuturePrice(params?: CallParams<NfdRegistryArgs['obj']['calcFuturePrice(uint64,uint64)uint64'] | NfdRegistryArgs['tuple']['calcFuturePrice(uint64,uint64)uint64']>): NfdRegistryComposer<[...TReturns, NfdRegistryReturns['calcFuturePrice(uint64,uint64)uint64'] | undefined]>\n\n  /**\n   * Makes a clear_state call to an existing instance of the NFDRegistry smart contract.\n   *\n   * @param args The arguments for the bare call\n   * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n   */\n  clearState(params?: AppClientBareCallParams): NfdRegistryComposer<[...TReturns, undefined]>\n\n  /**\n   * Adds a transaction to the composer\n   *\n   * @param txn A transaction to add to the transaction group\n   * @param signer The optional signer to use when signing this transaction.\n   */\n  addTransaction(txn: Transaction, signer?: TransactionSigner): NfdRegistryComposer<TReturns>\n  /**\n   * Returns the underlying AtomicTransactionComposer instance\n   */\n  composer(): Promise<TransactionComposer>\n  /**\n   * Simulates the transaction group and returns the result\n   */\n  simulate(): Promise<NfdRegistryComposerResults<TReturns> & { simulateResponse: SimulateResponse }>\n  simulate(options: SkipSignaturesSimulateOptions): Promise<NfdRegistryComposerResults<TReturns> & { simulateResponse: SimulateResponse }>\n  simulate(options: RawSimulateOptions): Promise<NfdRegistryComposerResults<TReturns> & { simulateResponse: SimulateResponse }>\n  /**\n   * Sends the transaction group to the network and returns the results\n   */\n  send(params?: SendParams): Promise<NfdRegistryComposerResults<TReturns>>\n}\nexport type NfdRegistryComposerResults<TReturns extends [...any[]]> = Expand<SendAtomicTransactionComposerResults & {\n  returns: TReturns\n}>\n\n","import { AlgorandClient } from '@algorandfoundation/algokit-utils'\nimport { TransactionSignerAccount } from '@algorandfoundation/algokit-utils/types/account'\nimport { Address, decodeUint64 } from 'algosdk'\nimport crypto from 'crypto-js'\n\nimport { DefaultSender, NfdRegistryId } from '../constants'\nimport { NfdInstanceClient } from '../contracts/NFDInstanceClient'\nimport { NfdRegistryClient } from '../contracts/NFDRegistryClient'\n\nimport type { NfdClient } from '../client'\nimport type { Constraints } from '../contracts/NFDRegistryClient'\n\n/**\n * Base module class that all other modules will extend\n */\nexport abstract class BaseModule {\n  protected readonly client: NfdClient\n  protected readonly algorand: AlgorandClient\n  protected readonly registryId: bigint\n  private readonly _defaultSender: string\n\n  constructor(client: NfdClient) {\n    this.client = client\n    this.algorand = client.algorand\n    this.registryId = client.registryId\n\n    // Determine the default sender based on the registry ID\n    this._defaultSender =\n      this.registryId === BigInt(NfdRegistryId.TESTNET)\n        ? DefaultSender.TESTNET\n        : DefaultSender.MAINNET\n  }\n\n  /**\n   * Get the current signer\n   * @returns The current signer or null if not set\n   */\n  protected getSigner(): TransactionSignerAccount | null {\n    return this.client.signer\n  }\n\n  /**\n   * Ensure a signer is set before proceeding\n   * @returns The current signer\n   * @throws If no signer is set\n   */\n  protected requireSigner(): TransactionSignerAccount {\n    const signer = this.getSigner()\n    if (!signer) {\n      throw new Error('Signer required. Call setSigner() first.')\n    }\n    return signer\n  }\n\n  /**\n   * Get a registry client\n   * @param defaultSender - Optional default sender address\n   * @returns The NFD registry client\n   */\n  protected getRegistryClient(\n    defaultSender: string | Address = this._defaultSender,\n  ): NfdRegistryClient {\n    return this.algorand.client.getTypedAppClientById(NfdRegistryClient, {\n      appId: this.registryId,\n      defaultSender,\n    })\n  }\n\n  /**\n   * Get an NFD instance client\n   * @param nfdAppId - The NFD's application ID\n   * @param defaultSender - Optional default sender address\n   * @returns The NFD instance client\n   */\n  protected getInstanceClient(\n    nfdAppId: bigint,\n    defaultSender: string | Address = this._defaultSender,\n  ): NfdInstanceClient {\n    return this.algorand.client.getTypedAppClientById(NfdInstanceClient, {\n      appId: nfdAppId,\n      defaultSender,\n    })\n  }\n\n  /**\n   * Get the box name for an NFD in the registry\n   * @param nfdName - The NFD name to get the box name for\n   * @returns The box name as a Uint8Array\n   */\n  protected getRegistryBoxNameForNFD(nfdName: string): Uint8Array {\n    const hash = crypto.SHA256(`name/${nfdName}`)\n    const wordArray = crypto.enc.Hex.parse(hash.toString())\n    const u8 = new Uint8Array(wordArray.words.length * 4)\n    wordArray.words.forEach((word: number, i: number) => {\n      u8[i * 4 + 0] = (word >> 24) & 0xff\n      u8[i * 4 + 1] = (word >> 16) & 0xff\n      u8[i * 4 + 2] = (word >> 8) & 0xff\n      u8[i * 4 + 3] = word & 0xff\n    })\n    return u8\n  }\n\n  /**\n   * Get an NFD's application ID from its name\n   * @param name - The NFD name\n   * @returns The NFD's application ID or null if not found\n   */\n  protected async getAppIdFromName(name: string): Promise<bigint | null> {\n    const registryClient = this.getRegistryClient()\n    const boxName = this.getRegistryBoxNameForNFD(name)\n    try {\n      const appIdBytes = await registryClient.appClient.getBoxValue(boxName)\n      if (!appIdBytes) {\n        return null\n      }\n      // Take the second 8 bytes for the app ID (bytes 8-15)\n      const appIdBytesSliced = appIdBytes.slice(8, 16)\n      return decodeUint64(appIdBytesSliced, 'bigint')\n    } catch (error) {\n      // Check if error is a 404 response\n      if (error instanceof Error && error.message.includes('404')) {\n        return null\n      }\n      // Re-throw other errors\n      throw error\n    }\n  }\n\n  /**\n   * Get the protocol constraints from the NFD registry\n   * @returns The protocol constraints\n   * @throws If an error occurs while fetching the constraints\n   */\n  protected async getConstraints(): Promise<Constraints> {\n    const registryClient = this.getRegistryClient()\n\n    try {\n      const result = await registryClient.newGroup().getConstraints().simulate({\n        skipSignatures: true,\n        allowUnnamedResources: true,\n      })\n\n      if (!result.returns) {\n        throw new Error('No data returned')\n      }\n\n      const constraints = result.returns[0]\n      if (!constraints) {\n        throw new Error('No constraints returned')\n      }\n\n      return constraints\n    } catch (error) {\n      throw new Error(\n        `Failed to get protocol constraints: ${error instanceof Error ? error.message : String(error)}`,\n      )\n    }\n  }\n}\n","import { Address } from 'algosdk'\n\nimport { isZeroBytes } from '../utils/internal/bytes'\nimport { determineNfdState, generateMetaTags } from '../utils/internal/nfd'\nimport { parseAddress, parseString, parseUint64 } from '../utils/internal/state'\nimport { isValidName } from '../utils/nfd'\n\nimport { BaseModule } from './base'\n\nimport type { Nfd } from '../types'\n\n/**\n * Options for resolving an NFD\n */\nexport interface ResolveOptions {\n  /**\n   * The view type to use for the response\n   * - 'tiny': Only include internal, caAlgo, and url properties\n   * - 'brief': Include internal, caAlgo, url, avatar, and reservedFor properties\n   * - 'full': Include all properties\n   */\n  view?: 'tiny' | 'brief' | 'full'\n}\n\n/**\n * Module for NFD lookup and resolution operations\n */\nexport class LookupModule extends BaseModule {\n  /**\n   * Parse a name or app ID input into a bigint app ID\n   * @param nameOrAppId - The NFD name or application ID to parse\n   * @returns The NFD's application ID as a bigint\n   * @throws If the input is an invalid NFD name or the NFD does not exist\n   */\n  private async parseAppId(\n    nameOrAppId: string | number | bigint,\n  ): Promise<bigint> {\n    // If it's already a number or bigint, just return it\n    if (typeof nameOrAppId !== 'string') {\n      return BigInt(nameOrAppId)\n    }\n\n    // Try to parse as a number first\n    const parsedNumber = parseInt(nameOrAppId)\n    if (!isNaN(parsedNumber)) {\n      return BigInt(parsedNumber)\n    }\n\n    // Validate and lookup NFD name\n    if (!isValidName(nameOrAppId)) {\n      throw new Error(\n        `Invalid NFD name: ${nameOrAppId}. Name must be in the format 'name.algo' or 'segment.name.algo'`,\n      )\n    }\n\n    const appId = await this.getAppIdFromName(nameOrAppId)\n    if (appId === null) {\n      throw new Error(`NFD not found: ${nameOrAppId}`)\n    }\n\n    return appId\n  }\n\n  /**\n   * Resolve an NFD by name or application ID by reading directly from the blockchain\n   * @param nameOrAppId - The NFD name or application ID to resolve\n   * @param options - Optional parameters\n   * @returns The NFD record\n   * @throws If the NFD name is invalid or not found\n   */\n  public async resolve(\n    nameOrAppId: string | number | bigint,\n    options: ResolveOptions = {},\n  ): Promise<Nfd> {\n    // Get the NFD app ID\n    const nfdAppId = await this.parseAppId(nameOrAppId)\n\n    // Get the NFD instance client\n    const instanceClient = this.getInstanceClient(nfdAppId)\n\n    // Get the global state in a single request\n    const globalState = await instanceClient.appClient.getGlobalState()\n\n    // Get all boxes to find user-defined and verified properties\n    const boxes = await instanceClient.appClient.getBoxNames()\n\n    // Filter boxes based on view type\n    const view = options.view ?? 'brief'\n    const filteredBoxes = boxes.filter((box) => {\n      const boxName = box.name\n      if (view === 'tiny') {\n        // Only include caAlgo and url properties\n        return (\n          boxName === 'v.caAlgo.0.as' ||\n          boxName === 'u.caalgo' ||\n          boxName === 'u.url'\n        )\n      }\n      if (view === 'brief') {\n        // Include caAlgo, url, avatar, and reservedFor properties\n        return (\n          boxName === 'v.caAlgo.0.as' ||\n          boxName === 'u.caalgo' ||\n          boxName === 'u.url' ||\n          boxName === 'u.avatar' ||\n          boxName === 'v.avatar' ||\n          boxName === 'v.avatarasaid' ||\n          boxName === 'v.reservedFor'\n        )\n      }\n      // Include all boxes for full view\n      return true\n    })\n\n    const userDefined: Record<string, string> = {}\n    const verified: Record<string, string> = {}\n    const caAlgo: string[] = []\n    const unverifiedCaAlgo: string[] = []\n\n    // Process filtered boxes\n    const boxGroups: Record<string, string[]> = {}\n\n    // Group box names by their base field name to handle split fields\n    for (const box of filteredBoxes) {\n      const boxName = box.name\n      if (boxName.startsWith('u.') || boxName.startsWith('v.')) {\n        // Check if this is a split field (has _XX suffix)\n        const splitMatch = boxName.match(/^([uv]\\.[^_]+)_(\\d{2})$/)\n\n        if (splitMatch) {\n          // This is a split field, group it by base name\n          const baseName = splitMatch[1]\n          const index = parseInt(splitMatch[2])\n\n          if (!boxGroups[baseName]) {\n            boxGroups[baseName] = []\n          }\n          // Store the box name at the correct index\n          boxGroups[baseName][index] = boxName\n        } else {\n          // Regular field (not split), add it as a single-item array\n          boxGroups[boxName] = [boxName]\n        }\n      }\n    }\n\n    // Process each group of boxes\n    for (const [baseFieldName, boxNames] of Object.entries(boxGroups)) {\n      // Sort the box names to ensure correct order (important for split fields)\n      boxNames.sort()\n\n      let value = new Uint8Array(0)\n\n      // Fetch and combine values from all boxes in this group\n      for (const boxName of boxNames) {\n        if (!boxName) continue // Skip undefined entries\n\n        const box = filteredBoxes.find((b) => b.name === boxName)\n        if (!box) continue\n\n        const boxValue = await instanceClient.appClient.getBoxValue(box.nameRaw)\n        if (!boxValue) continue\n\n        // Concatenate the value\n        const newCombined = new Uint8Array(value.length + boxValue.length)\n        newCombined.set(value)\n        newCombined.set(boxValue, value.length)\n        value = newCombined\n      }\n\n      if (value.length === 0) continue\n\n      // Process the combined value based on field type\n      if (baseFieldName === 'v.caAlgo.0.as') {\n        // For verified caAlgo, the value contains concatenated 32-byte public keys\n        try {\n          // Each Algorand address public key is 32 bytes\n          const PUBLIC_KEY_LENGTH = 32\n\n          // Split the value into chunks of 32 bytes\n          for (let i = 0; i < value.length; i += PUBLIC_KEY_LENGTH) {\n            const publicKey = value.slice(i, i + PUBLIC_KEY_LENGTH)\n\n            // Skip zero addresses (all bytes are zero)\n            if (isZeroBytes(publicKey)) {\n              continue\n            }\n\n            try {\n              const address = new Address(publicKey).toString()\n              if (address) {\n                caAlgo.push(address)\n              }\n            } catch (error) {\n              console.error(\n                'Failed to parse Algorand address from caAlgo box at offset',\n                i,\n                ':',\n                error,\n              )\n            }\n          }\n\n          // Set the verified.caAlgo property as a comma-delimited string\n          if (caAlgo.length > 0) {\n            verified.caAlgo = caAlgo.join(',')\n          }\n        } catch (error) {\n          console.error('Failed to parse Algorand addresses from box:', error)\n        }\n      } else if (baseFieldName.startsWith('u.')) {\n        // User-defined field\n        const propertyName = baseFieldName.slice(2) // Remove 'u.'\n        const propertyValue = new TextDecoder('utf-8').decode(value)\n        userDefined[propertyName] = propertyValue\n\n        // Extract unverified Algorand addresses\n        if (propertyName === 'caalgo') {\n          // Split comma-separated addresses and filter out empty strings\n          const addresses = propertyValue\n            .split(',')\n            .map((addr) => addr.trim())\n            .filter(Boolean)\n          unverifiedCaAlgo.push(...addresses)\n        }\n      } else if (baseFieldName.startsWith('v.')) {\n        // Verified field\n        const propertyName = baseFieldName.slice(2) // Remove 'v.'\n        const propertyValue = new TextDecoder('utf-8').decode(value)\n        verified[propertyName] = propertyValue\n      }\n    }\n\n    const expirationTime = parseUint64('i.expirationTime', globalState)\n    const isExpired =\n      expirationTime > 0 && Math.floor(Date.now() / 1000) > expirationTime\n\n    const stateParams = {\n      expired: isExpired,\n      owner: parseAddress('i.owner.a', globalState),\n      nfdAccount: instanceClient.appAddress.toString(),\n      reservedFor: verified['reservedFor'],\n      sellAmount: parseUint64('i.sellamt', globalState),\n      isMinting: parseString('i.minting', globalState) !== '',\n    }\n    const state = determineNfdState(stateParams)\n\n    const name = parseString('i.name', globalState)\n    const segmentCount = parseUint64('i.segmentCount', globalState)\n    const metaTags = generateMetaTags(name, segmentCount)\n\n    // Map the state values to an NFD object\n    const nfd: Nfd = {\n      name,\n      appID: Number(nfdAppId),\n      asaID: parseUint64('i.asaid', globalState),\n      ...(globalState['i.parentAppID'] && {\n        parentAppID: parseUint64('i.parentAppID', globalState),\n      }),\n      owner: parseAddress('i.owner.a', globalState),\n      state,\n      ...(isExpired && { expired: true }),\n      ...(state === 'owned' && {\n        depositAccount:\n          caAlgo[0] ??\n          unverifiedCaAlgo[0] ??\n          parseAddress('i.owner.a', globalState),\n      }),\n      ...(parseUint64('i.sellamt', globalState) > 0 && {\n        sellAmount: parseUint64('i.sellamt', globalState),\n      }),\n      seller: parseAddress('i.seller.a', globalState),\n      nfdAccount: instanceClient.appAddress.toString(),\n      metaTags,\n      timeCreated: new Date(\n        parseUint64('i.timeCreated', globalState) * 1000,\n      ).toISOString(),\n      timeChanged: new Date(\n        parseUint64('i.timeChanged', globalState) * 1000,\n      ).toISOString(),\n      timePurchased: new Date(\n        parseUint64('i.timePurchased', globalState) * 1000,\n      ).toISOString(),\n      ...(parseUint64('i.expirationTime', globalState) > 0 && {\n        timeExpires: new Date(\n          parseUint64('i.expirationTime', globalState) * 1000,\n        ).toISOString(),\n      }),\n      properties: {\n        internal: {\n          ver: parseString('i.ver', globalState),\n          contractLocked: parseString('i.contractLocked', globalState),\n          ...(globalState['i.segmentLocked'] && {\n            segmentLocked: parseString('i.segmentLocked', globalState),\n          }),\n          ...(parseUint64('i.segmentCount', globalState) > 0 && {\n            segmentCount: parseUint64('i.segmentCount', globalState).toString(),\n          }),\n          ...(globalState['i.vaultOptInLocked']?.value && {\n            vaultOptInLocked: parseString('i.vaultOptInLocked', globalState),\n          }),\n          ...(parseUint64('i.segmentPriceUsd', globalState) > 0 && {\n            segmentPriceUsd: parseUint64(\n              'i.segmentPriceUsd',\n              globalState,\n            ).toString(),\n          }),\n          highestSoldAmt: parseUint64(\n            'i.highestSoldAmt',\n            globalState,\n          ).toString(),\n          ...(parseAddress('i.segmentAgent', globalState) && {\n            segmentAgent: parseAddress('i.segmentAgent', globalState),\n          }),\n          category: parseString('i.category', globalState),\n          saleType: parseString('i.saleType', globalState),\n          // Mirror top-level properties\n          name: parseString('i.name', globalState),\n          owner: parseAddress('i.owner.a', globalState),\n          seller: parseAddress('i.seller.a', globalState),\n          asaid: parseUint64('i.asaid', globalState).toString(),\n          ...(globalState['i.parentAppID'] && {\n            parentAppID: parseUint64('i.parentAppID', globalState).toString(),\n          }),\n          timeChanged: parseUint64('i.timeChanged', globalState).toString(),\n          timeCreated: parseUint64('i.timeCreated', globalState).toString(),\n          timePurchased: parseUint64('i.timePurchased', globalState).toString(),\n          ...(parseUint64('i.expirationTime', globalState) > 0 && {\n            expirationTime: parseUint64(\n              'i.expirationTime',\n              globalState,\n            ).toString(),\n          }),\n        },\n        ...(Object.keys(userDefined).length > 0 && { userDefined }),\n        ...(Object.keys(verified).length > 0 && { verified }),\n      },\n      ...(caAlgo.length > 0 && { caAlgo }),\n      ...(unverifiedCaAlgo.length > 0 && { unverifiedCaAlgo }),\n    }\n\n    return nfd\n  }\n}\n","import algosdk from 'algosdk';\n\n/** Wrapper class to ensure safe, explicit conversion between µAlgo, Algo and numbers */\nclass AlgoAmount {\n    /** Return the amount as a number in µAlgo */\n    get microAlgos() {\n        return this.amountInMicroAlgo;\n    }\n    /** Return the amount as a number in µAlgo */\n    get microAlgo() {\n        return this.amountInMicroAlgo;\n    }\n    /** Return the amount as a number in Algo */\n    get algos() {\n        return algosdk.microalgosToAlgos(Number(this.amountInMicroAlgo));\n    }\n    /** Return the amount as a number in Algo */\n    get algo() {\n        return algosdk.microalgosToAlgos(Number(this.amountInMicroAlgo));\n    }\n    /**\n     * Create a new `AlgoAmount` instance.\n     *\n     * @param amount - An object specifying the amount in Algo or µALGO. Use the key 'algo' for Algo amounts and 'microAlgo' for µALGO.\n     * @returns A new instance of `AlgoAmount` representing the specified amount.\n     * @example\n     * ```typescript\n     * const amount = new AlgoAmount({ algo: 5 });\n     * ```\n     */\n    constructor(amount) {\n        this.amountInMicroAlgo =\n            'microAlgos' in amount\n                ? BigInt(amount.microAlgos)\n                : 'microAlgo' in amount\n                    ? BigInt(amount.microAlgo)\n                    : 'algos' in amount\n                        ? BigInt(algosdk.algosToMicroalgos(Number(amount.algos)))\n                        : BigInt(algosdk.algosToMicroalgos(Number(amount.algo)));\n    }\n    toString() {\n        return `${this.microAlgo.toLocaleString('en-US')} µALGO`;\n    }\n    /** valueOf allows you to use `AlgoAmount` in comparison operations such as `<` and `>=` etc.,\n     * but it's not recommended to use this to convert to a number, it's much safer to explicitly call\n     * the algos or microAlgos properties\n     */\n    valueOf() {\n        return Number(this.microAlgo);\n    }\n    /** Create a `AlgoAmount` object representing the given number of Algo */\n    static Algos(amount) {\n        return new AlgoAmount({ algos: amount });\n    }\n    /** Create a `AlgoAmount` object representing the given number of Algo */\n    static Algo(amount) {\n        return new AlgoAmount({ algos: amount });\n    }\n    /** Create a `AlgoAmount` object representing the given number of µAlgo */\n    static MicroAlgos(amount) {\n        return new AlgoAmount({ microAlgos: amount });\n    }\n    /** Create a `AlgoAmount` object representing the given number of µAlgo */\n    static MicroAlgo(amount) {\n        return new AlgoAmount({ microAlgos: amount });\n    }\n}\n\nexport { AlgoAmount };\n//# sourceMappingURL=amount.mjs.map\n","/**\n * Error parser utility for Algorand transaction errors\n * Provides user-friendly error messages for common Algorand transaction errors\n */\n\n/**\n * Common error patterns and their user-friendly messages\n */\nconst ERROR_PATTERNS: Record<string, string> = {\n  'fee too small':\n    'Transaction fee is too small. This usually happens when the transaction requires more resources than expected.',\n  'account .* balance .* below min':\n    'Insufficient balance: The account does not have enough ALGO to cover the minimum balance requirement.',\n  overspend:\n    'Insufficient balance: The account does not have enough ALGO to complete this transaction.',\n  'txn dead: round .* outside of':\n    'Transaction sent outside valid round range. This usually happens when a transaction takes too long to be confirmed.',\n  'logic eval error':\n    'Smart contract execution failed. The transaction could not be processed by the smart contract.',\n  'transaction rejected by ApprovalProgram':\n    'Transaction rejected by the smart contract.',\n}\n\n/**\n * Parse an error message and return a user-friendly version\n * @param error - The error object or string to parse\n * @returns A user-friendly error message\n */\nexport function parseTransactionError(error: unknown): string {\n  // Convert error to string\n  const errorMessage = error instanceof Error ? error.message : String(error)\n\n  // Process specific error patterns\n  // Insufficient balance error with details\n  const insufficientBalancePattern =\n    /account (\\w+) balance (\\d+) below min (\\d+) \\((\\d+) assets\\)/\n  let match = errorMessage.match(insufficientBalancePattern)\n  if (match) {\n    const account = match[1]\n    const balance = parseInt(match[2]) / 1_000_000 // Convert microAlgos to Algos\n    const min = parseInt(match[3]) / 1_000_000\n    const assets = match[4]\n    return `Insufficient balance: Account ${account} has ${balance} ALGO which is below the minimum ${min} ALGO required (${assets} assets)`\n  }\n\n  // Overspend error with details\n  const overspendPattern =\n    /account (\\w+), data.*MicroAlgos:\\{Raw:(\\d+)\\}[^}]*\\}[^}]*\\}[^}]*\\}[^}]*\\}[^}]*\\}[^}]*\\}, tried to spend \\{(\\d+)\\}/s\n  match = errorMessage.match(overspendPattern)\n  if (match) {\n    const account = match[1]\n    const balance = parseInt(match[2]) / 1_000_000\n    const triedToSpend = parseInt(match[3]) / 1_000_000\n    return `Insufficient balance: Account ${account} has ${balance} ALGO available but attempted to spend ${triedToSpend} ALGO`\n  }\n\n  // Transaction sent outside range error\n  const outsideRangePattern = /txn dead: round (\\d+) outside of (\\d+)--(\\d+)/\n  match = errorMessage.match(outsideRangePattern)\n  if (match) {\n    const round = match[1]\n    const rangeStart = match[2]\n    const rangeEnd = match[3]\n    return `Transaction sent outside valid round range: round ${round} outside of ${rangeStart}–${rangeEnd}`\n  }\n\n  // Smart contract logic eval error\n  const smartContractErrorPattern = /transaction (\\w+): logic eval error: (.+)/\n  match = errorMessage.match(smartContractErrorPattern)\n  if (match) {\n    const txnId = match[1]\n    const details = match[2]\n    return `Smart contract logic eval error: ${details}. Transaction: ${txnId}`\n  }\n\n  // Transaction rejected by smart contract error\n  const rejectedByContractPattern =\n    /transaction (\\w+): transaction rejected by ApprovalProgram/\n  match = errorMessage.match(rejectedByContractPattern)\n  if (match) {\n    const txnId = match[1]\n    return `Transaction rejected by smart contract. Transaction: ${txnId}`\n  }\n\n  // Check for general patterns if no specific regex matched\n  for (const [pattern, friendlyMessage] of Object.entries(ERROR_PATTERNS)) {\n    if (\n      errorMessage.toLowerCase().includes(pattern.toLowerCase()) ||\n      new RegExp(pattern, 'i').test(errorMessage)\n    ) {\n      return friendlyMessage\n    }\n  }\n\n  // If no specific pattern is found, return a cleaned-up version of the original error\n  // Remove the long stack trace and object dumps that often appear in Algorand errors\n  const cleanedError = errorMessage\n    .replace(/\\[.*?\\]/g, '') // Remove array contents in square brackets\n    .replace(/\\{.*?\\}/g, '') // Remove object contents in curly braces\n    .replace(/transactions\\..*?{/g, '{') // Remove transaction object references\n    .replace(/\\s+/g, ' ') // Replace multiple spaces with a single space\n    .trim()\n\n  // If the cleaned error is still very long, truncate it\n  if (cleanedError.length > 150) {\n    return cleanedError.substring(0, 150) + '...'\n  }\n\n  return cleanedError\n}\n\n/**\n * Wrap a function with error parsing\n * @param fn - The function to wrap\n * @returns A wrapped function that parses errors\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function withErrorParsing<T extends (...args: any[]) => Promise<any>>(\n  fn: T,\n): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>> {\n  return async (...args: Parameters<T>): Promise<Awaited<ReturnType<T>>> => {\n    try {\n      return await fn(...args)\n    } catch (error) {\n      throw new Error(parseTransactionError(error))\n    }\n  }\n}\n","import { AlgoAmount } from '@algorandfoundation/algokit-utils/types/amount'\nimport { Address } from 'algosdk'\n\nimport { parseTransactionError } from '../utils/error-parser'\nimport { strToUint8Array, concatUint8Arrays } from '../utils/internal/bytes'\n\nimport { BaseModule } from './base'\n\nimport type { NfdClient } from '../client'\nimport type { Nfd } from '../types'\n\n/**\n * Manager for operations on a specific NFD\n */\nexport class NfdManager extends BaseModule {\n  private _nfd: Nfd | null = null\n  private readonly _nameOrAppId: string | number | bigint\n\n  constructor(client: NfdClient, nameOrAppId: string | number | bigint) {\n    super(client)\n    this._nameOrAppId = nameOrAppId\n  }\n\n  /**\n   * Get the NFD instance\n   * @returns The NFD instance\n   * @throws If the NFD cannot be resolved\n   */\n  private async getNfd(): Promise<Nfd> {\n    if (!this._nfd) {\n      this._nfd = await this.client.resolve(this._nameOrAppId, { view: 'full' })\n    }\n    return this._nfd\n  }\n\n  /**\n   * Split fields and values if any values exceed the byte limit\n   * @param fieldsAndValues - Array of alternating field names and values\n   * @returns Array of field names and values, potentially split into chunks\n   * @private\n   */\n  private splitFields(fieldsAndValues: string[]): string[] {\n    const result: string[] = []\n\n    for (let i = 0; i < fieldsAndValues.length; i += 2) {\n      const field = fieldsAndValues[i]\n      const value = fieldsAndValues[i + 1]\n\n      // If value is small enough, add it directly\n      if (value.length <= 128) {\n        result.push(field, value)\n        continue\n      }\n\n      // Split large values into chunks\n      const chunks = Math.ceil(value.length / 128)\n      for (let j = 0; j < chunks; j++) {\n        const start = j * 128\n        const end = Math.min(start + 128, value.length)\n        const chunk = value.substring(start, end)\n        const chunkField = `${field}.${j + 1}`\n        result.push(chunkField, chunk)\n      }\n\n      // Add a count field\n      result.push(`${field}.count`, chunks.toString())\n    }\n\n    return result\n  }\n\n  /**\n   * Link an Algorand address to the NFD\n   * @param address - The Algorand address to link\n   * @returns The updated NFD\n   * @throws If the address cannot be linked\n   */\n  public async linkAddress(address: string | Address): Promise<Nfd> {\n    const signer = this.requireSigner()\n    const nfd = await this.getNfd()\n\n    // Ensure the default signer is the owner\n    if (signer.addr.toString() !== nfd.owner) {\n      throw new Error('Only the owner can link addresses to this NFD')\n    }\n\n    // Get the Address to link\n    const addressToLink =\n      typeof address === 'string' ? Address.fromString(address) : address\n\n    // If address to link is not the default signer (owner), add a signer for it\n    if (signer.addr !== addressToLink) {\n      this.algorand.setSigner(addressToLink, signer.signer)\n    }\n\n    // Get the NFD instance client\n    if (!nfd.appID) {\n      throw new Error('NFD has no application ID')\n    }\n    const nfdAppId = BigInt(nfd.appID)\n    const nfdInstanceClient = this.getInstanceClient(nfdAppId, signer.addr)\n\n    // Prepare the fields to update\n    const fieldsToUpdate: Uint8Array[] = [\n      strToUint8Array('u.cav.algo.a'),\n      addressToLink.publicKey,\n    ]\n\n    // Get current v.caAlgo.0.as box value/size\n    let curCaAlgo: Uint8Array\n    try {\n      curCaAlgo = await nfdInstanceClient.appClient.getBoxValue('v.caAlgo.0.as')\n    } catch {\n      curCaAlgo = new Uint8Array()\n    }\n\n    // Calculate the eventual fields after the update\n    const eventualFields: Uint8Array[] = [\n      fieldsToUpdate[0],\n      fieldsToUpdate[1],\n      strToUint8Array('v.caAlgo.0.as'),\n      concatUint8Arrays(curCaAlgo, addressToLink.publicKey),\n    ]\n\n    // Get the cost of the update\n    const updateCostResult = await nfdInstanceClient\n      .newGroup()\n      .getFieldUpdateCost({ args: { fieldAndVals: eventualFields } })\n      .simulate({ skipSignatures: true, allowUnnamedResources: true })\n\n    const updateCost = updateCostResult.returns[0] || 0n\n\n    // Create a transaction group for the update\n    const nfdNewGroup = nfdInstanceClient.newGroup()\n\n    // Add payment transaction for the update cost\n    const updatePaymentTxn = await this.algorand.createTransaction.payment({\n      sender: signer.addr,\n      receiver: nfdInstanceClient.appAddress,\n      amount: AlgoAmount.MicroAlgos(updateCost),\n    })\n\n    nfdNewGroup.addTransaction(updatePaymentTxn)\n    nfdNewGroup.updateFields({ args: { fieldAndVals: fieldsToUpdate } })\n\n    // Get the registry client\n    const registryClient = this.getRegistryClient(signer.addr)\n\n    // Get the cost to add to registry\n    const regMbrCostResult = await registryClient\n      .newGroup()\n      .costToAddToAddress({ args: { lookupAddress: addressToLink.toString() } })\n      .simulate({ skipSignatures: true, allowUnnamedResources: true })\n\n    const regMbrCost = regMbrCostResult.returns[0] || 0n\n\n    // Add payment transaction if needed\n    if (regMbrCost > 0n) {\n      const regPaymentTxn = await this.algorand.createTransaction.payment({\n        sender: signer.addr,\n        receiver: registryClient.appAddress,\n        amount: AlgoAmount.MicroAlgos(regMbrCost),\n      })\n\n      nfdNewGroup.addTransaction(regPaymentTxn)\n    }\n\n    // Create the link transaction\n    const linkRegAddress =\n      await registryClient.createTransaction.linkNfdAddress({\n        args: {\n          nfdName: nfd.name,\n          nfdAppId: nfdInstanceClient.appId,\n          addrToVerify: addressToLink.toString(),\n        },\n        sender: addressToLink,\n        staticFee: AlgoAmount.MicroAlgos(3000),\n      })\n\n    try {\n      // Send the transaction group\n      await nfdNewGroup\n        .addTransaction(linkRegAddress.transactions[0])\n        .send({ populateAppCallResources: true })\n    } catch (error) {\n      throw new Error(`Failed to link address: ${parseTransactionError(error)}`)\n    }\n\n    // Refresh the NFD data\n    this._nfd = null\n    return this.getNfd()\n  }\n\n  /**\n   * Unlink an Algorand address from the NFD\n   * @param address - The Algorand address to unlink\n   * @returns The updated NFD\n   * @throws If the address cannot be unlinked\n   */\n  public async unlinkAddress(address: string | Address): Promise<Nfd> {\n    const signer = this.requireSigner()\n    const nfd = await this.getNfd()\n\n    // Ensure the default signer is the owner\n    if (signer.addr.toString() !== nfd.owner) {\n      throw new Error('Only the owner can unlink addresses from this NFD')\n    }\n\n    // Get the Address to unlink\n    const addressToUnlink =\n      typeof address === 'string' ? Address.fromString(address) : address\n\n    // Get the NFD instance client\n    if (!nfd.appID) {\n      throw new Error('NFD has no application ID')\n    }\n    const nfdAppId = BigInt(nfd.appID)\n    const nfdInstanceClient = this.getInstanceClient(nfdAppId, signer.addr)\n\n    // Get the registry client\n    const registryClient = this.getRegistryClient(signer.addr)\n\n    try {\n      // Create and execute the unlink transaction\n      await registryClient\n        .newGroup()\n        .unlinkNfdAddress({\n          args: {\n            nfdName: nfd.name,\n            nfdAppId: nfdInstanceClient.appId,\n            addrToUnlink: addressToUnlink.toString(),\n          },\n          staticFee: AlgoAmount.MicroAlgos(5000),\n        })\n        .send({ populateAppCallResources: true })\n    } catch (error) {\n      throw new Error(\n        `Failed to unlink address: ${parseTransactionError(error)}`,\n      )\n    }\n\n    // Refresh the NFD data\n    this._nfd = null\n    return this.getNfd()\n  }\n\n  /**\n   * Set user-defined metadata for the NFD\n   * @param metadata - Object containing metadata key-value pairs to set\n   * @returns The updated NFD\n   * @throws If the metadata cannot be set\n   */\n  public async setMetadata(metadata: Record<string, string>): Promise<Nfd> {\n    const signer = this.requireSigner()\n    const nfd = await this.getNfd()\n\n    // Ensure the default signer is the owner\n    if (signer.addr.toString() !== nfd.owner) {\n      throw new Error('Only the owner can set metadata for this NFD')\n    }\n\n    // Get the NFD instance client\n    if (!nfd.appID) {\n      throw new Error('NFD has no application ID')\n    }\n    const nfdAppId = BigInt(nfd.appID)\n    const nfdInstanceClient = this.getInstanceClient(nfdAppId, signer.addr)\n\n    // Convert metadata object to array of fields and values\n    const fieldsAndValues: string[] = []\n    for (const [key, value] of Object.entries(metadata)) {\n      fieldsAndValues.push(`u.${key}`, value)\n    }\n\n    // Split fields if any values exceed the byte limit\n    const fieldsToUpdate = this.splitFields(fieldsAndValues)\n\n    // Calculate update cost for all fields\n    let updateCost = 0n\n    const newGroup = nfdInstanceClient.newGroup()\n\n    // Get cost for each field update\n    for (let i = 0; i < fieldsToUpdate.length; i += 2) {\n      newGroup.getFieldUpdateCost({\n        args: {\n          fieldAndVals: [\n            strToUint8Array(fieldsToUpdate[i]),\n            strToUint8Array(fieldsToUpdate[i + 1]),\n          ],\n        },\n        note: i.toString(),\n      })\n    }\n\n    // Simulate to get costs\n    const simReturn = await newGroup.simulate({\n      skipSignatures: true,\n      allowUnnamedResources: true,\n    })\n\n    const simResult = simReturn.returns\n\n    // Sum up all costs\n    for (let i = 0; i < fieldsToUpdate.length / 2; i += 1) {\n      if (simResult[i]) {\n        updateCost += BigInt(simResult[i])\n      }\n    }\n\n    // Create a transaction group for the update\n    const updateGroup = nfdInstanceClient.newGroup()\n\n    // Add payment transaction for the update cost\n    const updatePaymentTxn = await this.algorand.createTransaction.payment({\n      sender: signer.addr.toString(),\n      receiver: nfdInstanceClient.appAddress,\n      amount: AlgoAmount.MicroAlgos(updateCost),\n    })\n\n    updateGroup.addTransaction(updatePaymentTxn)\n\n    // Add each field update\n    for (let i = 0; i < fieldsToUpdate.length; i += 2) {\n      updateGroup.updateFields({\n        args: {\n          fieldAndVals: [\n            strToUint8Array(fieldsToUpdate[i]),\n            strToUint8Array(fieldsToUpdate[i + 1]),\n          ],\n        },\n      })\n    }\n\n    try {\n      // Execute the transaction\n      await updateGroup.send({ populateAppCallResources: true })\n    } catch (error) {\n      throw new Error(`Failed to set metadata: ${parseTransactionError(error)}`)\n    }\n\n    // Refresh the NFD data\n    this._nfd = null\n    return this.getNfd()\n  }\n\n  /**\n   * Set a specific address as the primary address for the NFD\n   * @param address - The Algorand address to set as primary\n   * @returns The updated NFD\n   * @throws If the address cannot be set as primary\n   */\n  public async setPrimaryAddress(address: string | Address): Promise<Nfd> {\n    const signer = this.requireSigner()\n    const nfd = await this.getNfd()\n\n    // Ensure the default signer is the owner\n    if (signer.addr.toString() !== nfd.owner) {\n      throw new Error('Only the owner can set the primary address for this NFD')\n    }\n\n    // Get the Address to set as primary\n    const addressToSet =\n      typeof address === 'string' ? Address.fromString(address) : address\n\n    // Get the NFD instance client\n    if (!nfd.appID) {\n      throw new Error('NFD has no application ID')\n    }\n    const nfdAppId = BigInt(nfd.appID)\n    const nfdInstanceClient = this.getInstanceClient(nfdAppId, signer.addr)\n\n    // The only supported field for now is 'v.caAlgo.0.as'\n    const fieldName = 'v.caAlgo.0.as'\n\n    try {\n      // Create and execute the setPrimaryAddress transaction\n      await nfdInstanceClient\n        .newGroup()\n        .setPrimaryAddress({\n          args: {\n            fieldName,\n            address: addressToSet.toString(),\n          },\n          staticFee: AlgoAmount.MicroAlgos(3000),\n        })\n        .send({ populateAppCallResources: true })\n    } catch (error) {\n      throw new Error(\n        `Failed to set primary address: ${parseTransactionError(error)}`,\n      )\n    }\n\n    // Refresh the NFD data\n    this._nfd = null\n    return this.getNfd()\n  }\n\n  /**\n   * Set this NFD as the primary NFD for a specific address\n   * @param address - The Algorand address to set this NFD as primary for\n   * @returns The updated NFD\n   * @throws If the NFD cannot be set as primary for the address\n   */\n  public async setPrimaryNfd(address: string | Address): Promise<Nfd> {\n    const signer = this.requireSigner()\n    const nfd = await this.getNfd()\n\n    // Get the Address to set this NFD as primary for\n    const targetAddress =\n      typeof address === 'string' ? Address.fromString(address) : address\n\n    // Get the NFD app ID\n    if (!nfd.appID) {\n      throw new Error('NFD has no application ID')\n    }\n    const nfdAppId = BigInt(nfd.appID)\n\n    // Get the registry client\n    const registryClient = this.getRegistryClient(signer.addr)\n\n    try {\n      await registryClient\n        .newGroup()\n        .setAddressPrimaryNfd({\n          sender: targetAddress,\n          args: {\n            nfdName: nfd.name,\n            nfdAppId,\n            addrBeingModified: targetAddress.toString(),\n          },\n          staticFee: AlgoAmount.MicroAlgos(3000),\n        })\n        .send({ populateAppCallResources: true })\n    } catch (error) {\n      throw new Error(\n        `Failed to set primary NFD: ${parseTransactionError(error)}`,\n      )\n    }\n\n    // Refresh the NFD data\n    this._nfd = null\n    return this.getNfd()\n  }\n}\n","import { AlgoAmount } from '@algorandfoundation/algokit-utils/types/amount'\n\nimport {\n  canMintSegment,\n  extractParentName,\n  isSegmentName,\n  isValidName,\n} from '../utils/nfd'\n\nimport { BaseModule } from './base'\n\nimport type { PriceInfo } from '../contracts/NFDRegistryClient'\nimport type { Nfd } from '../types'\n\n/**\n * Configuration options for minting a new NFD\n */\nexport interface NfdMintParams {\n  /**\n   * The address of the buyer\n   */\n  buyer: string\n\n  /**\n   * Number of years until expiration (1-20)\n   */\n  years: number\n}\n\n/**\n * Configuration options for getting an NFD price quote\n */\nexport interface NfdMintQuoteParams {\n  /**\n   * The address of the potential buyer\n   */\n  buyer: string\n\n  /**\n   * Number of years to get a quote for (default: 1)\n   */\n  years?: number\n}\n\n/**\n * Detailed price quote for minting an NFD\n */\nexport interface NfdMintQuote {\n  /** Base price for the specified years in microAlgos */\n  basePrice: bigint\n  /** Fixed carry cost in microAlgos */\n  carryCost: bigint\n  /** Extra fee for minting in microAlgos */\n  extraFee: bigint\n  /** Total price including all fees in microAlgos */\n  totalPrice: bigint\n  /** Number of years the quote is for */\n  years: number\n  /** The NFD name being quoted */\n  nfdName: string\n  /** The address of the buyer */\n  buyer: string\n  /** Whether the NFD is a segment */\n  isSegment: boolean\n}\n\n/**\n * Module for NFD minting and renewal operations\n */\nexport class MintingModule extends BaseModule {\n  /**\n   * Validate segment minting permissions\n   * @internal\n   * @param segmentName - The segment NFD name to validate\n   * @param caller - The address of the caller/potential buyer\n   * @throws If the segment name is invalid, the parent NFD does not exist, or the caller is not authorized to mint a segment\n   */\n  private async validateSegmentMinting(\n    segmentName: string,\n    caller: string,\n  ): Promise<void> {\n    // Extract the parent NFD name from the segment name (throws if invalid)\n    const parentName = extractParentName(segmentName)\n\n    try {\n      // Resolve the parent NFD to check its properties\n      const parentNfd = await this.client.resolve(parentName)\n\n      // Check if the caller is authorized to mint a segment\n      if (!canMintSegment(parentNfd, caller)) {\n        throw new Error(\n          `Cannot mint segment '${segmentName}' due to permission restrictions on the parent NFD '${parentName}'. ` +\n            `Only the owner can mint segments when segment minting is locked.`,\n        )\n      }\n    } catch (error) {\n      // If the error is that the parent NFD doesn't exist\n      if (error instanceof Error && error.message.includes('NFD not found')) {\n        throw new Error(\n          `Cannot mint segment '${segmentName}' because its parent NFD '${parentName}' does not exist. ` +\n            `A segment NFD (xxx.yyy.algo) can only be minted if its parent NFD (yyy.algo) already exists. ` +\n            `Please mint the parent NFD first.`,\n        )\n      }\n      // Re-throw other errors\n      throw error\n    }\n  }\n\n  /**\n   * Get price information for an NFD from the registry contract\n   * @param nfdName - The name of the NFD to get a price for\n   * @param caller - The address of the caller/potential buyer\n   * @returns The NFD price information\n   * @throws If the price information cannot be retrieved\n   */\n  private async getPriceInfo(\n    nfdName: string,\n    caller: string,\n  ): Promise<PriceInfo> {\n    // Validate NFD name format\n    if (!isValidName(nfdName)) {\n      throw new Error(\n        `Invalid NFD name: ${nfdName}. Name must be in the format \"xxx.algo\" or \"xxx.yyy.algo\"`,\n      )\n    }\n\n    // If the NFD is a segment, validate minting permissions\n    if (isSegmentName(nfdName)) {\n      await this.validateSegmentMinting(nfdName, caller)\n    }\n\n    // Get the registry client for executing the price query\n    const registryClient = this.getRegistryClient(caller)\n\n    // Get price quote for the NFD\n    const result = await registryClient\n      .newGroup()\n      .gas({ args: {} })\n      .getPrice({ args: { nfdName, caller } })\n      .simulate({\n        skipSignatures: true,\n        allowUnnamedResources: true,\n        extraOpcodeBudget: 2100,\n      })\n\n    // Check for simulation failure\n    const failureMessage = result.simulateResponse.txnGroups[0].failureMessage\n    if (failureMessage) {\n      throw new Error(`Failed to get price: ${failureMessage}`)\n    }\n\n    const priceInfo = result.returns[1]\n    if (!priceInfo) {\n      throw new Error('Failed to get price: Price info not returned')\n    }\n\n    return priceInfo\n  }\n\n  /**\n   * Get a price quote for minting an NFD\n   * @param nfdName - The name of the NFD to get a quote for\n   * @param params - Parameters for the quote\n   * @returns A detailed price quote including base price, fees, and total\n   * @throws If the quote cannot be generated\n   */\n  public async getMintQuote(\n    nfdName: string,\n    params: NfdMintQuoteParams,\n  ): Promise<NfdMintQuote> {\n    const { buyer, years = 1 } = params\n\n    // Validate NFD name format\n    if (!isValidName(nfdName)) {\n      throw new Error(\n        `Invalid NFD name: ${nfdName}. Name must be in the format \"xxx.algo\" or \"xxx.yyy.algo\"`,\n      )\n    }\n\n    // Check if NFD already exists\n    const existingAppId = await this.getAppIdFromName(nfdName)\n    if (existingAppId !== null) {\n      throw new Error(\n        `NFD already exists: ${nfdName} (appID: ${existingAppId})`,\n      )\n    }\n\n    // Get constraints to determine max years allowed\n    let maxYearsAllowed = 20 // Default fallback\n    try {\n      const constraints = await this.getConstraints()\n      maxYearsAllowed = Number(constraints.maxYearsAllowed)\n    } catch (error) {\n      console.warn('Failed to get constraints, using default max years:', error)\n    }\n\n    // Validate years parameter\n    if (years <= 0 || !Number.isInteger(years)) {\n      throw new Error('Years must be a positive integer')\n    }\n\n    if (years > maxYearsAllowed) {\n      throw new Error(\n        `Years cannot exceed the maximum allowed (${maxYearsAllowed})`,\n      )\n    }\n\n    // Determine if the NFD is a segment\n    const isSegment = isSegmentName(nfdName)\n\n    // If the NFD is a segment, validate minting permissions\n    if (isSegment) {\n      await this.validateSegmentMinting(nfdName, buyer)\n    }\n\n    // Get the price info from the registry\n    const priceInfo = await this.getPriceInfo(nfdName, buyer)\n\n    // Calculate extra fee based on NFD type\n    const extraFee = isSegment ? BigInt(12000) : BigInt(10000)\n\n    // Calculate base price for the specified number of years\n    const basePrice = priceInfo.oneYearPrice * BigInt(years)\n\n    // Calculate total price including all components\n    const totalPrice = basePrice + priceInfo.carryCost + extraFee\n\n    return {\n      basePrice,\n      carryCost: priceInfo.carryCost,\n      extraFee,\n      totalPrice,\n      years,\n      nfdName,\n      buyer,\n      isSegment,\n    }\n  }\n\n  /**\n   * Mint a new NFD\n   * @param nfdName - The name of the NFD to mint\n   * @param params - Configuration options for minting\n   * @returns The minted NFD record\n   * @throws If the mint operation fails\n   */\n  public async mint(nfdName: string, params: NfdMintParams): Promise<Nfd> {\n    // Ensure a signer is set\n    this.requireSigner()\n\n    // Validate NFD name format\n    if (!isValidName(nfdName)) {\n      throw new Error(\n        `Invalid NFD name: ${nfdName}. Name must be in the format 'name.algo' or 'segment.name.algo'`,\n      )\n    }\n\n    // Check if NFD already exists\n    const existingAppId = await this.getAppIdFromName(nfdName)\n    if (existingAppId !== null) {\n      throw new Error(\n        `NFD already exists: ${nfdName} (appID: ${existingAppId})`,\n      )\n    }\n\n    const { buyer: buyerAddr, years: numYears } = params\n\n    // Validate years parameter\n    if (numYears <= 0) {\n      throw new Error('Years must be greater than 0')\n    }\n\n    if (!Number.isInteger(numYears)) {\n      throw new Error('Years must be an integer')\n    }\n\n    // Get constraints to determine max years allowed\n    let maxYearsAllowed = 20 // Default fallback\n    try {\n      const constraints = await this.getConstraints()\n      maxYearsAllowed = Number(constraints.maxYearsAllowed)\n    } catch (error) {\n      console.warn('Failed to get constraints, using default max years:', error)\n    }\n\n    if (numYears > maxYearsAllowed) {\n      throw new Error(\n        `Years cannot exceed the maximum allowed (${maxYearsAllowed})`,\n      )\n    }\n\n    // Determine if the NFD is a segment\n    const isSegment = isSegmentName(nfdName)\n\n    // If the NFD is a segment, validate minting permissions\n    if (isSegment) {\n      await this.validateSegmentMinting(nfdName, buyerAddr)\n    }\n\n    // Get price info from the registry\n    const priceInfo = await this.getPriceInfo(nfdName, buyerAddr)\n\n    // Calculate extra fee based on NFD type\n    const extraFee = isSegment ? 12000 : 10000\n\n    // Get the registry client for executing the mint transaction\n    const registryClient = this.getRegistryClient(buyerAddr)\n\n    // Create payment transaction for the NFD price\n    const paymentTxn = await this.algorand.createTransaction.payment({\n      sender: buyerAddr,\n      receiver: registryClient.appAddress,\n      // Calculate total cost: (years * yearly price) + carry cost\n      amount: AlgoAmount.MicroAlgos(\n        BigInt(numYears) * priceInfo.oneYearPrice + priceInfo.carryCost,\n      ),\n    })\n\n    // Execute the mint transaction\n    const mintResult = await registryClient\n      .newGroup()\n      .gas({ args: {}, note: '1' })\n      .gas({ args: {}, note: '2' })\n      .gas({ args: {}, note: '3' })\n      .gas({ args: {}, note: '4' })\n      .mintNfd({\n        args: {\n          purchaseTxn: paymentTxn,\n          nfdName,\n          reservedFor: buyerAddr,\n          linkOnMint: false,\n        },\n        extraFee: AlgoAmount.MicroAlgos(extraFee),\n      })\n      .send({ populateAppCallResources: true })\n\n    const nfdAppId = mintResult.returns[4]\n\n    if (!nfdAppId) {\n      throw new Error(\n        'NFD was minted successfully but the app ID was not returned',\n      )\n    }\n\n    // Return the minted NFD record\n    return this.client.resolve(nfdAppId, { view: 'full' })\n  }\n}\n","import { AlgorandClient } from '@algorandfoundation/algokit-utils'\nimport { TransactionSignerAccount } from '@algorandfoundation/algokit-utils/types/account'\nimport { Address, TransactionSigner } from 'algosdk'\n\nimport { NfdApiClient } from './api-client'\nimport { NfdRegistryId } from './constants'\nimport { LookupModule } from './modules/lookup'\nimport { NfdManager } from './modules/manager'\nimport {\n  MintingModule,\n  NfdMintParams,\n  NfdMintQuote,\n  NfdMintQuoteParams,\n} from './modules/minting'\n\nimport type {\n  Nfd,\n  ResolveOptions,\n  SearchOptions,\n  SearchResponse,\n  ReverseLookupOptions,\n} from './types'\n\n/**\n * Configuration options for the NFD client\n */\nexport interface NfdClientConfig {\n  /**\n   * An existing AlgorandClient instance\n   */\n  algorand?: AlgorandClient\n  /**\n   * The application ID of the NFD registry\n   */\n  registryId?: number | bigint\n}\n\n/**\n * Client for interacting with NFDs (Non-Fungible Domains) through the smart contracts and the API\n */\nexport class NfdClient {\n  private readonly _algorand: AlgorandClient\n  private readonly _registryId: bigint\n  private readonly _api: NfdApiClient\n\n  // Core modules\n  private readonly _lookup: LookupModule\n  private readonly _minting: MintingModule\n\n  private _signer: TransactionSignerAccount | null = null\n\n  constructor(config: NfdClientConfig = {}) {\n    this._algorand = config.algorand ?? AlgorandClient.mainNet()\n    this._registryId = BigInt(config.registryId ?? NfdRegistryId.MAINNET)\n    this._api = new NfdApiClient(this._registryId)\n\n    // Initialize modules\n    this._lookup = new LookupModule(this)\n    this._minting = new MintingModule(this)\n  }\n\n  /**\n   * Create a new NfdClient instance configured for MainNet\n   * @returns A new NfdClient instance\n   */\n  public static mainNet(): NfdClient {\n    return new NfdClient({\n      algorand: AlgorandClient.mainNet(),\n      registryId: NfdRegistryId.MAINNET,\n    })\n  }\n\n  /**\n   * Create a new NfdClient instance configured for TestNet\n   * @returns A new NfdClient instance\n   */\n  public static testNet(): NfdClient {\n    return new NfdClient({\n      algorand: AlgorandClient.testNet(),\n      registryId: NfdRegistryId.TESTNET,\n    })\n  }\n\n  /**\n   * Get the AlgorandClient instance\n   * @returns The AlgorandClient instance\n   */\n  public get algorand(): AlgorandClient {\n    return this._algorand\n  }\n\n  /**\n   * Get the registry ID\n   * @returns The registry ID\n   */\n  public get registryId(): bigint {\n    return this._registryId\n  }\n\n  /**\n   * Get the API client for interacting with the NFD API\n   */\n  public get api(): NfdApiClient {\n    return this._api\n  }\n\n  /**\n   * Get the current signer\n   * @returns The current signer or null if not set\n   */\n  public get signer(): TransactionSignerAccount | null {\n    return this._signer\n  }\n\n  /**\n   * Tracks the given signer against the given sender for later signing.\n   * @param sender - The sender address to use this signer for\n   * @param signer - The signer to sign transactions with for the given sender\n   * @returns The `NfdClient` instance so method calls can be chained\n   */\n  public setSigner(\n    sender: string | Address,\n    signer: TransactionSigner,\n  ): NfdClient {\n    this._algorand.setSigner(sender, signer)\n    const addr =\n      typeof sender === 'string' ? Address.fromString(sender) : sender\n    this._signer = { addr, signer }\n    return this\n  }\n\n  /**\n   * Create a manager for a specific NFD\n   * @param nameOrAppId - The NFD name or application ID to manage\n   * @returns An NFD manager instance\n   */\n  public manage(nameOrAppId: string | number | bigint): NfdManager {\n    return new NfdManager(this, nameOrAppId)\n  }\n\n  /**\n   * Resolve an NFD by name or application ID by reading directly from the blockchain\n   * @param nameOrAppId - The NFD name or application ID to resolve\n   * @param options - Optional parameters\n   * @returns The NFD record\n   * @throws If the NFD name is invalid or not found\n   */\n  public async resolve(\n    nameOrAppId: string | number | bigint,\n    options: ResolveOptions = {},\n  ): Promise<Nfd> {\n    return this._lookup.resolve(nameOrAppId, options)\n  }\n\n  /**\n   * Get a price quote for minting an NFD\n   * @param nfdName - The name of the NFD to get a quote for\n   * @param params - Parameters for the quote\n   * @returns A detailed price quote including base price, fees, and total\n   * @throws If the quote cannot be generated\n   */\n  public async getMintQuote(\n    nfdName: string,\n    params: NfdMintQuoteParams,\n  ): Promise<NfdMintQuote> {\n    return this._minting.getMintQuote(nfdName, params)\n  }\n\n  /**\n   * Mint a new NFD\n   * @param nfdName - The name of the NFD to mint\n   * @param params - Configuration options for minting\n   * @returns The minted NFD record\n   * @throws If the mint operation fails\n   */\n  public async mint(nfdName: string, params: NfdMintParams): Promise<Nfd> {\n    try {\n      return await this._minting.mint(nfdName, params)\n    } finally {\n      // Reset signer after operation\n      this._signer = null\n    }\n  }\n\n  /**\n   * Resolve an address to find its associated NFD\n   * @param address - The address to resolve\n   * @param options - Options for the lookup\n   * @returns The NFD associated with the address, or null if not found\n   */\n  public async resolveAddress(\n    address: string | Address,\n    options: ReverseLookupOptions = {},\n  ): Promise<Nfd | null> {\n    const addressStr =\n      typeof address === 'string' ? address : address.toString()\n\n    const result = await this.api.reverseLookup([addressStr], options)\n    const nfd = result[addressStr]\n\n    if (!nfd) {\n      return null\n    }\n\n    return nfd\n  }\n\n  /**\n   * Resolve multiple addresses to find their associated NFDs\n   * @param addresses - Array of addresses to resolve\n   * @param options - Options for the lookup\n   * @returns Record mapping addresses to their associated NFD (one per address)\n   */\n  public async resolveAddresses(\n    addresses: Array<string | Address>,\n    options: ReverseLookupOptions = {},\n  ): Promise<Record<string, Nfd>> {\n    const addressStrings = addresses.map((addr) =>\n      typeof addr === 'string' ? addr : addr.toString(),\n    )\n\n    return this.api.reverseLookup(addressStrings, options)\n  }\n\n  /**\n   * Search for all NFDs owned by a specific wallet address\n   * @param address - The wallet address to search for\n   * @param options - Additional search options to apply\n   * @returns Search response containing owned NFDs\n   * @remarks\n   * By default, this method returns up to 20 results. You can override this by\n   * specifying a different limit in the options parameter.\n   */\n  public async searchByOwner(\n    address: string | Address,\n    options: Omit<SearchOptions, 'owner' | 'state'> = {},\n  ): Promise<SearchResponse> {\n    const addressStr =\n      typeof address === 'string' ? address : address.toString()\n    return this.api.search({\n      limit: 20,\n      ...options,\n      owner: addressStr,\n      state: ['owned'],\n    })\n  }\n\n  /**\n   * Search for all NFDs that are currently for sale\n   * @param options - Additional search options to apply\n   * @returns Search response containing NFDs for sale\n   * @remarks\n   * By default, this method returns up to 20 results. You can override this by\n   * specifying a different limit in the options parameter.\n   */\n  public async searchForSale(\n    options: Omit<SearchOptions, 'state'> = {},\n  ): Promise<SearchResponse> {\n    return this.api.search({\n      limit: 20,\n      ...options,\n      state: ['forSale'],\n    })\n  }\n}\n"],"names":["client","createClient","createConfig","nfdGetNfd","options","_heyApiClient","nfdGetLookup","nfdSearchV2","NfdRegistryId","DefaultSender","NfdApiBaseUrl","chunkArray","array","chunkSize","chunks","i","NfdApiClient","registryId","__publicField","baseUrl","apiClient","nameOrId","params","addresses","validAddresses","addr","addressChunks","responses","chunk","error","_a","mergedResults","response","address","nfd","errorMessage","flag","now","minutes","seconds","strToUint8Array","str","_","concatUint8Arrays","array1","array2","concatenatedArray","isZeroBytes","byte","isSegmentMintingUnlocked","_b","canMintSegment","callerAddress","isValidName","name","isSegmentName","extractParentName","segmentName","getNfdBasename","parts","determineNfdState","generateMetaTags","segmentCount","tags","basenameLength","parseString","key","state","parseUint64","value","decodeUint64","parseAddress","Address","Arc56Method","algosdk","method","arg","getABITupleTypeFromABIStructDefinition","struct","structs","v","getABIStructFromABITuple","decodedABITuple","structFields","type","abiValue","getABITupleFromABIStruct","getABIDecodedValue","tupleValue","getABIEncodedValue","tupleType","getArc56Method","methodNameOrSignature","appSpec","m","methods","getArc56ReturnValue","returnValue","base64Js","byteLength","toByteArray","fromByteArray","lookup","revLookup","Arr","code","len","getLens","b64","validLen","placeHoldersLen","lens","_byteLength","tmp","arr","curByte","tripletToBase64","num","encodeChunk","uint8","start","end","output","extraBytes","maxChunkLength","len2","ieee754","buffer","offset","isLE","mLen","nBytes","e","eLen","eMax","eBias","nBits","d","s","c","rt","base64","require$$0","require$$1","customInspectSymbol","exports","Buffer","SlowBuffer","K_MAX_LENGTH","typedArraySupport","proto","createBuffer","length","buf","encodingOrOffset","allocUnsafe","from","fromString","fromArrayView","isInstance","fromArrayBuffer","valueOf","b","fromObject","assertSize","size","alloc","fill","encoding","checked","string","actual","fromArrayLike","arrayView","copy","byteOffset","obj","numberIsNaN","a","x","y","list","pos","mustMatch","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","n","max","target","thisStart","thisEnd","thisCopy","targetCopy","bidirectionalIndexOf","val","dir","arrayIndexOf","indexSize","arrLength","valLength","read","foundIndex","found","j","hexWrite","remaining","strLen","parsed","utf8Write","blitBuffer","asciiWrite","asciiToBytes","base64Write","ucs2Write","utf16leToBytes","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","decodeCodePointsArray","MAX_ARGUMENTS_LENGTH","codePoints","ret","out","hexSliceLookupTable","bytes","newBuf","checkOffset","ext","noAssert","mul","defineBigIntMethod","validateNumber","first","last","boundsError","lo","hi","checkInt","min","maxBytes","wrtBigUInt64LE","checkIntBI","wrtBigUInt64BE","limit","sub","checkIEEE754","writeFloat","littleEndian","writeDouble","targetStart","errors","E","sym","getMessage","Base","range","input","msg","received","addNumericalSeparator","checkBounds","INVALID_BASE64_RE","base64clean","units","leadSurrogate","byteArray","src","dst","alphabet","table","i16","fn","BufferBigIntNotDefined","AsyncEventEmitter","eventName","event","listener","wrappedListener","consoleLogger","nullLogger","message","optionalParams","UpdatableConfig","returnNullLogger","lambda","original","newConfig","Config","toNumber","UnsafeConversionError","binaryStartsWith","base","startsWith","defaultJsonValueReplacer","asJson","replacer","space","EventType","ABIMethod","arc32ToArc56","arc32Structs","hint","fields","actions","callConfigToActions","bareActions","getDefaultArgValue","defaultArg","_c","_e","_d","LOGIC_ERROR","LogicError","errorDetails","program","getLineForPc","line","stop","stack_lines","OnApplicationComplete","SourceMap","BYTE_CBLOCK","INT_CBLOCK","getConstantBlockOffset","programSize","bytecblockOffset","intcblockOffset","isBytecblock","valuesRemaining","AppClient","appMetadata","network","networkNames","networkIndex","appId","spec","parsedSpec","filter","names","values","isClearStateProgram","pcOffsetMethod","appInfo","sourceMaps","result","resultValue","compilation","details","approvalSourceMap","clearSourceMap","sourceMap","arc56Pc","programSourceInfo","cblocksOffset","sourceInfo","inputPc","teal","txId","appManager","deployTimeParams","updatable","deletable","approvalTemplate","compiledApproval","clearTemplate","compiledClear","args","sender","defaultValue","compiled","readonlyParams","signer","onComplete","call","logicError","currentLine","stackWithLines","that","stateMethods","metadata","mapName","prefix","encodedKey","base64Key","boxNames","stateGetter","keyGetter","mapGetter","appState","APP_SPEC","NfdInstanceParamsFactory","NfdInstanceClient","appClientOrParams","_AppClient","composer","promiseChain","resultMappers","txn","NfdRegistryParamsFactory","NfdRegistryClient","encodedAddress","encodeAddress","BaseModule","defaultSender","nfdAppId","nfdName","hash","crypto","wordArray","u8","word","registryClient","boxName","appIdBytes","appIdBytesSliced","constraints","LookupModule","nameOrAppId","parsedNumber","instanceClient","globalState","boxes","view","filteredBoxes","box","userDefined","verified","caAlgo","unverifiedCaAlgo","boxGroups","splitMatch","baseName","index","baseFieldName","boxValue","newCombined","publicKey","propertyName","propertyValue","expirationTime","isExpired","stateParams","metaTags","AlgoAmount","amount","ERROR_PATTERNS","parseTransactionError","insufficientBalancePattern","match","account","balance","assets","overspendPattern","triedToSpend","outsideRangePattern","round","rangeStart","rangeEnd","smartContractErrorPattern","txnId","rejectedByContractPattern","pattern","friendlyMessage","cleanedError","withErrorParsing","NfdManager","fieldsAndValues","field","chunkField","addressToLink","nfdInstanceClient","fieldsToUpdate","curCaAlgo","eventualFields","updateCost","nfdNewGroup","updatePaymentTxn","regMbrCost","regPaymentTxn","linkRegAddress","addressToUnlink","newGroup","simResult","updateGroup","addressToSet","fieldName","targetAddress","MintingModule","caller","parentName","parentNfd","failureMessage","priceInfo","buyer","years","existingAppId","maxYearsAllowed","isSegment","extraFee","basePrice","totalPrice","buyerAddr","numYears","paymentTxn","NfdClient","config","AlgorandClient","addressStr","addressStrings"],"mappings":"+XAwBaA,GAASC,GAAA,aACpBC,gBAA4B,CAC1B,QAAS,wBACV,CAAA,CACH,EC+KaC,GACXC,IAEQA,EAAQ,QAAUC,IAAe,IAIvC,CACA,IAAK,kBACL,GAAGD,CAAA,CACJ,EA+TUE,GACXF,IAEQA,EAAQ,QAAUC,IAAe,IAIvC,CACA,IAAK,cACL,GAAGD,CAAA,CACJ,EA8WUG,GACXH,KAEQA,GAAA,YAAAA,EAAS,SAAUC,IAAe,IAIxC,CACA,IAAK,iBACL,GAAGD,CAAA,CACJ,ECr5BS,IAAAI,IAAAA,IACVA,EAAAA,EAAA,QAAU,SAAV,EAAA,UACAA,EAAAA,EAAA,QAAU,QAAV,EAAA,UAFUA,IAAAA,IAAA,CAAA,CAAA,EAMAC,IAAAA,IACVA,EA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