@solana-name-service/sns-sdk-kit 0.9.0-beta → 0.9.2-beta
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 +11 -6
- package/dist/cjs/address/getDomainsForAddress.cjs +1 -1
- package/dist/cjs/address/getDomainsForAddress.cjs.map +1 -1
- package/dist/cjs/address/getNftsForAddress.cjs +1 -1
- package/dist/cjs/address/getNftsForAddress.cjs.map +1 -1
- package/dist/cjs/address/getPrimaryDomain.cjs +1 -1
- package/dist/cjs/address/getPrimaryDomain.cjs.map +1 -1
- package/dist/cjs/address/getPrimaryDomainsBatch.cjs +1 -1
- package/dist/cjs/address/getPrimaryDomainsBatch.cjs.map +1 -1
- package/dist/cjs/address/index.cjs +2 -0
- package/dist/cjs/address/index.cjs.map +1 -0
- package/dist/cjs/bindings/burnDomain.cjs +1 -1
- package/dist/cjs/bindings/burnDomain.cjs.map +1 -1
- package/dist/cjs/bindings/createNameRegistry.cjs +1 -1
- package/dist/cjs/bindings/createNameRegistry.cjs.map +1 -1
- package/dist/cjs/bindings/createRecord.cjs +1 -1
- package/dist/cjs/bindings/createRecord.cjs.map +1 -1
- package/dist/cjs/bindings/createReverse.cjs +1 -1
- package/dist/cjs/bindings/createReverse.cjs.map +1 -1
- package/dist/cjs/bindings/createSubdomain.cjs +1 -1
- package/dist/cjs/bindings/createSubdomain.cjs.map +1 -1
- package/dist/cjs/bindings/deleteNameRegistry.cjs +1 -1
- package/dist/cjs/bindings/deleteNameRegistry.cjs.map +1 -1
- package/dist/cjs/bindings/deleteRecord.cjs +1 -1
- package/dist/cjs/bindings/deleteRecord.cjs.map +1 -1
- package/dist/cjs/bindings/index.cjs +2 -0
- package/dist/cjs/bindings/index.cjs.map +1 -0
- package/dist/cjs/bindings/registerDomain.cjs +1 -1
- package/dist/cjs/bindings/registerDomain.cjs.map +1 -1
- package/dist/cjs/bindings/registerWithNft.cjs +1 -1
- package/dist/cjs/bindings/registerWithNft.cjs.map +1 -1
- package/dist/cjs/bindings/setPrimaryDomain.cjs +1 -1
- package/dist/cjs/bindings/setPrimaryDomain.cjs.map +1 -1
- package/dist/cjs/bindings/transferDomain.cjs +1 -1
- package/dist/cjs/bindings/transferDomain.cjs.map +1 -1
- package/dist/cjs/bindings/transferSubdomain.cjs +1 -1
- package/dist/cjs/bindings/transferSubdomain.cjs.map +1 -1
- package/dist/cjs/bindings/updateNameRegistry.cjs +1 -1
- package/dist/cjs/bindings/updateNameRegistry.cjs.map +1 -1
- package/dist/cjs/bindings/updateRecord.cjs +1 -1
- package/dist/cjs/bindings/updateRecord.cjs.map +1 -1
- package/dist/cjs/bindings/validateRoa.cjs +1 -1
- package/dist/cjs/bindings/validateRoa.cjs.map +1 -1
- package/dist/cjs/bindings/validateRoaEthereum.cjs +1 -1
- package/dist/cjs/bindings/validateRoaEthereum.cjs.map +1 -1
- package/dist/cjs/bindings/writeRoa.cjs +1 -1
- package/dist/cjs/bindings/writeRoa.cjs.map +1 -1
- package/dist/cjs/constants/addresses.cjs +1 -1
- package/dist/cjs/constants/addresses.cjs.map +1 -1
- package/dist/cjs/constants/index.cjs +2 -0
- package/dist/cjs/constants/index.cjs.map +1 -0
- package/dist/cjs/domain/getAllDomains.cjs +1 -1
- package/dist/cjs/domain/getAllDomains.cjs.map +1 -1
- package/dist/cjs/domain/getDomainAddress.cjs +1 -1
- package/dist/cjs/domain/getDomainAddress.cjs.map +1 -1
- package/dist/cjs/domain/getDomainOwner.cjs +1 -1
- package/dist/cjs/domain/getDomainOwner.cjs.map +1 -1
- package/dist/cjs/domain/getDomainRecord.cjs +1 -1
- package/dist/cjs/domain/getDomainRecord.cjs.map +1 -1
- package/dist/cjs/domain/getDomainRecords.cjs +1 -1
- package/dist/cjs/domain/getDomainRecords.cjs.map +1 -1
- package/dist/cjs/domain/getSubdomains.cjs +1 -1
- package/dist/cjs/domain/getSubdomains.cjs.map +1 -1
- package/dist/cjs/domain/index.cjs +2 -0
- package/dist/cjs/domain/index.cjs.map +1 -0
- package/dist/cjs/domain/resolveDomain.cjs +1 -1
- package/dist/cjs/domain/resolveDomain.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/instructions/{allocateAndPostRecordInstructio.cjs → allocateAndPostRecordInstruction.cjs} +1 -1
- package/dist/cjs/instructions/allocateAndPostRecordInstruction.cjs.map +1 -0
- package/dist/cjs/instructions/index.cjs +2 -0
- package/dist/cjs/instructions/index.cjs.map +1 -0
- package/dist/cjs/nft/getNftMint.cjs +1 -1
- package/dist/cjs/nft/getNftMint.cjs.map +1 -1
- package/dist/cjs/nft/getNftOwner.cjs +1 -1
- package/dist/cjs/nft/getNftOwner.cjs.map +1 -1
- package/dist/cjs/nft/index.cjs +2 -0
- package/dist/cjs/nft/index.cjs.map +1 -0
- package/dist/cjs/record/getRecordV1Address.cjs +1 -1
- package/dist/cjs/record/getRecordV1Address.cjs.map +1 -1
- package/dist/cjs/record/getRecordV2Address.cjs +1 -1
- package/dist/cjs/record/getRecordV2Address.cjs.map +1 -1
- package/dist/cjs/record/index.cjs +2 -0
- package/dist/cjs/record/index.cjs.map +1 -0
- package/dist/cjs/record/verifyRecordRightOfAssociation.cjs +1 -1
- package/dist/cjs/record/verifyRecordRightOfAssociation.cjs.map +1 -1
- package/dist/cjs/record/verifyRecordStaleness.cjs +1 -1
- package/dist/cjs/record/verifyRecordStaleness.cjs.map +1 -1
- package/dist/cjs/states/index.cjs +2 -0
- package/dist/cjs/states/index.cjs.map +1 -0
- package/dist/cjs/states/nft.cjs +1 -1
- package/dist/cjs/states/nft.cjs.map +1 -1
- package/dist/cjs/states/record.cjs +1 -1
- package/dist/cjs/states/record.cjs.map +1 -1
- package/dist/cjs/states/registry.cjs +1 -1
- package/dist/cjs/states/registry.cjs.map +1 -1
- package/dist/cjs/types/index.cjs +2 -0
- package/dist/cjs/types/index.cjs.map +1 -0
- package/dist/cjs/utils/deserializers/deserializeRecordContent.cjs +1 -1
- package/dist/cjs/utils/deserializers/deserializeRecordContent.cjs.map +1 -1
- package/dist/cjs/utils/deserializers/deserializeReverse.cjs +1 -1
- package/dist/cjs/utils/deserializers/deserializeReverse.cjs.map +1 -1
- package/dist/cjs/utils/getPythFeedAddress.cjs +1 -1
- package/dist/cjs/utils/getPythFeedAddress.cjs.map +1 -1
- package/dist/cjs/utils/getReverseAddress.cjs +1 -1
- package/dist/cjs/utils/getReverseAddress.cjs.map +1 -1
- package/dist/cjs/utils/getReverseAddressFromDomainAddress.cjs +1 -1
- package/dist/cjs/utils/getReverseAddressFromDomainAddress.cjs.map +1 -1
- package/dist/cjs/utils/index.cjs +2 -0
- package/dist/cjs/utils/index.cjs.map +1 -0
- package/dist/cjs/utils/reverseLookup.cjs +1 -1
- package/dist/cjs/utils/reverseLookup.cjs.map +1 -1
- package/dist/cjs/utils/reverseLookupBatch.cjs +1 -1
- package/dist/cjs/utils/reverseLookupBatch.cjs.map +1 -1
- package/dist/cjs/utils/serializers/serializeRecordContent.cjs +1 -1
- package/dist/cjs/utils/serializers/serializeRecordContent.cjs.map +1 -1
- package/dist/esm/address/getDomainsForAddress.mjs +1 -1
- package/dist/esm/address/getDomainsForAddress.mjs.map +1 -1
- package/dist/esm/address/getNftsForAddress.mjs +1 -1
- package/dist/esm/address/getNftsForAddress.mjs.map +1 -1
- package/dist/esm/address/getPrimaryDomain.mjs +1 -1
- package/dist/esm/address/getPrimaryDomain.mjs.map +1 -1
- package/dist/esm/address/getPrimaryDomainsBatch.mjs +1 -1
- package/dist/esm/address/getPrimaryDomainsBatch.mjs.map +1 -1
- package/dist/esm/address/index.mjs +2 -0
- package/dist/esm/address/index.mjs.map +1 -0
- package/dist/esm/bindings/burnDomain.mjs +1 -1
- package/dist/esm/bindings/burnDomain.mjs.map +1 -1
- package/dist/esm/bindings/createNameRegistry.mjs +1 -1
- package/dist/esm/bindings/createNameRegistry.mjs.map +1 -1
- package/dist/esm/bindings/createRecord.mjs +1 -1
- package/dist/esm/bindings/createRecord.mjs.map +1 -1
- package/dist/esm/bindings/createReverse.mjs +1 -1
- package/dist/esm/bindings/createReverse.mjs.map +1 -1
- package/dist/esm/bindings/createSubdomain.mjs +1 -1
- package/dist/esm/bindings/createSubdomain.mjs.map +1 -1
- package/dist/esm/bindings/deleteNameRegistry.mjs +1 -1
- package/dist/esm/bindings/deleteNameRegistry.mjs.map +1 -1
- package/dist/esm/bindings/deleteRecord.mjs +1 -1
- package/dist/esm/bindings/deleteRecord.mjs.map +1 -1
- package/dist/esm/bindings/index.mjs +2 -0
- package/dist/esm/bindings/index.mjs.map +1 -0
- package/dist/esm/bindings/registerDomain.mjs +1 -1
- package/dist/esm/bindings/registerDomain.mjs.map +1 -1
- package/dist/esm/bindings/registerWithNft.mjs +1 -1
- package/dist/esm/bindings/registerWithNft.mjs.map +1 -1
- package/dist/esm/bindings/setPrimaryDomain.mjs +1 -1
- package/dist/esm/bindings/setPrimaryDomain.mjs.map +1 -1
- package/dist/esm/bindings/transferDomain.mjs +1 -1
- package/dist/esm/bindings/transferDomain.mjs.map +1 -1
- package/dist/esm/bindings/transferSubdomain.mjs +1 -1
- package/dist/esm/bindings/transferSubdomain.mjs.map +1 -1
- package/dist/esm/bindings/updateNameRegistry.mjs +1 -1
- package/dist/esm/bindings/updateNameRegistry.mjs.map +1 -1
- package/dist/esm/bindings/updateRecord.mjs +1 -1
- package/dist/esm/bindings/updateRecord.mjs.map +1 -1
- package/dist/esm/bindings/validateRoa.mjs +1 -1
- package/dist/esm/bindings/validateRoa.mjs.map +1 -1
- package/dist/esm/bindings/validateRoaEthereum.mjs +1 -1
- package/dist/esm/bindings/validateRoaEthereum.mjs.map +1 -1
- package/dist/esm/bindings/writeRoa.mjs +1 -1
- package/dist/esm/bindings/writeRoa.mjs.map +1 -1
- package/dist/esm/constants/addresses.mjs +1 -1
- package/dist/esm/constants/addresses.mjs.map +1 -1
- package/dist/esm/constants/index.mjs +2 -0
- package/dist/esm/constants/index.mjs.map +1 -0
- package/dist/esm/domain/getAllDomains.mjs +1 -1
- package/dist/esm/domain/getAllDomains.mjs.map +1 -1
- package/dist/esm/domain/getDomainAddress.mjs +1 -1
- package/dist/esm/domain/getDomainAddress.mjs.map +1 -1
- package/dist/esm/domain/getDomainOwner.mjs +1 -1
- package/dist/esm/domain/getDomainOwner.mjs.map +1 -1
- package/dist/esm/domain/getDomainRecord.mjs +1 -1
- package/dist/esm/domain/getDomainRecord.mjs.map +1 -1
- package/dist/esm/domain/getDomainRecords.mjs +1 -1
- package/dist/esm/domain/getDomainRecords.mjs.map +1 -1
- package/dist/esm/domain/getSubdomains.mjs +1 -1
- package/dist/esm/domain/getSubdomains.mjs.map +1 -1
- package/dist/esm/domain/index.mjs +2 -0
- package/dist/esm/domain/index.mjs.map +1 -0
- package/dist/esm/domain/resolveDomain.mjs +1 -1
- package/dist/esm/domain/resolveDomain.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/instructions/{allocateAndPostRecordInstructio.mjs → allocateAndPostRecordInstruction.mjs} +1 -1
- package/dist/esm/instructions/allocateAndPostRecordInstruction.mjs.map +1 -0
- package/dist/esm/instructions/index.mjs +2 -0
- package/dist/esm/instructions/index.mjs.map +1 -0
- package/dist/esm/nft/getNftMint.mjs +1 -1
- package/dist/esm/nft/getNftMint.mjs.map +1 -1
- package/dist/esm/nft/getNftOwner.mjs +1 -1
- package/dist/esm/nft/getNftOwner.mjs.map +1 -1
- package/dist/esm/nft/index.mjs +2 -0
- package/dist/esm/nft/index.mjs.map +1 -0
- package/dist/esm/record/getRecordV1Address.mjs +1 -1
- package/dist/esm/record/getRecordV1Address.mjs.map +1 -1
- package/dist/esm/record/getRecordV2Address.mjs +1 -1
- package/dist/esm/record/getRecordV2Address.mjs.map +1 -1
- package/dist/esm/record/index.mjs +2 -0
- package/dist/esm/record/index.mjs.map +1 -0
- package/dist/esm/record/verifyRecordRightOfAssociation.mjs +1 -1
- package/dist/esm/record/verifyRecordRightOfAssociation.mjs.map +1 -1
- package/dist/esm/record/verifyRecordStaleness.mjs +1 -1
- package/dist/esm/record/verifyRecordStaleness.mjs.map +1 -1
- package/dist/esm/states/index.mjs +2 -0
- package/dist/esm/states/index.mjs.map +1 -0
- package/dist/esm/states/nft.mjs +1 -1
- package/dist/esm/states/nft.mjs.map +1 -1
- package/dist/esm/states/record.mjs +1 -1
- package/dist/esm/states/record.mjs.map +1 -1
- package/dist/esm/states/registry.mjs +1 -1
- package/dist/esm/states/registry.mjs.map +1 -1
- package/dist/esm/types/index.mjs +2 -0
- package/dist/esm/types/index.mjs.map +1 -0
- package/dist/esm/utils/deserializers/deserializeRecordContent.mjs +1 -1
- package/dist/esm/utils/deserializers/deserializeRecordContent.mjs.map +1 -1
- package/dist/esm/utils/deserializers/deserializeReverse.mjs +1 -1
- package/dist/esm/utils/deserializers/deserializeReverse.mjs.map +1 -1
- package/dist/esm/utils/getPythFeedAddress.mjs +1 -1
- package/dist/esm/utils/getPythFeedAddress.mjs.map +1 -1
- package/dist/esm/utils/getReverseAddress.mjs +1 -1
- package/dist/esm/utils/getReverseAddress.mjs.map +1 -1
- package/dist/esm/utils/getReverseAddressFromDomainAddress.mjs +1 -1
- package/dist/esm/utils/getReverseAddressFromDomainAddress.mjs.map +1 -1
- package/dist/esm/utils/index.mjs +2 -0
- package/dist/esm/utils/index.mjs.map +1 -0
- package/dist/esm/utils/reverseLookup.mjs +1 -1
- package/dist/esm/utils/reverseLookup.mjs.map +1 -1
- package/dist/esm/utils/reverseLookupBatch.mjs +1 -1
- package/dist/esm/utils/reverseLookupBatch.mjs.map +1 -1
- package/dist/esm/utils/serializers/serializeRecordContent.mjs +1 -1
- package/dist/esm/utils/serializers/serializeRecordContent.mjs.map +1 -1
- package/dist/types/address/getDomainsForAddress.d.ts +8 -3
- package/dist/types/address/getNftsForAddress.d.ts +8 -3
- package/dist/types/address/getPrimaryDomain.d.ts +12 -6
- package/dist/types/address/getPrimaryDomainsBatch.d.ts +10 -4
- package/dist/types/address/index.d.ts +4 -0
- package/dist/types/bindings/burnDomain.d.ts +12 -5
- package/dist/types/bindings/createNameRegistry.d.ts +22 -10
- package/dist/types/bindings/createRecord.d.ts +16 -7
- package/dist/types/bindings/createReverse.d.ts +16 -7
- package/dist/types/bindings/createSubdomain.d.ts +15 -6
- package/dist/types/bindings/deleteNameRegistry.d.ts +15 -6
- package/dist/types/bindings/deleteRecord.d.ts +14 -6
- package/dist/types/bindings/index.d.ts +17 -0
- package/dist/types/bindings/registerDomain.d.ts +19 -8
- package/dist/types/bindings/registerWithNft.d.ts +16 -7
- package/dist/types/bindings/setPrimaryDomain.d.ts +11 -5
- package/dist/types/bindings/transferDomain.d.ts +17 -7
- package/dist/types/bindings/transferSubdomain.d.ts +19 -10
- package/dist/types/bindings/updateNameRegistry.d.ts +16 -7
- package/dist/types/bindings/updateRecord.d.ts +16 -7
- package/dist/types/bindings/validateRoa.d.ts +18 -8
- package/dist/types/bindings/validateRoaEthereum.d.ts +18 -8
- package/dist/types/bindings/writeRoa.d.ts +16 -7
- package/dist/types/constants/index.d.ts +3 -0
- package/dist/types/domain/getAllDomains.d.ts +8 -3
- package/dist/types/domain/getDomainAddress.d.ts +13 -6
- package/dist/types/domain/getDomainOwner.d.ts +9 -3
- package/dist/types/domain/getDomainRecord.d.ts +17 -10
- package/dist/types/domain/getDomainRecords.d.ts +19 -10
- package/dist/types/domain/getSubdomains.d.ts +8 -3
- package/dist/types/domain/index.d.ts +7 -0
- package/dist/types/domain/resolveDomain.d.ts +13 -7
- package/dist/types/index.d.ts +1 -1
- package/dist/types/instructions/index.d.ts +19 -0
- package/dist/types/nft/getNftMint.d.ts +7 -2
- package/dist/types/nft/getNftOwner.d.ts +10 -4
- package/dist/types/nft/index.d.ts +2 -0
- package/dist/types/record/getRecordV1Address.d.ts +9 -3
- package/dist/types/record/getRecordV2Address.d.ts +9 -3
- package/dist/types/record/index.d.ts +4 -0
- package/dist/types/record/verifyRecordRightOfAssociation.d.ts +11 -4
- package/dist/types/record/verifyRecordStaleness.d.ts +16 -6
- package/dist/types/states/index.d.ts +4 -0
- package/dist/types/states/nft.d.ts +1 -1
- package/dist/types/states/record.d.ts +1 -1
- package/dist/types/states/registry.d.ts +1 -1
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/utils/deserializers/deserializeRecordContent.d.ts +13 -6
- package/dist/types/utils/deserializers/deserializeReverse.d.ts +13 -7
- package/dist/types/utils/getPythFeedAddress.d.ts +14 -1
- package/dist/types/utils/getReverseAddressFromDomainAddress.d.ts +11 -5
- package/dist/types/utils/index.d.ts +10 -0
- package/dist/types/utils/reverseLookup.d.ts +13 -6
- package/dist/types/utils/reverseLookupBatch.d.ts +11 -4
- package/dist/types/utils/serializers/serializeRecordContent.d.ts +14 -1
- package/package.json +74 -4
- package/dist/cjs/instructions/allocateAndPostRecordInstructio.cjs.map +0 -1
- package/dist/esm/instructions/allocateAndPostRecordInstructio.mjs.map +0 -1
- /package/dist/types/instructions/{allocateAndPostRecordInstructio.d.ts → allocateAndPostRecordInstruction.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeRecordContent.mjs","sources":["../../../../src/utils/serializers/serializeRecordContent.ts"],"sourcesContent":["import { bech32 } from \"@scure/base\";\r\nimport { Address, ReadonlyUint8Array } from \"@solana/kit\";\r\nimport { parse as parseIp } from \"ipaddr.js\";\r\nimport { encode as encodePunycode } from \"punycode/\";\r\n\r\nimport { addressCodec, utf8Codec } from \"../../codecs\";\r\nimport { EVM_RECORDS, UTF8_ENCODED_RECORDS } from \"../../constants/records\";\r\nimport {\r\n InvalidAAAARecordError,\r\n InvalidARecordError,\r\n InvalidEvmAddressError,\r\n InvalidInjectiveAddressError,\r\n InvalidRecordInputError,\r\n} from \"../../errors\";\r\nimport { Record } from \"../../types/record\";\r\nimport { _check } from \"../check\";\r\nimport { uint8ArrayFromHex } from \"../uint8Array/uint8ArrayFromHex\";\r\n\r\nexport const serializeRecordContent = (\r\n content
|
|
1
|
+
{"version":3,"file":"serializeRecordContent.mjs","sources":["../../../../src/utils/serializers/serializeRecordContent.ts"],"sourcesContent":["import { bech32 } from \"@scure/base\";\r\nimport { Address, ReadonlyUint8Array } from \"@solana/kit\";\r\nimport { parse as parseIp } from \"ipaddr.js\";\r\nimport { encode as encodePunycode } from \"punycode/\";\r\n\r\nimport { addressCodec, utf8Codec } from \"../../codecs\";\r\nimport { EVM_RECORDS, UTF8_ENCODED_RECORDS } from \"../../constants/records\";\r\nimport {\r\n InvalidAAAARecordError,\r\n InvalidARecordError,\r\n InvalidEvmAddressError,\r\n InvalidInjectiveAddressError,\r\n InvalidRecordInputError,\r\n} from \"../../errors\";\r\nimport { Record } from \"../../types/record\";\r\nimport { _check } from \"../check\";\r\nimport { uint8ArrayFromHex } from \"../uint8Array/uint8ArrayFromHex\";\r\n\r\ninterface SerializeRecordContentParams {\r\n content: string;\r\n record: Record;\r\n}\r\n\r\n/**\r\n * Serializes record content based on its type.\r\n *\r\n * @param params - An object containing the following properties:\r\n * - `content`: The record content to serialize.\r\n * - `record`: The type of record for which the content is being serialized.\r\n * @returns The serialized content as a ReadonlyUint8Array.\r\n */\r\nexport const serializeRecordContent = ({\r\n content,\r\n record,\r\n}: SerializeRecordContentParams): ReadonlyUint8Array => {\r\n const utf8Encoded = UTF8_ENCODED_RECORDS.has(record);\r\n if (utf8Encoded) {\r\n if (record === Record.CNAME || record === Record.TXT) {\r\n content = encodePunycode(content);\r\n }\r\n return utf8Codec.encode(content);\r\n } else if (record === Record.SOL) {\r\n return addressCodec.encode(content as Address);\r\n } else if (EVM_RECORDS.has(record)) {\r\n _check(\r\n content.slice(0, 2) === \"0x\",\r\n new InvalidEvmAddressError(\"The record content must start with `0x`\")\r\n );\r\n _check(\r\n content.length === 42,\r\n new InvalidEvmAddressError(\r\n \"The record content must be 42 characters long\"\r\n )\r\n );\r\n return uint8ArrayFromHex(content.slice(2));\r\n } else if (record === Record.Injective) {\r\n const decoded = bech32.decodeToBytes(content);\r\n _check(\r\n decoded.prefix === \"inj\" && content.length === 42,\r\n new InvalidInjectiveAddressError(\r\n \"The record content must start with `inj`\"\r\n )\r\n );\r\n _check(\r\n decoded.bytes.length === 20,\r\n new InvalidInjectiveAddressError(\"The record data must be 20 bytes long\")\r\n );\r\n return decoded.bytes;\r\n } else if (record === Record.A) {\r\n const array = parseIp(content).toByteArray();\r\n _check(\r\n array.length === 4,\r\n new InvalidARecordError(\"The record content must be 4 bytes long\")\r\n );\r\n return new Uint8Array(array);\r\n } else if (record === Record.AAAA) {\r\n const array = parseIp(content).toByteArray();\r\n _check(\r\n array.length === 16,\r\n new InvalidAAAARecordError(\"The record content must be 16 bytes long\")\r\n );\r\n return new Uint8Array(array);\r\n } else {\r\n throw new InvalidRecordInputError(\"The record content is malformed\");\r\n }\r\n};\r\n"],"names":["serializeRecordContent","content","record","UTF8_ENCODED_RECORDS","has","Record","CNAME","TXT","encodePunycode","utf8Codec","encode","SOL","addressCodec","EVM_RECORDS","_check","slice","InvalidEvmAddressError","length","uint8ArrayFromHex","Injective","decoded","bech32","decodeToBytes","prefix","InvalidInjectiveAddressError","bytes","A","array","parseIp","toByteArray","InvalidARecordError","Uint8Array","AAAA","InvalidAAAARecordError","InvalidRecordInputError"],"mappings":"6pBA+Ba,MAAAA,EAAyB,EACpCC,UACAC,aAGA,GADoBC,EAAqBC,IAAIF,GAK3C,OAHIA,IAAWG,EAAOC,OAASJ,IAAWG,EAAOE,MAC/CN,EAAUO,EAAeP,IAEpBQ,EAAUC,OAAOT,GACnB,GAAIC,IAAWG,EAAOM,IAC3B,OAAOC,EAAaF,OAAOT,GACtB,GAAIY,EAAYT,IAAIF,GAWzB,OAVAY,EAC0B,OAAxBb,EAAQc,MAAM,EAAG,GACjB,IAAIC,EAAuB,4CAE7BF,EACqB,KAAnBb,EAAQgB,OACR,IAAID,EACF,kDAGGE,EAAkBjB,EAAQc,MAAM,IAClC,GAAIb,IAAWG,EAAOc,UAAW,CACtC,MAAMC,EAAUC,EAAOC,cAAcrB,GAWrC,OAVAa,EACqB,QAAnBM,EAAQG,QAAuC,KAAnBtB,EAAQgB,OACpC,IAAIO,EACF,6CAGJV,EAC2B,KAAzBM,EAAQK,MAAMR,OACd,IAAIO,EAA6B,0CAE5BJ,EAAQK,MACV,GAAIvB,IAAWG,EAAOqB,EAAG,CAC9B,MAAMC,EAAQC,EAAAA,MAAQ3B,GAAS4B,cAK/B,OAJAf,EACmB,IAAjBa,EAAMV,OACN,IAAIa,EAAoB,4CAEnB,IAAIC,WAAWJ,GACjB,GAAIzB,IAAWG,EAAO2B,KAAM,CACjC,MAAML,EAAQC,EAAAA,MAAQ3B,GAAS4B,cAK/B,OAJAf,EACmB,KAAjBa,EAAMV,OACN,IAAIgB,EAAuB,6CAEtB,IAAIF,WAAWJ,GAEtB,MAAM,IAAIO,EAAwB"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Address, GetMultipleAccountsApi, GetProgramAccountsApi, Rpc } from "@solana/kit";
|
|
2
|
+
interface GetDomainsForAddressParams {
|
|
3
|
+
rpc: Rpc<GetProgramAccountsApi & GetMultipleAccountsApi>;
|
|
4
|
+
address: Address;
|
|
5
|
+
}
|
|
2
6
|
interface Result {
|
|
3
7
|
domain: string;
|
|
4
8
|
domainAddress: Address;
|
|
@@ -6,9 +10,10 @@ interface Result {
|
|
|
6
10
|
/**
|
|
7
11
|
* Retrieves the domains owned by the given address.
|
|
8
12
|
*
|
|
9
|
-
* @param
|
|
10
|
-
*
|
|
13
|
+
* @param params - An object containing the following properties:
|
|
14
|
+
* - `rpc`: An RPC interface implementing GetProgramAccountsApi and GetMultipleAccountsApi.
|
|
15
|
+
* - `address`: The address for which to retrieve associated domains.
|
|
11
16
|
* @returns A promise resolving to an array of objects containing domain and domainAddress.
|
|
12
17
|
*/
|
|
13
|
-
export declare const getDomainsForAddress: (rpc
|
|
18
|
+
export declare const getDomainsForAddress: ({ rpc, address, }: GetDomainsForAddressParams) => Promise<Result[]>;
|
|
14
19
|
export {};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Address, GetMultipleAccountsApi, GetProgramAccountsApi, Rpc } from "@solana/kit";
|
|
2
|
+
interface GetNftsForAddressParams {
|
|
3
|
+
rpc: Rpc<GetMultipleAccountsApi & GetProgramAccountsApi>;
|
|
4
|
+
address: Address;
|
|
5
|
+
}
|
|
2
6
|
interface Result {
|
|
3
7
|
domain: string;
|
|
4
8
|
domainAddress: Address;
|
|
@@ -7,9 +11,10 @@ interface Result {
|
|
|
7
11
|
/**
|
|
8
12
|
* Retrieves NFTs owned by a given address.
|
|
9
13
|
*
|
|
10
|
-
* @param
|
|
11
|
-
*
|
|
14
|
+
* @param params - An object containing the following properties:
|
|
15
|
+
* - `rpc`: An RPC interface implementing GetMultipleAccountsApi and GetProgramAccountsApi.
|
|
16
|
+
* - `address`: The address for which NFTs are to be fetched.
|
|
12
17
|
* @returns A promise resolving to an array of Result objects containing domain, domainAddress, and mint.
|
|
13
18
|
*/
|
|
14
|
-
export declare const getNftsForAddress: (rpc
|
|
19
|
+
export declare const getNftsForAddress: ({ rpc, address, }: GetNftsForAddressParams) => Promise<Result[]>;
|
|
15
20
|
export {};
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { Address, GetAccountInfoApi, GetTokenLargestAccountsApi, Rpc } from "@solana/kit";
|
|
2
|
+
interface GetPrimaryDomainParams {
|
|
3
|
+
rpc: Rpc<GetAccountInfoApi & GetTokenLargestAccountsApi>;
|
|
4
|
+
walletAddress: Address;
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
7
|
* Fetches the primary domain associated with a given wallet address.
|
|
4
8
|
*
|
|
5
|
-
* @param
|
|
6
|
-
*
|
|
9
|
+
* @param params - An object containing the following properties:
|
|
10
|
+
* - `rpc`: An RPC interface implementing GetAccountInfoApi and GetTokenLargestAccountsApi.
|
|
11
|
+
* - `walletAddress`: The wallet address for which the primary domain is retrieved.
|
|
7
12
|
* @returns A promise resolving to an object containing:
|
|
8
|
-
* - domainAddress
|
|
9
|
-
* - domainName
|
|
10
|
-
* - stale
|
|
13
|
+
* - `domainAddress`: The address of the primary domain.
|
|
14
|
+
* - `domainName`: The primary domain name (without .sol suffix).
|
|
15
|
+
* - `stale`: false if primary domain was set by the current domain owner, true otherwise.
|
|
11
16
|
*/
|
|
12
|
-
export declare const getPrimaryDomain: (rpc
|
|
17
|
+
export declare const getPrimaryDomain: ({ rpc, walletAddress, }: GetPrimaryDomainParams) => Promise<{
|
|
13
18
|
domainAddress: Address;
|
|
14
19
|
domainName: string;
|
|
15
20
|
stale: boolean;
|
|
16
21
|
}>;
|
|
22
|
+
export {};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { Address, GetMultipleAccountsApi, GetTokenLargestAccountsApi, Rpc } from "@solana/kit";
|
|
2
|
+
interface GetPrimaryDomainsBatchParams {
|
|
3
|
+
rpc: Rpc<GetMultipleAccountsApi & GetTokenLargestAccountsApi>;
|
|
4
|
+
walletAddresses: Address[];
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
7
|
* Batch retrieves the primary domains associated with a list of wallet addresses.
|
|
4
8
|
*
|
|
5
|
-
* @param
|
|
6
|
-
*
|
|
9
|
+
* @param params - An object containing the following properties:
|
|
10
|
+
* - `rpc`: An RPC interface implementing GetMultipleAccountsApi and GetTokenLargestAccountsApi.
|
|
11
|
+
* - `walletAddresses`: An array of wallet addresses for which primary domains are to be fetched.
|
|
7
12
|
* @returns A promise resolving to an array of strings or undefined values, where each string represents
|
|
8
|
-
*
|
|
13
|
+
* the primary domain name if available and non-stale.
|
|
9
14
|
*/
|
|
10
|
-
export declare const getPrimaryDomainsBatch: (rpc
|
|
15
|
+
export declare const getPrimaryDomainsBatch: ({ rpc, walletAddresses, }: GetPrimaryDomainsBatchParams) => Promise<(string | undefined)[]>;
|
|
16
|
+
export {};
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import { Address } from "@solana/kit";
|
|
1
|
+
import { Address, IInstruction } from "@solana/kit";
|
|
2
|
+
interface BurnDomainParams {
|
|
3
|
+
domain: string;
|
|
4
|
+
owner: Address;
|
|
5
|
+
refundAddress: Address;
|
|
6
|
+
}
|
|
2
7
|
/**
|
|
3
8
|
* Generates an instruction to burn a domain.
|
|
4
9
|
*
|
|
5
|
-
* @param
|
|
6
|
-
*
|
|
7
|
-
*
|
|
10
|
+
* @param params - An object containing the following properties:
|
|
11
|
+
* - `domain`: The domain name to be burned.
|
|
12
|
+
* - `owner`: The address of the current owner of the domain.
|
|
13
|
+
* - `refundAddress`: The address to which rent will be refunded.
|
|
8
14
|
* @returns A promise which resolves to the burn domain instruction.
|
|
9
15
|
*/
|
|
10
|
-
export declare const burnDomain: (domain
|
|
16
|
+
export declare const burnDomain: ({ domain, owner, refundAddress, }: BurnDomainParams) => Promise<IInstruction>;
|
|
17
|
+
export {};
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import { Address, GetAccountInfoApi, GetMinimumBalanceForRentExemptionApi, IInstruction, Rpc } from "@solana/kit";
|
|
2
|
+
interface CreateNameRegistryParams {
|
|
3
|
+
rpc: Rpc<GetAccountInfoApi & GetMinimumBalanceForRentExemptionApi>;
|
|
4
|
+
name: string;
|
|
5
|
+
space: number;
|
|
6
|
+
payer: Address;
|
|
7
|
+
owner: Address;
|
|
8
|
+
lamports?: bigint;
|
|
9
|
+
classAddress?: Address;
|
|
10
|
+
parentAddress?: Address;
|
|
11
|
+
}
|
|
2
12
|
/**
|
|
3
13
|
* Creates a name registry with the given rent budget, allocated space, owner, and class.
|
|
4
14
|
*
|
|
5
|
-
* @param
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
15
|
+
* @param params - An object containing the following properties:
|
|
16
|
+
* - `rpc`: An RPC interface implementing GetAccountInfoApi and GetMinimumBalanceForRentExemptionApi.
|
|
17
|
+
* - `name`: The name of the new account.
|
|
18
|
+
* - `space`: The space in bytes allocated to the account.
|
|
19
|
+
* - `payer`: The allocation cost payer.
|
|
20
|
+
* - `owner`: The address to be set as the owner of the new name account.
|
|
21
|
+
* - `lamports`: (Optional) The budget to be set for the name account. If not specified,
|
|
22
|
+
* it'll be the minimum for rent exemption.
|
|
23
|
+
* - `classAddress`: (Optional) The address of the class associated with the registry.
|
|
24
|
+
* - `parentAddress`: (Optional) The address of the parent registry.
|
|
14
25
|
* @returns A promise which resolves to the create name registry instruction.
|
|
15
26
|
*/
|
|
16
|
-
export declare const createNameRegistry: (rpc
|
|
27
|
+
export declare const createNameRegistry: ({ rpc, name, space, payer, owner, lamports, classAddress, parentAddress, }: CreateNameRegistryParams) => Promise<IInstruction>;
|
|
28
|
+
export {};
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import { Address } from "@solana/kit";
|
|
1
|
+
import { Address, IInstruction } from "@solana/kit";
|
|
2
2
|
import { Record } from "../types/record";
|
|
3
|
+
interface CreateRecordParams {
|
|
4
|
+
domain: string;
|
|
5
|
+
record: Record;
|
|
6
|
+
content: string;
|
|
7
|
+
owner: Address;
|
|
8
|
+
payer: Address;
|
|
9
|
+
}
|
|
3
10
|
/**
|
|
4
11
|
* Creates a record for the specified domain. The record data will be serialized
|
|
5
12
|
* in compliance with the SNS-IP 1 guidelines.
|
|
6
13
|
*
|
|
7
|
-
* @param
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
14
|
+
* @param params - An object containing the following properties:
|
|
15
|
+
* - `domain`: The domain under which the record will be created.
|
|
16
|
+
* - `record`: A record enum representing the type of record to be created.
|
|
17
|
+
* - `content`: The record content.
|
|
18
|
+
* - `owner`: The address of the domain's owner.
|
|
19
|
+
* - `payer`: The address funding the record creation.
|
|
12
20
|
* @returns A promise which resolves to the create record instruction.
|
|
13
21
|
*/
|
|
14
|
-
export declare const createRecord: (domain
|
|
22
|
+
export declare const createRecord: ({ domain, record, content, owner, payer, }: CreateRecordParams) => Promise<IInstruction>;
|
|
23
|
+
export {};
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import { Address } from "@solana/kit";
|
|
1
|
+
import { Address, IInstruction } from "@solana/kit";
|
|
2
|
+
interface CreateReverseParams {
|
|
3
|
+
domainAddress: Address;
|
|
4
|
+
domain: string;
|
|
5
|
+
payer: Address;
|
|
6
|
+
parentAddress?: Address;
|
|
7
|
+
parentOwner?: Address;
|
|
8
|
+
}
|
|
2
9
|
/**
|
|
3
10
|
* Creates a reverse lookup record for the specified domain.
|
|
4
11
|
*
|
|
5
|
-
* @param
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
12
|
+
* @param params - An object containing the following properties:
|
|
13
|
+
* - `domainAddress`: The address of the domain for which the reverse lookup record is created.
|
|
14
|
+
* - `domain`: The domain name to be associated with the reverse lookup record.
|
|
15
|
+
* - `payer`: The address funding the creation of the reverse lookup record.
|
|
16
|
+
* - `parentAddress`: (Optional) The address of the parent domain, if applicable.
|
|
17
|
+
* - `parentOwner`: (Optional) The address of the parent domain owner, if applicable.
|
|
10
18
|
* @returns A promise which resolves to the create reverse lookup instruction.
|
|
11
19
|
*/
|
|
12
|
-
export declare const createReverse: (domainAddress
|
|
20
|
+
export declare const createReverse: ({ domainAddress, domain, payer, parentAddress, parentOwner, }: CreateReverseParams) => Promise<IInstruction>;
|
|
21
|
+
export {};
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import { Address, GetAccountInfoApi, GetMinimumBalanceForRentExemptionApi, IInstruction, Rpc } from "@solana/kit";
|
|
2
|
+
interface CreateSubdomainParams {
|
|
3
|
+
rpc: Rpc<GetAccountInfoApi & GetMinimumBalanceForRentExemptionApi>;
|
|
4
|
+
subdomain: string;
|
|
5
|
+
owner: Address;
|
|
6
|
+
space?: number;
|
|
7
|
+
feePayer?: Address;
|
|
8
|
+
}
|
|
2
9
|
/**
|
|
3
10
|
* Creates a subdomain for the specified domain. This includes setting up the subdomain
|
|
4
11
|
* registry and its reverse lookup record if not already existing.
|
|
5
12
|
*
|
|
6
|
-
* @param
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
13
|
+
* @param params - An object containing the following properties:
|
|
14
|
+
* - `rpc`: An RPC interface implementing GetAccountInfoApi and GetMinimumBalanceForRentExemptionApi.
|
|
15
|
+
* - `subdomain`: The subdomain to create, with or without .sol (e.g., something.sns.sol or something.sns).
|
|
16
|
+
* - `owner`: The address of the owner of the parent domain.
|
|
17
|
+
* - `space`: (Optional) The space in bytes allocated to the subdomain account (default: 2,000).
|
|
18
|
+
* - `feePayer`: (Optional) The address funding the subdomain creation (default: owner address).
|
|
11
19
|
* @returns A promise that resolves to an array of instructions required to create the subdomain
|
|
12
20
|
* and its reverse lookup record.
|
|
13
21
|
*/
|
|
14
|
-
export declare const createSubdomain: (rpc
|
|
22
|
+
export declare const createSubdomain: ({ rpc, subdomain, owner, space, feePayer, }: CreateSubdomainParams) => Promise<IInstruction[]>;
|
|
23
|
+
export {};
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { Address, GetAccountInfoApi, IInstruction, Rpc } from "@solana/kit";
|
|
2
|
+
interface DeleteNameRegistryParams {
|
|
3
|
+
rpc: Rpc<GetAccountInfoApi>;
|
|
4
|
+
name: string;
|
|
5
|
+
refundAddress: Address;
|
|
6
|
+
classAddress?: Address;
|
|
7
|
+
parentAddress?: Address;
|
|
8
|
+
}
|
|
2
9
|
/**
|
|
3
10
|
* Deletes a name registry and refunds the associated rent balance to the specified target.
|
|
4
11
|
*
|
|
5
|
-
* @param
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
12
|
+
* @param params - An object containing the following properties:
|
|
13
|
+
* - `rpc`: An RPC interface implementing GetAccountInfoApi.
|
|
14
|
+
* - `name`: The name of the registry to be deleted.
|
|
15
|
+
* - `refundTarget`: The address to which the refunded rent balance will be sent.
|
|
16
|
+
* - `classAddress`: (Optional) The address of the class associated with the registry.
|
|
17
|
+
* - `parentAddress`: (Optional) The address of the parent registry.
|
|
10
18
|
* @returns A promise which resolves to the delete name registry instruction.
|
|
11
19
|
*/
|
|
12
|
-
export declare const deleteNameRegistry: (rpc
|
|
20
|
+
export declare const deleteNameRegistry: ({ rpc, name, refundAddress, classAddress, parentAddress, }: DeleteNameRegistryParams) => Promise<IInstruction>;
|
|
21
|
+
export {};
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { Address } from "@solana/kit";
|
|
1
|
+
import { Address, IInstruction } from "@solana/kit";
|
|
2
2
|
import { Record } from "../types/record";
|
|
3
|
+
interface DeleteRecordParams {
|
|
4
|
+
domain: string;
|
|
5
|
+
record: Record;
|
|
6
|
+
owner: Address;
|
|
7
|
+
payer: Address;
|
|
8
|
+
}
|
|
3
9
|
/**
|
|
4
10
|
* Deletes a record under the specified domain and refunds the rent to the payer.
|
|
5
11
|
*
|
|
6
|
-
* @param
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
12
|
+
* @param params - An object containing the following properties:
|
|
13
|
+
* - `domain`: The domain under which the record resides.
|
|
14
|
+
* - `record`: An enumeration representing the type of record to be deleted.
|
|
15
|
+
* - `owner`: The address of the domain's owner.
|
|
16
|
+
* - `payer`: The address funding the record deletion.
|
|
10
17
|
* @returns A promise which resolves to the delete record instruction.
|
|
11
18
|
*/
|
|
12
|
-
export declare const deleteRecord: (domain
|
|
19
|
+
export declare const deleteRecord: ({ domain, record, owner, payer, }: DeleteRecordParams) => Promise<IInstruction>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from "./burnDomain";
|
|
2
|
+
export * from "./createNameRegistry";
|
|
3
|
+
export * from "./createRecord";
|
|
4
|
+
export * from "./createReverse";
|
|
5
|
+
export * from "./createSubdomain";
|
|
6
|
+
export * from "./deleteNameRegistry";
|
|
7
|
+
export * from "./deleteRecord";
|
|
8
|
+
export * from "./registerDomain";
|
|
9
|
+
export * from "./registerWithNft";
|
|
10
|
+
export * from "./setPrimaryDomain";
|
|
11
|
+
export * from "./transferDomain";
|
|
12
|
+
export * from "./transferSubdomain";
|
|
13
|
+
export * from "./updateNameRegistry";
|
|
14
|
+
export * from "./updateRecord";
|
|
15
|
+
export * from "./validateRoa";
|
|
16
|
+
export * from "./validateRoaEthereum";
|
|
17
|
+
export * from "./writeRoa";
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import { Address, GetAccountInfoApi, IInstruction, Rpc } from "@solana/kit";
|
|
2
|
+
interface RegisterDomainParams {
|
|
3
|
+
rpc: Rpc<GetAccountInfoApi>;
|
|
4
|
+
domain: string;
|
|
5
|
+
space: number;
|
|
6
|
+
buyer: Address;
|
|
7
|
+
buyerTokenAccount: Address;
|
|
8
|
+
mint?: Address;
|
|
9
|
+
referrer?: Address;
|
|
10
|
+
}
|
|
2
11
|
/**
|
|
3
12
|
* Registers a .sol domain.
|
|
4
13
|
*
|
|
5
|
-
* @param
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
14
|
+
* @param params - An object containing the following properties:
|
|
15
|
+
* - `rpc`: An RPC interface implementing GetAccountInfoApi.
|
|
16
|
+
* - `domain`: The domain name to be registered in lowercase.
|
|
17
|
+
* - `space`: The space in bytes to be allocated for the domain registry (max: 10,000).
|
|
18
|
+
* - `buyer`: The address of the buyer registering the domain.
|
|
19
|
+
* - `buyerTokenAccount`: The associated token account of the buyer.
|
|
20
|
+
* - `mint`: (Optional) The token mint used for payment. Defaults to USDC.
|
|
21
|
+
* - `referrer`: (Optional) The address of the referrer.
|
|
12
22
|
* @returns A promise which resolves to an array of instructions required for domain registration.
|
|
13
23
|
*/
|
|
14
|
-
export declare const registerDomain: (rpc
|
|
24
|
+
export declare const registerDomain: ({ rpc, domain, space, buyer, buyerTokenAccount, mint, referrer, }: RegisterDomainParams) => Promise<IInstruction[]>;
|
|
25
|
+
export {};
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import { Address } from "@solana/kit";
|
|
1
|
+
import { Address, IInstruction } from "@solana/kit";
|
|
2
|
+
interface RegisterWithNftParams {
|
|
3
|
+
domain: string;
|
|
4
|
+
space: number;
|
|
5
|
+
buyer: Address;
|
|
6
|
+
nftSource: Address;
|
|
7
|
+
nftMint: Address;
|
|
8
|
+
}
|
|
2
9
|
/**
|
|
3
10
|
* Registers a .sol domain using a Bonfida Wolves NFT.
|
|
4
11
|
*
|
|
5
|
-
* @param
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
12
|
+
* @param params - An object containing the following properties:
|
|
13
|
+
* - `domain`: The domain name to be registered.
|
|
14
|
+
* - `space`: The space in bytes to be allocated for the domain registry.
|
|
15
|
+
* - `buyer`: The address of the buyer registering the domain.
|
|
16
|
+
* - `nftSource`: The address of the NFT source account.
|
|
17
|
+
* - `nftMint`: The mint address of the NFT used for registration.
|
|
10
18
|
* @returns A promise which resolves to the register with NFT instruction.
|
|
11
19
|
*/
|
|
12
|
-
export declare const registerWithNft: (domain
|
|
20
|
+
export declare const registerWithNft: ({ domain, space, buyer, nftSource, nftMint, }: RegisterWithNftParams) => Promise<IInstruction>;
|
|
21
|
+
export {};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { Address, GetAccountInfoApi, Rpc } from "@solana/kit";
|
|
1
|
+
import { Address, GetAccountInfoApi, IInstruction, Rpc } from "@solana/kit";
|
|
2
|
+
export interface SetPrimaryDomainParams {
|
|
3
|
+
rpc: Rpc<GetAccountInfoApi>;
|
|
4
|
+
domainAddress: Address;
|
|
5
|
+
owner: Address;
|
|
6
|
+
}
|
|
2
7
|
/**
|
|
3
8
|
* Sets the primary domain for the specified owner.
|
|
4
9
|
*
|
|
5
|
-
* @param
|
|
6
|
-
*
|
|
7
|
-
*
|
|
10
|
+
* @param params - An object containing the following properties:
|
|
11
|
+
* - `rpc`: An RPC interface implementing GetAccountInfoApi.
|
|
12
|
+
* - `domainAddress`: The address of the domain to be set as primary.
|
|
13
|
+
* - `owner`: The address of the domain owner.
|
|
8
14
|
* @returns A promise which resolves to the set primary domain instruction.
|
|
9
15
|
*/
|
|
10
|
-
export declare const setPrimaryDomain: (rpc
|
|
16
|
+
export declare const setPrimaryDomain: ({ rpc, domainAddress, owner, }: SetPrimaryDomainParams) => Promise<IInstruction>;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { Address, GetAccountInfoApi, IInstruction, Rpc } from "@solana/kit";
|
|
2
|
+
interface TransferDomainParams {
|
|
3
|
+
rpc: Rpc<GetAccountInfoApi>;
|
|
4
|
+
domain: string;
|
|
5
|
+
newOwner: Address;
|
|
6
|
+
classAddress?: Address;
|
|
7
|
+
parentAddress?: Address;
|
|
8
|
+
parentOwner?: Address;
|
|
9
|
+
}
|
|
2
10
|
/**
|
|
3
11
|
* Transfers a domain to a new owner.
|
|
4
12
|
*
|
|
5
|
-
* @param
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
13
|
+
* @param params - An object containing the following properties:
|
|
14
|
+
* - `rpc`: An RPC interface implementing GetAccountInfoApi.
|
|
15
|
+
* - `domain`: The name of the domain to be transferred.
|
|
16
|
+
* - `newOwner`: The address of the new owner of the domain.
|
|
17
|
+
* - `classAddress`: (Optional) The address of the class associated with the domain.
|
|
18
|
+
* - `parentAddress`: (Optional) The address of the parent domain.
|
|
19
|
+
* - `parentOwner`: (Optional) The address of the parent domain owner.
|
|
11
20
|
* @returns A promise that resolves to the transfer domain instruction.
|
|
12
21
|
*/
|
|
13
|
-
export declare const transferDomain: (rpc
|
|
22
|
+
export declare const transferDomain: ({ rpc, domain, newOwner, classAddress, parentAddress, parentOwner, }: TransferDomainParams) => Promise<IInstruction>;
|
|
23
|
+
export {};
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { Address, GetAccountInfoApi, IInstruction, Rpc } from "@solana/kit";
|
|
2
|
+
interface TransferSubdomainParams {
|
|
3
|
+
rpc: Rpc<GetAccountInfoApi>;
|
|
4
|
+
subdomain: string;
|
|
5
|
+
newOwner: Address;
|
|
6
|
+
isParentOwnerSigner?: boolean;
|
|
7
|
+
currentOwner?: Address;
|
|
8
|
+
}
|
|
2
9
|
/**
|
|
3
10
|
* Transfers a subdomain to a new owner.
|
|
4
11
|
*
|
|
5
|
-
* @param
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* @param params - An object containing the following properties:
|
|
13
|
+
* - `rpc`: An RPC interface implementing GetAccountInfoApi.
|
|
14
|
+
* - `subdomain`: The subdomain to transfer. This can include or omit the .sol suffix
|
|
15
|
+
* (e.g., 'something.sns.sol' or 'something.sns').
|
|
16
|
+
* - `newOwner`: The address of the new owner.
|
|
17
|
+
* - `isParentOwnerSigner`: (Optional) Specifies if the parent domain owner is a signer
|
|
18
|
+
* for this transaction.
|
|
19
|
+
* - `currentOwner`: (Optional) The current owner of the subdomain. If not provided, it
|
|
20
|
+
* will be resolved automatically. This is useful for building transactions when the subdomain
|
|
21
|
+
* does not yet exist.
|
|
14
22
|
* @returns A promise that resolves to the transfer subdomain instruction.
|
|
15
23
|
*/
|
|
16
|
-
export declare const transferSubdomain: (rpc
|
|
24
|
+
export declare const transferSubdomain: ({ rpc, subdomain, newOwner, isParentOwnerSigner, currentOwner, }: TransferSubdomainParams) => Promise<IInstruction>;
|
|
25
|
+
export {};
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { Address, GetAccountInfoApi, IInstruction, Rpc } from "@solana/kit";
|
|
2
|
+
export interface UpdateNameRegistryParams {
|
|
3
|
+
rpc: Rpc<GetAccountInfoApi>;
|
|
4
|
+
domain: string;
|
|
5
|
+
offset: number;
|
|
6
|
+
data: Uint8Array;
|
|
7
|
+
classAddress?: Address;
|
|
8
|
+
parentAddress?: Address;
|
|
9
|
+
}
|
|
2
10
|
/**
|
|
3
11
|
* Update the data of the given name registry.
|
|
4
12
|
*
|
|
5
|
-
* @param
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
13
|
+
* @param params - An object containing the following properties:
|
|
14
|
+
* - `rpc`: An RPC interface implementing GetAccountInfoApi.
|
|
15
|
+
* - `domain`: The name of the domain whose registry will be updated.
|
|
16
|
+
* - `offset`: The offset in bytes where the update should begin.
|
|
17
|
+
* - `data`: The data to be written to the registry.
|
|
18
|
+
* - `classAddress`: (Optional) The address of the class associated with the registry.
|
|
19
|
+
* - `parentAddress`: (Optional) The address of the parent registry.
|
|
11
20
|
* @returns A promise that resolves to the update name registry instruction.
|
|
12
21
|
*/
|
|
13
|
-
export declare function updateNameRegistry(rpc
|
|
22
|
+
export declare function updateNameRegistry({ rpc, domain, offset, data, classAddress, parentAddress, }: UpdateNameRegistryParams): Promise<IInstruction>;
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import { Address } from "@solana/kit";
|
|
1
|
+
import { Address, IInstruction } from "@solana/kit";
|
|
2
2
|
import { Record } from "../types/record";
|
|
3
|
+
interface UpdateRecordParams {
|
|
4
|
+
domain: string;
|
|
5
|
+
record: Record;
|
|
6
|
+
content: string;
|
|
7
|
+
owner: Address;
|
|
8
|
+
payer: Address;
|
|
9
|
+
}
|
|
3
10
|
/**
|
|
4
11
|
* Updates an existing record under the specified domain.
|
|
5
12
|
*
|
|
6
|
-
* @param
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
13
|
+
* @param params - An object containing the following properties:
|
|
14
|
+
* - `domain`: The domain under which the record resides.
|
|
15
|
+
* - `record`: An enumeration representing the type of record to be updated.
|
|
16
|
+
* - `content`: The updated content to be associated with the record.
|
|
17
|
+
* - `owner`: The address of the domain's owner.
|
|
18
|
+
* - `payer`: The address funding the record update.
|
|
11
19
|
* @returns A promise that resolves to the update record instruction.
|
|
12
20
|
*/
|
|
13
|
-
export declare const updateRecord: (domain
|
|
21
|
+
export declare const updateRecord: ({ domain, record, content, owner, payer, }: UpdateRecordParams) => Promise<IInstruction>;
|
|
22
|
+
export {};
|