@solana-name-service/sns-sdk-kit 0.10.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +322 -90
- package/dist/cjs/address/getPrimaryDomain.cjs +54 -1
- package/dist/cjs/address/getPrimaryDomain.cjs.map +1 -1
- package/dist/cjs/address/getPrimaryDomainsBatch.cjs +108 -1
- package/dist/cjs/address/getPrimaryDomainsBatch.cjs.map +1 -1
- package/dist/cjs/address/getSnsDomainsForAddress.cjs +65 -0
- package/dist/cjs/address/getSnsDomainsForAddress.cjs.map +1 -0
- package/dist/cjs/address/getSnsNftsForAddress.cjs +94 -0
- package/dist/cjs/address/getSnsNftsForAddress.cjs.map +1 -0
- package/dist/cjs/address/index.cjs +15 -1
- package/dist/cjs/address/index.cjs.map +1 -1
- package/dist/cjs/bindings/burnDomain.cjs +46 -1
- package/dist/cjs/bindings/burnDomain.cjs.map +1 -1
- package/dist/cjs/bindings/createNameRegistry.cjs +54 -1
- package/dist/cjs/bindings/createNameRegistry.cjs.map +1 -1
- package/dist/cjs/bindings/createRecord.cjs +57 -1
- package/dist/cjs/bindings/createRecord.cjs.map +1 -1
- package/dist/cjs/bindings/createReverse.cjs +36 -1
- package/dist/cjs/bindings/createReverse.cjs.map +1 -1
- package/dist/cjs/bindings/createSubdomain.cjs +69 -1
- package/dist/cjs/bindings/createSubdomain.cjs.map +1 -1
- package/dist/cjs/bindings/deleteNameRegistry.cjs +37 -1
- package/dist/cjs/bindings/deleteNameRegistry.cjs.map +1 -1
- package/dist/cjs/bindings/deleteRecord.cjs +49 -1
- package/dist/cjs/bindings/deleteRecord.cjs.map +1 -1
- package/dist/cjs/bindings/index.cjs +43 -1
- package/dist/cjs/bindings/index.cjs.map +1 -1
- package/dist/cjs/bindings/recordValidation.cjs +60 -0
- package/dist/cjs/bindings/recordValidation.cjs.map +1 -0
- package/dist/cjs/bindings/registerDomain.cjs +86 -1
- package/dist/cjs/bindings/registerDomain.cjs.map +1 -1
- package/dist/cjs/bindings/registerDomainWithNft.cjs +67 -0
- package/dist/cjs/bindings/registerDomainWithNft.cjs.map +1 -0
- package/dist/cjs/bindings/setPrimaryDomain.cjs +39 -1
- package/dist/cjs/bindings/setPrimaryDomain.cjs.map +1 -1
- package/dist/cjs/bindings/setRecordRoaVerifier.cjs +44 -0
- package/dist/cjs/bindings/setRecordRoaVerifier.cjs.map +1 -0
- package/dist/cjs/bindings/setRecordStalenessVerifier.cjs +32 -0
- package/dist/cjs/bindings/setRecordStalenessVerifier.cjs.map +1 -0
- package/dist/cjs/bindings/transferDomain.cjs +33 -1
- package/dist/cjs/bindings/transferDomain.cjs.map +1 -1
- package/dist/cjs/bindings/transferSubdomain.cjs +48 -1
- package/dist/cjs/bindings/transferSubdomain.cjs.map +1 -1
- package/dist/cjs/bindings/updateNameRegistry.cjs +45 -1
- package/dist/cjs/bindings/updateNameRegistry.cjs.map +1 -1
- package/dist/cjs/bindings/updateRecord.cjs +57 -1
- package/dist/cjs/bindings/updateRecord.cjs.map +1 -1
- package/dist/cjs/bindings/validateRecordRoa.cjs +32 -0
- package/dist/cjs/bindings/validateRecordRoa.cjs.map +1 -0
- package/dist/cjs/bindings/validateRecordRoaEthereum.cjs +49 -0
- package/dist/cjs/bindings/validateRecordRoaEthereum.cjs.map +1 -0
- package/dist/cjs/codecs.cjs +27 -1
- package/dist/cjs/codecs.cjs.map +1 -1
- package/dist/cjs/config.cjs +18 -0
- package/dist/cjs/config.cjs.map +1 -0
- package/dist/cjs/constants/addresses.cjs +124 -1
- package/dist/cjs/constants/addresses.cjs.map +1 -1
- package/dist/cjs/constants/index.cjs +40 -1
- package/dist/cjs/constants/index.cjs.map +1 -1
- package/dist/cjs/constants/pythFeeds.cjs +91 -1
- package/dist/cjs/constants/pythFeeds.cjs.map +1 -1
- package/dist/cjs/constants/records.cjs +71 -1
- package/dist/cjs/constants/records.cjs.map +1 -1
- package/dist/cjs/domain/getAllSnsDomains.cjs +43 -0
- package/dist/cjs/domain/getAllSnsDomains.cjs.map +1 -0
- package/dist/cjs/domain/getDomainOwner.cjs +27 -1
- package/dist/cjs/domain/getDomainOwner.cjs.map +1 -1
- package/dist/cjs/domain/getDomainRecord.cjs +54 -1
- package/dist/cjs/domain/getDomainRecord.cjs.map +1 -1
- package/dist/cjs/domain/getDomainRecords.cjs +64 -1
- package/dist/cjs/domain/getDomainRecords.cjs.map +1 -1
- package/dist/cjs/domain/getSnsDomainAddress.cjs +52 -0
- package/dist/cjs/domain/getSnsDomainAddress.cjs.map +1 -0
- package/dist/cjs/domain/getSnsDomainOwner.cjs +31 -0
- package/dist/cjs/domain/getSnsDomainOwner.cjs.map +1 -0
- package/dist/cjs/domain/getSrsDomainAddress.cjs +36 -0
- package/dist/cjs/domain/getSrsDomainAddress.cjs.map +1 -0
- package/dist/cjs/domain/getSubdomains.cjs +95 -1
- package/dist/cjs/domain/getSubdomains.cjs.map +1 -1
- package/dist/cjs/domain/index.cjs +24 -1
- package/dist/cjs/domain/index.cjs.map +1 -1
- package/dist/cjs/domain/resolve.cjs +67 -0
- package/dist/cjs/domain/resolve.cjs.map +1 -0
- package/dist/cjs/domain/resolveSns.cjs +113 -0
- package/dist/cjs/domain/resolveSns.cjs.map +1 -0
- package/dist/cjs/errors.cjs +250 -1
- package/dist/cjs/errors.cjs.map +1 -1
- package/dist/cjs/index.cjs +245 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/instructions/allocateAndPostRecordInstruction.cjs +71 -1
- package/dist/cjs/instructions/allocateAndPostRecordInstruction.cjs.map +1 -1
- package/dist/cjs/instructions/burnDomainInstruction.cjs +71 -1
- package/dist/cjs/instructions/burnDomainInstruction.cjs.map +1 -1
- package/dist/cjs/instructions/createAtaIdempotentInstruction.cjs +71 -0
- package/dist/cjs/instructions/createAtaIdempotentInstruction.cjs.map +1 -0
- package/dist/cjs/instructions/createNameRegistryInstruction.cjs +94 -1
- package/dist/cjs/instructions/createNameRegistryInstruction.cjs.map +1 -1
- package/dist/cjs/instructions/createReverseInstruction.cjs +79 -1
- package/dist/cjs/instructions/createReverseInstruction.cjs.map +1 -1
- package/dist/cjs/instructions/createSplitV2Instruction.cjs +113 -1
- package/dist/cjs/instructions/createSplitV2Instruction.cjs.map +1 -1
- package/dist/cjs/instructions/createWithNftInstruction.cjs +107 -1
- package/dist/cjs/instructions/createWithNftInstruction.cjs.map +1 -1
- package/dist/cjs/instructions/deleteNameRegistryInstruction.cjs +47 -1
- package/dist/cjs/instructions/deleteNameRegistryInstruction.cjs.map +1 -1
- package/dist/cjs/instructions/deleteRecordInstruction.cjs +63 -1
- package/dist/cjs/instructions/deleteRecordInstruction.cjs.map +1 -1
- package/dist/cjs/instructions/index.cjs +41 -1
- package/dist/cjs/instructions/index.cjs.map +1 -1
- package/dist/cjs/instructions/reallocInstruction.cjs +55 -1
- package/dist/cjs/instructions/reallocInstruction.cjs.map +1 -1
- package/dist/cjs/instructions/registerPrimaryInstruction.cjs +58 -0
- package/dist/cjs/instructions/registerPrimaryInstruction.cjs.map +1 -0
- package/dist/cjs/instructions/setRecordRoaVerifierInstruction.cjs +69 -0
- package/dist/cjs/instructions/setRecordRoaVerifierInstruction.cjs.map +1 -0
- package/dist/cjs/instructions/transferInstruction.cjs +67 -1
- package/dist/cjs/instructions/transferInstruction.cjs.map +1 -1
- package/dist/cjs/instructions/updateNameRegistryInstruction.cjs +51 -1
- package/dist/cjs/instructions/updateNameRegistryInstruction.cjs.map +1 -1
- package/dist/cjs/instructions/updateRecordInstruction.cjs +71 -1
- package/dist/cjs/instructions/updateRecordInstruction.cjs.map +1 -1
- package/dist/cjs/instructions/validateEthereumSignatureInstruction.cjs +76 -0
- package/dist/cjs/instructions/validateEthereumSignatureInstruction.cjs.map +1 -0
- package/dist/cjs/instructions/validateSolanaSignatureInstruction.cjs +72 -0
- package/dist/cjs/instructions/validateSolanaSignatureInstruction.cjs.map +1 -0
- package/dist/cjs/nft/getSnsNftMint.cjs +31 -0
- package/dist/cjs/nft/getSnsNftMint.cjs.map +1 -0
- package/dist/cjs/nft/getSnsNftOwner.cjs +48 -0
- package/dist/cjs/nft/getSnsNftOwner.cjs.map +1 -0
- package/dist/cjs/nft/index.cjs +11 -1
- package/dist/cjs/nft/index.cjs.map +1 -1
- package/dist/cjs/record/getRecordV1Address.cjs +31 -1
- package/dist/cjs/record/getRecordV1Address.cjs.map +1 -1
- package/dist/cjs/record/getRecordV2Address.cjs +27 -1
- package/dist/cjs/record/getRecordV2Address.cjs.map +1 -1
- package/dist/cjs/record/index.cjs +18 -1
- package/dist/cjs/record/index.cjs.map +1 -1
- package/dist/cjs/record/verifyRecordRightOfAssociation.cjs +95 -1
- package/dist/cjs/record/verifyRecordRightOfAssociation.cjs.map +1 -1
- package/dist/cjs/record/verifyRecordStaleness.cjs +55 -1
- package/dist/cjs/record/verifyRecordStaleness.cjs.map +1 -1
- package/dist/cjs/states/index.cjs +22 -1
- package/dist/cjs/states/index.cjs.map +1 -1
- package/dist/cjs/states/nft.cjs +109 -1
- package/dist/cjs/states/nft.cjs.map +1 -1
- package/dist/cjs/states/primaryDomain.cjs +65 -1
- package/dist/cjs/states/primaryDomain.cjs.map +1 -1
- package/dist/cjs/states/record.cjs +120 -1
- package/dist/cjs/states/record.cjs.map +1 -1
- package/dist/cjs/states/registry.cjs +68 -1
- package/dist/cjs/states/registry.cjs.map +1 -1
- package/dist/cjs/types/index.cjs +22 -1
- package/dist/cjs/types/index.cjs.map +1 -1
- package/dist/cjs/types/record.cjs +56 -1
- package/dist/cjs/types/record.cjs.map +1 -1
- package/dist/cjs/types/validation.cjs +12 -1
- package/dist/cjs/types/validation.cjs.map +1 -1
- package/dist/cjs/utils/assertTldSupported.cjs +28 -0
- package/dist/cjs/utils/assertTldSupported.cjs.map +1 -0
- package/dist/cjs/utils/check.cjs +20 -1
- package/dist/cjs/utils/check.cjs.map +1 -1
- package/dist/cjs/utils/checkAddressOnCurve/ed25519.cjs +81 -3
- package/dist/cjs/utils/checkAddressOnCurve/ed25519.cjs.map +1 -1
- package/dist/cjs/utils/checkAddressOnCurve/index.cjs +42 -1
- package/dist/cjs/utils/checkAddressOnCurve/index.cjs.map +1 -1
- package/dist/cjs/utils/deriveAddress.cjs +57 -1
- package/dist/cjs/utils/deriveAddress.cjs.map +1 -1
- package/dist/cjs/utils/deserializers/deserializeRecordContent.cjs +64 -1
- package/dist/cjs/utils/deserializers/deserializeRecordContent.cjs.map +1 -1
- package/dist/cjs/utils/deserializers/deserializeReverse.cjs +17 -1
- package/dist/cjs/utils/deserializers/deserializeReverse.cjs.map +1 -1
- package/dist/cjs/utils/getPythFeedAddress.cjs +32 -1
- package/dist/cjs/utils/getPythFeedAddress.cjs.map +1 -1
- package/dist/cjs/utils/getReverseAddress.cjs +29 -1
- package/dist/cjs/utils/getReverseAddress.cjs.map +1 -1
- package/dist/cjs/utils/getReverseAddressFromDomainAddress.cjs +25 -1
- package/dist/cjs/utils/getReverseAddressFromDomainAddress.cjs.map +1 -1
- package/dist/cjs/utils/index.cjs +32 -1
- package/dist/cjs/utils/index.cjs.map +1 -1
- package/dist/cjs/utils/parseSnsDomain.cjs +66 -0
- package/dist/cjs/utils/parseSnsDomain.cjs.map +1 -0
- package/dist/cjs/utils/reverseLookup.cjs +40 -1
- package/dist/cjs/utils/reverseLookup.cjs.map +1 -1
- package/dist/cjs/utils/reverseLookupBatch.cjs +30 -1
- package/dist/cjs/utils/reverseLookupBatch.cjs.map +1 -1
- package/dist/cjs/utils/serializers/serializeRecordContent.cjs +90 -1
- package/dist/cjs/utils/serializers/serializeRecordContent.cjs.map +1 -1
- package/dist/cjs/utils/tld.cjs +67 -0
- package/dist/cjs/utils/tld.cjs.map +1 -0
- package/dist/cjs/utils/uint8Array/uint8ArrayFromHex.cjs +20 -1
- package/dist/cjs/utils/uint8Array/uint8ArrayFromHex.cjs.map +1 -1
- package/dist/cjs/utils/uint8Array/uint8ArrayToHex.cjs +16 -1
- package/dist/cjs/utils/uint8Array/uint8ArrayToHex.cjs.map +1 -1
- package/dist/cjs/utils/uint8Array/uint8ArraysEqual.cjs +20 -1
- package/dist/cjs/utils/uint8Array/uint8ArraysEqual.cjs.map +1 -1
- package/dist/esm/address/getPrimaryDomain.mjs +50 -1
- package/dist/esm/address/getPrimaryDomain.mjs.map +1 -1
- package/dist/esm/address/getPrimaryDomainsBatch.mjs +104 -1
- package/dist/esm/address/getPrimaryDomainsBatch.mjs.map +1 -1
- package/dist/esm/address/getSnsDomainsForAddress.mjs +61 -0
- package/dist/esm/address/getSnsDomainsForAddress.mjs.map +1 -0
- package/dist/esm/address/getSnsNftsForAddress.mjs +90 -0
- package/dist/esm/address/getSnsNftsForAddress.mjs.map +1 -0
- package/dist/esm/address/index.mjs +4 -1
- package/dist/esm/address/index.mjs.map +1 -1
- package/dist/esm/bindings/burnDomain.mjs +42 -1
- package/dist/esm/bindings/burnDomain.mjs.map +1 -1
- package/dist/esm/bindings/createNameRegistry.mjs +50 -1
- package/dist/esm/bindings/createNameRegistry.mjs.map +1 -1
- package/dist/esm/bindings/createRecord.mjs +53 -1
- package/dist/esm/bindings/createRecord.mjs.map +1 -1
- package/dist/esm/bindings/createReverse.mjs +32 -1
- package/dist/esm/bindings/createReverse.mjs.map +1 -1
- package/dist/esm/bindings/createSubdomain.mjs +65 -1
- package/dist/esm/bindings/createSubdomain.mjs.map +1 -1
- package/dist/esm/bindings/deleteNameRegistry.mjs +33 -1
- package/dist/esm/bindings/deleteNameRegistry.mjs.map +1 -1
- package/dist/esm/bindings/deleteRecord.mjs +45 -1
- package/dist/esm/bindings/deleteRecord.mjs.map +1 -1
- package/dist/esm/bindings/index.mjs +18 -1
- package/dist/esm/bindings/index.mjs.map +1 -1
- package/dist/esm/bindings/recordValidation.mjs +55 -0
- package/dist/esm/bindings/recordValidation.mjs.map +1 -0
- package/dist/esm/bindings/registerDomain.mjs +82 -1
- package/dist/esm/bindings/registerDomain.mjs.map +1 -1
- package/dist/esm/bindings/registerDomainWithNft.mjs +63 -0
- package/dist/esm/bindings/registerDomainWithNft.mjs.map +1 -0
- package/dist/esm/bindings/setPrimaryDomain.mjs +35 -1
- package/dist/esm/bindings/setPrimaryDomain.mjs.map +1 -1
- package/dist/esm/bindings/setRecordRoaVerifier.mjs +40 -0
- package/dist/esm/bindings/setRecordRoaVerifier.mjs.map +1 -0
- package/dist/esm/bindings/setRecordStalenessVerifier.mjs +28 -0
- package/dist/esm/bindings/setRecordStalenessVerifier.mjs.map +1 -0
- package/dist/esm/bindings/transferDomain.mjs +29 -1
- package/dist/esm/bindings/transferDomain.mjs.map +1 -1
- package/dist/esm/bindings/transferSubdomain.mjs +44 -1
- package/dist/esm/bindings/transferSubdomain.mjs.map +1 -1
- package/dist/esm/bindings/updateNameRegistry.mjs +41 -1
- package/dist/esm/bindings/updateNameRegistry.mjs.map +1 -1
- package/dist/esm/bindings/updateRecord.mjs +53 -1
- package/dist/esm/bindings/updateRecord.mjs.map +1 -1
- package/dist/esm/bindings/validateRecordRoa.mjs +28 -0
- package/dist/esm/bindings/validateRecordRoa.mjs.map +1 -0
- package/dist/esm/bindings/validateRecordRoaEthereum.mjs +45 -0
- package/dist/esm/bindings/validateRecordRoaEthereum.mjs.map +1 -0
- package/dist/esm/codecs.mjs +19 -1
- package/dist/esm/codecs.mjs.map +1 -1
- package/dist/esm/config.mjs +11 -0
- package/dist/esm/config.mjs.map +1 -0
- package/dist/esm/constants/addresses.mjs +98 -1
- package/dist/esm/constants/addresses.mjs.map +1 -1
- package/dist/esm/constants/index.mjs +3 -1
- package/dist/esm/constants/index.mjs.map +1 -1
- package/dist/esm/constants/pythFeeds.mjs +86 -1
- package/dist/esm/constants/pythFeeds.mjs.map +1 -1
- package/dist/esm/constants/records.mjs +63 -1
- package/dist/esm/constants/records.mjs.map +1 -1
- package/dist/esm/domain/getAllSnsDomains.mjs +39 -0
- package/dist/esm/domain/getAllSnsDomains.mjs.map +1 -0
- package/dist/esm/domain/getDomainOwner.mjs +23 -1
- package/dist/esm/domain/getDomainOwner.mjs.map +1 -1
- package/dist/esm/domain/getDomainRecord.mjs +50 -1
- package/dist/esm/domain/getDomainRecord.mjs.map +1 -1
- package/dist/esm/domain/getDomainRecords.mjs +60 -1
- package/dist/esm/domain/getDomainRecords.mjs.map +1 -1
- package/dist/esm/domain/getSnsDomainAddress.mjs +48 -0
- package/dist/esm/domain/getSnsDomainAddress.mjs.map +1 -0
- package/dist/esm/domain/getSnsDomainOwner.mjs +27 -0
- package/dist/esm/domain/getSnsDomainOwner.mjs.map +1 -0
- package/dist/esm/domain/getSrsDomainAddress.mjs +32 -0
- package/dist/esm/domain/getSrsDomainAddress.mjs.map +1 -0
- package/dist/esm/domain/getSubdomains.mjs +91 -1
- package/dist/esm/domain/getSubdomains.mjs.map +1 -1
- package/dist/esm/domain/index.mjs +8 -1
- package/dist/esm/domain/index.mjs.map +1 -1
- package/dist/esm/domain/resolve.mjs +62 -0
- package/dist/esm/domain/resolve.mjs.map +1 -0
- package/dist/esm/domain/resolveSns.mjs +109 -0
- package/dist/esm/domain/resolveSns.mjs.map +1 -0
- package/dist/esm/errors.mjs +218 -1
- package/dist/esm/errors.mjs.map +1 -1
- package/dist/esm/index.mjs +74 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/instructions/allocateAndPostRecordInstruction.mjs +67 -1
- package/dist/esm/instructions/allocateAndPostRecordInstruction.mjs.map +1 -1
- package/dist/esm/instructions/burnDomainInstruction.mjs +67 -1
- package/dist/esm/instructions/burnDomainInstruction.mjs.map +1 -1
- package/dist/esm/instructions/createAtaIdempotentInstruction.mjs +67 -0
- package/dist/esm/instructions/createAtaIdempotentInstruction.mjs.map +1 -0
- package/dist/esm/instructions/createNameRegistryInstruction.mjs +90 -1
- package/dist/esm/instructions/createNameRegistryInstruction.mjs.map +1 -1
- package/dist/esm/instructions/createReverseInstruction.mjs +75 -1
- package/dist/esm/instructions/createReverseInstruction.mjs.map +1 -1
- package/dist/esm/instructions/createSplitV2Instruction.mjs +109 -1
- package/dist/esm/instructions/createSplitV2Instruction.mjs.map +1 -1
- package/dist/esm/instructions/createWithNftInstruction.mjs +103 -1
- package/dist/esm/instructions/createWithNftInstruction.mjs.map +1 -1
- package/dist/esm/instructions/deleteNameRegistryInstruction.mjs +43 -1
- package/dist/esm/instructions/deleteNameRegistryInstruction.mjs.map +1 -1
- package/dist/esm/instructions/deleteRecordInstruction.mjs +59 -1
- package/dist/esm/instructions/deleteRecordInstruction.mjs.map +1 -1
- package/dist/esm/instructions/index.mjs +17 -1
- package/dist/esm/instructions/index.mjs.map +1 -1
- package/dist/esm/instructions/reallocInstruction.mjs +51 -1
- package/dist/esm/instructions/reallocInstruction.mjs.map +1 -1
- package/dist/esm/instructions/registerPrimaryInstruction.mjs +54 -0
- package/dist/esm/instructions/registerPrimaryInstruction.mjs.map +1 -0
- package/dist/esm/instructions/setRecordRoaVerifierInstruction.mjs +65 -0
- package/dist/esm/instructions/setRecordRoaVerifierInstruction.mjs.map +1 -0
- package/dist/esm/instructions/transferInstruction.mjs +63 -1
- package/dist/esm/instructions/transferInstruction.mjs.map +1 -1
- package/dist/esm/instructions/updateNameRegistryInstruction.mjs +47 -1
- package/dist/esm/instructions/updateNameRegistryInstruction.mjs.map +1 -1
- package/dist/esm/instructions/updateRecordInstruction.mjs +67 -1
- package/dist/esm/instructions/updateRecordInstruction.mjs.map +1 -1
- package/dist/esm/instructions/validateEthereumSignatureInstruction.mjs +72 -0
- package/dist/esm/instructions/validateEthereumSignatureInstruction.mjs.map +1 -0
- package/dist/esm/instructions/validateSolanaSignatureInstruction.mjs +68 -0
- package/dist/esm/instructions/validateSolanaSignatureInstruction.mjs.map +1 -0
- package/dist/esm/nft/getSnsNftMint.mjs +27 -0
- package/dist/esm/nft/getSnsNftMint.mjs.map +1 -0
- package/dist/esm/nft/getSnsNftOwner.mjs +44 -0
- package/dist/esm/nft/getSnsNftOwner.mjs.map +1 -0
- package/dist/esm/nft/index.mjs +2 -1
- package/dist/esm/nft/index.mjs.map +1 -1
- package/dist/esm/record/getRecordV1Address.mjs +27 -1
- package/dist/esm/record/getRecordV1Address.mjs.map +1 -1
- package/dist/esm/record/getRecordV2Address.mjs +23 -1
- package/dist/esm/record/getRecordV2Address.mjs.map +1 -1
- package/dist/esm/record/index.mjs +4 -1
- package/dist/esm/record/index.mjs.map +1 -1
- package/dist/esm/record/verifyRecordRightOfAssociation.mjs +89 -1
- package/dist/esm/record/verifyRecordRightOfAssociation.mjs.map +1 -1
- package/dist/esm/record/verifyRecordStaleness.mjs +50 -1
- package/dist/esm/record/verifyRecordStaleness.mjs.map +1 -1
- package/dist/esm/states/index.mjs +4 -1
- package/dist/esm/states/index.mjs.map +1 -1
- package/dist/esm/states/nft.mjs +105 -1
- package/dist/esm/states/nft.mjs.map +1 -1
- package/dist/esm/states/primaryDomain.mjs +61 -1
- package/dist/esm/states/primaryDomain.mjs.map +1 -1
- package/dist/esm/states/record.mjs +113 -1
- package/dist/esm/states/record.mjs.map +1 -1
- package/dist/esm/states/registry.mjs +64 -1
- package/dist/esm/states/registry.mjs.map +1 -1
- package/dist/esm/types/index.mjs +2 -1
- package/dist/esm/types/index.mjs.map +1 -1
- package/dist/esm/types/record.mjs +52 -1
- package/dist/esm/types/record.mjs.map +1 -1
- package/dist/esm/types/validation.mjs +10 -1
- package/dist/esm/types/validation.mjs.map +1 -1
- package/dist/esm/utils/assertTldSupported.mjs +24 -0
- package/dist/esm/utils/assertTldSupported.mjs.map +1 -0
- package/dist/esm/utils/check.mjs +16 -1
- package/dist/esm/utils/check.mjs.map +1 -1
- package/dist/esm/utils/checkAddressOnCurve/ed25519.mjs +76 -2
- package/dist/esm/utils/checkAddressOnCurve/ed25519.mjs.map +1 -1
- package/dist/esm/utils/checkAddressOnCurve/index.mjs +38 -1
- package/dist/esm/utils/checkAddressOnCurve/index.mjs.map +1 -1
- package/dist/esm/utils/deriveAddress.mjs +51 -1
- package/dist/esm/utils/deriveAddress.mjs.map +1 -1
- package/dist/esm/utils/deserializers/deserializeRecordContent.mjs +60 -1
- package/dist/esm/utils/deserializers/deserializeRecordContent.mjs.map +1 -1
- package/dist/esm/utils/deserializers/deserializeReverse.mjs +13 -1
- package/dist/esm/utils/deserializers/deserializeReverse.mjs.map +1 -1
- package/dist/esm/utils/getPythFeedAddress.mjs +28 -1
- package/dist/esm/utils/getPythFeedAddress.mjs.map +1 -1
- package/dist/esm/utils/getReverseAddress.mjs +25 -1
- package/dist/esm/utils/getReverseAddress.mjs.map +1 -1
- package/dist/esm/utils/getReverseAddressFromDomainAddress.mjs +21 -1
- package/dist/esm/utils/getReverseAddressFromDomainAddress.mjs.map +1 -1
- package/dist/esm/utils/index.mjs +10 -1
- package/dist/esm/utils/index.mjs.map +1 -1
- package/dist/esm/utils/parseSnsDomain.mjs +60 -0
- package/dist/esm/utils/parseSnsDomain.mjs.map +1 -0
- package/dist/esm/utils/reverseLookup.mjs +36 -1
- package/dist/esm/utils/reverseLookup.mjs.map +1 -1
- package/dist/esm/utils/reverseLookupBatch.mjs +26 -1
- package/dist/esm/utils/reverseLookupBatch.mjs.map +1 -1
- package/dist/esm/utils/serializers/serializeRecordContent.mjs +86 -1
- package/dist/esm/utils/serializers/serializeRecordContent.mjs.map +1 -1
- package/dist/esm/utils/tld.mjs +58 -0
- package/dist/esm/utils/tld.mjs.map +1 -0
- package/dist/esm/utils/uint8Array/uint8ArrayFromHex.mjs +16 -1
- package/dist/esm/utils/uint8Array/uint8ArrayFromHex.mjs.map +1 -1
- package/dist/esm/utils/uint8Array/uint8ArrayToHex.mjs +12 -1
- package/dist/esm/utils/uint8Array/uint8ArrayToHex.mjs.map +1 -1
- package/dist/esm/utils/uint8Array/uint8ArraysEqual.mjs +16 -1
- package/dist/esm/utils/uint8Array/uint8ArraysEqual.mjs.map +1 -1
- package/dist/types/address/index.d.ts +193 -4
- package/dist/types/bindings/index.d.ts +821 -17
- package/dist/types/codecs.d.ts +16 -5
- package/dist/types/constants/index.d.ts +141 -3
- package/dist/types/domain/index.d.ts +559 -7
- package/dist/types/errors.d.ts +73 -85
- package/dist/types/index.d.ts +3038 -74
- package/dist/types/instructions/index.d.ts +523 -19
- package/dist/types/nft/index.d.ts +59 -2
- package/dist/types/record/index.d.ts +254 -4
- package/dist/types/states/index.d.ts +235 -4
- package/dist/types/types/index.d.ts +50 -2
- package/dist/types/utils/index.d.ts +346 -10
- package/package.json +47 -41
- package/dist/cjs/_virtual/ipaddr.cjs +0 -2
- package/dist/cjs/_virtual/ipaddr.cjs.map +0 -1
- package/dist/cjs/_virtual/ipaddr2.cjs +0 -2
- package/dist/cjs/_virtual/ipaddr2.cjs.map +0 -1
- package/dist/cjs/address/getDomainsForAddress.cjs +0 -2
- package/dist/cjs/address/getDomainsForAddress.cjs.map +0 -1
- package/dist/cjs/address/getNftsForAddress.cjs +0 -2
- package/dist/cjs/address/getNftsForAddress.cjs.map +0 -1
- package/dist/cjs/bindings/registerWithNft.cjs +0 -2
- package/dist/cjs/bindings/registerWithNft.cjs.map +0 -1
- package/dist/cjs/bindings/validateRoa.cjs +0 -2
- package/dist/cjs/bindings/validateRoa.cjs.map +0 -1
- package/dist/cjs/bindings/validateRoaEthereum.cjs +0 -2
- package/dist/cjs/bindings/validateRoaEthereum.cjs.map +0 -1
- package/dist/cjs/bindings/writeRoa.cjs +0 -2
- package/dist/cjs/bindings/writeRoa.cjs.map +0 -1
- package/dist/cjs/domain/getAllDomains.cjs +0 -2
- package/dist/cjs/domain/getAllDomains.cjs.map +0 -1
- package/dist/cjs/domain/getDomainAddress.cjs +0 -2
- package/dist/cjs/domain/getDomainAddress.cjs.map +0 -1
- package/dist/cjs/domain/resolveDomain.cjs +0 -2
- package/dist/cjs/domain/resolveDomain.cjs.map +0 -1
- package/dist/cjs/instructions/createAtaInstruction.cjs +0 -2
- package/dist/cjs/instructions/createAtaInstruction.cjs.map +0 -1
- package/dist/cjs/instructions/createInstructionV3.cjs +0 -2
- package/dist/cjs/instructions/createInstructionV3.cjs.map +0 -1
- package/dist/cjs/instructions/createV2Instruction.cjs +0 -2
- package/dist/cjs/instructions/createV2Instruction.cjs.map +0 -1
- package/dist/cjs/instructions/registerFavoriteInstruction.cjs +0 -2
- package/dist/cjs/instructions/registerFavoriteInstruction.cjs.map +0 -1
- package/dist/cjs/instructions/validateRoaEthereumInstruction.cjs +0 -2
- package/dist/cjs/instructions/validateRoaEthereumInstruction.cjs.map +0 -1
- package/dist/cjs/instructions/validateRoaInstruction.cjs +0 -2
- package/dist/cjs/instructions/validateRoaInstruction.cjs.map +0 -1
- package/dist/cjs/instructions/writeRoaInstruction.cjs +0 -2
- package/dist/cjs/instructions/writeRoaInstruction.cjs.map +0 -1
- package/dist/cjs/nft/getNftMint.cjs +0 -2
- package/dist/cjs/nft/getNftMint.cjs.map +0 -1
- package/dist/cjs/nft/getNftOwner.cjs +0 -2
- package/dist/cjs/nft/getNftOwner.cjs.map +0 -1
- package/dist/cjs/node_modules/@scure/base/lib/esm/index.cjs +0 -3
- package/dist/cjs/node_modules/@scure/base/lib/esm/index.cjs.map +0 -1
- package/dist/cjs/node_modules/@solana-program/token/dist/src/index.cjs +0 -2
- package/dist/cjs/node_modules/@solana-program/token/dist/src/index.cjs.map +0 -1
- package/dist/cjs/node_modules/borsh/lib/esm/buffer.cjs +0 -2
- package/dist/cjs/node_modules/borsh/lib/esm/buffer.cjs.map +0 -1
- package/dist/cjs/node_modules/borsh/lib/esm/deserialize.cjs +0 -2
- package/dist/cjs/node_modules/borsh/lib/esm/deserialize.cjs.map +0 -1
- package/dist/cjs/node_modules/borsh/lib/esm/index.cjs +0 -2
- package/dist/cjs/node_modules/borsh/lib/esm/index.cjs.map +0 -1
- package/dist/cjs/node_modules/borsh/lib/esm/serialize.cjs +0 -2
- package/dist/cjs/node_modules/borsh/lib/esm/serialize.cjs.map +0 -1
- package/dist/cjs/node_modules/borsh/lib/esm/types.cjs +0 -2
- package/dist/cjs/node_modules/borsh/lib/esm/types.cjs.map +0 -1
- package/dist/cjs/node_modules/borsh/lib/esm/utils.cjs +0 -2
- package/dist/cjs/node_modules/borsh/lib/esm/utils.cjs.map +0 -1
- package/dist/cjs/node_modules/ipaddr.js/lib/ipaddr.cjs +0 -2
- package/dist/cjs/node_modules/ipaddr.js/lib/ipaddr.cjs.map +0 -1
- package/dist/cjs/node_modules/punycode/punycode.es6.cjs +0 -2
- package/dist/cjs/node_modules/punycode/punycode.es6.cjs.map +0 -1
- package/dist/esm/_virtual/ipaddr.mjs +0 -2
- package/dist/esm/_virtual/ipaddr.mjs.map +0 -1
- package/dist/esm/_virtual/ipaddr2.mjs +0 -2
- package/dist/esm/_virtual/ipaddr2.mjs.map +0 -1
- package/dist/esm/address/getDomainsForAddress.mjs +0 -2
- package/dist/esm/address/getDomainsForAddress.mjs.map +0 -1
- package/dist/esm/address/getNftsForAddress.mjs +0 -2
- package/dist/esm/address/getNftsForAddress.mjs.map +0 -1
- package/dist/esm/bindings/registerWithNft.mjs +0 -2
- package/dist/esm/bindings/registerWithNft.mjs.map +0 -1
- package/dist/esm/bindings/validateRoa.mjs +0 -2
- package/dist/esm/bindings/validateRoa.mjs.map +0 -1
- package/dist/esm/bindings/validateRoaEthereum.mjs +0 -2
- package/dist/esm/bindings/validateRoaEthereum.mjs.map +0 -1
- package/dist/esm/bindings/writeRoa.mjs +0 -2
- package/dist/esm/bindings/writeRoa.mjs.map +0 -1
- package/dist/esm/domain/getAllDomains.mjs +0 -2
- package/dist/esm/domain/getAllDomains.mjs.map +0 -1
- package/dist/esm/domain/getDomainAddress.mjs +0 -2
- package/dist/esm/domain/getDomainAddress.mjs.map +0 -1
- package/dist/esm/domain/resolveDomain.mjs +0 -2
- package/dist/esm/domain/resolveDomain.mjs.map +0 -1
- package/dist/esm/instructions/createAtaInstruction.mjs +0 -2
- package/dist/esm/instructions/createAtaInstruction.mjs.map +0 -1
- package/dist/esm/instructions/createInstructionV3.mjs +0 -2
- package/dist/esm/instructions/createInstructionV3.mjs.map +0 -1
- package/dist/esm/instructions/createV2Instruction.mjs +0 -2
- package/dist/esm/instructions/createV2Instruction.mjs.map +0 -1
- package/dist/esm/instructions/registerFavoriteInstruction.mjs +0 -2
- package/dist/esm/instructions/registerFavoriteInstruction.mjs.map +0 -1
- package/dist/esm/instructions/validateRoaEthereumInstruction.mjs +0 -2
- package/dist/esm/instructions/validateRoaEthereumInstruction.mjs.map +0 -1
- package/dist/esm/instructions/validateRoaInstruction.mjs +0 -2
- package/dist/esm/instructions/validateRoaInstruction.mjs.map +0 -1
- package/dist/esm/instructions/writeRoaInstruction.mjs +0 -2
- package/dist/esm/instructions/writeRoaInstruction.mjs.map +0 -1
- package/dist/esm/nft/getNftMint.mjs +0 -2
- package/dist/esm/nft/getNftMint.mjs.map +0 -1
- package/dist/esm/nft/getNftOwner.mjs +0 -2
- package/dist/esm/nft/getNftOwner.mjs.map +0 -1
- package/dist/esm/node_modules/@scure/base/lib/esm/index.mjs +0 -3
- package/dist/esm/node_modules/@scure/base/lib/esm/index.mjs.map +0 -1
- package/dist/esm/node_modules/@solana-program/token/dist/src/index.mjs +0 -2
- package/dist/esm/node_modules/@solana-program/token/dist/src/index.mjs.map +0 -1
- package/dist/esm/node_modules/borsh/lib/esm/buffer.mjs +0 -2
- package/dist/esm/node_modules/borsh/lib/esm/buffer.mjs.map +0 -1
- package/dist/esm/node_modules/borsh/lib/esm/deserialize.mjs +0 -2
- package/dist/esm/node_modules/borsh/lib/esm/deserialize.mjs.map +0 -1
- package/dist/esm/node_modules/borsh/lib/esm/index.mjs +0 -2
- package/dist/esm/node_modules/borsh/lib/esm/index.mjs.map +0 -1
- package/dist/esm/node_modules/borsh/lib/esm/serialize.mjs +0 -2
- package/dist/esm/node_modules/borsh/lib/esm/serialize.mjs.map +0 -1
- package/dist/esm/node_modules/borsh/lib/esm/types.mjs +0 -2
- package/dist/esm/node_modules/borsh/lib/esm/types.mjs.map +0 -1
- package/dist/esm/node_modules/borsh/lib/esm/utils.mjs +0 -2
- package/dist/esm/node_modules/borsh/lib/esm/utils.mjs.map +0 -1
- package/dist/esm/node_modules/ipaddr.js/lib/ipaddr.mjs +0 -2
- package/dist/esm/node_modules/ipaddr.js/lib/ipaddr.mjs.map +0 -1
- package/dist/esm/node_modules/punycode/punycode.es6.mjs +0 -2
- package/dist/esm/node_modules/punycode/punycode.es6.mjs.map +0 -1
- package/dist/types/address/getDomainsForAddress.d.ts +0 -19
- package/dist/types/address/getNftsForAddress.d.ts +0 -20
- package/dist/types/address/getPrimaryDomain.d.ts +0 -22
- package/dist/types/address/getPrimaryDomainsBatch.d.ts +0 -16
- package/dist/types/bindings/burnDomain.d.ts +0 -17
- package/dist/types/bindings/createNameRegistry.d.ts +0 -28
- package/dist/types/bindings/createRecord.d.ts +0 -23
- package/dist/types/bindings/createReverse.d.ts +0 -21
- package/dist/types/bindings/createSubdomain.d.ts +0 -23
- package/dist/types/bindings/deleteNameRegistry.d.ts +0 -21
- package/dist/types/bindings/deleteRecord.d.ts +0 -20
- package/dist/types/bindings/registerDomain.d.ts +0 -25
- package/dist/types/bindings/registerWithNft.d.ts +0 -21
- package/dist/types/bindings/setPrimaryDomain.d.ts +0 -16
- package/dist/types/bindings/transferDomain.d.ts +0 -23
- package/dist/types/bindings/transferSubdomain.d.ts +0 -25
- package/dist/types/bindings/updateNameRegistry.d.ts +0 -22
- package/dist/types/bindings/updateRecord.d.ts +0 -22
- package/dist/types/bindings/validateRoa.d.ts +0 -24
- package/dist/types/bindings/validateRoaEthereum.d.ts +0 -24
- package/dist/types/bindings/writeRoa.d.ts +0 -22
- package/dist/types/constants/addresses.d.ts +0 -53
- package/dist/types/constants/pythFeeds.d.ts +0 -3
- package/dist/types/constants/records.d.ts +0 -23
- package/dist/types/domain/getAllDomains.d.ts +0 -16
- package/dist/types/domain/getDomainAddress.d.ts +0 -30
- package/dist/types/domain/getDomainOwner.d.ts +0 -16
- package/dist/types/domain/getDomainRecord.d.ts +0 -35
- package/dist/types/domain/getDomainRecords.d.ts +0 -39
- package/dist/types/domain/getSubdomains.d.ts +0 -19
- package/dist/types/domain/resolveDomain.d.ts +0 -26
- package/dist/types/instructions/allocateAndPostRecordInstruction.d.ts +0 -23
- package/dist/types/instructions/burnDomainInstruction.d.ts +0 -12
- package/dist/types/instructions/createAtaInstruction.d.ts +0 -2
- package/dist/types/instructions/createInstructionV3.d.ts +0 -24
- package/dist/types/instructions/createNameRegistryInstruction.d.ts +0 -26
- package/dist/types/instructions/createReverseInstruction.d.ts +0 -16
- package/dist/types/instructions/createSplitV2Instruction.d.ts +0 -24
- package/dist/types/instructions/createV2Instruction.d.ts +0 -19
- package/dist/types/instructions/createWithNftInstruction.d.ts +0 -19
- package/dist/types/instructions/deleteNameRegistryInstruction.d.ts +0 -12
- package/dist/types/instructions/deleteRecordInstruction.d.ts +0 -12
- package/dist/types/instructions/reallocInstruction.d.ts +0 -16
- package/dist/types/instructions/registerFavoriteInstruction.d.ts +0 -12
- package/dist/types/instructions/transferInstruction.d.ts +0 -21
- package/dist/types/instructions/updateNameRegistryInstruction.d.ts +0 -23
- package/dist/types/instructions/updateRecordInstruction.d.ts +0 -23
- package/dist/types/instructions/validateRoaEthereumInstruction.d.ts +0 -30
- package/dist/types/instructions/validateRoaInstruction.d.ts +0 -16
- package/dist/types/instructions/writeRoaInstruction.d.ts +0 -20
- package/dist/types/nft/getNftMint.d.ts +0 -13
- package/dist/types/nft/getNftOwner.d.ts +0 -15
- package/dist/types/record/getRecordV1Address.d.ts +0 -15
- package/dist/types/record/getRecordV2Address.d.ts +0 -16
- package/dist/types/record/verifyRecordRightOfAssociation.d.ts +0 -40
- package/dist/types/record/verifyRecordStaleness.d.ts +0 -31
- package/dist/types/states/nft.d.ts +0 -50
- package/dist/types/states/primaryDomain.d.ts +0 -25
- package/dist/types/states/record.d.ts +0 -30
- package/dist/types/states/registry.d.ts +0 -39
- package/dist/types/types/record.d.ts +0 -38
- package/dist/types/types/validation.d.ts +0 -6
- package/dist/types/utils/check.d.ts +0 -10
- package/dist/types/utils/checkAddressOnCurve/ed25519.d.ts +0 -1
- package/dist/types/utils/checkAddressOnCurve/index.d.ts +0 -2
- package/dist/types/utils/deriveAddress.d.ts +0 -28
- package/dist/types/utils/deserializers/deserializeRecordContent.d.ts +0 -17
- package/dist/types/utils/deserializers/deserializeReverse.d.ts +0 -16
- package/dist/types/utils/getPythFeedAddress.d.ts +0 -14
- package/dist/types/utils/getReverseAddress.d.ts +0 -1
- package/dist/types/utils/getReverseAddressFromDomainAddress.d.ts +0 -15
- package/dist/types/utils/reverseLookup.d.ts +0 -18
- package/dist/types/utils/reverseLookupBatch.d.ts +0 -16
- package/dist/types/utils/serializers/serializeRecordContent.d.ts +0 -16
- package/dist/types/utils/uint8Array/uint8ArrayFromHex.d.ts +0 -6
- package/dist/types/utils/uint8Array/uint8ArrayToHex.d.ts +0 -7
- package/dist/types/utils/uint8Array/uint8ArraysConcat.d.ts +0 -8
- package/dist/types/utils/uint8Array/uint8ArraysEqual.d.ts +0 -9
package/dist/types/index.d.ts
CHANGED
|
@@ -1,74 +1,3038 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
1
|
+
import { Rpc, GetProgramAccountsApi, GetMultipleAccountsApi, Address, GetAccountInfoApi, GetTokenLargestAccountsApi, Instruction, GetMinimumBalanceForRentExemptionApi, GetSlotApi, ReadonlyUint8Array } from '@solana/kit';
|
|
2
|
+
import * as _solana_program_token from '@solana-program/token';
|
|
3
|
+
import * as _solana_codecs_core from '@solana/codecs-core';
|
|
4
|
+
import * as _solana_addresses from '@solana/addresses';
|
|
5
|
+
import { Schema } from 'borsh';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Parameters for retrieving SNS domains owned by an address.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const params: GetSnsDomainsForAddressParams = { rpc, address };
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
interface GetSnsDomainsForAddressParams {
|
|
16
|
+
/** RPC client. */
|
|
17
|
+
rpc: Rpc<GetProgramAccountsApi & GetMultipleAccountsApi>;
|
|
18
|
+
/** Owner address. */
|
|
19
|
+
address: Address;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* An SNS domain owned directly by a registry address.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const domain: GetSnsDomainsForAddressResult = {
|
|
27
|
+
* domain: "example",
|
|
28
|
+
* domainAddress,
|
|
29
|
+
* };
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
interface GetSnsDomainsForAddressResult {
|
|
33
|
+
/** TLD-less domain name. */
|
|
34
|
+
domain: string;
|
|
35
|
+
/** Domain account address. */
|
|
36
|
+
domainAddress: Address;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves directly registry-owned top-level SNS domains for an address.
|
|
40
|
+
*
|
|
41
|
+
* Tokenized domains and subdomains are not included. Entries without reverse
|
|
42
|
+
* lookup results are omitted.
|
|
43
|
+
*
|
|
44
|
+
* @param params Domain retrieval parameters
|
|
45
|
+
* @param params.rpc RPC client implementing program account and multiple-account APIs
|
|
46
|
+
* @param params.address Address whose directly registry-owned SNS domains are retrieved
|
|
47
|
+
* @returns Domain records with names without a TLD suffix and domain addresses.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const domains = await getSnsDomainsForAddress({ rpc, address });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
declare const getSnsDomainsForAddress: ({ rpc, address, }: GetSnsDomainsForAddressParams) => Promise<GetSnsDomainsForAddressResult[]>;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Parameters for retrieving SNS domain NFTs owned by an address.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const params: GetSnsNftsForAddressParams = { rpc, address };
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
interface GetSnsNftsForAddressParams {
|
|
65
|
+
/** RPC client. */
|
|
66
|
+
rpc: Rpc<GetMultipleAccountsApi & GetProgramAccountsApi>;
|
|
67
|
+
/** Owner address. */
|
|
68
|
+
address: Address;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* An SNS domain NFT owned by an address.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const domain: GetSnsNftsForAddressResult = {
|
|
76
|
+
* domain: "example",
|
|
77
|
+
* domainAddress,
|
|
78
|
+
* mint,
|
|
79
|
+
* };
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
interface GetSnsNftsForAddressResult {
|
|
83
|
+
/** TLD-less domain name. */
|
|
84
|
+
domain: string;
|
|
85
|
+
/** Domain account address. */
|
|
86
|
+
domainAddress: Address;
|
|
87
|
+
/** NFT mint address. */
|
|
88
|
+
mint: Address;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Retrieves the SNS domain NFTs owned by a given address.
|
|
92
|
+
*
|
|
93
|
+
* Returned `domain` values do not include a `.sns` or `.sol` suffix.
|
|
94
|
+
* If NFT records cannot be retrieved or decoded, this function returns an empty
|
|
95
|
+
* array instead of throwing.
|
|
96
|
+
*
|
|
97
|
+
* Entries without reverse lookup results are omitted.
|
|
98
|
+
*
|
|
99
|
+
* @param params Tokenized domain retrieval parameters
|
|
100
|
+
* @param params.rpc RPC client implementing multiple-account and program account APIs
|
|
101
|
+
* @param params.address Address whose SNS domain NFTs are retrieved
|
|
102
|
+
* @returns Tokenized domain records with names without a TLD suffix, domain addresses, and mints.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* const domains = await getSnsNftsForAddress({ rpc, address });
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
declare const getSnsNftsForAddress: ({ rpc, address, }: GetSnsNftsForAddressParams) => Promise<GetSnsNftsForAddressResult[]>;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Parameters for retrieving a wallet's primary domain.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* const params: GetPrimaryDomainParams = { rpc, walletAddress };
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
interface GetPrimaryDomainParams {
|
|
120
|
+
/** RPC client. */
|
|
121
|
+
rpc: Rpc<GetAccountInfoApi & GetTokenLargestAccountsApi>;
|
|
122
|
+
/** Wallet address. */
|
|
123
|
+
walletAddress: Address;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A wallet's primary domain.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* const primary: GetPrimaryDomainResult = {
|
|
131
|
+
* domainAddress,
|
|
132
|
+
* domainName: "example",
|
|
133
|
+
* stale: false,
|
|
134
|
+
* };
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
interface GetPrimaryDomainResult {
|
|
138
|
+
/** Primary domain account address. */
|
|
139
|
+
domainAddress: Address;
|
|
140
|
+
/** TLD-less primary domain name. */
|
|
141
|
+
domainName: string;
|
|
142
|
+
/** Whether the wallet is no longer the domain's effective owner. */
|
|
143
|
+
stale: boolean;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Retrieves the primary SNS domain associated with a wallet address.
|
|
147
|
+
*
|
|
148
|
+
* Returned domain names omit the TLD suffix; subdomain primary names can
|
|
149
|
+
* include parent labels such as `sub.parent`.
|
|
150
|
+
*
|
|
151
|
+
* @param params Primary domain retrieval parameters
|
|
152
|
+
* @param params.rpc RPC client implementing account and token-largest-account APIs
|
|
153
|
+
* @param params.walletAddress Wallet address whose primary domain is retrieved
|
|
154
|
+
* @returns Primary domain address, domain name, and stale status.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* const primary = await getPrimaryDomain({ rpc, walletAddress });
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
declare const getPrimaryDomain: ({ rpc, walletAddress, }: GetPrimaryDomainParams) => Promise<GetPrimaryDomainResult>;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Parameters for retrieving primary domains for multiple wallets.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```ts
|
|
168
|
+
* const params: GetPrimaryDomainsBatchParams = { rpc, walletAddresses };
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
interface GetPrimaryDomainsBatchParams {
|
|
172
|
+
/** RPC client. */
|
|
173
|
+
rpc: Rpc<GetMultipleAccountsApi & GetTokenLargestAccountsApi>;
|
|
174
|
+
/** Wallet addresses. */
|
|
175
|
+
walletAddresses: Address[];
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Retrieves primary SNS domain names for multiple wallet addresses.
|
|
179
|
+
*
|
|
180
|
+
* Returned values are index-aligned with `walletAddresses`. Domain names omit
|
|
181
|
+
* the TLD suffix; subdomain primary names can include parent labels such as
|
|
182
|
+
* `sub.parent`.
|
|
183
|
+
*
|
|
184
|
+
* @param params Primary domain retrieval parameters
|
|
185
|
+
* @param params.rpc RPC client implementing multiple-account and token-largest-account APIs
|
|
186
|
+
* @param params.walletAddresses Wallet addresses whose primary domains are retrieved
|
|
187
|
+
* @returns Primary domain names, or `undefined` when no valid non-stale primary domain is found.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```ts
|
|
191
|
+
* const domains = await getPrimaryDomainsBatch({ rpc, walletAddresses });
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
declare const getPrimaryDomainsBatch: ({ rpc, walletAddresses, }: GetPrimaryDomainsBatchParams) => Promise<(string | undefined)[]>;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Parameters for burning an SNS domain.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```ts
|
|
201
|
+
* const params: BurnDomainParams = {
|
|
202
|
+
* domain: "example.sns",
|
|
203
|
+
* owner,
|
|
204
|
+
* refundAddress,
|
|
205
|
+
* };
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
interface BurnDomainParams {
|
|
209
|
+
/** Full `.sns` domain name. */
|
|
210
|
+
domain: string;
|
|
211
|
+
/** Current domain owner. */
|
|
212
|
+
owner: Address;
|
|
213
|
+
/** Account receiving reclaimed rent. */
|
|
214
|
+
refundAddress: Address;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Builds an instruction to burn a top-level `.sns` domain.
|
|
218
|
+
*
|
|
219
|
+
* @param params Burn parameters
|
|
220
|
+
* @param params.domain Full `.sns` domain name
|
|
221
|
+
* @param params.owner Current owner of the domain
|
|
222
|
+
* @param params.refundAddress Account receiving reclaimed rent
|
|
223
|
+
* @returns Transaction instruction.
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```ts
|
|
227
|
+
* const instruction = await burnDomain({ domain: "example.sns", owner, refundAddress });
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
declare const burnDomain: ({ domain, owner, refundAddress, }: BurnDomainParams) => Promise<Instruction>;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Parameters for creating a name registry.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```ts
|
|
237
|
+
* const params: CreateNameRegistryParams = { rpc, name: "example", space: 32, payer, owner };
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
interface CreateNameRegistryParams {
|
|
241
|
+
/** RPC client. */
|
|
242
|
+
rpc: Rpc<GetAccountInfoApi & GetMinimumBalanceForRentExemptionApi>;
|
|
243
|
+
/** Raw registry name. */
|
|
244
|
+
name: string;
|
|
245
|
+
/** Account data size in bytes. */
|
|
246
|
+
space: number;
|
|
247
|
+
/** Account paying for creation. */
|
|
248
|
+
payer: Address;
|
|
249
|
+
/** Owner of the new registry. */
|
|
250
|
+
owner: Address;
|
|
251
|
+
/** Account funding amount. Defaults to the rent-exempt minimum. */
|
|
252
|
+
lamports?: bigint;
|
|
253
|
+
/** Registry class address. */
|
|
254
|
+
classAddress?: Address;
|
|
255
|
+
/** Parent registry address. */
|
|
256
|
+
parentAddress?: Address;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Creates a raw SPL Name Registry account with the given rent budget,
|
|
260
|
+
* allocated space, owner, and class.
|
|
261
|
+
*
|
|
262
|
+
* This low-level helper accepts a raw registry seed/name and does not parse
|
|
263
|
+
* `.sns` or `.sol` suffixes.
|
|
264
|
+
*
|
|
265
|
+
* @param params Creation parameters
|
|
266
|
+
* @param params.rpc RPC client implementing account and rent-exemption APIs
|
|
267
|
+
* @param params.name Raw registry seed/name for the new account
|
|
268
|
+
* @param params.space Space in bytes allocated to the account
|
|
269
|
+
* @param params.payer Account paying for allocation
|
|
270
|
+
* @param params.owner Owner of the new name account
|
|
271
|
+
* @param params.lamports Optional lamports to fund the account. Defaults to the rent-exempt minimum
|
|
272
|
+
* @param params.classAddress Optional class address for the registry
|
|
273
|
+
* @param params.parentAddress Optional parent registry address
|
|
274
|
+
* @returns Transaction instruction.
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
* ```ts
|
|
278
|
+
* const instruction = await createNameRegistry({ rpc, name: "example", space: 32, payer, owner });
|
|
279
|
+
* ```
|
|
280
|
+
*/
|
|
281
|
+
declare const createNameRegistry: ({ rpc, name, space, payer, owner, lamports, classAddress, parentAddress, }: CreateNameRegistryParams) => Promise<Instruction>;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Supported SNS record identifiers.
|
|
285
|
+
*/
|
|
286
|
+
declare enum Record {
|
|
287
|
+
IPFS = "IPFS",
|
|
288
|
+
ARWV = "ARWV",
|
|
289
|
+
SOL = "SOL",
|
|
290
|
+
ETH = "ETH",
|
|
291
|
+
BTC = "BTC",
|
|
292
|
+
LTC = "LTC",
|
|
293
|
+
DOGE = "DOGE",
|
|
294
|
+
Email = "email",
|
|
295
|
+
Url = "url",
|
|
296
|
+
Discord = "discord",
|
|
297
|
+
Github = "github",
|
|
298
|
+
Reddit = "reddit",
|
|
299
|
+
Twitter = "twitter",
|
|
300
|
+
Telegram = "telegram",
|
|
301
|
+
Pic = "pic",
|
|
302
|
+
SHDW = "SHDW",
|
|
303
|
+
POINT = "POINT",
|
|
304
|
+
BSC = "BSC",
|
|
305
|
+
Injective = "INJ",
|
|
306
|
+
Backpack = "backpack",
|
|
307
|
+
A = "A",
|
|
308
|
+
AAAA = "AAAA",
|
|
309
|
+
CNAME = "CNAME",
|
|
310
|
+
TXT = "TXT",
|
|
311
|
+
Background = "background",
|
|
312
|
+
BASE = "BASE",
|
|
313
|
+
IPNS = "IPNS",
|
|
314
|
+
Bio = "bio"
|
|
315
|
+
}
|
|
316
|
+
/** Fixed content sizes, in bytes, for V1 record types. */
|
|
317
|
+
declare const RECORD_V1_SIZE: Map<Record, number>;
|
|
318
|
+
/** Versions of the SNS record account layout. */
|
|
319
|
+
declare enum RecordVersion {
|
|
320
|
+
V1 = 1,
|
|
321
|
+
V2 = 2
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Parameters for creating a domain record.
|
|
326
|
+
*
|
|
327
|
+
* @example
|
|
328
|
+
* ```ts
|
|
329
|
+
* const params: CreateRecordParams = {
|
|
330
|
+
* domain: "example.sns",
|
|
331
|
+
* record: Record.Url,
|
|
332
|
+
* content: "https://example.com",
|
|
333
|
+
* owner,
|
|
334
|
+
* payer,
|
|
335
|
+
* };
|
|
336
|
+
* ```
|
|
337
|
+
*/
|
|
338
|
+
interface CreateRecordParams {
|
|
339
|
+
/** Full `.sns` domain name. */
|
|
340
|
+
domain: string;
|
|
341
|
+
/** Record type. */
|
|
342
|
+
record: Record;
|
|
343
|
+
/** Record content. */
|
|
344
|
+
content: string;
|
|
345
|
+
/** Current domain owner. */
|
|
346
|
+
owner: Address;
|
|
347
|
+
/** Instruction fee payer. */
|
|
348
|
+
payer: Address;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Builds an instruction to create a V2 record for a `.sns` domain or subdomain.
|
|
352
|
+
*
|
|
353
|
+
* Record content is serialized according to SNS-IP 1.
|
|
354
|
+
*
|
|
355
|
+
* @param params Record creation parameters
|
|
356
|
+
* @param params.domain Full `.sns` domain or subdomain name
|
|
357
|
+
* @param params.record Record type
|
|
358
|
+
* @param params.content Record content
|
|
359
|
+
* @param params.owner Current owner of the domain
|
|
360
|
+
* @param params.payer Fee payer for the instruction
|
|
361
|
+
* @returns Transaction instruction.
|
|
362
|
+
*
|
|
363
|
+
* @example
|
|
364
|
+
* ```ts
|
|
365
|
+
* const instruction = await createRecord({
|
|
366
|
+
* domain: "example.sns",
|
|
367
|
+
* record: Record.Url,
|
|
368
|
+
* content: "https://example.com",
|
|
369
|
+
* owner,
|
|
370
|
+
* payer,
|
|
371
|
+
* });
|
|
372
|
+
* ```
|
|
373
|
+
*/
|
|
374
|
+
declare const createRecord: ({ domain, record, content, owner, payer, }: CreateRecordParams) => Promise<Instruction>;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Parameters for creating a reverse lookup record.
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* ```ts
|
|
381
|
+
* const params: CreateReverseParams = { domainAddress, domain: "example", payer };
|
|
382
|
+
* ```
|
|
383
|
+
*/
|
|
384
|
+
interface CreateReverseParams {
|
|
385
|
+
/** Domain account address. */
|
|
386
|
+
domainAddress: Address;
|
|
387
|
+
/** Raw reverse lookup payload. */
|
|
388
|
+
domain: string;
|
|
389
|
+
/** Account funding creation. */
|
|
390
|
+
payer: Address;
|
|
391
|
+
/** Parent domain address for a subdomain. */
|
|
392
|
+
parentAddress?: Address;
|
|
393
|
+
/** Parent domain owner for a subdomain. */
|
|
394
|
+
parentOwner?: Address;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Creates a raw reverse lookup record for the specified domain account.
|
|
398
|
+
*
|
|
399
|
+
* This low-level helper accepts the stored reverse payload as `domain` and
|
|
400
|
+
* does not parse `.sns` or `.sol` suffixes.
|
|
401
|
+
*
|
|
402
|
+
* @param params Reverse lookup creation parameters
|
|
403
|
+
* @param params.domainAddress Domain account the reverse lookup points to
|
|
404
|
+
* @param params.domain Raw reverse payload to store
|
|
405
|
+
* @param params.payer Account funding reverse lookup creation
|
|
406
|
+
* @param params.parentAddress Optional parent domain address for subdomain reverse lookups
|
|
407
|
+
* @param params.parentOwner Optional parent domain owner for subdomain reverse lookups
|
|
408
|
+
* @returns Transaction instruction.
|
|
409
|
+
*
|
|
410
|
+
* @example
|
|
411
|
+
* ```ts
|
|
412
|
+
* const instruction = await createReverse({ domainAddress, domain: "example", payer });
|
|
413
|
+
* ```
|
|
414
|
+
*/
|
|
415
|
+
declare const createReverse: ({ domainAddress, domain, payer, parentAddress, parentOwner, }: CreateReverseParams) => Promise<Instruction>;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Parameters for creating an SNS subdomain.
|
|
419
|
+
*
|
|
420
|
+
* @example
|
|
421
|
+
* ```ts
|
|
422
|
+
* const params: CreateSubdomainParams = {
|
|
423
|
+
* rpc,
|
|
424
|
+
* subdomain: "sub.example.sns",
|
|
425
|
+
* owner,
|
|
426
|
+
* };
|
|
427
|
+
* ```
|
|
428
|
+
*/
|
|
429
|
+
interface CreateSubdomainParams {
|
|
430
|
+
/** RPC client. */
|
|
431
|
+
rpc: Rpc<GetAccountInfoApi & GetMinimumBalanceForRentExemptionApi>;
|
|
432
|
+
/** Full `.sns` subdomain name. */
|
|
433
|
+
subdomain: string;
|
|
434
|
+
/** New subdomain owner. */
|
|
435
|
+
owner: Address;
|
|
436
|
+
/** Account data size in bytes. Defaults to 2,000. */
|
|
437
|
+
space?: number;
|
|
438
|
+
/** Account funding creation. Defaults to `owner`. */
|
|
439
|
+
feePayer?: Address;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Builds the instructions to create a `.sns` subdomain.
|
|
443
|
+
*
|
|
444
|
+
* The subdomain registry instruction is always included. The reverse lookup
|
|
445
|
+
* instruction is included only when the reverse lookup account does not exist.
|
|
446
|
+
*
|
|
447
|
+
* @param params Subdomain creation parameters
|
|
448
|
+
* @param params.rpc RPC client implementing account and rent-exemption APIs
|
|
449
|
+
* @param params.subdomain Full `.sns` subdomain name
|
|
450
|
+
* @param params.owner New subdomain owner and parent owner for reverse lookup creation
|
|
451
|
+
* @param params.space Optional space in bytes allocated to the subdomain account. Defaults to 2,000
|
|
452
|
+
* @param params.feePayer Optional account funding subdomain creation. Defaults to `owner`
|
|
453
|
+
* @returns Transaction instructions.
|
|
454
|
+
*
|
|
455
|
+
* @example
|
|
456
|
+
* ```ts
|
|
457
|
+
* const instructions = await createSubdomain({ rpc, subdomain: "sub.example.sns", owner });
|
|
458
|
+
* ```
|
|
459
|
+
*/
|
|
460
|
+
declare const createSubdomain: ({ rpc, subdomain, owner, space, feePayer, }: CreateSubdomainParams) => Promise<Instruction[]>;
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Parameters for deleting a name registry.
|
|
464
|
+
*
|
|
465
|
+
* @example
|
|
466
|
+
* ```ts
|
|
467
|
+
* const params: DeleteNameRegistryParams = { rpc, name: "example", refundAddress };
|
|
468
|
+
* ```
|
|
469
|
+
*/
|
|
470
|
+
interface DeleteNameRegistryParams {
|
|
471
|
+
/** RPC client. */
|
|
472
|
+
rpc: Rpc<GetAccountInfoApi>;
|
|
473
|
+
/** Raw registry name. */
|
|
474
|
+
name: string;
|
|
475
|
+
/** Account receiving refunded rent. */
|
|
476
|
+
refundAddress: Address;
|
|
477
|
+
/** Registry class address. */
|
|
478
|
+
classAddress?: Address;
|
|
479
|
+
/** Parent registry address. */
|
|
480
|
+
parentAddress?: Address;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Deletes a raw SPL Name Registry account and refunds the associated rent
|
|
484
|
+
* balance to the specified target.
|
|
485
|
+
*
|
|
486
|
+
* This low-level helper accepts a raw registry seed/name and does not parse
|
|
487
|
+
* `.sns` or `.sol` suffixes.
|
|
488
|
+
*
|
|
489
|
+
* @param params Deletion parameters
|
|
490
|
+
* @param params.rpc RPC client implementing account lookup
|
|
491
|
+
* @param params.name Raw registry seed/name whose account will be deleted
|
|
492
|
+
* @param params.refundAddress Address receiving the refunded rent balance
|
|
493
|
+
* @param params.classAddress Optional class address for the registry
|
|
494
|
+
* @param params.parentAddress Optional parent registry address
|
|
495
|
+
* @returns Transaction instruction.
|
|
496
|
+
*
|
|
497
|
+
* @example
|
|
498
|
+
* ```ts
|
|
499
|
+
* const instruction = await deleteNameRegistry({ rpc, name: "example", refundAddress });
|
|
500
|
+
* ```
|
|
501
|
+
*/
|
|
502
|
+
declare const deleteNameRegistry: ({ rpc, name, refundAddress, classAddress, parentAddress, }: DeleteNameRegistryParams) => Promise<Instruction>;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Parameters for deleting a domain record.
|
|
506
|
+
*
|
|
507
|
+
* @example
|
|
508
|
+
* ```ts
|
|
509
|
+
* const params: DeleteRecordParams = {
|
|
510
|
+
* domain: "example.sns",
|
|
511
|
+
* record: Record.Url,
|
|
512
|
+
* owner,
|
|
513
|
+
* payer,
|
|
514
|
+
* };
|
|
515
|
+
* ```
|
|
516
|
+
*/
|
|
517
|
+
interface DeleteRecordParams {
|
|
518
|
+
/** Full `.sns` domain name. */
|
|
519
|
+
domain: string;
|
|
520
|
+
/** Record type. */
|
|
521
|
+
record: Record;
|
|
522
|
+
/** Current domain owner. */
|
|
523
|
+
owner: Address;
|
|
524
|
+
/** Instruction fee payer. */
|
|
525
|
+
payer: Address;
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Builds an instruction to delete a V2 record for a `.sns` domain or subdomain.
|
|
529
|
+
*
|
|
530
|
+
* @param params Record deletion parameters
|
|
531
|
+
* @param params.domain Full `.sns` domain or subdomain name
|
|
532
|
+
* @param params.record Record type
|
|
533
|
+
* @param params.owner Current owner of the domain
|
|
534
|
+
* @param params.payer Fee payer for the instruction
|
|
535
|
+
* @returns Transaction instruction.
|
|
536
|
+
*
|
|
537
|
+
* @example
|
|
538
|
+
* ```ts
|
|
539
|
+
* const instruction = await deleteRecord({
|
|
540
|
+
* domain: "example.sns",
|
|
541
|
+
* record: Record.Url,
|
|
542
|
+
* owner,
|
|
543
|
+
* payer,
|
|
544
|
+
* });
|
|
545
|
+
* ```
|
|
546
|
+
*/
|
|
547
|
+
declare const deleteRecord: ({ domain, record, owner, payer, }: DeleteRecordParams) => Promise<Instruction>;
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Parameters for registering an SNS domain.
|
|
551
|
+
*
|
|
552
|
+
* @example
|
|
553
|
+
* ```ts
|
|
554
|
+
* const params: RegisterDomainParams = {
|
|
555
|
+
* domain: "example.sns",
|
|
556
|
+
* space: 1_000,
|
|
557
|
+
* buyer,
|
|
558
|
+
* buyerTokenAccount,
|
|
559
|
+
* };
|
|
560
|
+
* ```
|
|
561
|
+
*/
|
|
562
|
+
interface RegisterDomainParams {
|
|
563
|
+
/** Full `.sns` domain name. */
|
|
564
|
+
domain: string;
|
|
565
|
+
/** Domain registry size in bytes. */
|
|
566
|
+
space: number;
|
|
567
|
+
/** Account paying for registration. */
|
|
568
|
+
buyer: Address;
|
|
569
|
+
/** Buyer's payment token account. */
|
|
570
|
+
buyerTokenAccount: Address;
|
|
571
|
+
/** Payment token mint. Defaults to USDC. */
|
|
572
|
+
mint?: Address;
|
|
573
|
+
/** Supported referrer address. */
|
|
574
|
+
referrer?: Address;
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Builds the instructions to register a top-level `.sns` domain.
|
|
578
|
+
*
|
|
579
|
+
* If a supported referrer is provided, the returned instructions include an
|
|
580
|
+
* idempotent associated token account creation instruction before the
|
|
581
|
+
* registration instruction.
|
|
582
|
+
*
|
|
583
|
+
* @param params Registration parameters
|
|
584
|
+
* @param params.domain Full `.sns` domain name
|
|
585
|
+
* @param params.space Number of bytes to allocate for the domain registry
|
|
586
|
+
* @param params.buyer Buyer paying for the registration
|
|
587
|
+
* @param params.buyerTokenAccount Buyer's token account used to pay for registration
|
|
588
|
+
* @param params.mint Token mint used for payment. Defaults to USDC
|
|
589
|
+
* @param params.referrer Optional referrer address
|
|
590
|
+
* @returns Transaction instructions.
|
|
591
|
+
*
|
|
592
|
+
* @example
|
|
593
|
+
* ```ts
|
|
594
|
+
* const instructions = await registerDomain({
|
|
595
|
+
* domain: "example.sns",
|
|
596
|
+
* space: 1_000,
|
|
597
|
+
* buyer,
|
|
598
|
+
* buyerTokenAccount,
|
|
599
|
+
* });
|
|
600
|
+
* ```
|
|
601
|
+
*/
|
|
602
|
+
declare const registerDomain: ({ domain, space, buyer, buyerTokenAccount, mint, referrer, }: RegisterDomainParams) => Promise<Instruction[]>;
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Parameters for registering an SNS domain with an NFT.
|
|
606
|
+
*
|
|
607
|
+
* @example
|
|
608
|
+
* ```ts
|
|
609
|
+
* const params: RegisterDomainWithNftParams = {
|
|
610
|
+
* domain: "example.sns",
|
|
611
|
+
* space: 1_000,
|
|
612
|
+
* buyer,
|
|
613
|
+
* nftSource,
|
|
614
|
+
* nftMint,
|
|
615
|
+
* };
|
|
616
|
+
* ```
|
|
617
|
+
*/
|
|
618
|
+
interface RegisterDomainWithNftParams {
|
|
619
|
+
/** Full `.sns` domain name. */
|
|
620
|
+
domain: string;
|
|
621
|
+
/** Domain registry size in bytes. */
|
|
622
|
+
space: number;
|
|
623
|
+
/** Account registering the domain. */
|
|
624
|
+
buyer: Address;
|
|
625
|
+
/** Source token account for the NFT. */
|
|
626
|
+
nftSource: Address;
|
|
627
|
+
/** Bonfida Wolves NFT mint. */
|
|
628
|
+
nftMint: Address;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Builds an instruction to register a top-level `.sns` domain using a Bonfida Wolves NFT.
|
|
632
|
+
*
|
|
633
|
+
* @param params Registration parameters
|
|
634
|
+
* @param params.domain Full `.sns` domain name
|
|
635
|
+
* @param params.space Number of bytes to allocate for the domain registry
|
|
636
|
+
* @param params.buyer Buyer paying for the registration
|
|
637
|
+
* @param params.nftSource NFT source account
|
|
638
|
+
* @param params.nftMint NFT mint used for registration
|
|
639
|
+
* @returns Transaction instruction.
|
|
640
|
+
*
|
|
641
|
+
* @example
|
|
642
|
+
* ```ts
|
|
643
|
+
* const instruction = await registerDomainWithNft({
|
|
644
|
+
* domain: "example.sns",
|
|
645
|
+
* space: 1_000,
|
|
646
|
+
* buyer,
|
|
647
|
+
* nftSource,
|
|
648
|
+
* nftMint,
|
|
649
|
+
* });
|
|
650
|
+
* ```
|
|
651
|
+
*/
|
|
652
|
+
declare const registerDomainWithNft: ({ domain, space, buyer, nftSource, nftMint, }: RegisterDomainWithNftParams) => Promise<Instruction>;
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Input for setting an owner's already-derived SNS primary domain.
|
|
656
|
+
*
|
|
657
|
+
* @example
|
|
658
|
+
* ```ts
|
|
659
|
+
* const params: SetPrimaryDomainParams = { rpc, domainAddress, owner };
|
|
660
|
+
* ```
|
|
661
|
+
*/
|
|
662
|
+
interface SetPrimaryDomainParams {
|
|
663
|
+
/** RPC client used to retrieve the domain registry. */
|
|
664
|
+
rpc: Rpc<GetAccountInfoApi>;
|
|
665
|
+
/** Already-derived SNS domain account address. */
|
|
666
|
+
domainAddress: Address;
|
|
667
|
+
/** Owner of the domain account. */
|
|
668
|
+
owner: Address;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Sets the primary domain for the specified owner.
|
|
672
|
+
*
|
|
673
|
+
* This is an address-only API: `domainAddress` must be an already-derived SNS
|
|
674
|
+
* domain account.
|
|
675
|
+
*
|
|
676
|
+
* @param params Primary-domain registration parameters
|
|
677
|
+
* @param params.rpc RPC client implementing account lookup
|
|
678
|
+
* @param params.domainAddress SNS domain account address to set as primary
|
|
679
|
+
* @param params.owner Owner of the domain account
|
|
680
|
+
* @returns Transaction instruction.
|
|
681
|
+
*
|
|
682
|
+
* @example
|
|
683
|
+
* ```ts
|
|
684
|
+
* const instruction = await setPrimaryDomain({ rpc, domainAddress, owner });
|
|
685
|
+
* ```
|
|
686
|
+
*/
|
|
687
|
+
declare const setPrimaryDomain: ({ rpc, domainAddress, owner, }: SetPrimaryDomainParams) => Promise<Instruction>;
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Accounts and record identity required to build a record-validation instruction.
|
|
691
|
+
*
|
|
692
|
+
* @example
|
|
693
|
+
* ```ts
|
|
694
|
+
* const params: RecordVerificationParams = {
|
|
695
|
+
* domain: "example.sns",
|
|
696
|
+
* record: Record.Url,
|
|
697
|
+
* owner,
|
|
698
|
+
* payer,
|
|
699
|
+
* verifier,
|
|
700
|
+
* };
|
|
701
|
+
* ```
|
|
702
|
+
*/
|
|
703
|
+
interface RecordVerificationParams {
|
|
704
|
+
/** Full `.sns` domain or subdomain name. */
|
|
705
|
+
domain: string;
|
|
706
|
+
/** V2 record type to validate. */
|
|
707
|
+
record: Record;
|
|
708
|
+
/** Current owner of the domain. */
|
|
709
|
+
owner: Address;
|
|
710
|
+
/** Fee payer for the validation instruction. */
|
|
711
|
+
payer: Address;
|
|
712
|
+
/** Account whose signature or identity verifies the record. */
|
|
713
|
+
verifier: Address;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Builds an instruction to store the expected Right of Association verifier for a V2 record.
|
|
718
|
+
*
|
|
719
|
+
* @param params V2 record validation parameters
|
|
720
|
+
* @param params.domain Full `.sns` domain or subdomain name
|
|
721
|
+
* @param params.record V2 record type
|
|
722
|
+
* @param params.owner Current owner of the domain
|
|
723
|
+
* @param params.payer Fee payer for the instruction
|
|
724
|
+
* @param params.verifier Verifier account used by the record validation instruction
|
|
725
|
+
* @returns Transaction instruction.
|
|
726
|
+
*
|
|
727
|
+
* @example
|
|
728
|
+
* ```ts
|
|
729
|
+
* const instruction = await setRecordRoaVerifier({
|
|
730
|
+
* domain: "example.sns",
|
|
731
|
+
* record: Record.Url,
|
|
732
|
+
* owner,
|
|
733
|
+
* payer,
|
|
734
|
+
* verifier,
|
|
735
|
+
* });
|
|
736
|
+
* ```
|
|
737
|
+
*/
|
|
738
|
+
declare const setRecordRoaVerifier: ({ domain, record, owner, payer, verifier, }: RecordVerificationParams) => Promise<Instruction>;
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Builds an instruction to write or refresh staleness verifier metadata for a V2 record.
|
|
742
|
+
*
|
|
743
|
+
* @param params V2 record validation parameters
|
|
744
|
+
* @param params.domain Full `.sns` domain or subdomain name
|
|
745
|
+
* @param params.record V2 record type
|
|
746
|
+
* @param params.owner Current owner of the domain
|
|
747
|
+
* @param params.payer Fee payer for the instruction
|
|
748
|
+
* @param params.verifier Verifier account used by the record validation instruction
|
|
749
|
+
* @returns Transaction instruction.
|
|
750
|
+
*
|
|
751
|
+
* @example
|
|
752
|
+
* ```ts
|
|
753
|
+
* const instruction = await setRecordStalenessVerifier({
|
|
754
|
+
* domain: "example.sns",
|
|
755
|
+
* record: Record.Url,
|
|
756
|
+
* owner,
|
|
757
|
+
* payer,
|
|
758
|
+
* verifier,
|
|
759
|
+
* });
|
|
760
|
+
* ```
|
|
761
|
+
*/
|
|
762
|
+
declare const setRecordStalenessVerifier: (params: RecordVerificationParams) => Promise<Instruction>;
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Parameters for transferring an SNS domain.
|
|
766
|
+
*
|
|
767
|
+
* @example
|
|
768
|
+
* ```ts
|
|
769
|
+
* const params: TransferDomainParams = { rpc, domain: "example.sns", newOwner };
|
|
770
|
+
* ```
|
|
771
|
+
*/
|
|
772
|
+
interface TransferDomainParams {
|
|
773
|
+
/** RPC client. */
|
|
774
|
+
rpc: Rpc<GetAccountInfoApi>;
|
|
775
|
+
/** Full `.sns` domain name. */
|
|
776
|
+
domain: string;
|
|
777
|
+
/** New domain owner. */
|
|
778
|
+
newOwner: Address;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Builds an instruction to transfer a top-level `.sns` domain.
|
|
782
|
+
*
|
|
783
|
+
* @param params Transfer parameters
|
|
784
|
+
* @param params.rpc RPC client implementing account lookup
|
|
785
|
+
* @param params.domain Full `.sns` domain name
|
|
786
|
+
* @param params.newOwner New owner of the domain
|
|
787
|
+
* @returns Transaction instruction.
|
|
788
|
+
*
|
|
789
|
+
* @example
|
|
790
|
+
* ```ts
|
|
791
|
+
* const instruction = await transferDomain({ rpc, domain: "example.sns", newOwner });
|
|
792
|
+
* ```
|
|
793
|
+
*/
|
|
794
|
+
declare const transferDomain: ({ rpc, domain, newOwner, }: TransferDomainParams) => Promise<Instruction>;
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Parameters for transferring an SNS subdomain.
|
|
798
|
+
*
|
|
799
|
+
* @example
|
|
800
|
+
* ```ts
|
|
801
|
+
* const params: TransferSubdomainParams = {
|
|
802
|
+
* rpc,
|
|
803
|
+
* subdomain: "sub.example.sns",
|
|
804
|
+
* newOwner,
|
|
805
|
+
* };
|
|
806
|
+
* ```
|
|
807
|
+
*/
|
|
808
|
+
interface TransferSubdomainParams {
|
|
809
|
+
/** RPC client. */
|
|
810
|
+
rpc: Rpc<GetAccountInfoApi>;
|
|
811
|
+
/** Full `.sns` subdomain name. */
|
|
812
|
+
subdomain: string;
|
|
813
|
+
/** New subdomain owner. */
|
|
814
|
+
newOwner: Address;
|
|
815
|
+
/** Whether the parent domain owner signs. */
|
|
816
|
+
isParentOwnerSigner?: boolean;
|
|
817
|
+
/** Current subdomain owner. Resolved when omitted. */
|
|
818
|
+
currentOwner?: Address;
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* Builds an instruction to transfer a `.sns` subdomain.
|
|
822
|
+
*
|
|
823
|
+
* @param params Transfer parameters
|
|
824
|
+
* @param params.rpc RPC client implementing account lookup
|
|
825
|
+
* @param params.subdomain Full `.sns` subdomain name
|
|
826
|
+
* @param params.newOwner New owner of the subdomain
|
|
827
|
+
* @param params.isParentOwnerSigner Whether the parent domain owner signs the transfer
|
|
828
|
+
* @param params.currentOwner Optional current owner of the subdomain. Resolved automatically when omitted
|
|
829
|
+
* @returns Transaction instruction.
|
|
830
|
+
*
|
|
831
|
+
* @example
|
|
832
|
+
* ```ts
|
|
833
|
+
* const instruction = await transferSubdomain({ rpc, subdomain: "sub.example.sns", newOwner });
|
|
834
|
+
* ```
|
|
835
|
+
*/
|
|
836
|
+
declare const transferSubdomain: ({ rpc, subdomain, newOwner, isParentOwnerSigner, currentOwner, }: TransferSubdomainParams) => Promise<Instruction>;
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Input for updating bytes in a raw SNS name-registry account.
|
|
840
|
+
*
|
|
841
|
+
* @example
|
|
842
|
+
* ```ts
|
|
843
|
+
* const params: UpdateNameRegistryParams = {
|
|
844
|
+
* rpc,
|
|
845
|
+
* domain: "example",
|
|
846
|
+
* offset: 0,
|
|
847
|
+
* data: new TextEncoder().encode("data"),
|
|
848
|
+
* };
|
|
849
|
+
* ```
|
|
850
|
+
*/
|
|
851
|
+
interface UpdateNameRegistryParams {
|
|
852
|
+
/** RPC client used to retrieve the registry owner. */
|
|
853
|
+
rpc: Rpc<GetAccountInfoApi>;
|
|
854
|
+
/** Raw registry seed/name to update. */
|
|
855
|
+
domain: string;
|
|
856
|
+
/** Byte offset where the update begins. */
|
|
857
|
+
offset: number;
|
|
858
|
+
/** Bytes to write to the registry. */
|
|
859
|
+
data: Uint8Array;
|
|
860
|
+
/** Optional class address for the registry. */
|
|
861
|
+
classAddress?: Address;
|
|
862
|
+
/**
|
|
863
|
+
* Optional parent name-account address.
|
|
864
|
+
*/
|
|
865
|
+
parentAddress?: Address;
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Updates the data of a raw SPL Name Registry account.
|
|
869
|
+
*
|
|
870
|
+
* This low-level helper accepts a raw registry seed/name as `domain` and does
|
|
871
|
+
* not parse `.sns` or `.sol` suffixes.
|
|
872
|
+
*
|
|
873
|
+
* @param params Update parameters
|
|
874
|
+
* @param params.rpc RPC client implementing account lookup
|
|
875
|
+
* @param params.domain Raw registry seed/name whose account will be updated
|
|
876
|
+
* @param params.offset Offset in bytes where the update should begin
|
|
877
|
+
* @param params.data Data to write to the registry
|
|
878
|
+
* @param params.classAddress Optional class address for the registry
|
|
879
|
+
* @param params.parentAddress Optional parent registry address
|
|
880
|
+
* @returns Transaction instruction.
|
|
881
|
+
*
|
|
882
|
+
* @example
|
|
883
|
+
* ```ts
|
|
884
|
+
* const instruction = await updateNameRegistry({
|
|
885
|
+
* rpc,
|
|
886
|
+
* domain: "example",
|
|
887
|
+
* offset: 0,
|
|
888
|
+
* data: new TextEncoder().encode("data"),
|
|
889
|
+
* });
|
|
890
|
+
* ```
|
|
891
|
+
*/
|
|
892
|
+
declare function updateNameRegistry({ rpc, domain, offset, data, classAddress, parentAddress, }: UpdateNameRegistryParams): Promise<Instruction>;
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* Parameters for updating a domain record.
|
|
896
|
+
*
|
|
897
|
+
* @example
|
|
898
|
+
* ```ts
|
|
899
|
+
* const params: UpdateRecordParams = {
|
|
900
|
+
* domain: "example.sns",
|
|
901
|
+
* record: Record.Url,
|
|
902
|
+
* content: "https://example.com",
|
|
903
|
+
* owner,
|
|
904
|
+
* payer,
|
|
905
|
+
* };
|
|
906
|
+
* ```
|
|
907
|
+
*/
|
|
908
|
+
interface UpdateRecordParams {
|
|
909
|
+
/** Full `.sns` domain name. */
|
|
910
|
+
domain: string;
|
|
911
|
+
/** Record type. */
|
|
912
|
+
record: Record;
|
|
913
|
+
/** Record content. */
|
|
914
|
+
content: string;
|
|
915
|
+
/** Current domain owner. */
|
|
916
|
+
owner: Address;
|
|
917
|
+
/** Instruction fee payer. */
|
|
918
|
+
payer: Address;
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Builds an instruction to update a V2 record for a `.sns` domain or subdomain.
|
|
922
|
+
*
|
|
923
|
+
* Record content is serialized according to SNS-IP 1.
|
|
924
|
+
*
|
|
925
|
+
* @param params Record update parameters
|
|
926
|
+
* @param params.domain Full `.sns` domain or subdomain name
|
|
927
|
+
* @param params.record Record type
|
|
928
|
+
* @param params.content Record content
|
|
929
|
+
* @param params.owner Current owner of the domain
|
|
930
|
+
* @param params.payer Fee payer for the instruction
|
|
931
|
+
* @returns Transaction instruction.
|
|
932
|
+
*
|
|
933
|
+
* @example
|
|
934
|
+
* ```ts
|
|
935
|
+
* const instruction = await updateRecord({
|
|
936
|
+
* domain: "example.sns",
|
|
937
|
+
* record: Record.Url,
|
|
938
|
+
* content: "https://example.com",
|
|
939
|
+
* owner,
|
|
940
|
+
* payer,
|
|
941
|
+
* });
|
|
942
|
+
* ```
|
|
943
|
+
*/
|
|
944
|
+
declare const updateRecord: ({ domain, record, content, owner, payer, }: UpdateRecordParams) => Promise<Instruction>;
|
|
945
|
+
|
|
946
|
+
/**
|
|
947
|
+
* Builds an instruction to validate a V2 record's Right of Association with a Solana verifier.
|
|
948
|
+
*
|
|
949
|
+
* @param params Record validation parameters
|
|
950
|
+
* @param params.domain Full `.sns` domain or subdomain name
|
|
951
|
+
* @param params.record Record type
|
|
952
|
+
* @param params.owner Current owner of the domain
|
|
953
|
+
* @param params.payer Fee payer for the instruction
|
|
954
|
+
* @param params.verifier Verifier account used by the record validation instruction
|
|
955
|
+
* @returns Transaction instruction.
|
|
956
|
+
*
|
|
957
|
+
* @example
|
|
958
|
+
* ```ts
|
|
959
|
+
* const instruction = await validateRecordRoa({
|
|
960
|
+
* domain: "example.sns",
|
|
961
|
+
* record: Record.Url,
|
|
962
|
+
* owner,
|
|
963
|
+
* payer,
|
|
964
|
+
* verifier,
|
|
965
|
+
* });
|
|
966
|
+
* ```
|
|
967
|
+
*/
|
|
968
|
+
declare const validateRecordRoa: (params: RecordVerificationParams) => Promise<Instruction>;
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* Parameters for validating a record with an Ethereum signature.
|
|
972
|
+
*
|
|
973
|
+
* @example
|
|
974
|
+
* ```ts
|
|
975
|
+
* const params: ValidateRecordRoaEthereumParams = {
|
|
976
|
+
* domain: "example.sns", record: Record.ETH, owner, payer, signature, expectedPubkey,
|
|
977
|
+
* };
|
|
978
|
+
* ```
|
|
979
|
+
*/
|
|
980
|
+
interface ValidateRecordRoaEthereumParams {
|
|
981
|
+
/** Full `.sns` domain name. */
|
|
982
|
+
domain: string;
|
|
983
|
+
/** Record type. */
|
|
984
|
+
record: Record;
|
|
985
|
+
/** Current domain owner. */
|
|
986
|
+
owner: Address;
|
|
987
|
+
/** Instruction fee payer. */
|
|
988
|
+
payer: Address;
|
|
989
|
+
/** Ethereum signature. */
|
|
990
|
+
signature: Uint8Array;
|
|
991
|
+
/** Expected Ethereum public key. */
|
|
992
|
+
expectedPubkey: Uint8Array;
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* Builds an instruction to validate a V2 record's Right of Association with an Ethereum signature.
|
|
996
|
+
*
|
|
997
|
+
* @param params Record validation parameters
|
|
998
|
+
* @param params.domain Full `.sns` domain or subdomain name
|
|
999
|
+
* @param params.record Record type
|
|
1000
|
+
* @param params.owner Current owner of the domain
|
|
1001
|
+
* @param params.payer Fee payer for the instruction
|
|
1002
|
+
* @param params.signature Ethereum signature used for validation
|
|
1003
|
+
* @param params.expectedPubkey Expected Ethereum public key for validation
|
|
1004
|
+
* @returns Transaction instruction.
|
|
1005
|
+
*
|
|
1006
|
+
* @example
|
|
1007
|
+
* ```ts
|
|
1008
|
+
* const instruction = await validateRecordRoaEthereum({
|
|
1009
|
+
* domain: "example.sns",
|
|
1010
|
+
* record: Record.ETH,
|
|
1011
|
+
* owner,
|
|
1012
|
+
* payer,
|
|
1013
|
+
* signature,
|
|
1014
|
+
* expectedPubkey,
|
|
1015
|
+
* });
|
|
1016
|
+
* ```
|
|
1017
|
+
*/
|
|
1018
|
+
declare const validateRecordRoaEthereum: ({ domain, record, owner, payer, signature, expectedPubkey, }: ValidateRecordRoaEthereumParams) => Promise<Instruction>;
|
|
1019
|
+
|
|
1020
|
+
/** Codec for serializing and deserializing Solana addresses. */
|
|
1021
|
+
declare const addressCodec: _solana_codecs_core.FixedSizeCodec<_solana_addresses.Address<string>, _solana_addresses.Address<string>, 32>;
|
|
1022
|
+
/** Codec for Base58-encoded binary data. */
|
|
1023
|
+
declare const base58Codec: _solana_codecs_core.VariableSizeCodec<string, string>;
|
|
1024
|
+
/** Codec for Base64-encoded binary data. */
|
|
1025
|
+
declare const base64Codec: _solana_codecs_core.VariableSizeCodec<string>;
|
|
1026
|
+
/** Codec for SPL Token account data. */
|
|
1027
|
+
declare const tokenCodec: _solana_codecs_core.FixedSizeCodec<_solana_program_token.TokenArgs, _solana_program_token.Token>;
|
|
1028
|
+
/** Codec for UTF-8 text data. */
|
|
1029
|
+
declare const utf8Codec: _solana_codecs_core.VariableSizeCodec<string>;
|
|
1030
|
+
|
|
1031
|
+
/** Address of the Solana System Program. */
|
|
1032
|
+
declare const SYSTEM_PROGRAM_ADDRESS: Address;
|
|
1033
|
+
/** Address of the rent sysvar account. */
|
|
1034
|
+
declare const SYSVAR_RENT_ADDRESS: Address;
|
|
1035
|
+
/** All-zero Solana address used as the SDK default sentinel. */
|
|
1036
|
+
declare const DEFAULT_ADDRESS: Address;
|
|
1037
|
+
/** Address of the SPL Token program. */
|
|
1038
|
+
declare const TOKEN_PROGRAM_ADDRESS: Address;
|
|
1039
|
+
/**
|
|
1040
|
+
* The Solana Name Service program address.
|
|
1041
|
+
*/
|
|
1042
|
+
declare const NAME_PROGRAM_ADDRESS: Address;
|
|
1043
|
+
/**
|
|
1044
|
+
* The SNS root domain account address.
|
|
1045
|
+
*/
|
|
1046
|
+
declare const SNS_ROOT_DOMAIN_ACCOUNT: Address;
|
|
1047
|
+
/**
|
|
1048
|
+
* The SNS Registry program address.
|
|
1049
|
+
*/
|
|
1050
|
+
declare const REGISTRY_PROGRAM_ADDRESS: Address;
|
|
1051
|
+
/**
|
|
1052
|
+
* The SNS Name Tokenizer program address.
|
|
1053
|
+
*/
|
|
1054
|
+
declare const NAME_TOKENIZER_ADDRESS: Address;
|
|
1055
|
+
/**
|
|
1056
|
+
* The SNS Offers program address.
|
|
1057
|
+
*/
|
|
1058
|
+
declare const NAME_OFFERS_ADDRESS: Address;
|
|
1059
|
+
/**
|
|
1060
|
+
* The SNS Records program address.
|
|
1061
|
+
*/
|
|
1062
|
+
declare const RECORDS_PROGRAM_ADDRESS: Address;
|
|
1063
|
+
/**
|
|
1064
|
+
* The Solana Registration Service registrar central state PDA.
|
|
1065
|
+
*
|
|
1066
|
+
* This address is derived from the `central_state` seed and must be recomputed
|
|
1067
|
+
* if `SOL_REGISTRAR_PROGRAM_ADDRESS` is updated.
|
|
1068
|
+
*/
|
|
1069
|
+
declare const SRS_CENTRAL_STATE: Address;
|
|
1070
|
+
/**
|
|
1071
|
+
* The Solana Registration Service class PDA for `.sol` records.
|
|
1072
|
+
*
|
|
1073
|
+
* This address is derived from `SRS_CENTRAL_STATE`, `.sol`, and
|
|
1074
|
+
* `SRS_PROGRAM_ADDRESS`. It must be recomputed if either
|
|
1075
|
+
* `SOL_REGISTRAR_PROGRAM_ADDRESS` or `SRS_PROGRAM_ADDRESS` is updated.
|
|
1076
|
+
*/
|
|
1077
|
+
declare const SOL_SRS_CLASS: Address;
|
|
1078
|
+
/**
|
|
1079
|
+
* The reverse lookup class address.
|
|
1080
|
+
*/
|
|
1081
|
+
declare const REVERSE_LOOKUP_CLASS: Address;
|
|
1082
|
+
/** Legacy alias for the reverse-lookup class address. */
|
|
1083
|
+
declare const CENTRAL_STATE: Address;
|
|
1084
|
+
/**
|
|
1085
|
+
* The central state address for domain records.
|
|
1086
|
+
*/
|
|
1087
|
+
declare const CENTRAL_STATE_DOMAIN_RECORDS: Address;
|
|
1088
|
+
/**
|
|
1089
|
+
* Address of the `.twitter` TLD authority.
|
|
1090
|
+
*/
|
|
1091
|
+
declare const TWITTER_VERIFICATION_AUTHORITY: Address;
|
|
1092
|
+
/**
|
|
1093
|
+
* The `.twitter` root parent registry address.
|
|
1094
|
+
*/
|
|
1095
|
+
declare const TWITTER_ROOT_PARENT_REGISTRY_ADDRESS: Address;
|
|
1096
|
+
/** Owner address of the SNS registration vault. */
|
|
1097
|
+
declare const VAULT_OWNER: Address;
|
|
1098
|
+
/** Mainnet USDC mint address. */
|
|
1099
|
+
declare const USDC_MINT: Address;
|
|
1100
|
+
/** Mainnet FIDA mint address. */
|
|
1101
|
+
declare const FIDA_MINT: Address;
|
|
1102
|
+
/** Address of the Metaplex Token Metadata program. */
|
|
1103
|
+
declare const METAPLEX_PROGRAM_ADDRESS: Address;
|
|
1104
|
+
/** Metadata account for the SNS Wolves collection. */
|
|
1105
|
+
declare const WOLVES_COLLECTION_METADATA: Address;
|
|
1106
|
+
/** Approved referrer addresses for SNS registration flows. */
|
|
1107
|
+
declare const REFERRERS: Address[];
|
|
1108
|
+
|
|
1109
|
+
/** Program address of the legacy Pyth oracle program. */
|
|
1110
|
+
declare const PYTH_PROGRAM_ID: Address;
|
|
1111
|
+
/** Maps supported payment mint addresses to their Pyth price-feed identifiers. */
|
|
1112
|
+
declare const PYTH_FEEDS: Map<string, number[]>;
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* Maps record types to guardian addresses used for Right of Association verification.
|
|
1116
|
+
*/
|
|
1117
|
+
declare const GUARDIANS: Map<Record, Address>;
|
|
1118
|
+
/**
|
|
1119
|
+
* Record types that use Ethereum/secp256k1 Right of Association validation.
|
|
1120
|
+
*/
|
|
1121
|
+
declare const ETH_ROA_RECORDS: Set<Record>;
|
|
1122
|
+
/**
|
|
1123
|
+
* Record types whose content is a `0x`-prefixed EVM address.
|
|
1124
|
+
*/
|
|
1125
|
+
declare const EVM_RECORDS: Set<Record>;
|
|
1126
|
+
/**
|
|
1127
|
+
* Record types whose content is UTF-8 encoded.
|
|
1128
|
+
*/
|
|
1129
|
+
declare const UTF8_ENCODED_RECORDS: Set<Record>;
|
|
1130
|
+
/**
|
|
1131
|
+
* Record types whose Right of Association verifier is derived from the record content itself.
|
|
1132
|
+
*/
|
|
1133
|
+
declare const SELF_SIGNED_RECORDS: Set<Record>;
|
|
1134
|
+
|
|
1135
|
+
/**
|
|
1136
|
+
* Parameters for retrieving all SNS domains.
|
|
1137
|
+
*
|
|
1138
|
+
* @example
|
|
1139
|
+
* ```ts
|
|
1140
|
+
* const params: GetAllSnsDomainsParams = { rpc };
|
|
1141
|
+
* ```
|
|
1142
|
+
*/
|
|
1143
|
+
interface GetAllSnsDomainsParams {
|
|
1144
|
+
/** RPC client. */
|
|
1145
|
+
rpc: Rpc<GetProgramAccountsApi>;
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* A top-level SNS domain account.
|
|
1149
|
+
*
|
|
1150
|
+
* @example
|
|
1151
|
+
* ```ts
|
|
1152
|
+
* const domain: GetAllSnsDomainsResult = { domainAddress, owner };
|
|
1153
|
+
* ```
|
|
1154
|
+
*/
|
|
1155
|
+
interface GetAllSnsDomainsResult {
|
|
1156
|
+
/** Domain account address. */
|
|
1157
|
+
domainAddress: Address;
|
|
1158
|
+
/** Registry owner address. */
|
|
1159
|
+
owner: Address;
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Retrieves all top-level SNS domain accounts.
|
|
1163
|
+
*
|
|
1164
|
+
* @param params Domain retrieval parameters
|
|
1165
|
+
* @param params.rpc RPC client implementing program account lookup
|
|
1166
|
+
* @returns Domain account addresses and owners.
|
|
1167
|
+
*
|
|
1168
|
+
* @example
|
|
1169
|
+
* ```ts
|
|
1170
|
+
* const domains = await getAllSnsDomains({ rpc });
|
|
1171
|
+
* ```
|
|
1172
|
+
*/
|
|
1173
|
+
declare const getAllSnsDomains: ({ rpc, }: GetAllSnsDomainsParams) => Promise<GetAllSnsDomainsResult[]>;
|
|
1174
|
+
|
|
1175
|
+
/**
|
|
1176
|
+
* Parameters for deriving an SNS domain address.
|
|
1177
|
+
*
|
|
1178
|
+
* @example
|
|
1179
|
+
* ```ts
|
|
1180
|
+
* const params: GetSnsDomainAddressParams = { domain: "example" };
|
|
1181
|
+
* ```
|
|
1182
|
+
*/
|
|
1183
|
+
interface GetSnsDomainAddressParams {
|
|
1184
|
+
/** TLD-less domain name. */
|
|
1185
|
+
domain: string;
|
|
1186
|
+
/** Record version. */
|
|
1187
|
+
record?: RecordVersion;
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* A derived SNS domain address.
|
|
1191
|
+
*
|
|
1192
|
+
* @example
|
|
1193
|
+
* ```ts
|
|
1194
|
+
* const derived: GetSnsDomainAddressResult = {
|
|
1195
|
+
* domainAddress,
|
|
1196
|
+
* isSub: false,
|
|
1197
|
+
* };
|
|
1198
|
+
* ```
|
|
1199
|
+
*/
|
|
1200
|
+
interface GetSnsDomainAddressResult {
|
|
1201
|
+
/** Derived account address. */
|
|
1202
|
+
domainAddress: Address;
|
|
1203
|
+
/** Parent domain address for subdomains. */
|
|
1204
|
+
parentAddress?: Address;
|
|
1205
|
+
/** Whether the input is a subdomain. */
|
|
1206
|
+
isSub: boolean;
|
|
1207
|
+
/** Whether the input is a subdomain record. */
|
|
1208
|
+
isSubRecord?: boolean;
|
|
1209
|
+
}
|
|
1210
|
+
/**
|
|
1211
|
+
* Derives the address of a domain, subdomain, or record account.
|
|
1212
|
+
*
|
|
1213
|
+
* @param params Derivation parameters
|
|
1214
|
+
* @param params.domain TLD-trimmed SNS domain name
|
|
1215
|
+
* @param params.record Optional record account version for record derivation
|
|
1216
|
+
* @returns Derived account address and metadata describing top-level, subdomain, or sub-record derivation.
|
|
1217
|
+
*
|
|
1218
|
+
* @example
|
|
1219
|
+
* ```ts
|
|
1220
|
+
* const derived = await getSnsDomainAddress({ domain: "example" });
|
|
1221
|
+
* ```
|
|
1222
|
+
*/
|
|
1223
|
+
declare const getSnsDomainAddress: ({ domain, record, }: GetSnsDomainAddressParams) => Promise<GetSnsDomainAddressResult>;
|
|
1224
|
+
|
|
1225
|
+
/**
|
|
1226
|
+
* Parameters for deriving an SRS domain address.
|
|
1227
|
+
*
|
|
1228
|
+
* @example
|
|
1229
|
+
* ```ts
|
|
1230
|
+
* const params: GetSrsDomainAddressParams = { domain: "example" };
|
|
1231
|
+
* ```
|
|
1232
|
+
*/
|
|
1233
|
+
interface GetSrsDomainAddressParams {
|
|
1234
|
+
/** TLD-less `.sol` domain name. */
|
|
1235
|
+
domain: string;
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* A derived SRS domain address.
|
|
1239
|
+
*
|
|
1240
|
+
* @example
|
|
1241
|
+
* ```ts
|
|
1242
|
+
* const derived: GetSrsDomainAddressResult = { domainAddress, hashed };
|
|
1243
|
+
* ```
|
|
1244
|
+
*/
|
|
1245
|
+
interface GetSrsDomainAddressResult {
|
|
1246
|
+
/** Derived SRS record address. */
|
|
1247
|
+
domainAddress: Address;
|
|
1248
|
+
/** SHA-256 hash of the canonical name. */
|
|
1249
|
+
hashed: Uint8Array;
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1252
|
+
* Derives the canonical SRS record address for a TLD-trimmed `.sol` name.
|
|
1253
|
+
*
|
|
1254
|
+
* @param params Derivation parameters
|
|
1255
|
+
* @param params.domain TLD-trimmed `.sol` name
|
|
1256
|
+
* @returns The SRS record address and canonical name hash.
|
|
1257
|
+
*
|
|
1258
|
+
* @example
|
|
1259
|
+
* ```ts
|
|
1260
|
+
* const derived = await getSrsDomainAddress({ domain: "example" });
|
|
1261
|
+
* ```
|
|
1262
|
+
*/
|
|
1263
|
+
declare const getSrsDomainAddress: ({ domain, }: GetSrsDomainAddressParams) => Promise<GetSrsDomainAddressResult>;
|
|
1264
|
+
|
|
1265
|
+
/**
|
|
1266
|
+
* Parameters for retrieving a domain owner.
|
|
1267
|
+
*
|
|
1268
|
+
* @example
|
|
1269
|
+
* ```ts
|
|
1270
|
+
* const params: GetDomainOwnerParams = { rpc, domain: "example.sns" };
|
|
1271
|
+
* ```
|
|
1272
|
+
*/
|
|
1273
|
+
interface GetDomainOwnerParams {
|
|
1274
|
+
/** RPC client. */
|
|
1275
|
+
rpc: Rpc<GetAccountInfoApi & GetTokenLargestAccountsApi & GetSlotApi>;
|
|
1276
|
+
/** Full domain name. */
|
|
1277
|
+
domain: string;
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* Retrieves the owner of the specified domain. If the domain is tokenized,
|
|
1281
|
+
* the NFT's owner is returned; otherwise, the registry owner is returned.
|
|
1282
|
+
*
|
|
1283
|
+
* @param params Domain owner retrieval parameters
|
|
1284
|
+
* @param params.rpc RPC client implementing account and token-largest-account APIs
|
|
1285
|
+
* @param params.domain Full domain name including a `.sns` or `.sol` suffix
|
|
1286
|
+
* @returns The domain owner address.
|
|
1287
|
+
*
|
|
1288
|
+
* @example
|
|
1289
|
+
* ```ts
|
|
1290
|
+
* const owner = await getDomainOwner({ rpc, domain: "example.sns" });
|
|
1291
|
+
* ```
|
|
1292
|
+
*/
|
|
1293
|
+
declare const getDomainOwner: ({ rpc, domain }: GetDomainOwnerParams) => Promise<_solana_addresses.Address>;
|
|
1294
|
+
|
|
1295
|
+
/** Validation modes encoded in an SNS record header. */
|
|
1296
|
+
declare enum Validation {
|
|
1297
|
+
None = 0,
|
|
1298
|
+
Solana = 1,
|
|
1299
|
+
Ethereum = 2,
|
|
1300
|
+
UnverifiedSolana = 3
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
/** Byte length of the common SNS name-registry account header. */
|
|
1304
|
+
declare const NAME_REGISTRY_LEN = 96;
|
|
1305
|
+
/**
|
|
1306
|
+
* Returns the byte length of an identifier encoded for a validation mode.
|
|
1307
|
+
*
|
|
1308
|
+
* @example
|
|
1309
|
+
* ```ts
|
|
1310
|
+
* const length = getValidationLength(Validation.Solana);
|
|
1311
|
+
* ```
|
|
1312
|
+
*/
|
|
1313
|
+
declare const getValidationLength: (validation: Validation) => 32 | 0 | 20;
|
|
1314
|
+
/**
|
|
1315
|
+
* Input for decoding an SNS V2 record header.
|
|
1316
|
+
*
|
|
1317
|
+
* @example
|
|
1318
|
+
* ```ts
|
|
1319
|
+
* const params: RecordHeaderStateParams = { stalenessValidation: 0, rightOfAssociationValidation: 0, contentLength: 0 };
|
|
1320
|
+
* ```
|
|
1321
|
+
*/
|
|
1322
|
+
interface RecordHeaderStateParams {
|
|
1323
|
+
/** Staleness validation mode. */
|
|
1324
|
+
stalenessValidation: number;
|
|
1325
|
+
/** Right of Association validation mode. */
|
|
1326
|
+
rightOfAssociationValidation: number;
|
|
1327
|
+
/** Record content length in bytes. */
|
|
1328
|
+
contentLength: number;
|
|
1329
|
+
}
|
|
1330
|
+
/** Decoded header of an SNS V2 record account. */
|
|
1331
|
+
declare class RecordHeaderState {
|
|
1332
|
+
/** Staleness validation mode. */
|
|
1333
|
+
stalenessValidation: number;
|
|
1334
|
+
/** Right of Association validation mode. */
|
|
1335
|
+
rightOfAssociationValidation: number;
|
|
1336
|
+
/** Record content length in bytes. */
|
|
1337
|
+
contentLength: number;
|
|
1338
|
+
static schema: Schema;
|
|
1339
|
+
static LEN: number;
|
|
1340
|
+
constructor(obj: RecordHeaderStateParams);
|
|
1341
|
+
static deserialize(data: Uint8Array): RecordHeaderState;
|
|
1342
|
+
static retrieve(rpc: Rpc<GetAccountInfoApi>, address: Address): Promise<RecordHeaderState>;
|
|
1343
|
+
}
|
|
1344
|
+
/** Decoded SNS V2 record account, including its validation data and content. */
|
|
1345
|
+
declare class RecordState {
|
|
1346
|
+
/** Decoded record header. */
|
|
1347
|
+
header: RecordHeaderState;
|
|
1348
|
+
/** Validation identifiers and record content. */
|
|
1349
|
+
data: Uint8Array;
|
|
1350
|
+
constructor(header: RecordHeaderState, data: Uint8Array);
|
|
1351
|
+
static deserialize(data: Uint8Array): RecordState;
|
|
1352
|
+
static retrieve(rpc: Rpc<GetAccountInfoApi>, address: Address): Promise<RecordState>;
|
|
1353
|
+
static retrieveBatch(rpc: Rpc<GetMultipleAccountsApi>, addresses: Address[]): Promise<(RecordState | undefined)[]>;
|
|
1354
|
+
getContent(): Uint8Array;
|
|
1355
|
+
getStalenessId(): Uint8Array;
|
|
1356
|
+
getRoAId(): Uint8Array;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
/**
|
|
1360
|
+
* Options for retrieving a domain record.
|
|
1361
|
+
*
|
|
1362
|
+
* @example
|
|
1363
|
+
* ```ts
|
|
1364
|
+
* const options: GetDomainRecordOptions = { deserialize: true };
|
|
1365
|
+
* ```
|
|
1366
|
+
*/
|
|
1367
|
+
interface GetDomainRecordOptions {
|
|
1368
|
+
/** Whether to decode record content. */
|
|
1369
|
+
deserialize?: boolean;
|
|
1370
|
+
/** Custom Right of Association verifier. */
|
|
1371
|
+
verifier?: ReadonlyUint8Array;
|
|
1372
|
+
}
|
|
1373
|
+
/**
|
|
1374
|
+
* Parameters for retrieving a domain record.
|
|
1375
|
+
*
|
|
1376
|
+
* @example
|
|
1377
|
+
* ```ts
|
|
1378
|
+
* const params: GetDomainRecordParams = {
|
|
1379
|
+
* rpc,
|
|
1380
|
+
* domain: "example.sns",
|
|
1381
|
+
* record: Record.Url,
|
|
1382
|
+
* };
|
|
1383
|
+
* ```
|
|
1384
|
+
*/
|
|
1385
|
+
interface GetDomainRecordParams {
|
|
1386
|
+
/** RPC client. */
|
|
1387
|
+
rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi & GetTokenLargestAccountsApi & GetSlotApi>;
|
|
1388
|
+
/** Full domain name. */
|
|
1389
|
+
domain: string;
|
|
1390
|
+
/** Record type to retrieve. */
|
|
1391
|
+
record: Record;
|
|
1392
|
+
/** Record retrieval options. */
|
|
1393
|
+
options?: GetDomainRecordOptions;
|
|
1394
|
+
}
|
|
1395
|
+
/**
|
|
1396
|
+
* Verification status for a domain record.
|
|
1397
|
+
*
|
|
1398
|
+
* @example
|
|
1399
|
+
* ```ts
|
|
1400
|
+
* const verified: GetDomainRecordVerification = { staleness: true };
|
|
1401
|
+
* ```
|
|
1402
|
+
*/
|
|
1403
|
+
interface GetDomainRecordVerification {
|
|
1404
|
+
/** Whether the record is current. */
|
|
1405
|
+
staleness: boolean;
|
|
1406
|
+
/** Right of Association verification result. */
|
|
1407
|
+
roa?: boolean;
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* A retrieved domain record.
|
|
1411
|
+
*
|
|
1412
|
+
* @example
|
|
1413
|
+
* ```ts
|
|
1414
|
+
* const result: GetDomainRecordResult = {
|
|
1415
|
+
* record: Record.Url,
|
|
1416
|
+
* retrievedRecord,
|
|
1417
|
+
* verified: { staleness: true },
|
|
1418
|
+
* };
|
|
1419
|
+
* ```
|
|
1420
|
+
*/
|
|
1421
|
+
interface GetDomainRecordResult {
|
|
1422
|
+
/** Record type. */
|
|
1423
|
+
record: Record;
|
|
1424
|
+
/** Retrieved record state. */
|
|
1425
|
+
retrievedRecord: RecordState;
|
|
1426
|
+
/** Verification status. */
|
|
1427
|
+
verified: GetDomainRecordVerification;
|
|
1428
|
+
/** Decoded record content. */
|
|
1429
|
+
deserializedContent?: string;
|
|
1430
|
+
}
|
|
1431
|
+
/**
|
|
1432
|
+
* Retrieves a V2 record under a domain, verifies it, and optionally decodes its content.
|
|
1433
|
+
*
|
|
1434
|
+
* @param params Record retrieval parameters
|
|
1435
|
+
* @param params.rpc RPC client implementing account, multiple-account, and token-largest-account APIs
|
|
1436
|
+
* @param params.domain Full domain name including a `.sns` or `.sol` suffix
|
|
1437
|
+
* @param params.record Record type to retrieve
|
|
1438
|
+
* @param params.options Optional record processing options
|
|
1439
|
+
* @returns The V2 record state, its verification result, and optional decoded content
|
|
1440
|
+
*
|
|
1441
|
+
* @example
|
|
1442
|
+
* ```ts
|
|
1443
|
+
* const result = await getDomainRecord({ rpc, domain: "example.sns", record: Record.Url });
|
|
1444
|
+
* ```
|
|
1445
|
+
*/
|
|
1446
|
+
declare function getDomainRecord({ rpc, domain, record, options, }: GetDomainRecordParams): Promise<GetDomainRecordResult>;
|
|
1447
|
+
|
|
1448
|
+
/**
|
|
1449
|
+
* Options for retrieving domain records.
|
|
1450
|
+
*
|
|
1451
|
+
* @example
|
|
1452
|
+
* ```ts
|
|
1453
|
+
* const options: GetDomainRecordsOptions<[Record.Url], [undefined]> = {
|
|
1454
|
+
* deserialize: true,
|
|
1455
|
+
* verifiers: [undefined],
|
|
1456
|
+
* };
|
|
1457
|
+
* ```
|
|
1458
|
+
*/
|
|
1459
|
+
interface GetDomainRecordsOptions<T extends Record[], U extends {
|
|
1460
|
+
[K in keyof T]: ReadonlyUint8Array | undefined;
|
|
1461
|
+
}> {
|
|
1462
|
+
/** Whether to decode record content. */
|
|
1463
|
+
deserialize?: boolean;
|
|
1464
|
+
/** Right of Association verifiers by record position. */
|
|
1465
|
+
verifiers?: [...U];
|
|
1466
|
+
}
|
|
1467
|
+
/**
|
|
1468
|
+
* Parameters for retrieving domain records.
|
|
1469
|
+
*
|
|
1470
|
+
* @example
|
|
1471
|
+
* ```ts
|
|
1472
|
+
* const params: GetDomainRecordsParams<[Record.Url], [undefined]> = {
|
|
1473
|
+
* rpc,
|
|
1474
|
+
* domain: "example.sns",
|
|
1475
|
+
* records: [Record.Url],
|
|
1476
|
+
* };
|
|
1477
|
+
* ```
|
|
1478
|
+
*/
|
|
1479
|
+
interface GetDomainRecordsParams<T extends Record[], U extends {
|
|
1480
|
+
[K in keyof T]: ReadonlyUint8Array | undefined;
|
|
1481
|
+
}> {
|
|
1482
|
+
/** RPC client. */
|
|
1483
|
+
rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi & GetTokenLargestAccountsApi & GetSlotApi>;
|
|
1484
|
+
/** Full domain name. */
|
|
1485
|
+
domain: string;
|
|
1486
|
+
/** Record types to retrieve. */
|
|
1487
|
+
records: [...T];
|
|
1488
|
+
/** Record retrieval options. */
|
|
1489
|
+
options?: GetDomainRecordsOptions<T, U>;
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* Verification status for a domain record.
|
|
1493
|
+
*
|
|
1494
|
+
* @example
|
|
1495
|
+
* ```ts
|
|
1496
|
+
* const verified: GetDomainRecordsVerification = { staleness: true };
|
|
1497
|
+
* ```
|
|
1498
|
+
*/
|
|
1499
|
+
interface GetDomainRecordsVerification {
|
|
1500
|
+
/** Whether the record is current. */
|
|
1501
|
+
staleness: boolean;
|
|
1502
|
+
/** Right of Association verification result. */
|
|
1503
|
+
roa?: boolean;
|
|
1504
|
+
}
|
|
1505
|
+
/**
|
|
1506
|
+
* A retrieved domain record.
|
|
1507
|
+
*
|
|
1508
|
+
* @example
|
|
1509
|
+
* ```ts
|
|
1510
|
+
* const result: GetDomainRecordsResult = {
|
|
1511
|
+
* record: Record.Url,
|
|
1512
|
+
* retrievedRecord,
|
|
1513
|
+
* verified: { staleness: true },
|
|
1514
|
+
* };
|
|
1515
|
+
* ```
|
|
1516
|
+
*/
|
|
1517
|
+
interface GetDomainRecordsResult {
|
|
1518
|
+
/** Record type. */
|
|
1519
|
+
record: Record;
|
|
1520
|
+
/** Retrieved record state. */
|
|
1521
|
+
retrievedRecord: RecordState;
|
|
1522
|
+
/** Verification status. */
|
|
1523
|
+
verified: GetDomainRecordsVerification;
|
|
1524
|
+
/** Decoded record content. */
|
|
1525
|
+
deserializedContent?: string;
|
|
1526
|
+
}
|
|
1527
|
+
/**
|
|
1528
|
+
* Retrieves V2 records under a domain, verifies them, and optionally decodes their content.
|
|
1529
|
+
*
|
|
1530
|
+
* @param params Record retrieval parameters
|
|
1531
|
+
* @param params.rpc RPC client implementing account, multiple-account, and token-largest-account APIs
|
|
1532
|
+
* @param params.domain Full domain name including a `.sns` or `.sol` suffix
|
|
1533
|
+
* @param params.records Record types to retrieve
|
|
1534
|
+
* @param params.options Optional record processing options
|
|
1535
|
+
* @returns Results aligned with `records`; missing V2 record accounts produce `undefined`
|
|
1536
|
+
*
|
|
1537
|
+
* @example
|
|
1538
|
+
* ```ts
|
|
1539
|
+
* const results = await getDomainRecords({ rpc, domain: "example.sns", records: [Record.Url] });
|
|
1540
|
+
* ```
|
|
1541
|
+
*/
|
|
1542
|
+
declare function getDomainRecords<T extends Record[], U extends {
|
|
1543
|
+
[K in keyof T]: ReadonlyUint8Array | undefined;
|
|
1544
|
+
}>({ rpc, domain, records, options, }: GetDomainRecordsParams<T, U>): Promise<(GetDomainRecordsResult | undefined)[]>;
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* Parameters for retrieving subdomains under a parent domain.
|
|
1548
|
+
*
|
|
1549
|
+
* @example
|
|
1550
|
+
* ```ts
|
|
1551
|
+
* const params: GetSubdomainsParams = {
|
|
1552
|
+
* rpc,
|
|
1553
|
+
* domain: "example.sns",
|
|
1554
|
+
* };
|
|
1555
|
+
* ```
|
|
1556
|
+
*/
|
|
1557
|
+
interface GetSubdomainsParams {
|
|
1558
|
+
/** RPC client. */
|
|
1559
|
+
rpc: Rpc<GetProgramAccountsApi & GetSlotApi>;
|
|
1560
|
+
/** Full parent domain name, including its `.sns` or `.sol` suffix. */
|
|
1561
|
+
domain: string;
|
|
1562
|
+
}
|
|
1563
|
+
/**
|
|
1564
|
+
* A subdomain and the owner recorded in its name registry.
|
|
1565
|
+
*
|
|
1566
|
+
* @example
|
|
1567
|
+
* ```ts
|
|
1568
|
+
* const subdomain: GetSubdomainsResult = {
|
|
1569
|
+
* subdomain: "blog",
|
|
1570
|
+
* owner: "Fxuoy3gFjfJALhwkRcuKjRdechcgffUApeYAfMWck6w8" as Address,
|
|
1571
|
+
* };
|
|
1572
|
+
* ```
|
|
1573
|
+
*/
|
|
1574
|
+
interface GetSubdomainsResult {
|
|
1575
|
+
/** TLD-less label recorded by the subdomain's reverse lookup account. */
|
|
1576
|
+
subdomain: string;
|
|
1577
|
+
/** Owner address stored in the subdomain's name registry account. */
|
|
1578
|
+
owner: Address;
|
|
1579
|
+
}
|
|
1580
|
+
/**
|
|
1581
|
+
* Retrieves subdomains under a parent domain, including their owners.
|
|
1582
|
+
*
|
|
1583
|
+
* Entries without reverse lookup data are omitted. Passing a subdomain returns
|
|
1584
|
+
* an empty array.
|
|
1585
|
+
*
|
|
1586
|
+
* @param params Subdomain retrieval parameters
|
|
1587
|
+
* @param params.rpc RPC client implementing program account lookup
|
|
1588
|
+
* @param params.domain Full parent domain name including a `.sns` or `.sol` suffix
|
|
1589
|
+
* @returns Subdomain names and owner addresses.
|
|
1590
|
+
*
|
|
1591
|
+
* @example
|
|
1592
|
+
* ```ts
|
|
1593
|
+
* const subdomains = await getSubdomains({ rpc, domain: "example.sns" });
|
|
1594
|
+
* ```
|
|
1595
|
+
*/
|
|
1596
|
+
declare const getSubdomains: ({ rpc, domain, }: GetSubdomainsParams) => Promise<GetSubdomainsResult[]>;
|
|
1597
|
+
|
|
1598
|
+
/** Controls whether resolution may return program-derived addresses. */
|
|
1599
|
+
type ResolveOptions = {
|
|
1600
|
+
allowPda: false;
|
|
1601
|
+
programIds?: never;
|
|
1602
|
+
} | {
|
|
1603
|
+
allowPda: "any";
|
|
1604
|
+
programIds?: never;
|
|
1605
|
+
} | {
|
|
1606
|
+
allowPda: true;
|
|
1607
|
+
programIds: Address[];
|
|
1608
|
+
};
|
|
1609
|
+
/** RPC client type for domain resolution. */
|
|
1610
|
+
type ResolveRpc = Rpc<GetAccountInfoApi & GetMultipleAccountsApi & GetTokenLargestAccountsApi & GetSlotApi>;
|
|
1611
|
+
/**
|
|
1612
|
+
* Parameters for resolving a domain.
|
|
1613
|
+
*
|
|
1614
|
+
* @example
|
|
1615
|
+
* ```ts
|
|
1616
|
+
* const params: ResolveParams = { rpc, domain: "example.sns" };
|
|
1617
|
+
* ```
|
|
1618
|
+
*/
|
|
1619
|
+
interface ResolveParams {
|
|
1620
|
+
/** RPC client. */
|
|
1621
|
+
rpc: ResolveRpc;
|
|
1622
|
+
/** Full domain name. */
|
|
1623
|
+
domain: string;
|
|
1624
|
+
/** Resolution options. */
|
|
1625
|
+
options?: ResolveOptions;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
/**
|
|
1629
|
+
* Resolves a `.sns` or `.sol` domain to its target address.
|
|
1630
|
+
*
|
|
1631
|
+
* @param params Resolution parameters
|
|
1632
|
+
* @param params.rpc RPC client implementing account, multiple-account, token-largest-account, and slot APIs
|
|
1633
|
+
* @param params.domain Full domain name including a `.sns` or `.sol` suffix
|
|
1634
|
+
* @param params.options Optional PDA owner resolution options. Defaults to `{ allowPda: false }`
|
|
1635
|
+
* @returns The resolved target address.
|
|
1636
|
+
*
|
|
1637
|
+
* @see {@link safeResolve} for `.sol` resolution that verifies the SRS and
|
|
1638
|
+
* corresponding SNS targets match when SRS-backed resolution is enabled.
|
|
1639
|
+
*
|
|
1640
|
+
* @example
|
|
1641
|
+
* ```ts
|
|
1642
|
+
* const address = await resolve({ rpc, domain: "example.sns" });
|
|
1643
|
+
* ```
|
|
1644
|
+
*/
|
|
1645
|
+
declare const resolve: ({ rpc, domain, options, }: ResolveParams) => Promise<Address>;
|
|
1646
|
+
/**
|
|
1647
|
+
* Resolves a `.sns` or `.sol` domain using the same routing as {@link resolve}.
|
|
1648
|
+
*
|
|
1649
|
+
* When SRS-backed `.sol` resolution is enabled, both the `.sol` domain and its
|
|
1650
|
+
* corresponding `.sns` domain must resolve to the same target; otherwise,
|
|
1651
|
+
* {@link Errors.SnsSolResolutionMismatchError} is thrown.
|
|
1652
|
+
*
|
|
1653
|
+
* @param params Resolution parameters
|
|
1654
|
+
* @param params.rpc RPC client implementing account, multiple-account, token-largest-account, and slot APIs
|
|
1655
|
+
* @param params.domain Full domain name including a `.sns` or `.sol` suffix
|
|
1656
|
+
* @param params.options Optional PDA owner resolution options. Defaults to `{ allowPda: false }`
|
|
1657
|
+
* @returns The matching SRS and SNS target when compared; otherwise the target returned by {@link resolve}
|
|
1658
|
+
* @throws
|
|
1659
|
+
* - {@link Errors.SnsSolResolutionMismatchError} when SRS and SNS resolve a `.sol` domain to different addresses.
|
|
1660
|
+
* - Any resolution error propagated by {@link resolve}, `resolveSol`, or `resolveSns`.
|
|
1661
|
+
* @example
|
|
1662
|
+
* ```ts
|
|
1663
|
+
* const address = await safeResolve({ rpc, domain: "example.sol" });
|
|
1664
|
+
* ```
|
|
1665
|
+
*/
|
|
1666
|
+
declare const safeResolve: ({ rpc, domain, options, }: ResolveParams) => Promise<Address>;
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* Error classes and stable error categories emitted by SDK operations.
|
|
1670
|
+
* @module Errors
|
|
1671
|
+
*/
|
|
1672
|
+
/** Stable error codes emitted by SNS SDK operations. */
|
|
1673
|
+
declare enum ErrorType {
|
|
1674
|
+
InvalidSubdomain = "InvalidSubdomain",
|
|
1675
|
+
PrimaryDomainNotFound = "PrimaryDomainNotFound",
|
|
1676
|
+
NoRecordData = "NoRecordData",
|
|
1677
|
+
InvalidRecordData = "InvalidRecordData",
|
|
1678
|
+
InvalidEvmAddress = "InvalidEvmAddress",
|
|
1679
|
+
InvalidInjectiveAddress = "InvalidInjectiveAddress",
|
|
1680
|
+
InvalidARecord = "InvalidARecord",
|
|
1681
|
+
InvalidAAAARecord = "InvalidAAAARecord",
|
|
1682
|
+
InvalidRecordInput = "InvalidRecordInput",
|
|
1683
|
+
AccountDoesNotExist = "AccountDoesNotExist",
|
|
1684
|
+
NoAccountData = "NoAccountData",
|
|
1685
|
+
InvalidInput = "InvalidInput",
|
|
1686
|
+
InvalidDomain = "InvalidDomain",
|
|
1687
|
+
MissingVerifier = "MissingVerifier",
|
|
1688
|
+
PythFeedNotFound = "PythFeedNotFound",
|
|
1689
|
+
InvalidRoa = "InvalidRoa",
|
|
1690
|
+
InvalidParent = "InvalidParent",
|
|
1691
|
+
NftAccountNotFound = "NftRecordNotFound",
|
|
1692
|
+
PdaOwnerNotAllowed = "PdaOwnerNotAllowed",
|
|
1693
|
+
DomainDoesNotExist = "DomainDoesNotExist",
|
|
1694
|
+
RecordMalformed = "RecordMalformed",
|
|
1695
|
+
CouldNotFindNftOwner = "CouldNotFindNftOwner",
|
|
1696
|
+
InvalidValidation = "InvalidValidation",
|
|
1697
|
+
InvalidSerializedData = "InvalidSerializedData",
|
|
1698
|
+
UnsupportedTld = "UnsupportedTld",
|
|
1699
|
+
DomainExpired = "DomainExpired",
|
|
1700
|
+
CouldNotFindSrsOwner = "CouldNotFindSrsOwner",
|
|
1701
|
+
SnsSolResolutionMismatch = "SnsSolResolutionMismatch"
|
|
1702
|
+
}
|
|
1703
|
+
/** Base error thrown by SNS SDK operations. Inspect `type` for a stable error code. */
|
|
1704
|
+
declare class SNSError extends Error {
|
|
1705
|
+
type: ErrorType;
|
|
1706
|
+
constructor(type: ErrorType, message?: string);
|
|
1707
|
+
}
|
|
1708
|
+
/** Thrown when a subdomain name is malformed or unsupported. */
|
|
1709
|
+
declare class InvalidSubdomainError extends SNSError {
|
|
1710
|
+
constructor(message?: string);
|
|
1711
|
+
}
|
|
1712
|
+
/** Thrown when an address has no configured primary domain. */
|
|
1713
|
+
declare class PrimaryDomainNotFoundError extends SNSError {
|
|
1714
|
+
constructor(message?: string);
|
|
1715
|
+
}
|
|
1716
|
+
/** Thrown when a requested record account has no readable data. */
|
|
1717
|
+
declare class NoRecordDataError extends SNSError {
|
|
1718
|
+
constructor(message?: string);
|
|
1719
|
+
}
|
|
1720
|
+
/** Thrown when record content fails format validation. */
|
|
1721
|
+
declare class InvalidRecordDataError extends SNSError {
|
|
1722
|
+
constructor(message?: string);
|
|
1723
|
+
}
|
|
1724
|
+
/** Thrown when an EVM address is invalid for a record operation. */
|
|
1725
|
+
declare class InvalidEvmAddressError extends SNSError {
|
|
1726
|
+
constructor(message?: string);
|
|
1727
|
+
}
|
|
1728
|
+
/** Thrown when an Injective address is invalid for a record operation. */
|
|
1729
|
+
declare class InvalidInjectiveAddressError extends SNSError {
|
|
1730
|
+
constructor(message?: string);
|
|
1731
|
+
}
|
|
1732
|
+
/** Thrown when an IPv4 record value is invalid. */
|
|
1733
|
+
declare class InvalidARecordError extends SNSError {
|
|
1734
|
+
constructor(message?: string);
|
|
1735
|
+
}
|
|
1736
|
+
/** Thrown when an IPv6 record value is invalid. */
|
|
1737
|
+
declare class InvalidAAAARecordError extends SNSError {
|
|
1738
|
+
constructor(message?: string);
|
|
1739
|
+
}
|
|
1740
|
+
/** Thrown when record creation or update input is incomplete or invalid. */
|
|
1741
|
+
declare class InvalidRecordInputError extends SNSError {
|
|
1742
|
+
constructor(message?: string);
|
|
1743
|
+
}
|
|
1744
|
+
/** Thrown when a required on-chain account does not exist. */
|
|
1745
|
+
declare class AccountDoesNotExistError extends SNSError {
|
|
1746
|
+
constructor(message?: string);
|
|
1747
|
+
}
|
|
1748
|
+
/** Thrown when an existing account has no readable data. */
|
|
1749
|
+
declare class NoAccountDataError extends SNSError {
|
|
1750
|
+
constructor(message?: string);
|
|
1751
|
+
}
|
|
1752
|
+
/** Thrown when a general SDK input contract is not met. */
|
|
1753
|
+
declare class InvalidInputError extends SNSError {
|
|
1754
|
+
constructor(message?: string);
|
|
1755
|
+
}
|
|
1756
|
+
/** Thrown when a domain name is malformed or invalid. */
|
|
1757
|
+
declare class InvalidDomainError extends SNSError {
|
|
1758
|
+
constructor(message?: string);
|
|
1759
|
+
}
|
|
1760
|
+
/** Thrown when required record verification data is missing. */
|
|
1761
|
+
declare class MissingVerifierError extends SNSError {
|
|
1762
|
+
constructor(message?: string);
|
|
1763
|
+
}
|
|
1764
|
+
/** Thrown when no Pyth price feed is configured for a mint. */
|
|
1765
|
+
declare class PythFeedNotFoundError extends SNSError {
|
|
1766
|
+
constructor(message?: string);
|
|
1767
|
+
}
|
|
1768
|
+
/** Thrown when a Right of Association proof is invalid. */
|
|
1769
|
+
declare class InvalidRoaError extends SNSError {
|
|
1770
|
+
constructor(message?: string);
|
|
1771
|
+
}
|
|
1772
|
+
/** Thrown when a required parent domain account cannot be resolved. */
|
|
1773
|
+
declare class InvalidParentError extends SNSError {
|
|
1774
|
+
constructor(message?: string);
|
|
1775
|
+
}
|
|
1776
|
+
/** Thrown when an expected SNS NFT account cannot be found. */
|
|
1777
|
+
declare class NftAccountNotFoundError extends SNSError {
|
|
1778
|
+
constructor(message?: string);
|
|
1779
|
+
}
|
|
1780
|
+
/** Thrown when a program-derived address is not an allowed owner. */
|
|
1781
|
+
declare class PdaOwnerNotAllowedError extends SNSError {
|
|
1782
|
+
constructor(message?: string);
|
|
1783
|
+
}
|
|
1784
|
+
/** Thrown when a requested SNS domain account does not exist. */
|
|
1785
|
+
declare class DomainDoesNotExistError extends SNSError {
|
|
1786
|
+
constructor(message?: string);
|
|
1787
|
+
}
|
|
1788
|
+
/** Thrown when serialized record data cannot be decoded safely. */
|
|
1789
|
+
declare class RecordMalformedError extends SNSError {
|
|
1790
|
+
constructor(message?: string);
|
|
1791
|
+
}
|
|
1792
|
+
/** Thrown when the owner of an SNS NFT cannot be determined. */
|
|
1793
|
+
declare class CouldNotFindNftOwnerError extends SNSError {
|
|
1794
|
+
constructor(message?: string);
|
|
1795
|
+
}
|
|
1796
|
+
/** Thrown when an unsupported record validation mode is encountered. */
|
|
1797
|
+
declare class InvalidValidationError extends SNSError {
|
|
1798
|
+
constructor(message?: string);
|
|
1799
|
+
}
|
|
1800
|
+
/** Thrown when serialized account or record data is inconsistent. */
|
|
1801
|
+
declare class InvalidSerializedDataError extends SNSError {
|
|
1802
|
+
constructor(message?: string);
|
|
1803
|
+
}
|
|
1804
|
+
/** Thrown when a domain does not use a supported top-level domain. */
|
|
1805
|
+
declare class UnsupportedTldError extends SNSError {
|
|
1806
|
+
constructor(message?: string);
|
|
1807
|
+
}
|
|
1808
|
+
/** Thrown when a Solana Registration Service domain has expired. */
|
|
1809
|
+
declare class DomainExpiredError extends SNSError {
|
|
1810
|
+
constructor(message?: string);
|
|
1811
|
+
}
|
|
1812
|
+
/** Thrown when a Solana Registration Service domain owner cannot be resolved. */
|
|
1813
|
+
declare class CouldNotFindSrsOwnerError extends SNSError {
|
|
1814
|
+
constructor(message?: string);
|
|
1815
|
+
}
|
|
1816
|
+
/** Thrown when .sns and .sol resolve the same domain to different addresses. */
|
|
1817
|
+
declare class SnsSolResolutionMismatchError extends SNSError {
|
|
1818
|
+
constructor(message?: string);
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
/**
|
|
1822
|
+
* Input for allocating and writing an SNS V2 record.
|
|
1823
|
+
*
|
|
1824
|
+
* @example
|
|
1825
|
+
* ```ts
|
|
1826
|
+
* const params: AllocateAndPostRecordInstructionParams = { record, content };
|
|
1827
|
+
* ```
|
|
1828
|
+
*/
|
|
1829
|
+
interface AllocateAndPostRecordInstructionParams {
|
|
1830
|
+
/** Encoded V2 record label. */
|
|
1831
|
+
record: string;
|
|
1832
|
+
/** Serialized record content. */
|
|
1833
|
+
content: ReadonlyUint8Array;
|
|
1834
|
+
}
|
|
1835
|
+
/** Builder for allocating and writing an SNS V2 record account. */
|
|
1836
|
+
declare class AllocateAndPostRecordInstruction {
|
|
1837
|
+
/** Instruction discriminator. */
|
|
1838
|
+
tag: number;
|
|
1839
|
+
/** Encoded V2 record label. */
|
|
1840
|
+
record: string;
|
|
1841
|
+
/** Serialized record content. */
|
|
1842
|
+
content: ReadonlyUint8Array;
|
|
1843
|
+
static schema: {
|
|
1844
|
+
struct: {
|
|
1845
|
+
tag: string;
|
|
1846
|
+
record: string;
|
|
1847
|
+
content: {
|
|
1848
|
+
array: {
|
|
1849
|
+
type: string;
|
|
1850
|
+
};
|
|
1851
|
+
};
|
|
1852
|
+
};
|
|
1853
|
+
};
|
|
1854
|
+
constructor(obj: AllocateAndPostRecordInstructionParams);
|
|
1855
|
+
serialize(): Uint8Array;
|
|
1856
|
+
getInstruction(programAddress: Address, systemProgram: Address, splNameServiceProgram: Address, payer: Address, record: Address, domainAddress: Address, domainOwner: Address, centralState: Address): Instruction;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
/** Builder for burning an SNS domain NFT and registry account. */
|
|
1860
|
+
declare class BurnDomainInstruction {
|
|
1861
|
+
/** Instruction discriminator. */
|
|
1862
|
+
tag: number;
|
|
1863
|
+
static schema: {
|
|
1864
|
+
struct: {
|
|
1865
|
+
tag: string;
|
|
1866
|
+
};
|
|
1867
|
+
};
|
|
1868
|
+
constructor();
|
|
1869
|
+
serialize(): Uint8Array;
|
|
1870
|
+
getInstruction(programAddress: Address, nameServiceId: Address, systemProgram: Address, domainAddress: Address, reverse: Address, resellingState: Address, state: Address, centralState: Address, owner: Address, target: Address): Instruction;
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
/**
|
|
1874
|
+
* Creates an idempotent associated-token-account instruction.
|
|
1875
|
+
*
|
|
1876
|
+
* The instruction succeeds when the associated token account already exists,
|
|
1877
|
+
* allowing callers to include it safely before token transfers.
|
|
1878
|
+
*
|
|
1879
|
+
* @param programAddress Associated Token Program address
|
|
1880
|
+
* @param payer Account funding associated token account creation
|
|
1881
|
+
* @param ata Derived associated token account address
|
|
1882
|
+
* @param owner Owner of the associated token account
|
|
1883
|
+
* @param mint Token mint for the associated token account
|
|
1884
|
+
* @param systemProgram Solana System Program address
|
|
1885
|
+
* @param splTokenProgram SPL Token Program address
|
|
1886
|
+
* @returns Idempotent associated-token-account creation instruction
|
|
1887
|
+
*
|
|
1888
|
+
* @example
|
|
1889
|
+
* ```ts
|
|
1890
|
+
* const instruction = _createAtaIdempotentInstruction(
|
|
1891
|
+
* ASSOCIATED_TOKEN_PROGRAM_ADDRESS,
|
|
1892
|
+
* payer,
|
|
1893
|
+
* ata,
|
|
1894
|
+
* owner,
|
|
1895
|
+
* mint,
|
|
1896
|
+
* SYSTEM_PROGRAM_ADDRESS,
|
|
1897
|
+
* TOKEN_PROGRAM_ADDRESS,
|
|
1898
|
+
* );
|
|
1899
|
+
* ```
|
|
1900
|
+
*/
|
|
1901
|
+
declare const _createAtaIdempotentInstruction: (programAddress: Address, payer: Address, ata: Address, owner: Address, mint: Address, systemProgram: Address, splTokenProgram: Address) => Instruction;
|
|
1902
|
+
|
|
1903
|
+
/**
|
|
1904
|
+
* Input for creating an SNS name-registry account.
|
|
1905
|
+
*
|
|
1906
|
+
* @example
|
|
1907
|
+
* ```ts
|
|
1908
|
+
* const params: CreateNameRegistryInstructionParams = { nameHash, lamports, space: 32 };
|
|
1909
|
+
* ```
|
|
1910
|
+
*/
|
|
1911
|
+
interface CreateNameRegistryInstructionParams {
|
|
1912
|
+
/** Hash of the registry name. */
|
|
1913
|
+
nameHash: Uint8Array;
|
|
1914
|
+
/** Account funding amount. */
|
|
1915
|
+
lamports: bigint;
|
|
1916
|
+
/** Account data size in bytes. */
|
|
1917
|
+
space: number;
|
|
1918
|
+
}
|
|
1919
|
+
/** Builder for creating an SNS name-registry account. */
|
|
1920
|
+
declare class CreateNameRegistryInstruction {
|
|
1921
|
+
/** Instruction discriminator. */
|
|
1922
|
+
tag: number;
|
|
1923
|
+
/** Hash of the registry name. */
|
|
1924
|
+
nameHash: Uint8Array;
|
|
1925
|
+
/** Account funding amount. */
|
|
1926
|
+
lamports: bigint;
|
|
1927
|
+
/** Account data size in bytes. */
|
|
1928
|
+
space: number;
|
|
1929
|
+
static schema: {
|
|
1930
|
+
struct: {
|
|
1931
|
+
tag: string;
|
|
1932
|
+
nameHash: {
|
|
1933
|
+
array: {
|
|
1934
|
+
type: string;
|
|
1935
|
+
};
|
|
1936
|
+
};
|
|
1937
|
+
lamports: string;
|
|
1938
|
+
space: string;
|
|
1939
|
+
};
|
|
1940
|
+
};
|
|
1941
|
+
constructor(obj: CreateNameRegistryInstructionParams);
|
|
1942
|
+
serialize(): Uint8Array;
|
|
1943
|
+
getInstruction(programAddress: Address, systemProgram: Address, domainAddress: Address, owner: Address, payer: Address, classAddress?: Address, parentAddress?: Address, parentOwner?: Address): Instruction;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
/**
|
|
1947
|
+
* Input for creating an SNS reverse-lookup account.
|
|
1948
|
+
*
|
|
1949
|
+
* @example
|
|
1950
|
+
* ```ts
|
|
1951
|
+
* const params: CreateReverseInstructionParams = { domain: "example" };
|
|
1952
|
+
* ```
|
|
1953
|
+
*/
|
|
1954
|
+
interface CreateReverseInstructionParams {
|
|
1955
|
+
/** Raw reverse lookup payload. */
|
|
1956
|
+
domain: string;
|
|
1957
|
+
}
|
|
1958
|
+
/** Builder for creating an SNS reverse-lookup account. */
|
|
1959
|
+
declare class CreateReverseInstruction {
|
|
1960
|
+
/** Instruction discriminator. */
|
|
1961
|
+
tag: number;
|
|
1962
|
+
/** Raw reverse lookup payload. */
|
|
1963
|
+
domain: string;
|
|
1964
|
+
static schema: {
|
|
1965
|
+
struct: {
|
|
1966
|
+
tag: string;
|
|
1967
|
+
domain: string;
|
|
1968
|
+
};
|
|
1969
|
+
};
|
|
1970
|
+
constructor(obj: CreateReverseInstructionParams);
|
|
1971
|
+
serialize(): Uint8Array;
|
|
1972
|
+
getInstruction(programAddress: Address, namingServiceProgram: Address, rootDomain: Address, reverseLookup: Address, systemProgram: Address, centralState: Address, payer: Address, rentSysvar: Address, parentAddress?: Address, parentOwner?: Address): Instruction;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* Input for creating a split SNS V2 domain account.
|
|
1977
|
+
*
|
|
1978
|
+
* @example
|
|
1979
|
+
* ```ts
|
|
1980
|
+
* const params: CreateSplitV2InstructionParams = { name: "example", space: 1_000, referrerIdxOpt: null };
|
|
1981
|
+
* ```
|
|
1982
|
+
*/
|
|
1983
|
+
interface CreateSplitV2InstructionParams {
|
|
1984
|
+
/** TLD-less domain name. */
|
|
1985
|
+
name: string;
|
|
1986
|
+
/** Account data size in bytes. */
|
|
1987
|
+
space: number;
|
|
1988
|
+
/** Approved referrer index, if any. */
|
|
1989
|
+
referrerIdxOpt: number | null;
|
|
1990
|
+
}
|
|
1991
|
+
/** Builder for creating a split SNS V2 domain account. */
|
|
1992
|
+
declare class CreateSplitV2Instruction {
|
|
1993
|
+
/** Instruction discriminator. */
|
|
1994
|
+
tag: number;
|
|
1995
|
+
/** TLD-less domain name. */
|
|
1996
|
+
name: string;
|
|
1997
|
+
/** Account data size in bytes. */
|
|
1998
|
+
space: number;
|
|
1999
|
+
/** Approved referrer index, if any. */
|
|
2000
|
+
referrerIdxOpt: number | null;
|
|
2001
|
+
static schema: {
|
|
2002
|
+
struct: {
|
|
2003
|
+
tag: string;
|
|
2004
|
+
name: string;
|
|
2005
|
+
space: string;
|
|
2006
|
+
referrerIdxOpt: {
|
|
2007
|
+
option: string;
|
|
2008
|
+
};
|
|
2009
|
+
};
|
|
2010
|
+
};
|
|
2011
|
+
constructor(obj: CreateSplitV2InstructionParams);
|
|
2012
|
+
serialize(): Uint8Array;
|
|
2013
|
+
getInstruction(programAddress: Address, namingServiceProgram: Address, rootDomain: Address, name: Address, reverseLookup: Address, systemProgram: Address, centralState: Address, buyer: Address, domainOwner: Address, feePayer: Address, buyerTokenSource: Address, pythFeedAccount: Address, vault: Address, splTokenProgram: Address, rentSysvar: Address, state: Address, referrerAccountOpt?: Address): Instruction;
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
/**
|
|
2017
|
+
* Input for registering an SNS domain backed by an NFT.
|
|
2018
|
+
*
|
|
2019
|
+
* @example
|
|
2020
|
+
* ```ts
|
|
2021
|
+
* const params: CreateWithNftInstructionParams = { name: "example", space: 1_000 };
|
|
2022
|
+
* ```
|
|
2023
|
+
*/
|
|
2024
|
+
interface CreateWithNftInstructionParams {
|
|
2025
|
+
/** TLD-less domain name. */
|
|
2026
|
+
name: string;
|
|
2027
|
+
/** Account data size in bytes. */
|
|
2028
|
+
space: number;
|
|
2029
|
+
}
|
|
2030
|
+
/** Builder for registering an SNS domain backed by an NFT. */
|
|
2031
|
+
declare class CreateWithNftInstruction {
|
|
2032
|
+
/** Instruction discriminator. */
|
|
2033
|
+
tag: number;
|
|
2034
|
+
/** TLD-less domain name. */
|
|
2035
|
+
name: string;
|
|
2036
|
+
/** Account data size in bytes. */
|
|
2037
|
+
space: number;
|
|
2038
|
+
static schema: {
|
|
2039
|
+
struct: {
|
|
2040
|
+
tag: string;
|
|
2041
|
+
name: string;
|
|
2042
|
+
space: string;
|
|
2043
|
+
};
|
|
2044
|
+
};
|
|
2045
|
+
constructor(obj: CreateWithNftInstructionParams);
|
|
2046
|
+
serialize(): Uint8Array;
|
|
2047
|
+
getInstruction(programAddress: Address, namingServiceProgram: Address, rootDomain: Address, name: Address, reverseLookup: Address, systemProgram: Address, centralState: Address, buyer: Address, nftSource: Address, nftMetadata: Address, nftMint: Address, masterEdition: Address, collection: Address, splTokenProgram: Address, rentSysvar: Address, state: Address, mplTokenMetadata: Address): Instruction;
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
/** Builder for deleting an SNS name-registry account. */
|
|
2051
|
+
declare class DeleteNameRegistryInstruction {
|
|
2052
|
+
/** Instruction discriminator. */
|
|
2053
|
+
tag: number;
|
|
2054
|
+
static schema: {
|
|
2055
|
+
struct: {
|
|
2056
|
+
tag: string;
|
|
2057
|
+
};
|
|
2058
|
+
};
|
|
2059
|
+
constructor();
|
|
2060
|
+
serialize(): Uint8Array;
|
|
2061
|
+
getInstruction(programAddress: Address, domainAddress: Address, refundTarget: Address, owner: Address): Instruction;
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
/** Builder for deleting an SNS V2 record account. */
|
|
2065
|
+
declare class DeleteRecordInstruction {
|
|
2066
|
+
/** Instruction discriminator. */
|
|
2067
|
+
tag: number;
|
|
2068
|
+
static schema: {
|
|
2069
|
+
struct: {
|
|
2070
|
+
tag: string;
|
|
2071
|
+
};
|
|
2072
|
+
};
|
|
2073
|
+
constructor();
|
|
2074
|
+
serialize(): Uint8Array;
|
|
2075
|
+
getInstruction(programAddress: Address, systemProgram: Address, splNameServiceProgram: Address, payer: Address, record: Address, domainAddress: Address, domainOwner: Address, centralState: Address): Instruction;
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
/**
|
|
2079
|
+
* Input for reallocating an SNS name-registry account.
|
|
2080
|
+
*
|
|
2081
|
+
* @example
|
|
2082
|
+
* ```ts
|
|
2083
|
+
* const params: ReallocInstructionParams = { space: 1_000 };
|
|
2084
|
+
* ```
|
|
2085
|
+
*/
|
|
2086
|
+
interface ReallocInstructionParams {
|
|
2087
|
+
/** New account data size in bytes. */
|
|
2088
|
+
space: number;
|
|
2089
|
+
}
|
|
2090
|
+
/** Builder for reallocating an SNS name-registry account. */
|
|
2091
|
+
declare class ReallocInstruction {
|
|
2092
|
+
/** Instruction discriminator. */
|
|
2093
|
+
tag: number;
|
|
2094
|
+
/** New account data size in bytes. */
|
|
2095
|
+
space: number;
|
|
2096
|
+
static schema: {
|
|
2097
|
+
struct: {
|
|
2098
|
+
tag: string;
|
|
2099
|
+
space: string;
|
|
2100
|
+
};
|
|
2101
|
+
};
|
|
2102
|
+
constructor(obj: ReallocInstructionParams);
|
|
2103
|
+
serialize(): Uint8Array;
|
|
2104
|
+
getInstruction(programAddress: Address, systemProgramId: Address, payerKey: Address, nameAccountKey: Address, nameOwnerKey: Address): Instruction;
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
/** Builder for registering an address's SNS primary domain. */
|
|
2108
|
+
declare class RegisterPrimaryInstruction {
|
|
2109
|
+
/** Instruction discriminator. */
|
|
2110
|
+
tag: number;
|
|
2111
|
+
static schema: {
|
|
2112
|
+
struct: {
|
|
2113
|
+
tag: string;
|
|
2114
|
+
};
|
|
2115
|
+
};
|
|
2116
|
+
constructor();
|
|
2117
|
+
serialize(): Uint8Array;
|
|
2118
|
+
getInstruction(programAddress: Address, nameAccount: Address, primaryAccount: Address, owner: Address, systemProgram: Address, optParent?: Address): Instruction;
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
/**
|
|
2122
|
+
* Input for transferring an SNS name-registry account.
|
|
2123
|
+
*
|
|
2124
|
+
* @example
|
|
2125
|
+
* ```ts
|
|
2126
|
+
* const params: TransferInstructionParams = { newOwner };
|
|
2127
|
+
* ```
|
|
2128
|
+
*/
|
|
2129
|
+
interface TransferInstructionParams {
|
|
2130
|
+
/** New registry owner. */
|
|
2131
|
+
newOwner: Address;
|
|
2132
|
+
}
|
|
2133
|
+
/** Builder for the SNS name-registry transfer instruction. */
|
|
2134
|
+
declare class TransferInstruction {
|
|
2135
|
+
/** Instruction discriminator. */
|
|
2136
|
+
tag: number;
|
|
2137
|
+
/** Encoded new owner address. */
|
|
2138
|
+
encodedNewOwnerAddress: ReadonlyUint8Array;
|
|
2139
|
+
static schema: {
|
|
2140
|
+
struct: {
|
|
2141
|
+
tag: string;
|
|
2142
|
+
encodedNewOwnerAddress: {
|
|
2143
|
+
array: {
|
|
2144
|
+
type: string;
|
|
2145
|
+
len: number;
|
|
2146
|
+
};
|
|
2147
|
+
};
|
|
2148
|
+
};
|
|
2149
|
+
};
|
|
2150
|
+
constructor(obj: TransferInstructionParams);
|
|
2151
|
+
serialize(): Uint8Array;
|
|
2152
|
+
getInstruction(programAddress: Address, domainAddress: Address, currentOwner: Address, classAddress?: Address, parentAddress?: Address, parentOwner?: Address): Instruction;
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
/**
|
|
2156
|
+
* Input for updating an SNS name-registry account.
|
|
2157
|
+
*
|
|
2158
|
+
* @example
|
|
2159
|
+
* ```ts
|
|
2160
|
+
* const params: UpdateNameRegistryInstructionParams = { offset: 0, inputData };
|
|
2161
|
+
* ```
|
|
2162
|
+
*/
|
|
2163
|
+
interface UpdateNameRegistryInstructionParams {
|
|
2164
|
+
/** Byte offset where the update begins. */
|
|
2165
|
+
offset: number;
|
|
2166
|
+
/** Bytes to write. */
|
|
2167
|
+
inputData: Uint8Array;
|
|
2168
|
+
}
|
|
2169
|
+
/** Builder for updating the data of an SNS name-registry account. */
|
|
2170
|
+
declare class UpdateNameRegistryInstruction {
|
|
2171
|
+
/** Instruction discriminator. */
|
|
2172
|
+
tag: number;
|
|
2173
|
+
/** Byte offset where the update begins. */
|
|
2174
|
+
offset: number;
|
|
2175
|
+
/** Bytes to write. */
|
|
2176
|
+
inputData: Uint8Array;
|
|
2177
|
+
static schema: {
|
|
2178
|
+
struct: {
|
|
2179
|
+
tag: string;
|
|
2180
|
+
offset: string;
|
|
2181
|
+
inputData: {
|
|
2182
|
+
array: {
|
|
2183
|
+
type: string;
|
|
2184
|
+
};
|
|
2185
|
+
};
|
|
2186
|
+
};
|
|
2187
|
+
};
|
|
2188
|
+
constructor(obj: UpdateNameRegistryInstructionParams);
|
|
2189
|
+
serialize(): Uint8Array;
|
|
2190
|
+
getInstruction(programAddress: Address, domainAddress: Address, signer: Address): Instruction;
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
/**
|
|
2194
|
+
* Input for updating an SNS V2 record account.
|
|
2195
|
+
*
|
|
2196
|
+
* @example
|
|
2197
|
+
* ```ts
|
|
2198
|
+
* const params: UpdateRecordInstructionParams = { record, content };
|
|
2199
|
+
* ```
|
|
2200
|
+
*/
|
|
2201
|
+
interface UpdateRecordInstructionParams {
|
|
2202
|
+
/** Encoded V2 record label. */
|
|
2203
|
+
record: string;
|
|
2204
|
+
/** Serialized record content. */
|
|
2205
|
+
content: ReadonlyUint8Array;
|
|
2206
|
+
}
|
|
2207
|
+
/** Builder for updating content in an SNS V2 record account. */
|
|
2208
|
+
declare class UpdateRecordInstruction {
|
|
2209
|
+
/** Instruction discriminator. */
|
|
2210
|
+
tag: number;
|
|
2211
|
+
/** Encoded V2 record label. */
|
|
2212
|
+
record: string;
|
|
2213
|
+
/** Serialized record content. */
|
|
2214
|
+
content: ReadonlyUint8Array;
|
|
2215
|
+
static schema: {
|
|
2216
|
+
struct: {
|
|
2217
|
+
tag: string;
|
|
2218
|
+
record: string;
|
|
2219
|
+
content: {
|
|
2220
|
+
array: {
|
|
2221
|
+
type: string;
|
|
2222
|
+
};
|
|
2223
|
+
};
|
|
2224
|
+
};
|
|
2225
|
+
};
|
|
2226
|
+
constructor(obj: UpdateRecordInstructionParams);
|
|
2227
|
+
serialize(): Uint8Array;
|
|
2228
|
+
getInstruction(programAddress: Address, systemProgram: Address, splNameServiceProgram: Address, feePayer: Address, record: Address, domain: Address, domainOwner: Address, centralState: Address): Instruction;
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
/**
|
|
2232
|
+
* Input for validating an Ethereum signature for an SNS record.
|
|
2233
|
+
*
|
|
2234
|
+
* @example
|
|
2235
|
+
* ```ts
|
|
2236
|
+
* const params: ValidateEthereumSignatureInstructionParams = { validation, signature, expectedPubkey };
|
|
2237
|
+
* ```
|
|
2238
|
+
*/
|
|
2239
|
+
interface ValidateEthereumSignatureInstructionParams {
|
|
2240
|
+
/** Validation mode discriminator. */
|
|
2241
|
+
validation: number;
|
|
2242
|
+
/** Ethereum signature. */
|
|
2243
|
+
signature: ReadonlyUint8Array;
|
|
2244
|
+
/** Expected Ethereum public key. */
|
|
2245
|
+
expectedPubkey: ReadonlyUint8Array;
|
|
2246
|
+
}
|
|
2247
|
+
/** Builder for validating an Ethereum signature for an SNS record. */
|
|
2248
|
+
declare class ValidateEthereumSignatureInstruction {
|
|
2249
|
+
/** Instruction discriminator. */
|
|
2250
|
+
tag: number;
|
|
2251
|
+
/** Validation mode discriminator. */
|
|
2252
|
+
validation: number;
|
|
2253
|
+
/** Ethereum signature. */
|
|
2254
|
+
signature: ReadonlyUint8Array;
|
|
2255
|
+
/** Expected Ethereum public key. */
|
|
2256
|
+
expectedPubkey: ReadonlyUint8Array;
|
|
2257
|
+
static schema: {
|
|
2258
|
+
struct: {
|
|
2259
|
+
tag: string;
|
|
2260
|
+
validation: string;
|
|
2261
|
+
signature: {
|
|
2262
|
+
array: {
|
|
2263
|
+
type: string;
|
|
2264
|
+
};
|
|
2265
|
+
};
|
|
2266
|
+
expectedPubkey: {
|
|
2267
|
+
array: {
|
|
2268
|
+
type: string;
|
|
2269
|
+
};
|
|
2270
|
+
};
|
|
2271
|
+
};
|
|
2272
|
+
};
|
|
2273
|
+
constructor(obj: ValidateEthereumSignatureInstructionParams);
|
|
2274
|
+
serialize(): Uint8Array;
|
|
2275
|
+
getInstruction(programAddress: Address, systemProgram: Address, splNameServiceProgram: Address, feePayer: Address, record: Address, domain: Address, domainOwner: Address, centralState: Address): Instruction;
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
/**
|
|
2279
|
+
* Input for validating a Solana signature for an SNS record.
|
|
2280
|
+
*
|
|
2281
|
+
* @example
|
|
2282
|
+
* ```ts
|
|
2283
|
+
* const params: ValidateSolanaSignatureInstructionParams = { staleness: false };
|
|
2284
|
+
* ```
|
|
2285
|
+
*/
|
|
2286
|
+
interface ValidateSolanaSignatureInstructionParams {
|
|
2287
|
+
/** Whether to validate staleness. */
|
|
2288
|
+
staleness: boolean;
|
|
2289
|
+
}
|
|
2290
|
+
/** Builder for validating a Solana signature for an SNS record. */
|
|
2291
|
+
declare class ValidateSolanaSignatureInstruction {
|
|
2292
|
+
/** Instruction discriminator. */
|
|
2293
|
+
tag: number;
|
|
2294
|
+
/** Whether to validate staleness. */
|
|
2295
|
+
staleness: boolean;
|
|
2296
|
+
static schema: {
|
|
2297
|
+
struct: {
|
|
2298
|
+
tag: string;
|
|
2299
|
+
staleness: string;
|
|
2300
|
+
};
|
|
2301
|
+
};
|
|
2302
|
+
constructor(obj: ValidateSolanaSignatureInstructionParams);
|
|
2303
|
+
serialize(): Uint8Array;
|
|
2304
|
+
getInstruction(programAddress: Address, systemProgram: Address, splNameServiceProgram: Address, feePayer: Address, record: Address, domain: Address, domainOwner: Address, centralState: Address, verifier: Address): Instruction;
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
/**
|
|
2308
|
+
* Input for setting an SNS record's Right of Association verifier.
|
|
2309
|
+
*
|
|
2310
|
+
* @example
|
|
2311
|
+
* ```ts
|
|
2312
|
+
* const params: SetRecordRoaVerifierInstructionParams = { verifier };
|
|
2313
|
+
* ```
|
|
2314
|
+
*/
|
|
2315
|
+
interface SetRecordRoaVerifierInstructionParams {
|
|
2316
|
+
/** Verifier account address. */
|
|
2317
|
+
verifier: Address;
|
|
2318
|
+
}
|
|
2319
|
+
/** Builder for setting an SNS record's Right of Association verifier. */
|
|
2320
|
+
declare class SetRecordRoaVerifierInstruction {
|
|
2321
|
+
/** Instruction discriminator. */
|
|
2322
|
+
tag: number;
|
|
2323
|
+
/** Encoded verifier address. */
|
|
2324
|
+
roaId: ReadonlyUint8Array;
|
|
2325
|
+
static schema: {
|
|
2326
|
+
struct: {
|
|
2327
|
+
tag: string;
|
|
2328
|
+
roaId: {
|
|
2329
|
+
array: {
|
|
2330
|
+
type: string;
|
|
2331
|
+
};
|
|
2332
|
+
};
|
|
2333
|
+
};
|
|
2334
|
+
};
|
|
2335
|
+
constructor(obj: SetRecordRoaVerifierInstructionParams);
|
|
2336
|
+
serialize(): Uint8Array;
|
|
2337
|
+
getInstruction(programAddress: Address, systemProgram: Address, splNameServiceProgram: Address, feePayer: Address, record: Address, domain: Address, domainOwner: Address, centralState: Address): Instruction;
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
/**
|
|
2341
|
+
* Parameters for deriving an SNS NFT mint.
|
|
2342
|
+
*
|
|
2343
|
+
* @example
|
|
2344
|
+
* ```ts
|
|
2345
|
+
* const params: GetSnsNftMintParams = { domainAddress };
|
|
2346
|
+
* ```
|
|
2347
|
+
*/
|
|
2348
|
+
interface GetSnsNftMintParams {
|
|
2349
|
+
/** Tokenized domain account address. */
|
|
2350
|
+
domainAddress: Address;
|
|
2351
|
+
}
|
|
2352
|
+
/**
|
|
2353
|
+
* Derives the mint address of a tokenized SNS domain.
|
|
2354
|
+
*
|
|
2355
|
+
* @param params NFT mint derivation parameters
|
|
2356
|
+
* @param params.domainAddress Domain account address used to derive the NFT mint
|
|
2357
|
+
* @returns The derived SNS domain NFT mint address.
|
|
2358
|
+
*
|
|
2359
|
+
* @example
|
|
2360
|
+
* ```ts
|
|
2361
|
+
* const mint = await getSnsNftMint({ domainAddress });
|
|
2362
|
+
* ```
|
|
2363
|
+
*/
|
|
2364
|
+
declare const getSnsNftMint: ({ domainAddress }: GetSnsNftMintParams) => Promise<Address<string>>;
|
|
2365
|
+
|
|
2366
|
+
/**
|
|
2367
|
+
* Parameters for retrieving an SNS NFT owner.
|
|
2368
|
+
*
|
|
2369
|
+
* @example
|
|
2370
|
+
* ```ts
|
|
2371
|
+
* const params: GetSnsNftOwnerParams = { rpc, domainAddress };
|
|
2372
|
+
* ```
|
|
2373
|
+
*/
|
|
2374
|
+
interface GetSnsNftOwnerParams {
|
|
2375
|
+
/** RPC client. */
|
|
2376
|
+
rpc: Rpc<GetAccountInfoApi & GetTokenLargestAccountsApi>;
|
|
2377
|
+
/** Tokenized domain account address. */
|
|
2378
|
+
domainAddress: Address;
|
|
2379
|
+
}
|
|
2380
|
+
/**
|
|
2381
|
+
* Retrieves the owner of a tokenized SNS domain.
|
|
2382
|
+
*
|
|
2383
|
+
* @param params NFT owner retrieval parameters
|
|
2384
|
+
* @param params.rpc RPC client implementing account and token-largest-account APIs
|
|
2385
|
+
* @param params.domainAddress Domain account address whose tokenized owner is retrieved
|
|
2386
|
+
* @returns The SNS domain NFT owner address, or `null` when no valid tokenized owner is found.
|
|
2387
|
+
*
|
|
2388
|
+
* @example
|
|
2389
|
+
* ```ts
|
|
2390
|
+
* const owner = await getSnsNftOwner({ rpc, domainAddress });
|
|
2391
|
+
* ```
|
|
2392
|
+
*/
|
|
2393
|
+
declare const getSnsNftOwner: ({ rpc, domainAddress, }: GetSnsNftOwnerParams) => Promise<Address | null>;
|
|
2394
|
+
|
|
2395
|
+
/**
|
|
2396
|
+
* Parameters for deriving a V1 record address.
|
|
2397
|
+
*
|
|
2398
|
+
* @example
|
|
2399
|
+
* ```ts
|
|
2400
|
+
* const params: GetRecordV1AddressParams = { domain: "example", record: Record.Url };
|
|
2401
|
+
* ```
|
|
2402
|
+
*/
|
|
2403
|
+
interface GetRecordV1AddressParams {
|
|
2404
|
+
/** TLD-less domain name. */
|
|
2405
|
+
domain: string;
|
|
2406
|
+
/** Record type. */
|
|
2407
|
+
record: Record;
|
|
2408
|
+
}
|
|
2409
|
+
/**
|
|
2410
|
+
* Derives the address of a V1 record account.
|
|
2411
|
+
*
|
|
2412
|
+
* The V1 account is derived by prefixing the record label to the domain name.
|
|
2413
|
+
*
|
|
2414
|
+
* @param params Record address derivation parameters
|
|
2415
|
+
* @param params.domain TLD-trimmed SNS domain name
|
|
2416
|
+
* @param params.record Record type
|
|
2417
|
+
* @returns The derived V1 record account address.
|
|
2418
|
+
*
|
|
2419
|
+
* @example
|
|
2420
|
+
* ```ts
|
|
2421
|
+
* const address = await getRecordV1Address({ domain: "example", record: Record.Url });
|
|
2422
|
+
* ```
|
|
2423
|
+
*/
|
|
2424
|
+
declare const getRecordV1Address: ({ domain, record, }: GetRecordV1AddressParams) => Promise<_solana_addresses.Address>;
|
|
2425
|
+
|
|
2426
|
+
/**
|
|
2427
|
+
* Parameters for deriving a V2 record address.
|
|
2428
|
+
*
|
|
2429
|
+
* @example
|
|
2430
|
+
* ```ts
|
|
2431
|
+
* const params: GetRecordV2AddressParams = { domain: "example", record: Record.Url };
|
|
2432
|
+
* ```
|
|
2433
|
+
*/
|
|
2434
|
+
interface GetRecordV2AddressParams {
|
|
2435
|
+
/** TLD-less domain name. */
|
|
2436
|
+
domain: string;
|
|
2437
|
+
/** Record type. */
|
|
2438
|
+
record: Record;
|
|
2439
|
+
}
|
|
2440
|
+
/**
|
|
2441
|
+
* Derives the address of a V2 record account.
|
|
2442
|
+
*
|
|
2443
|
+
* @param params Record address derivation parameters
|
|
2444
|
+
* @param params.domain TLD-trimmed SNS domain name
|
|
2445
|
+
* @param params.record Record type
|
|
2446
|
+
* @returns The derived V2 record account address.
|
|
2447
|
+
*
|
|
2448
|
+
* @example
|
|
2449
|
+
* ```ts
|
|
2450
|
+
* const address = await getRecordV2Address({ domain: "example", record: Record.Url });
|
|
2451
|
+
* ```
|
|
2452
|
+
*/
|
|
2453
|
+
declare const getRecordV2Address: ({ domain, record, }: GetRecordV2AddressParams) => Promise<Address>;
|
|
2454
|
+
|
|
2455
|
+
/**
|
|
2456
|
+
* Internal helper that derives the default verifier for a record state.
|
|
2457
|
+
*
|
|
2458
|
+
* @param params Default verifier parameters
|
|
2459
|
+
* @param params.record Record type
|
|
2460
|
+
* @param params.state Record state
|
|
2461
|
+
* @returns The default verifier, or `undefined` when no verifier is found.
|
|
2462
|
+
*
|
|
2463
|
+
* @example
|
|
2464
|
+
* ```ts
|
|
2465
|
+
* const verifier = _getDefaultVerifier({ record: Record.Url, state });
|
|
2466
|
+
* ```
|
|
2467
|
+
*/
|
|
2468
|
+
declare const _getDefaultVerifier: ({ record, state, }: {
|
|
2469
|
+
record: Record;
|
|
2470
|
+
state: RecordState;
|
|
2471
|
+
}) => Uint8Array<ArrayBufferLike> | ReadonlyUint8Array<ArrayBuffer> | undefined;
|
|
2472
|
+
/**
|
|
2473
|
+
* Internal helper that verifies a record's Right of Association validation.
|
|
2474
|
+
*
|
|
2475
|
+
* Ethereum/secp256k1 validation is used for EVM RoA records; Solana validation
|
|
2476
|
+
* is used otherwise.
|
|
2477
|
+
*
|
|
2478
|
+
* @param params Right of Association verification parameters
|
|
2479
|
+
* @param params.record Record type to verify
|
|
2480
|
+
* @param params.state Record state
|
|
2481
|
+
* @param params.verifier Verifier for the record
|
|
2482
|
+
* @returns True if the association is valid, false otherwise.
|
|
2483
|
+
*
|
|
2484
|
+
* @example
|
|
2485
|
+
* ```ts
|
|
2486
|
+
* const valid = _verifyRoaSync({ record: Record.Url, state, verifier });
|
|
2487
|
+
* ```
|
|
2488
|
+
*/
|
|
2489
|
+
declare const _verifyRoaSync: ({ record, state, verifier, }: {
|
|
2490
|
+
record: Record;
|
|
2491
|
+
state: RecordState;
|
|
2492
|
+
verifier: ReadonlyUint8Array;
|
|
2493
|
+
}) => boolean;
|
|
2494
|
+
/**
|
|
2495
|
+
* Verifies a record's Right of Association validation.
|
|
2496
|
+
*
|
|
2497
|
+
* @param rpc RPC client implementing account and token-largest-account APIs
|
|
2498
|
+
* @param domain Full domain name including a `.sns` or `.sol` suffix
|
|
2499
|
+
* @param record Record type to verify
|
|
2500
|
+
* @param verifier Optional verifier for the record. If omitted, a default verifier is derived
|
|
2501
|
+
* @returns True if the association is valid, false otherwise.
|
|
2502
|
+
* @throws MissingVerifierError If no verifier is specified and no default verifier is found.
|
|
2503
|
+
*
|
|
2504
|
+
* @example
|
|
2505
|
+
* ```ts
|
|
2506
|
+
* const valid = await verifyRecordRightOfAssociation(rpc, "example.sns", Record.Url);
|
|
2507
|
+
* ```
|
|
2508
|
+
*/
|
|
2509
|
+
declare const verifyRecordRightOfAssociation: (rpc: Rpc<GetAccountInfoApi & GetTokenLargestAccountsApi & GetSlotApi>, domain: string, record: Record, verifier?: ReadonlyUint8Array) => Promise<boolean>;
|
|
2510
|
+
|
|
2511
|
+
/**
|
|
2512
|
+
* Internal helper that verifies a record's staleness validation.
|
|
2513
|
+
*
|
|
2514
|
+
* @param params Staleness verification parameters
|
|
2515
|
+
* @param params.domainOwner Current owner of the domain
|
|
2516
|
+
* @param params.state Record state to verify
|
|
2517
|
+
* @returns True if the record's staleness validation passes, false otherwise.
|
|
2518
|
+
*
|
|
2519
|
+
* @example
|
|
2520
|
+
* ```ts
|
|
2521
|
+
* const valid = _verifyStalenessSync({ domainOwner, state });
|
|
2522
|
+
* ```
|
|
2523
|
+
*/
|
|
2524
|
+
declare const _verifyStalenessSync: ({ domainOwner, state, }: {
|
|
2525
|
+
domainOwner: Address;
|
|
2526
|
+
state: RecordState;
|
|
2527
|
+
}) => boolean;
|
|
2528
|
+
/**
|
|
2529
|
+
* Parameters for verifying record staleness.
|
|
2530
|
+
*
|
|
2531
|
+
* @example
|
|
2532
|
+
* ```ts
|
|
2533
|
+
* const params: VerifyRecordStalenessParams = {
|
|
2534
|
+
* rpc,
|
|
2535
|
+
* domain: "example.sns",
|
|
2536
|
+
* record: Record.Url,
|
|
2537
|
+
* };
|
|
2538
|
+
* ```
|
|
2539
|
+
*/
|
|
2540
|
+
interface VerifyRecordStalenessParams {
|
|
2541
|
+
/** RPC client. */
|
|
2542
|
+
rpc: Rpc<GetAccountInfoApi & GetTokenLargestAccountsApi & GetSlotApi>;
|
|
2543
|
+
/** Full domain name. */
|
|
2544
|
+
domain: string;
|
|
2545
|
+
/** Record type. */
|
|
2546
|
+
record: Record;
|
|
2547
|
+
}
|
|
2548
|
+
/**
|
|
2549
|
+
* Verifies a record's staleness validation.
|
|
2550
|
+
*
|
|
2551
|
+
* @param params Staleness verification parameters
|
|
2552
|
+
* @param params.rpc RPC client implementing account and token-largest-account APIs
|
|
2553
|
+
* @param params.domain Full domain name including a `.sns` or `.sol` suffix
|
|
2554
|
+
* @param params.record Record type to verify
|
|
2555
|
+
* @returns True if the record's staleness validation passes, false otherwise.
|
|
2556
|
+
*
|
|
2557
|
+
* @example
|
|
2558
|
+
* ```ts
|
|
2559
|
+
* const valid = await verifyRecordStaleness({ rpc, domain: "example.sns", record: Record.Url });
|
|
2560
|
+
* ```
|
|
2561
|
+
*/
|
|
2562
|
+
declare const verifyRecordStaleness: ({ rpc, domain, record, }: VerifyRecordStalenessParams) => Promise<boolean>;
|
|
2563
|
+
|
|
2564
|
+
/** Tags identifying the SNS NFT state variant. */
|
|
2565
|
+
declare enum NftTag {
|
|
2566
|
+
Uninitialized = 0,
|
|
2567
|
+
CentralState = 1,
|
|
2568
|
+
ActiveRecord = 2,
|
|
2569
|
+
InactiveRecord = 3
|
|
2570
|
+
}
|
|
2571
|
+
/**
|
|
2572
|
+
* Input for decoding an SNS NFT account.
|
|
2573
|
+
*
|
|
2574
|
+
* @example
|
|
2575
|
+
* ```ts
|
|
2576
|
+
* const params: NftStateParams = { tag: 2, nonce: 0, nameAccount, owner, nftMint };
|
|
2577
|
+
* ```
|
|
2578
|
+
*/
|
|
2579
|
+
interface NftStateParams {
|
|
2580
|
+
/** NFT state tag. */
|
|
2581
|
+
tag: number;
|
|
2582
|
+
/** NFT record nonce. */
|
|
2583
|
+
nonce: number;
|
|
2584
|
+
/** Encoded SNS domain account address. */
|
|
2585
|
+
nameAccount: Uint8Array;
|
|
2586
|
+
/** Encoded NFT owner address. */
|
|
2587
|
+
owner: Uint8Array;
|
|
2588
|
+
/** Encoded NFT mint address. */
|
|
2589
|
+
nftMint: Uint8Array;
|
|
2590
|
+
}
|
|
2591
|
+
/** Decoded state of an SNS NFT account. */
|
|
2592
|
+
declare class NftState {
|
|
2593
|
+
/** NFT state tag. */
|
|
2594
|
+
tag: NftTag;
|
|
2595
|
+
/** NFT record nonce. */
|
|
2596
|
+
nonce: number;
|
|
2597
|
+
/** SNS domain account address. */
|
|
2598
|
+
nameAccount: Address;
|
|
2599
|
+
/** NFT owner address. */
|
|
2600
|
+
owner: Address;
|
|
2601
|
+
/** NFT mint address. */
|
|
2602
|
+
nftMint: Address;
|
|
2603
|
+
static schema: {
|
|
2604
|
+
struct: {
|
|
2605
|
+
tag: string;
|
|
2606
|
+
nonce: string;
|
|
2607
|
+
nameAccount: {
|
|
2608
|
+
array: {
|
|
2609
|
+
type: string;
|
|
2610
|
+
len: number;
|
|
2611
|
+
};
|
|
2612
|
+
};
|
|
2613
|
+
owner: {
|
|
2614
|
+
array: {
|
|
2615
|
+
type: string;
|
|
2616
|
+
len: number;
|
|
2617
|
+
};
|
|
2618
|
+
};
|
|
2619
|
+
nftMint: {
|
|
2620
|
+
array: {
|
|
2621
|
+
type: string;
|
|
2622
|
+
len: number;
|
|
2623
|
+
};
|
|
2624
|
+
};
|
|
2625
|
+
};
|
|
2626
|
+
};
|
|
2627
|
+
static LEN: number;
|
|
2628
|
+
constructor(obj: NftStateParams);
|
|
2629
|
+
static deserialize(data: Uint8Array): NftState;
|
|
2630
|
+
static retrieve(rpc: Rpc<GetAccountInfoApi>, address: Address): Promise<NftState>;
|
|
2631
|
+
static retrieveFromMint(rpc: Rpc<GetProgramAccountsApi>, mint: Address): Promise<NftState>;
|
|
2632
|
+
static getAddress(domainAddress: Address): Promise<Address>;
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
/**
|
|
2636
|
+
* Input for decoding an SNS primary-domain account.
|
|
2637
|
+
*
|
|
2638
|
+
* @example
|
|
2639
|
+
* ```ts
|
|
2640
|
+
* const params: PrimaryDomainStateParams = { tag: 0, nameAccount };
|
|
2641
|
+
* ```
|
|
2642
|
+
*/
|
|
2643
|
+
interface PrimaryDomainStateParams {
|
|
2644
|
+
/** Account state tag. */
|
|
2645
|
+
tag: number;
|
|
2646
|
+
/** Encoded primary domain account address. */
|
|
2647
|
+
nameAccount: Uint8Array;
|
|
2648
|
+
}
|
|
2649
|
+
/** Decoded state of an SNS primary-domain account. */
|
|
2650
|
+
declare class PrimaryDomainState {
|
|
2651
|
+
/** Account state tag. */
|
|
2652
|
+
tag: number;
|
|
2653
|
+
/** Primary domain account address. */
|
|
2654
|
+
nameAccount: Address;
|
|
2655
|
+
static schema: {
|
|
2656
|
+
struct: {
|
|
2657
|
+
tag: string;
|
|
2658
|
+
nameAccount: {
|
|
2659
|
+
array: {
|
|
2660
|
+
type: string;
|
|
2661
|
+
len: number;
|
|
2662
|
+
};
|
|
2663
|
+
};
|
|
2664
|
+
};
|
|
2665
|
+
};
|
|
2666
|
+
constructor(obj: PrimaryDomainStateParams);
|
|
2667
|
+
static deserialize(data: Uint8Array): PrimaryDomainState;
|
|
2668
|
+
static retrieve(rpc: Rpc<GetAccountInfoApi>, address: Address): Promise<PrimaryDomainState>;
|
|
2669
|
+
static _retrieveBatch(rpc: Rpc<GetMultipleAccountsApi>, primaryAddresses: Address[]): Promise<(PrimaryDomainState | undefined)[]>;
|
|
2670
|
+
static retrieveBatch(rpc: Rpc<GetMultipleAccountsApi>, primaryAddresses: Address[]): Promise<(PrimaryDomainState | undefined)[]>;
|
|
2671
|
+
static getAddress(programAddress: Address, walletAddress: Address): Promise<Address<string>>;
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
/**
|
|
2675
|
+
* Input for decoding an SNS name-registry account.
|
|
2676
|
+
*
|
|
2677
|
+
* @example
|
|
2678
|
+
* ```ts
|
|
2679
|
+
* const params: RegistryStateParams = { parentName, owner, class: classAddress };
|
|
2680
|
+
* ```
|
|
2681
|
+
*/
|
|
2682
|
+
interface RegistryStateParams {
|
|
2683
|
+
/** Encoded parent registry address. */
|
|
2684
|
+
parentName: Uint8Array;
|
|
2685
|
+
/** Encoded registry owner address. */
|
|
2686
|
+
owner: Uint8Array;
|
|
2687
|
+
/** Encoded registry class address. */
|
|
2688
|
+
class: Uint8Array;
|
|
2689
|
+
}
|
|
2690
|
+
/** Decoded state of an SNS name-registry account. */
|
|
2691
|
+
declare class RegistryState {
|
|
2692
|
+
/** Parent registry address. */
|
|
2693
|
+
parentName: Address;
|
|
2694
|
+
/** Registry owner address. */
|
|
2695
|
+
owner: Address;
|
|
2696
|
+
/** Registry class address. */
|
|
2697
|
+
class: Address;
|
|
2698
|
+
/** Registry data after the fixed header. */
|
|
2699
|
+
data: Uint8Array | undefined;
|
|
2700
|
+
static schema: {
|
|
2701
|
+
struct: {
|
|
2702
|
+
parentName: {
|
|
2703
|
+
array: {
|
|
2704
|
+
type: string;
|
|
2705
|
+
len: number;
|
|
2706
|
+
};
|
|
2707
|
+
};
|
|
2708
|
+
owner: {
|
|
2709
|
+
array: {
|
|
2710
|
+
type: string;
|
|
2711
|
+
len: number;
|
|
2712
|
+
};
|
|
2713
|
+
};
|
|
2714
|
+
class: {
|
|
2715
|
+
array: {
|
|
2716
|
+
type: string;
|
|
2717
|
+
len: number;
|
|
2718
|
+
};
|
|
2719
|
+
};
|
|
2720
|
+
};
|
|
2721
|
+
};
|
|
2722
|
+
static HEADER_LEN: number;
|
|
2723
|
+
constructor(obj: RegistryStateParams);
|
|
2724
|
+
static deserialize(data: Uint8Array): RegistryState;
|
|
2725
|
+
static retrieve(rpc: Rpc<GetAccountInfoApi>, address: Address): Promise<RegistryState>;
|
|
2726
|
+
static _retrieveBatch(rpc: Rpc<GetMultipleAccountsApi>, domainAddresses: Address[]): Promise<(RegistryState | undefined)[]>;
|
|
2727
|
+
static retrieveBatch(rpc: Rpc<GetMultipleAccountsApi>, domainAddresses: Address[]): Promise<(RegistryState | undefined)[]>;
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
/**
|
|
2731
|
+
* Returns whether a Solana address represents a valid Ed25519 curve point.
|
|
2732
|
+
*
|
|
2733
|
+
* @param address Solana address to validate
|
|
2734
|
+
* @returns Whether the address is an Ed25519 curve point
|
|
2735
|
+
*
|
|
2736
|
+
* @example
|
|
2737
|
+
* ```ts
|
|
2738
|
+
* const onCurve = checkAddressOnCurve(address);
|
|
2739
|
+
* ```
|
|
2740
|
+
*/
|
|
2741
|
+
declare function checkAddressOnCurve(address: Address): boolean;
|
|
2742
|
+
|
|
2743
|
+
/**
|
|
2744
|
+
* Parameters for deserializing record content.
|
|
2745
|
+
*
|
|
2746
|
+
* @example
|
|
2747
|
+
* ```ts
|
|
2748
|
+
* const params: DeserializeRecordContentParams = { content, record: Record.Url };
|
|
2749
|
+
* ```
|
|
2750
|
+
*/
|
|
2751
|
+
interface DeserializeRecordContentParams {
|
|
2752
|
+
/** Serialized record content. */
|
|
2753
|
+
content: ReadonlyUint8Array;
|
|
2754
|
+
/** Record type. */
|
|
2755
|
+
record: Record;
|
|
2756
|
+
}
|
|
2757
|
+
/**
|
|
2758
|
+
* Deserializes record content according to SNS-IP 1.
|
|
2759
|
+
*
|
|
2760
|
+
* `CNAME` and `TXT` content is punycode-decoded after UTF-8 deserialization.
|
|
2761
|
+
*
|
|
2762
|
+
* @param params Record deserialization parameters
|
|
2763
|
+
* @param params.content Serialized record content
|
|
2764
|
+
* @param params.record Record type
|
|
2765
|
+
* @returns Deserialized record content.
|
|
2766
|
+
* @throws InvalidRecordDataError If the record type or content is unsupported.
|
|
2767
|
+
*
|
|
2768
|
+
* @example
|
|
2769
|
+
* ```ts
|
|
2770
|
+
* const result = await getDomainRecord({
|
|
2771
|
+
* rpc,
|
|
2772
|
+
* domain: "example.sns",
|
|
2773
|
+
* record: Record.Url,
|
|
2774
|
+
* });
|
|
2775
|
+
* const content = deserializeRecordContent({
|
|
2776
|
+
* content: result.retrievedRecord.getContent(),
|
|
2777
|
+
* record: Record.Url,
|
|
2778
|
+
* });
|
|
2779
|
+
* ```
|
|
2780
|
+
*/
|
|
2781
|
+
declare const deserializeRecordContent: ({ content, record, }: DeserializeRecordContentParams) => string;
|
|
2782
|
+
|
|
2783
|
+
/**
|
|
2784
|
+
* Parameters for deserializing reverse account data.
|
|
2785
|
+
*
|
|
2786
|
+
* @example
|
|
2787
|
+
* ```ts
|
|
2788
|
+
* const params: DeserializeReverseParams = { data: reverseAccountData };
|
|
2789
|
+
* ```
|
|
2790
|
+
*/
|
|
2791
|
+
interface DeserializeReverseParams {
|
|
2792
|
+
/** Reverse account data. */
|
|
2793
|
+
data: ReadonlyUint8Array | undefined;
|
|
2794
|
+
/** Whether to remove a subdomain's leading null byte. Defaults to false. */
|
|
2795
|
+
trimFirstNullByte?: boolean;
|
|
2796
|
+
}
|
|
2797
|
+
/**
|
|
2798
|
+
* Deserializes reverse account data.
|
|
2799
|
+
*
|
|
2800
|
+
* The first four bytes encode the reverse name length.
|
|
2801
|
+
*
|
|
2802
|
+
* @param params Reverse deserialization parameters
|
|
2803
|
+
* @param params.data Reverse account data. If undefined, returns undefined
|
|
2804
|
+
* @param params.trimFirstNullByte Whether to trim the first null byte for subdomain reverse names. Defaults to false
|
|
2805
|
+
* @returns The deserialized string, or `undefined` if data is undefined.
|
|
2806
|
+
*
|
|
2807
|
+
* @example
|
|
2808
|
+
* ```ts
|
|
2809
|
+
* const name = deserializeReverse({ data: reverseAccountData });
|
|
2810
|
+
* ```
|
|
2811
|
+
*/
|
|
2812
|
+
declare function deserializeReverse({ data, trimFirstNullByte, }: DeserializeReverseParams): string;
|
|
2813
|
+
declare function deserializeReverse({ data, trimFirstNullByte, }: DeserializeReverseParams): undefined;
|
|
2814
|
+
|
|
2815
|
+
/**
|
|
2816
|
+
* Parameters for deriving a Pyth feed address.
|
|
2817
|
+
*
|
|
2818
|
+
* @example
|
|
2819
|
+
* ```ts
|
|
2820
|
+
* const params: GetPythFeedAddressParams = { shard: 0, priceFeed };
|
|
2821
|
+
* ```
|
|
2822
|
+
*/
|
|
2823
|
+
interface GetPythFeedAddressParams {
|
|
2824
|
+
/** Pyth feed shard number. */
|
|
2825
|
+
shard: number;
|
|
2826
|
+
/** Pyth price feed ID bytes. */
|
|
2827
|
+
priceFeed: number[];
|
|
2828
|
+
}
|
|
2829
|
+
/**
|
|
2830
|
+
* Derives the Pyth feed PDA for a shard and price feed.
|
|
2831
|
+
*
|
|
2832
|
+
* @param params Pyth feed derivation parameters
|
|
2833
|
+
* @param params.shard Shard number associated with the Pyth feed
|
|
2834
|
+
* @param params.priceFeed Feed ID bytes
|
|
2835
|
+
* @returns The Pyth feed address.
|
|
2836
|
+
*
|
|
2837
|
+
* @example
|
|
2838
|
+
* ```ts
|
|
2839
|
+
* const address = await getPythFeedAddress({ shard: 0, priceFeed });
|
|
2840
|
+
* ```
|
|
2841
|
+
*/
|
|
2842
|
+
declare const getPythFeedAddress: ({ shard, priceFeed, }: GetPythFeedAddressParams) => Promise<_solana_addresses.Address<string>>;
|
|
2843
|
+
|
|
2844
|
+
/**
|
|
2845
|
+
* Derives the reverse lookup account address for a TLD-trimmed SNS domain.
|
|
2846
|
+
*
|
|
2847
|
+
* @param domain TLD-trimmed SNS domain name
|
|
2848
|
+
* @returns The reverse lookup account address.
|
|
2849
|
+
*
|
|
2850
|
+
* @example
|
|
2851
|
+
* ```ts
|
|
2852
|
+
* const address = await getReverseAddress("example");
|
|
2853
|
+
* ```
|
|
2854
|
+
*/
|
|
2855
|
+
declare const getReverseAddress: (domain: string) => Promise<_solana_addresses.Address>;
|
|
2856
|
+
|
|
2857
|
+
/**
|
|
2858
|
+
* Parameters for deriving a reverse lookup address.
|
|
2859
|
+
*
|
|
2860
|
+
* @example
|
|
2861
|
+
* ```ts
|
|
2862
|
+
* const params: GetReverseAddressFromDomainAddressParams = { domainAddress };
|
|
2863
|
+
* ```
|
|
2864
|
+
*/
|
|
2865
|
+
interface GetReverseAddressFromDomainAddressParams {
|
|
2866
|
+
/** Domain account address. */
|
|
2867
|
+
domainAddress: Address;
|
|
2868
|
+
/** Parent domain address for a subdomain. */
|
|
2869
|
+
parentAddress?: Address;
|
|
2870
|
+
}
|
|
2871
|
+
/**
|
|
2872
|
+
* Derives the reverse lookup account address from a domain address.
|
|
2873
|
+
*
|
|
2874
|
+
* @param params Reverse lookup derivation parameters
|
|
2875
|
+
* @param params.domainAddress Domain account address to reverse look up
|
|
2876
|
+
* @param params.parentAddress Optional parent address for subdomain reverse lookups
|
|
2877
|
+
* @returns The reverse lookup account address.
|
|
2878
|
+
*
|
|
2879
|
+
* @example
|
|
2880
|
+
* ```ts
|
|
2881
|
+
* const address = await getReverseAddressFromDomainAddress({ domainAddress });
|
|
2882
|
+
* ```
|
|
2883
|
+
*/
|
|
2884
|
+
declare const getReverseAddressFromDomainAddress: ({ domainAddress, parentAddress, }: GetReverseAddressFromDomainAddressParams) => Promise<Address>;
|
|
2885
|
+
|
|
2886
|
+
/**
|
|
2887
|
+
* Parameters for reverse lookup.
|
|
2888
|
+
*
|
|
2889
|
+
* @example
|
|
2890
|
+
* ```ts
|
|
2891
|
+
* const params: ReverseLookupParams = { rpc, domainAddress };
|
|
2892
|
+
* ```
|
|
2893
|
+
*/
|
|
2894
|
+
interface ReverseLookupParams {
|
|
2895
|
+
/** RPC client. */
|
|
2896
|
+
rpc: Rpc<GetAccountInfoApi>;
|
|
2897
|
+
/** Domain account address. */
|
|
2898
|
+
domainAddress: Address;
|
|
2899
|
+
/** Parent domain address for a subdomain. */
|
|
2900
|
+
parentAddress?: Address;
|
|
2901
|
+
}
|
|
2902
|
+
/**
|
|
2903
|
+
* Performs a reverse lookup for a domain address.
|
|
2904
|
+
*
|
|
2905
|
+
* @param params Reverse lookup parameters
|
|
2906
|
+
* @param params.rpc RPC client implementing account lookup
|
|
2907
|
+
* @param params.domainAddress Domain address to reverse look up
|
|
2908
|
+
* @param params.parentAddress Optional parent domain address for subdomain reverse lookups
|
|
2909
|
+
* @returns Human-readable domain name.
|
|
2910
|
+
* @throws NoAccountDataError If the registry data is empty.
|
|
2911
|
+
*
|
|
2912
|
+
* @example
|
|
2913
|
+
* ```ts
|
|
2914
|
+
* const name = await reverseLookup({ rpc, domainAddress });
|
|
2915
|
+
* ```
|
|
2916
|
+
*/
|
|
2917
|
+
declare function reverseLookup({ rpc, domainAddress, parentAddress, }: ReverseLookupParams): Promise<string>;
|
|
2918
|
+
|
|
2919
|
+
/**
|
|
2920
|
+
* Parameters for batch reverse lookup.
|
|
2921
|
+
*
|
|
2922
|
+
* @example
|
|
2923
|
+
* ```ts
|
|
2924
|
+
* const params: ReverseLookupBatchParams = { rpc, domainAddresses };
|
|
2925
|
+
* ```
|
|
2926
|
+
*/
|
|
2927
|
+
interface ReverseLookupBatchParams {
|
|
2928
|
+
/** RPC client. */
|
|
2929
|
+
rpc: Rpc<GetMultipleAccountsApi>;
|
|
2930
|
+
/** Domain account addresses. */
|
|
2931
|
+
domainAddresses: Address[];
|
|
2932
|
+
}
|
|
2933
|
+
/**
|
|
2934
|
+
* Performs reverse lookups for domain addresses.
|
|
2935
|
+
*
|
|
2936
|
+
* @param params Reverse lookup parameters
|
|
2937
|
+
* @param params.rpc RPC client implementing multiple-account lookup
|
|
2938
|
+
* @param params.domainAddresses Domain addresses to reverse look up
|
|
2939
|
+
* @returns Human-readable domain names, or `undefined` when reverse account data is unavailable.
|
|
2940
|
+
*
|
|
2941
|
+
* @example
|
|
2942
|
+
* ```ts
|
|
2943
|
+
* const domains = await reverseLookupBatch({ rpc, domainAddresses });
|
|
2944
|
+
* ```
|
|
2945
|
+
*/
|
|
2946
|
+
declare function reverseLookupBatch({ rpc, domainAddresses, }: ReverseLookupBatchParams): Promise<(string | undefined)[]>;
|
|
2947
|
+
|
|
2948
|
+
/**
|
|
2949
|
+
* Parameters for serializing record content.
|
|
2950
|
+
*
|
|
2951
|
+
* @example
|
|
2952
|
+
* ```ts
|
|
2953
|
+
* const params: SerializeRecordContentParams = {
|
|
2954
|
+
* content: "https://example.com",
|
|
2955
|
+
* record: Record.Url,
|
|
2956
|
+
* };
|
|
2957
|
+
* ```
|
|
2958
|
+
*/
|
|
2959
|
+
interface SerializeRecordContentParams {
|
|
2960
|
+
/** Record content. */
|
|
2961
|
+
content: string;
|
|
2962
|
+
/** Record type. */
|
|
2963
|
+
record: Record;
|
|
2964
|
+
}
|
|
2965
|
+
/**
|
|
2966
|
+
* Serializes record content according to SNS-IP 1.
|
|
2967
|
+
*
|
|
2968
|
+
* `CNAME` and `TXT` content is punycode-encoded before UTF-8 serialization.
|
|
2969
|
+
*
|
|
2970
|
+
* @param params Record serialization parameters
|
|
2971
|
+
* @param params.content Record content to serialize
|
|
2972
|
+
* @param params.record Record type
|
|
2973
|
+
* @returns Serialized record content.
|
|
2974
|
+
* @throws InvalidEvmAddressError, InvalidInjectiveAddressError, InvalidARecordError,
|
|
2975
|
+
* InvalidAAAARecordError, or InvalidRecordInputError when the record content is invalid or unsupported.
|
|
2976
|
+
*
|
|
2977
|
+
* @example
|
|
2978
|
+
* ```ts
|
|
2979
|
+
* const content = serializeRecordContent({
|
|
2980
|
+
* content: "https://example.com",
|
|
2981
|
+
* record: Record.Url,
|
|
2982
|
+
* });
|
|
2983
|
+
* ```
|
|
2984
|
+
*/
|
|
2985
|
+
declare const serializeRecordContent: ({ content, record, }: SerializeRecordContentParams) => ReadonlyUint8Array;
|
|
2986
|
+
|
|
2987
|
+
/** The Solana Name Service top-level domain. */
|
|
2988
|
+
declare const SOL_TLD = ".sol";
|
|
2989
|
+
/** The Bonfida SNS top-level domain. */
|
|
2990
|
+
declare const SNS_TLD = ".sns";
|
|
2991
|
+
/** A top-level domain supported by this SDK. */
|
|
2992
|
+
type SupportedTld = typeof SNS_TLD | typeof SOL_TLD;
|
|
2993
|
+
/** TLD suffixes accepted by the domain parsing and resolution helpers. */
|
|
2994
|
+
declare const SUPPORTED_TLDS: readonly SupportedTld[];
|
|
2995
|
+
/**
|
|
2996
|
+
* Returns the matching TLD from `supportedTlds` if `domain` ends with one,
|
|
2997
|
+
* or `undefined` otherwise.
|
|
2998
|
+
*
|
|
2999
|
+
* @param domain Domain name to inspect
|
|
3000
|
+
* @param supportedTlds Supported suffixes to match against
|
|
3001
|
+
* @returns The matching suffix, or `undefined` when none match.
|
|
3002
|
+
*
|
|
3003
|
+
* @example
|
|
3004
|
+
* ```ts
|
|
3005
|
+
* const tld = getTld("example.sns");
|
|
3006
|
+
* ```
|
|
3007
|
+
*/
|
|
3008
|
+
declare const getTld: (domain: string, supportedTlds?: readonly string[]) => string | undefined;
|
|
3009
|
+
/**
|
|
3010
|
+
* Ensures `domain` ends with one of the `supportedTlds` and strips that suffix.
|
|
3011
|
+
*
|
|
3012
|
+
* @param domain Domain name to parse
|
|
3013
|
+
* @param supportedTlds Supported suffixes to match against
|
|
3014
|
+
* @returns Domain name without suffix and the matching suffix.
|
|
3015
|
+
* @throws UnsupportedTldError If no supported suffix matches.
|
|
3016
|
+
*
|
|
3017
|
+
* @example
|
|
3018
|
+
* ```ts
|
|
3019
|
+
* const [domain, tld] = parseSupportedTld("example.sns");
|
|
3020
|
+
* ```
|
|
3021
|
+
*/
|
|
3022
|
+
declare const parseSupportedTld: (domain: string, supportedTlds?: readonly string[]) => [string, string];
|
|
3023
|
+
/**
|
|
3024
|
+
* Ensures `domain` ends with `.sns` and strips that suffix.
|
|
3025
|
+
*
|
|
3026
|
+
* @param domain Domain name to parse
|
|
3027
|
+
* @returns Domain name without suffix and the `.sns` suffix.
|
|
3028
|
+
* @throws UnsupportedTldError If the domain does not end with `.sns`.
|
|
3029
|
+
*
|
|
3030
|
+
* @example
|
|
3031
|
+
* ```ts
|
|
3032
|
+
* const [domain] = parseSnsTld("example.sns");
|
|
3033
|
+
* ```
|
|
3034
|
+
*/
|
|
3035
|
+
declare const parseSnsTld: (domain: string) => [string, string];
|
|
3036
|
+
|
|
3037
|
+
export { AccountDoesNotExistError, AllocateAndPostRecordInstruction, BurnDomainInstruction, CENTRAL_STATE, CENTRAL_STATE_DOMAIN_RECORDS, CouldNotFindNftOwnerError, CouldNotFindSrsOwnerError, CreateNameRegistryInstruction, CreateReverseInstruction, CreateSplitV2Instruction, CreateWithNftInstruction, DEFAULT_ADDRESS, DeleteNameRegistryInstruction, DeleteRecordInstruction, DomainDoesNotExistError, DomainExpiredError, ETH_ROA_RECORDS, EVM_RECORDS, ErrorType, FIDA_MINT, GUARDIANS, InvalidAAAARecordError, InvalidARecordError, InvalidDomainError, InvalidEvmAddressError, InvalidInjectiveAddressError, InvalidInputError, InvalidParentError, InvalidRecordDataError, InvalidRecordInputError, InvalidRoaError, InvalidSerializedDataError, InvalidSubdomainError, InvalidValidationError, METAPLEX_PROGRAM_ADDRESS, MissingVerifierError, NAME_OFFERS_ADDRESS, NAME_PROGRAM_ADDRESS, NAME_REGISTRY_LEN, NAME_TOKENIZER_ADDRESS, NftAccountNotFoundError, NftState, NftTag, NoAccountDataError, NoRecordDataError, PYTH_FEEDS, PYTH_PROGRAM_ID, PdaOwnerNotAllowedError, PrimaryDomainNotFoundError, PrimaryDomainState, PythFeedNotFoundError, RECORDS_PROGRAM_ADDRESS, RECORD_V1_SIZE, REFERRERS, REGISTRY_PROGRAM_ADDRESS, REVERSE_LOOKUP_CLASS, ReallocInstruction, Record, RecordHeaderState, RecordMalformedError, RecordState, RecordVersion, RegisterPrimaryInstruction, RegistryState, SELF_SIGNED_RECORDS, SNSError, SNS_ROOT_DOMAIN_ACCOUNT, SNS_TLD, SOL_SRS_CLASS, SOL_TLD, SRS_CENTRAL_STATE, SUPPORTED_TLDS, SYSTEM_PROGRAM_ADDRESS, SYSVAR_RENT_ADDRESS, SetRecordRoaVerifierInstruction, SnsSolResolutionMismatchError, TOKEN_PROGRAM_ADDRESS, TWITTER_ROOT_PARENT_REGISTRY_ADDRESS, TWITTER_VERIFICATION_AUTHORITY, TransferInstruction, USDC_MINT, UTF8_ENCODED_RECORDS, UnsupportedTldError, UpdateNameRegistryInstruction, UpdateRecordInstruction, VAULT_OWNER, ValidateEthereumSignatureInstruction, ValidateSolanaSignatureInstruction, Validation, WOLVES_COLLECTION_METADATA, _createAtaIdempotentInstruction, _getDefaultVerifier, _verifyRoaSync, _verifyStalenessSync, addressCodec, base58Codec, base64Codec, burnDomain, checkAddressOnCurve, createNameRegistry, createRecord, createReverse, createSubdomain, deleteNameRegistry, deleteRecord, deserializeRecordContent, deserializeReverse, getAllSnsDomains, getDomainOwner, getDomainRecord, getDomainRecords, getPrimaryDomain, getPrimaryDomainsBatch, getPythFeedAddress, getRecordV1Address, getRecordV2Address, getReverseAddress, getReverseAddressFromDomainAddress, getSnsDomainAddress, getSnsDomainsForAddress, getSnsNftMint, getSnsNftOwner, getSnsNftsForAddress, getSrsDomainAddress, getSubdomains, getTld, getValidationLength, parseSnsTld, parseSupportedTld, registerDomain, registerDomainWithNft, resolve, reverseLookup, reverseLookupBatch, safeResolve, serializeRecordContent, setPrimaryDomain, setRecordRoaVerifier, setRecordStalenessVerifier, tokenCodec, transferDomain, transferSubdomain, updateNameRegistry, updateRecord, utf8Codec, validateRecordRoa, validateRecordRoaEthereum, verifyRecordRightOfAssociation, verifyRecordStaleness };
|
|
3038
|
+
export type { AllocateAndPostRecordInstructionParams, BurnDomainParams, CreateNameRegistryInstructionParams, CreateNameRegistryParams, CreateRecordParams, CreateReverseInstructionParams, CreateReverseParams, CreateSplitV2InstructionParams, CreateSubdomainParams, CreateWithNftInstructionParams, DeleteNameRegistryParams, DeleteRecordParams, DeserializeRecordContentParams, DeserializeReverseParams, GetAllSnsDomainsParams, GetAllSnsDomainsResult, GetDomainOwnerParams, GetDomainRecordOptions, GetDomainRecordParams, GetDomainRecordResult, GetDomainRecordVerification, GetDomainRecordsOptions, GetDomainRecordsParams, GetDomainRecordsResult, GetDomainRecordsVerification, GetPrimaryDomainParams, GetPrimaryDomainResult, GetPrimaryDomainsBatchParams, GetPythFeedAddressParams, GetRecordV1AddressParams, GetRecordV2AddressParams, GetReverseAddressFromDomainAddressParams, GetSnsDomainAddressParams, GetSnsDomainAddressResult, GetSnsDomainsForAddressParams, GetSnsDomainsForAddressResult, GetSnsNftMintParams, GetSnsNftOwnerParams, GetSnsNftsForAddressParams, GetSnsNftsForAddressResult, GetSrsDomainAddressParams, GetSrsDomainAddressResult, GetSubdomainsParams, GetSubdomainsResult, NftStateParams, PrimaryDomainStateParams, ReallocInstructionParams, RecordHeaderStateParams, RecordVerificationParams, RegisterDomainParams, RegisterDomainWithNftParams, RegistryStateParams, ResolveOptions, ResolveParams, ReverseLookupBatchParams, ReverseLookupParams, SerializeRecordContentParams, SetPrimaryDomainParams, SetRecordRoaVerifierInstructionParams, SupportedTld, TransferDomainParams, TransferInstructionParams, TransferSubdomainParams, UpdateNameRegistryInstructionParams, UpdateNameRegistryParams, UpdateRecordInstructionParams, UpdateRecordParams, ValidateEthereumSignatureInstructionParams, ValidateRecordRoaEthereumParams, ValidateSolanaSignatureInstructionParams, VerifyRecordStalenessParams };
|