diff --git a/sdk/src/constants.ts b/sdk/src/constants.ts index 1a9a7579..6b25bc68 100644 --- a/sdk/src/constants.ts +++ b/sdk/src/constants.ts @@ -113,6 +113,9 @@ export const mainPackage: Config = { payments: { packageId: '0xe1c0778c7097e727a0dee47ce87a18671456ddbdb1b2dabc027c99dd0a6c2395', }, + utils: { + packageId: '0xd79fd8f79a2c9d139cb9944d5ee99158f5bff7205b14e23a09e86a1e7f45d7fe', + }, registryTableId: '0xa353bcf5adea89def84920513cf888c9d78f304cfd8476a1d831d72c0f92309d', pyth: { pythStateId: '0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c', diff --git a/sdk/src/suins-transaction.ts b/sdk/src/suins-transaction.ts index e691d6c4..39ebc0ad 100644 --- a/sdk/src/suins-transaction.ts +++ b/sdk/src/suins-transaction.ts @@ -113,7 +113,7 @@ export class SuinsTransaction { tx.add(this.finalizeRenew(receipt, nftObject)); if (transferNft) { - return nft; + return nft as TransactionObjectArgument; } return null; @@ -482,11 +482,11 @@ export class SuinsTransaction { address, isSubname, }: { - nft: ObjectArgument; + nft: TransactionObjectArgument; address?: string; isSubname?: boolean; }) { - if (!this.suinsClient.config.suins) throw new Error('SuiNS Object ID not found'); + if (!this.suinsClient.config.utils?.packageId) throw new Error('SuiNS Object ID not found'); if (isSubname && !this.suinsClient.config.tempSubdomainsProxyPackageId) throw new Error('Subnames proxy package ID not found'); @@ -494,10 +494,10 @@ export class SuinsTransaction { this.transaction.moveCall({ target: isSubname ? `${this.suinsClient.config.tempSubdomainsProxyPackageId}::subdomain_proxy::set_target_address` - : `${this.suinsClient.config.packageId}::controller::set_target_address`, + : `${this.suinsClient.config.utils.packageId}::direct_setup::set_target_address`, arguments: [ this.transaction.object(this.suinsClient.config.suins), - this.transaction.object(nft), + nft, this.transaction.pure(bcs.option(bcs.Address).serialize(address).toBytes()), this.transaction.object(SUI_CLOCK_OBJECT_ID), ], @@ -508,10 +508,10 @@ export class SuinsTransaction { setDefault(name: string) { if (!isValidSuiNSName(name)) throw new Error('Invalid SuiNS name'); if (!this.suinsClient.config.suins) throw new Error('SuiNS Object ID not found'); - if (!this.suinsClient.config.utils) throw new Error('Utils package ID not found'); + if (!this.suinsClient.config.utils?.packageId) throw new Error('Utils package ID not found'); this.transaction.moveCall({ - target: `${this.suinsClient.config.packageId}::controller::set_reverse_lookup`, + target: `${this.suinsClient.config.utils?.packageId}::direct_setup::set_reverse_lookup`, arguments: [ this.transaction.object(this.suinsClient.config.suins), this.transaction.pure.string(normalizeSuiNSName(name, 'dot')),