Skip to content

Commit

Permalink
set target
Browse files Browse the repository at this point in the history
  • Loading branch information
leecchh committed Dec 17, 2024
1 parent c07e544 commit 4ee8c19
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions sdk/examples/exampleRegistration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,24 @@ import { SuinsTransaction } from '../src/suins-transaction';
network,
});

// console.log(await suinsClient.getCoinTypeDiscount());
// console.log(await suinsClient.getNameRecord('tonytony.sui'));

const suinsTx = new SuinsTransaction(suinsClient, new Transaction());
const nft = await suinsTx.register('manosmassssnos.sui', 1, suinsClient.config.coins.NS, {
couponCode: 'fiveplus15percentoff',
coinId: '0x32f09a77fc392453cf412b65c5a9a40134cf72d5b3206b2df6d311e032e1613e',
});

if (nft) {
suinsTx.transaction.transferObjects([nft], suinsTx.getActiveAddress());
}
/* Register a new SuiNS name */
// const nft = await suinsTx.register('tonytony.sui', 1, suinsClient.config.coins.NS, {
// couponCode: 'fiveplus15percentoff',
// coinId: '0x32f09a77fc392453cf412b65c5a9a40134cf72d5b3206b2df6d311e032e1613e',
// });
// if (nft) {
// suinsTx.transaction.transferObjects([nft], suinsTx.getActiveAddress());
// }

/* Set target address */
const nft = '0x42004431a99f4467a892815f3d8fed20c4396256332ead3b6687a36219b18758';
const address = '0xe55684e6a538d29df4b9f510a6bd3ec17d3dc47fb524839954bf7fcf835b5d0d';
suinsTx.setTargetAddress({ nft, address });

return suinsTx.signAndExecute();
})();

0 comments on commit 4ee8c19

Please sign in to comment.