@typemove/aptos 1.2.9-rc.1 → 1.3.0-rc.1

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.
Files changed (101) hide show
  1. package/dist/cjs/account-resource-client.d.ts +8 -15
  2. package/dist/cjs/account-resource-client.d.ts.map +1 -1
  3. package/dist/cjs/account-resource-client.js +17 -10
  4. package/dist/cjs/account-resource-client.js.map +1 -1
  5. package/dist/cjs/account-resource-client.test.js.map +1 -1
  6. package/dist/cjs/aptos-chain-adapter.d.ts +3 -4
  7. package/dist/cjs/aptos-chain-adapter.d.ts.map +1 -1
  8. package/dist/cjs/aptos-chain-adapter.js +7 -2
  9. package/dist/cjs/aptos-chain-adapter.js.map +1 -1
  10. package/dist/cjs/builtin/0x1.d.ts +1039 -961
  11. package/dist/cjs/builtin/0x1.d.ts.map +1 -1
  12. package/dist/cjs/builtin/0x1.js +2675 -1458
  13. package/dist/cjs/builtin/0x1.js.map +1 -1
  14. package/dist/cjs/builtin/0x3.d.ts +126 -83
  15. package/dist/cjs/builtin/0x3.d.ts.map +1 -1
  16. package/dist/cjs/builtin/0x3.js +203 -117
  17. package/dist/cjs/builtin/0x3.js.map +1 -1
  18. package/dist/cjs/builtin/0x4.d.ts +139 -135
  19. package/dist/cjs/builtin/0x4.d.ts.map +1 -1
  20. package/dist/cjs/builtin/0x4.js +365 -210
  21. package/dist/cjs/builtin/0x4.js.map +1 -1
  22. package/dist/cjs/client.test.js.map +1 -1
  23. package/dist/cjs/codegen/codegen.d.ts +1 -1
  24. package/dist/cjs/codegen/codegen.d.ts.map +1 -1
  25. package/dist/cjs/codegen/codegen.js +29 -23
  26. package/dist/cjs/codegen/codegen.js.map +1 -1
  27. package/dist/cjs/codegen/types.test.js.map +1 -1
  28. package/dist/cjs/models.d.ts +2 -2
  29. package/dist/cjs/models.d.ts.map +1 -1
  30. package/dist/cjs/move-coder.d.ts +4 -5
  31. package/dist/cjs/move-coder.d.ts.map +1 -1
  32. package/dist/cjs/move-coder.js +6 -3
  33. package/dist/cjs/move-coder.js.map +1 -1
  34. package/dist/cjs/move-types.d.ts +1 -11
  35. package/dist/cjs/move-types.d.ts.map +1 -1
  36. package/dist/cjs/move-types.js +11 -0
  37. package/dist/cjs/move-types.js.map +1 -1
  38. package/dist/cjs/to-internal.d.ts +1 -1
  39. package/dist/cjs/to-internal.d.ts.map +1 -1
  40. package/dist/cjs/to-internal.js +8 -8
  41. package/dist/cjs/to-internal.js.map +1 -1
  42. package/dist/esm/account-resource-client.d.ts +8 -15
  43. package/dist/esm/account-resource-client.d.ts.map +1 -1
  44. package/dist/esm/account-resource-client.js +17 -10
  45. package/dist/esm/account-resource-client.js.map +1 -1
  46. package/dist/esm/account-resource-client.test.js.map +1 -1
  47. package/dist/esm/aptos-chain-adapter.d.ts +3 -4
  48. package/dist/esm/aptos-chain-adapter.d.ts.map +1 -1
  49. package/dist/esm/aptos-chain-adapter.js +7 -2
  50. package/dist/esm/aptos-chain-adapter.js.map +1 -1
  51. package/dist/esm/builtin/0x1.d.ts +1039 -961
  52. package/dist/esm/builtin/0x1.d.ts.map +1 -1
  53. package/dist/esm/builtin/0x1.js +2675 -1458
  54. package/dist/esm/builtin/0x1.js.map +1 -1
  55. package/dist/esm/builtin/0x3.d.ts +126 -83
  56. package/dist/esm/builtin/0x3.d.ts.map +1 -1
  57. package/dist/esm/builtin/0x3.js +203 -117
  58. package/dist/esm/builtin/0x3.js.map +1 -1
  59. package/dist/esm/builtin/0x4.d.ts +139 -135
  60. package/dist/esm/builtin/0x4.d.ts.map +1 -1
  61. package/dist/esm/builtin/0x4.js +365 -210
  62. package/dist/esm/builtin/0x4.js.map +1 -1
  63. package/dist/esm/client.test.js.map +1 -1
  64. package/dist/esm/codegen/codegen.d.ts +1 -1
  65. package/dist/esm/codegen/codegen.d.ts.map +1 -1
  66. package/dist/esm/codegen/codegen.js +29 -23
  67. package/dist/esm/codegen/codegen.js.map +1 -1
  68. package/dist/esm/codegen/run.js +5 -5
  69. package/dist/esm/codegen/run.js.map +1 -1
  70. package/dist/esm/codegen/types.test.js.map +1 -1
  71. package/dist/esm/models.d.ts +2 -2
  72. package/dist/esm/models.d.ts.map +1 -1
  73. package/dist/esm/move-coder.d.ts +4 -5
  74. package/dist/esm/move-coder.d.ts.map +1 -1
  75. package/dist/esm/move-coder.js +6 -3
  76. package/dist/esm/move-coder.js.map +1 -1
  77. package/dist/esm/move-types.d.ts +1 -11
  78. package/dist/esm/move-types.d.ts.map +1 -1
  79. package/dist/esm/move-types.js +11 -0
  80. package/dist/esm/move-types.js.map +1 -1
  81. package/dist/esm/to-internal.d.ts +1 -1
  82. package/dist/esm/to-internal.d.ts.map +1 -1
  83. package/dist/esm/to-internal.js +9 -9
  84. package/dist/esm/to-internal.js.map +1 -1
  85. package/package.json +3 -3
  86. package/src/abis/0x1.json +193 -4
  87. package/src/abis/0x4.json +20 -1
  88. package/src/account-resource-client.ts +30 -19
  89. package/src/aptos-chain-adapter.ts +10 -6
  90. package/src/builtin/0x1.ts +3994 -3160
  91. package/src/builtin/0x3.ts +337 -263
  92. package/src/builtin/0x4.ts +529 -437
  93. package/src/codegen/codegen.ts +29 -26
  94. package/src/codegen/run.ts +5 -5
  95. package/src/models.ts +7 -12
  96. package/src/move-coder.ts +18 -9
  97. package/src/move-types.ts +13 -12
  98. package/src/tests/types/0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af.ts +829 -684
  99. package/src/tests/types/0x4dcae85fc5559071906cd5c76b7420fcbb4b0a92f00ab40ffc394aadbbff5ee9.ts +8 -9
  100. package/src/tests/types/0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541.ts +803 -687
  101. package/src/to-internal.ts +15 -10
@@ -9,16 +9,15 @@ import { MoveCoder, TypedEventInstance } from "@typemove/aptos";
9
9
 
10
10
  import { defaultMoveCoder } from "@typemove/aptos";
11
11
 
12
- import { Address } from "@typemove/aptos";
13
-
14
12
  import {
15
- AptosClient,
16
- AptosAccount,
17
- TransactionBuilderRemoteABI,
18
- Types,
19
- TxnBuilderTypes,
20
- OptionalTransactionArgs,
21
- } from "aptos";
13
+ Aptos,
14
+ Account as AptosAccount,
15
+ MoveAddressType,
16
+ PendingTransactionResponse,
17
+ InputGenerateTransactionOptions,
18
+ MoveStructId,
19
+ InputViewRequestData,
20
+ } from "@aptos-labs/ts-sdk";
22
21
 
23
22
  import * as _0x1 from "./0x1.js";
24
23
 
@@ -106,7 +105,7 @@ export namespace token {
106
105
  }
107
106
 
108
107
  export interface CreateCollectionEvent {
109
- creator: Address;
108
+ creator: MoveAddressType;
110
109
  collection_name: string;
111
110
  uri: string;
112
111
  description: string;
@@ -136,7 +135,7 @@ export namespace token {
136
135
  description: string;
137
136
  maximum: bigint;
138
137
  uri: string;
139
- royalty_payee_address: Address;
138
+ royalty_payee_address: MoveAddressType;
140
139
  royalty_points_denominator: bigint;
141
140
  royalty_points_numerator: bigint;
142
141
  name: string;
@@ -235,7 +234,7 @@ export namespace token {
235
234
  export interface Royalty {
236
235
  royalty_points_numerator: bigint;
237
236
  royalty_points_denominator: bigint;
238
- payee_address: Address;
237
+ payee_address: MoveAddressType;
239
238
  }
240
239
 
241
240
  export namespace Royalty {
@@ -292,7 +291,7 @@ export namespace token {
292
291
  }
293
292
 
294
293
  export interface TokenDataId {
295
- creator: Address;
294
+ creator: MoveAddressType;
296
295
  collection: string;
297
296
  name: string;
298
297
  }
@@ -378,7 +377,7 @@ export namespace token {
378
377
  }
379
378
 
380
379
  export interface WithdrawCapability {
381
- token_owner: Address;
380
+ token_owner: MoveAddressType;
382
381
  token_id: token.TokenId;
383
382
  amount: bigint;
384
383
  expiration_sec: bigint;
@@ -425,86 +424,92 @@ export namespace token {
425
424
 
426
425
  export namespace entry {
427
426
  export async function burn(
428
- client: AptosClient,
427
+ client: Aptos,
429
428
  account: AptosAccount,
430
429
  request: {
431
- type_arguments: [];
432
- arguments: [Address, string, string, bigint, bigint];
430
+ typeArguments: [];
431
+ functionArguments: [MoveAddressType, string, string, bigint, bigint];
433
432
  },
434
- extraArgs?: OptionalTransactionArgs,
435
- ): Promise<Types.PendingTransaction> {
436
- const coder = defaultMoveCoder(client.nodeUrl);
437
- const builder = new TransactionBuilderRemoteABI(client, {
438
- sender: account.address(),
439
- ...extraArgs,
433
+ options?: InputGenerateTransactionOptions,
434
+ ): Promise<PendingTransactionResponse> {
435
+ const coder = defaultMoveCoder(client.config.fullnode);
436
+ const transaction = await client.build.simple({
437
+ sender: account.accountAddress,
438
+ data: {
439
+ function: "0x3::token::burn",
440
+ functionArguments: coder.encodeArray(request.functionArguments),
441
+ typeArguments: [],
442
+ },
443
+ options,
444
+ });
445
+ return await client.signAndSubmitTransaction({
446
+ signer: account,
447
+ transaction,
440
448
  });
441
- const txn = await builder.build(
442
- "0x3::token::burn",
443
- request.type_arguments,
444
- coder.encodeArray(request.arguments),
445
- );
446
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
447
- return await client.submitSignedBCSTransaction(bcsTxn);
448
449
  }
449
450
  export async function burnByCreator(
450
- client: AptosClient,
451
+ client: Aptos,
451
452
  account: AptosAccount,
452
453
  request: {
453
- type_arguments: [];
454
- arguments: [Address, string, string, bigint, bigint];
454
+ typeArguments: [];
455
+ functionArguments: [MoveAddressType, string, string, bigint, bigint];
455
456
  },
456
- extraArgs?: OptionalTransactionArgs,
457
- ): Promise<Types.PendingTransaction> {
458
- const coder = defaultMoveCoder(client.nodeUrl);
459
- const builder = new TransactionBuilderRemoteABI(client, {
460
- sender: account.address(),
461
- ...extraArgs,
457
+ options?: InputGenerateTransactionOptions,
458
+ ): Promise<PendingTransactionResponse> {
459
+ const coder = defaultMoveCoder(client.config.fullnode);
460
+ const transaction = await client.build.simple({
461
+ sender: account.accountAddress,
462
+ data: {
463
+ function: "0x3::token::burn_by_creator",
464
+ functionArguments: coder.encodeArray(request.functionArguments),
465
+ typeArguments: [],
466
+ },
467
+ options,
468
+ });
469
+ return await client.signAndSubmitTransaction({
470
+ signer: account,
471
+ transaction,
462
472
  });
463
- const txn = await builder.build(
464
- "0x3::token::burn_by_creator",
465
- request.type_arguments,
466
- coder.encodeArray(request.arguments),
467
- );
468
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
469
- return await client.submitSignedBCSTransaction(bcsTxn);
470
473
  }
471
474
 
472
475
  export async function createCollectionScript(
473
- client: AptosClient,
476
+ client: Aptos,
474
477
  account: AptosAccount,
475
478
  request: {
476
- type_arguments: [];
477
- arguments: [string, string, string, bigint, Boolean[]];
479
+ typeArguments: [];
480
+ functionArguments: [string, string, string, bigint, Boolean[]];
478
481
  },
479
- extraArgs?: OptionalTransactionArgs,
480
- ): Promise<Types.PendingTransaction> {
481
- const coder = defaultMoveCoder(client.nodeUrl);
482
- const builder = new TransactionBuilderRemoteABI(client, {
483
- sender: account.address(),
484
- ...extraArgs,
482
+ options?: InputGenerateTransactionOptions,
483
+ ): Promise<PendingTransactionResponse> {
484
+ const coder = defaultMoveCoder(client.config.fullnode);
485
+ const transaction = await client.build.simple({
486
+ sender: account.accountAddress,
487
+ data: {
488
+ function: "0x3::token::create_collection_script",
489
+ functionArguments: coder.encodeArray(request.functionArguments),
490
+ typeArguments: [],
491
+ },
492
+ options,
493
+ });
494
+ return await client.signAndSubmitTransaction({
495
+ signer: account,
496
+ transaction,
485
497
  });
486
- const txn = await builder.build(
487
- "0x3::token::create_collection_script",
488
- request.type_arguments,
489
- coder.encodeArray(request.arguments),
490
- );
491
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
492
- return await client.submitSignedBCSTransaction(bcsTxn);
493
498
  }
494
499
 
495
500
  export async function createTokenScript(
496
- client: AptosClient,
501
+ client: Aptos,
497
502
  account: AptosAccount,
498
503
  request: {
499
- type_arguments: [];
500
- arguments: [
504
+ typeArguments: [];
505
+ functionArguments: [
501
506
  string,
502
507
  string,
503
508
  string,
504
509
  bigint,
505
510
  bigint,
506
511
  string,
507
- Address,
512
+ MoveAddressType,
508
513
  bigint,
509
514
  bigint,
510
515
  Boolean[],
@@ -513,99 +518,114 @@ export namespace token {
513
518
  string[],
514
519
  ];
515
520
  },
516
- extraArgs?: OptionalTransactionArgs,
517
- ): Promise<Types.PendingTransaction> {
518
- const coder = defaultMoveCoder(client.nodeUrl);
519
- const builder = new TransactionBuilderRemoteABI(client, {
520
- sender: account.address(),
521
- ...extraArgs,
521
+ options?: InputGenerateTransactionOptions,
522
+ ): Promise<PendingTransactionResponse> {
523
+ const coder = defaultMoveCoder(client.config.fullnode);
524
+ const transaction = await client.build.simple({
525
+ sender: account.accountAddress,
526
+ data: {
527
+ function: "0x3::token::create_token_script",
528
+ functionArguments: coder.encodeArray(request.functionArguments),
529
+ typeArguments: [],
530
+ },
531
+ options,
532
+ });
533
+ return await client.signAndSubmitTransaction({
534
+ signer: account,
535
+ transaction,
522
536
  });
523
- const txn = await builder.build(
524
- "0x3::token::create_token_script",
525
- request.type_arguments,
526
- coder.encodeArray(request.arguments),
527
- );
528
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
529
- return await client.submitSignedBCSTransaction(bcsTxn);
530
537
  }
531
538
 
532
539
  export async function directTransferScript(
533
- client: AptosClient,
540
+ client: Aptos,
534
541
  account: AptosAccount,
535
542
  request: {
536
- type_arguments: [];
537
- arguments: [Address, Address, string, string, bigint, bigint];
543
+ typeArguments: [];
544
+ functionArguments: [
545
+ MoveAddressType,
546
+ MoveAddressType,
547
+ string,
548
+ string,
549
+ bigint,
550
+ bigint,
551
+ ];
538
552
  },
539
- extraArgs?: OptionalTransactionArgs,
540
- ): Promise<Types.PendingTransaction> {
541
- const coder = defaultMoveCoder(client.nodeUrl);
542
- const builder = new TransactionBuilderRemoteABI(client, {
543
- sender: account.address(),
544
- ...extraArgs,
553
+ options?: InputGenerateTransactionOptions,
554
+ ): Promise<PendingTransactionResponse> {
555
+ const coder = defaultMoveCoder(client.config.fullnode);
556
+ const transaction = await client.build.simple({
557
+ sender: account.accountAddress,
558
+ data: {
559
+ function: "0x3::token::direct_transfer_script",
560
+ functionArguments: coder.encodeArray(request.functionArguments),
561
+ typeArguments: [],
562
+ },
563
+ options,
564
+ });
565
+ return await client.signAndSubmitTransaction({
566
+ signer: account,
567
+ transaction,
545
568
  });
546
- const txn = await builder.build(
547
- "0x3::token::direct_transfer_script",
548
- request.type_arguments,
549
- coder.encodeArray(request.arguments),
550
- );
551
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
552
- return await client.submitSignedBCSTransaction(bcsTxn);
553
569
  }
554
570
 
555
571
  export async function initializeTokenScript(
556
- client: AptosClient,
572
+ client: Aptos,
557
573
  account: AptosAccount,
558
574
  request: {
559
- type_arguments: [];
560
- arguments: [];
575
+ typeArguments: [];
576
+ functionArguments: [];
561
577
  },
562
- extraArgs?: OptionalTransactionArgs,
563
- ): Promise<Types.PendingTransaction> {
564
- const coder = defaultMoveCoder(client.nodeUrl);
565
- const builder = new TransactionBuilderRemoteABI(client, {
566
- sender: account.address(),
567
- ...extraArgs,
578
+ options?: InputGenerateTransactionOptions,
579
+ ): Promise<PendingTransactionResponse> {
580
+ const coder = defaultMoveCoder(client.config.fullnode);
581
+ const transaction = await client.build.simple({
582
+ sender: account.accountAddress,
583
+ data: {
584
+ function: "0x3::token::initialize_token_script",
585
+ functionArguments: coder.encodeArray(request.functionArguments),
586
+ typeArguments: [],
587
+ },
588
+ options,
589
+ });
590
+ return await client.signAndSubmitTransaction({
591
+ signer: account,
592
+ transaction,
568
593
  });
569
- const txn = await builder.build(
570
- "0x3::token::initialize_token_script",
571
- request.type_arguments,
572
- coder.encodeArray(request.arguments),
573
- );
574
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
575
- return await client.submitSignedBCSTransaction(bcsTxn);
576
594
  }
577
595
 
578
596
  export async function mintScript(
579
- client: AptosClient,
597
+ client: Aptos,
580
598
  account: AptosAccount,
581
599
  request: {
582
- type_arguments: [];
583
- arguments: [Address, string, string, bigint];
600
+ typeArguments: [];
601
+ functionArguments: [MoveAddressType, string, string, bigint];
584
602
  },
585
- extraArgs?: OptionalTransactionArgs,
586
- ): Promise<Types.PendingTransaction> {
587
- const coder = defaultMoveCoder(client.nodeUrl);
588
- const builder = new TransactionBuilderRemoteABI(client, {
589
- sender: account.address(),
590
- ...extraArgs,
603
+ options?: InputGenerateTransactionOptions,
604
+ ): Promise<PendingTransactionResponse> {
605
+ const coder = defaultMoveCoder(client.config.fullnode);
606
+ const transaction = await client.build.simple({
607
+ sender: account.accountAddress,
608
+ data: {
609
+ function: "0x3::token::mint_script",
610
+ functionArguments: coder.encodeArray(request.functionArguments),
611
+ typeArguments: [],
612
+ },
613
+ options,
614
+ });
615
+ return await client.signAndSubmitTransaction({
616
+ signer: account,
617
+ transaction,
591
618
  });
592
- const txn = await builder.build(
593
- "0x3::token::mint_script",
594
- request.type_arguments,
595
- coder.encodeArray(request.arguments),
596
- );
597
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
598
- return await client.submitSignedBCSTransaction(bcsTxn);
599
619
  }
600
620
 
601
621
  export async function mutateTokenProperties(
602
- client: AptosClient,
622
+ client: Aptos,
603
623
  account: AptosAccount,
604
624
  request: {
605
- type_arguments: [];
606
- arguments: [
607
- Address,
608
- Address,
625
+ typeArguments: [];
626
+ functionArguments: [
627
+ MoveAddressType,
628
+ MoveAddressType,
609
629
  string,
610
630
  string,
611
631
  bigint,
@@ -615,83 +635,99 @@ export namespace token {
615
635
  string[],
616
636
  ];
617
637
  },
618
- extraArgs?: OptionalTransactionArgs,
619
- ): Promise<Types.PendingTransaction> {
620
- const coder = defaultMoveCoder(client.nodeUrl);
621
- const builder = new TransactionBuilderRemoteABI(client, {
622
- sender: account.address(),
623
- ...extraArgs,
638
+ options?: InputGenerateTransactionOptions,
639
+ ): Promise<PendingTransactionResponse> {
640
+ const coder = defaultMoveCoder(client.config.fullnode);
641
+ const transaction = await client.build.simple({
642
+ sender: account.accountAddress,
643
+ data: {
644
+ function: "0x3::token::mutate_token_properties",
645
+ functionArguments: coder.encodeArray(request.functionArguments),
646
+ typeArguments: [],
647
+ },
648
+ options,
649
+ });
650
+ return await client.signAndSubmitTransaction({
651
+ signer: account,
652
+ transaction,
624
653
  });
625
- const txn = await builder.build(
626
- "0x3::token::mutate_token_properties",
627
- request.type_arguments,
628
- coder.encodeArray(request.arguments),
629
- );
630
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
631
- return await client.submitSignedBCSTransaction(bcsTxn);
632
654
  }
633
655
 
634
656
  export async function optInDirectTransfer(
635
- client: AptosClient,
657
+ client: Aptos,
636
658
  account: AptosAccount,
637
659
  request: {
638
- type_arguments: [];
639
- arguments: [Boolean];
660
+ typeArguments: [];
661
+ functionArguments: [Boolean];
640
662
  },
641
- extraArgs?: OptionalTransactionArgs,
642
- ): Promise<Types.PendingTransaction> {
643
- const coder = defaultMoveCoder(client.nodeUrl);
644
- const builder = new TransactionBuilderRemoteABI(client, {
645
- sender: account.address(),
646
- ...extraArgs,
663
+ options?: InputGenerateTransactionOptions,
664
+ ): Promise<PendingTransactionResponse> {
665
+ const coder = defaultMoveCoder(client.config.fullnode);
666
+ const transaction = await client.build.simple({
667
+ sender: account.accountAddress,
668
+ data: {
669
+ function: "0x3::token::opt_in_direct_transfer",
670
+ functionArguments: coder.encodeArray(request.functionArguments),
671
+ typeArguments: [],
672
+ },
673
+ options,
674
+ });
675
+ return await client.signAndSubmitTransaction({
676
+ signer: account,
677
+ transaction,
647
678
  });
648
- const txn = await builder.build(
649
- "0x3::token::opt_in_direct_transfer",
650
- request.type_arguments,
651
- coder.encodeArray(request.arguments),
652
- );
653
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
654
- return await client.submitSignedBCSTransaction(bcsTxn);
655
679
  }
656
680
 
657
681
  export async function transferWithOptIn(
658
- client: AptosClient,
682
+ client: Aptos,
659
683
  account: AptosAccount,
660
684
  request: {
661
- type_arguments: [];
662
- arguments: [Address, string, string, bigint, Address, bigint];
685
+ typeArguments: [];
686
+ functionArguments: [
687
+ MoveAddressType,
688
+ string,
689
+ string,
690
+ bigint,
691
+ MoveAddressType,
692
+ bigint,
693
+ ];
663
694
  },
664
- extraArgs?: OptionalTransactionArgs,
665
- ): Promise<Types.PendingTransaction> {
666
- const coder = defaultMoveCoder(client.nodeUrl);
667
- const builder = new TransactionBuilderRemoteABI(client, {
668
- sender: account.address(),
669
- ...extraArgs,
695
+ options?: InputGenerateTransactionOptions,
696
+ ): Promise<PendingTransactionResponse> {
697
+ const coder = defaultMoveCoder(client.config.fullnode);
698
+ const transaction = await client.build.simple({
699
+ sender: account.accountAddress,
700
+ data: {
701
+ function: "0x3::token::transfer_with_opt_in",
702
+ functionArguments: coder.encodeArray(request.functionArguments),
703
+ typeArguments: [],
704
+ },
705
+ options,
706
+ });
707
+ return await client.signAndSubmitTransaction({
708
+ signer: account,
709
+ transaction,
670
710
  });
671
- const txn = await builder.build(
672
- "0x3::token::transfer_with_opt_in",
673
- request.type_arguments,
674
- coder.encodeArray(request.arguments),
675
- );
676
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
677
- return await client.submitSignedBCSTransaction(bcsTxn);
678
711
  }
679
712
  }
680
713
  export namespace view {
681
714
  export async function getCollectionMutabilityConfig(
682
- client: AptosClient,
715
+ client: Aptos,
683
716
  request: {
684
- arguments: [Address, string];
717
+ functionArguments: [MoveAddressType, string];
685
718
  },
686
719
  version?: bigint,
687
720
  ): Promise<[token.CollectionMutabilityConfig]> {
688
- const coder = defaultMoveCoder(client.nodeUrl);
689
- const data = {
690
- type_arguments: [],
691
- arguments: coder.encodeArray(request.arguments),
721
+ const coder = defaultMoveCoder(client.config.fullnode);
722
+ const data: InputViewRequestData = {
692
723
  function: "0x3::token::get_collection_mutability_config",
724
+ functionArguments: coder.encodeArray(request.functionArguments),
725
+ typeArguments: [],
693
726
  };
694
- const res = await client.view(data, version?.toString());
727
+ const res = await client.view({
728
+ payload: data,
729
+ options: { ledgerVersion: version },
730
+ });
695
731
  const type = await coder.getMoveFunction(
696
732
  "0x3::token::get_collection_mutability_config",
697
733
  );
@@ -853,7 +889,7 @@ export namespace token_coin_swap {
853
889
 
854
890
  export interface TokenSwapEvent {
855
891
  token_id: token.TokenId;
856
- token_buyer: Address;
892
+ token_buyer: MoveAddressType;
857
893
  token_amount: bigint;
858
894
  coin_amount: bigint;
859
895
  coin_type_info: _0x1.type_info.TypeInfo;
@@ -877,26 +913,36 @@ export namespace token_coin_swap {
877
913
 
878
914
  export namespace entry {
879
915
  export async function listTokenForSwap<T0 = any>(
880
- client: AptosClient,
916
+ client: Aptos,
881
917
  account: AptosAccount,
882
918
  request: {
883
- type_arguments: [string];
884
- arguments: [Address, string, string, bigint, bigint, bigint, bigint];
919
+ typeArguments: [MoveStructId];
920
+ functionArguments: [
921
+ MoveAddressType,
922
+ string,
923
+ string,
924
+ bigint,
925
+ bigint,
926
+ bigint,
927
+ bigint,
928
+ ];
885
929
  },
886
- extraArgs?: OptionalTransactionArgs,
887
- ): Promise<Types.PendingTransaction> {
888
- const coder = defaultMoveCoder(client.nodeUrl);
889
- const builder = new TransactionBuilderRemoteABI(client, {
890
- sender: account.address(),
891
- ...extraArgs,
930
+ options?: InputGenerateTransactionOptions,
931
+ ): Promise<PendingTransactionResponse> {
932
+ const coder = defaultMoveCoder(client.config.fullnode);
933
+ const transaction = await client.build.simple({
934
+ sender: account.accountAddress,
935
+ data: {
936
+ function: "0x3::token_coin_swap::list_token_for_swap",
937
+ functionArguments: coder.encodeArray(request.functionArguments),
938
+ typeArguments: request.typeArguments,
939
+ },
940
+ options,
941
+ });
942
+ return await client.signAndSubmitTransaction({
943
+ signer: account,
944
+ transaction,
892
945
  });
893
- const txn = await builder.build(
894
- "0x3::token_coin_swap::list_token_for_swap",
895
- request.type_arguments,
896
- coder.encodeArray(request.arguments),
897
- );
898
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
899
- return await client.submitSignedBCSTransaction(bcsTxn);
900
946
  }
901
947
  }
902
948
  export namespace view {}
@@ -921,7 +967,7 @@ export namespace token_transfers {
921
967
  }
922
968
 
923
969
  export interface TokenCancelOfferEvent {
924
- to_address: Address;
970
+ to_address: MoveAddressType;
925
971
  token_id: token.TokenId;
926
972
  amount: bigint;
927
973
  }
@@ -945,7 +991,7 @@ export namespace token_transfers {
945
991
  }
946
992
 
947
993
  export interface TokenClaimEvent {
948
- to_address: Address;
994
+ to_address: MoveAddressType;
949
995
  token_id: token.TokenId;
950
996
  amount: bigint;
951
997
  }
@@ -969,7 +1015,7 @@ export namespace token_transfers {
969
1015
  }
970
1016
 
971
1017
  export interface TokenOfferEvent {
972
- to_address: Address;
1018
+ to_address: MoveAddressType;
973
1019
  token_id: token.TokenId;
974
1020
  amount: bigint;
975
1021
  }
@@ -993,7 +1039,7 @@ export namespace token_transfers {
993
1039
  }
994
1040
 
995
1041
  export interface TokenOfferId {
996
- to_addr: Address;
1042
+ to_addr: MoveAddressType;
997
1043
  token_id: token.TokenId;
998
1044
  }
999
1045
 
@@ -1015,72 +1061,100 @@ export namespace token_transfers {
1015
1061
 
1016
1062
  export namespace entry {
1017
1063
  export async function cancelOfferScript(
1018
- client: AptosClient,
1064
+ client: Aptos,
1019
1065
  account: AptosAccount,
1020
1066
  request: {
1021
- type_arguments: [];
1022
- arguments: [Address, Address, Address, string, string, bigint];
1067
+ typeArguments: [];
1068
+ functionArguments: [
1069
+ MoveAddressType,
1070
+ MoveAddressType,
1071
+ MoveAddressType,
1072
+ string,
1073
+ string,
1074
+ bigint,
1075
+ ];
1023
1076
  },
1024
- extraArgs?: OptionalTransactionArgs,
1025
- ): Promise<Types.PendingTransaction> {
1026
- const coder = defaultMoveCoder(client.nodeUrl);
1027
- const builder = new TransactionBuilderRemoteABI(client, {
1028
- sender: account.address(),
1029
- ...extraArgs,
1077
+ options?: InputGenerateTransactionOptions,
1078
+ ): Promise<PendingTransactionResponse> {
1079
+ const coder = defaultMoveCoder(client.config.fullnode);
1080
+ const transaction = await client.build.simple({
1081
+ sender: account.accountAddress,
1082
+ data: {
1083
+ function: "0x3::token_transfers::cancel_offer_script",
1084
+ functionArguments: coder.encodeArray(request.functionArguments),
1085
+ typeArguments: [],
1086
+ },
1087
+ options,
1088
+ });
1089
+ return await client.signAndSubmitTransaction({
1090
+ signer: account,
1091
+ transaction,
1030
1092
  });
1031
- const txn = await builder.build(
1032
- "0x3::token_transfers::cancel_offer_script",
1033
- request.type_arguments,
1034
- coder.encodeArray(request.arguments),
1035
- );
1036
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
1037
- return await client.submitSignedBCSTransaction(bcsTxn);
1038
1093
  }
1039
1094
 
1040
1095
  export async function claimScript(
1041
- client: AptosClient,
1096
+ client: Aptos,
1042
1097
  account: AptosAccount,
1043
1098
  request: {
1044
- type_arguments: [];
1045
- arguments: [Address, Address, Address, string, string, bigint];
1099
+ typeArguments: [];
1100
+ functionArguments: [
1101
+ MoveAddressType,
1102
+ MoveAddressType,
1103
+ MoveAddressType,
1104
+ string,
1105
+ string,
1106
+ bigint,
1107
+ ];
1046
1108
  },
1047
- extraArgs?: OptionalTransactionArgs,
1048
- ): Promise<Types.PendingTransaction> {
1049
- const coder = defaultMoveCoder(client.nodeUrl);
1050
- const builder = new TransactionBuilderRemoteABI(client, {
1051
- sender: account.address(),
1052
- ...extraArgs,
1109
+ options?: InputGenerateTransactionOptions,
1110
+ ): Promise<PendingTransactionResponse> {
1111
+ const coder = defaultMoveCoder(client.config.fullnode);
1112
+ const transaction = await client.build.simple({
1113
+ sender: account.accountAddress,
1114
+ data: {
1115
+ function: "0x3::token_transfers::claim_script",
1116
+ functionArguments: coder.encodeArray(request.functionArguments),
1117
+ typeArguments: [],
1118
+ },
1119
+ options,
1120
+ });
1121
+ return await client.signAndSubmitTransaction({
1122
+ signer: account,
1123
+ transaction,
1053
1124
  });
1054
- const txn = await builder.build(
1055
- "0x3::token_transfers::claim_script",
1056
- request.type_arguments,
1057
- coder.encodeArray(request.arguments),
1058
- );
1059
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
1060
- return await client.submitSignedBCSTransaction(bcsTxn);
1061
1125
  }
1062
1126
 
1063
1127
  export async function offerScript(
1064
- client: AptosClient,
1128
+ client: Aptos,
1065
1129
  account: AptosAccount,
1066
1130
  request: {
1067
- type_arguments: [];
1068
- arguments: [Address, Address, Address, string, string, bigint, bigint];
1131
+ typeArguments: [];
1132
+ functionArguments: [
1133
+ MoveAddressType,
1134
+ MoveAddressType,
1135
+ MoveAddressType,
1136
+ string,
1137
+ string,
1138
+ bigint,
1139
+ bigint,
1140
+ ];
1069
1141
  },
1070
- extraArgs?: OptionalTransactionArgs,
1071
- ): Promise<Types.PendingTransaction> {
1072
- const coder = defaultMoveCoder(client.nodeUrl);
1073
- const builder = new TransactionBuilderRemoteABI(client, {
1074
- sender: account.address(),
1075
- ...extraArgs,
1142
+ options?: InputGenerateTransactionOptions,
1143
+ ): Promise<PendingTransactionResponse> {
1144
+ const coder = defaultMoveCoder(client.config.fullnode);
1145
+ const transaction = await client.build.simple({
1146
+ sender: account.accountAddress,
1147
+ data: {
1148
+ function: "0x3::token_transfers::offer_script",
1149
+ functionArguments: coder.encodeArray(request.functionArguments),
1150
+ typeArguments: [],
1151
+ },
1152
+ options,
1153
+ });
1154
+ return await client.signAndSubmitTransaction({
1155
+ signer: account,
1156
+ transaction,
1076
1157
  });
1077
- const txn = await builder.build(
1078
- "0x3::token_transfers::offer_script",
1079
- request.type_arguments,
1080
- coder.encodeArray(request.arguments),
1081
- );
1082
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
1083
- return await client.submitSignedBCSTransaction(bcsTxn);
1084
1158
  }
1085
1159
  }
1086
1160
  export namespace view {}
@@ -1088,7 +1162,7 @@ export namespace token_transfers {
1088
1162
 
1089
1163
  export namespace token_event_store {
1090
1164
  export interface CollectionDescriptionMutateEvent {
1091
- creator_addr: Address;
1165
+ creator_addr: MoveAddressType;
1092
1166
  collection_name: string;
1093
1167
  old_description: string;
1094
1168
  new_description: string;
@@ -1114,7 +1188,7 @@ export namespace token_event_store {
1114
1188
  }
1115
1189
 
1116
1190
  export interface CollectionMaxiumMutateEvent {
1117
- creator_addr: Address;
1191
+ creator_addr: MoveAddressType;
1118
1192
  collection_name: string;
1119
1193
  old_maximum: bigint;
1120
1194
  new_maximum: bigint;
@@ -1140,7 +1214,7 @@ export namespace token_event_store {
1140
1214
  }
1141
1215
 
1142
1216
  export interface CollectionUriMutateEvent {
1143
- creator_addr: Address;
1217
+ creator_addr: MoveAddressType;
1144
1218
  collection_name: string;
1145
1219
  old_uri: string;
1146
1220
  new_uri: string;
@@ -1166,7 +1240,7 @@ export namespace token_event_store {
1166
1240
  }
1167
1241
 
1168
1242
  export interface DefaultPropertyMutateEvent {
1169
- creator: Address;
1243
+ creator: MoveAddressType;
1170
1244
  collection: string;
1171
1245
  token: string;
1172
1246
  keys: string[];
@@ -1194,7 +1268,7 @@ export namespace token_event_store {
1194
1268
  }
1195
1269
 
1196
1270
  export interface DescriptionMutateEvent {
1197
- creator: Address;
1271
+ creator: MoveAddressType;
1198
1272
  collection: string;
1199
1273
  token: string;
1200
1274
  old_description: string;
@@ -1220,7 +1294,7 @@ export namespace token_event_store {
1220
1294
  }
1221
1295
 
1222
1296
  export interface MaxiumMutateEvent {
1223
- creator: Address;
1297
+ creator: MoveAddressType;
1224
1298
  collection: string;
1225
1299
  token: string;
1226
1300
  old_maximum: bigint;
@@ -1268,15 +1342,15 @@ export namespace token_event_store {
1268
1342
  }
1269
1343
 
1270
1344
  export interface RoyaltyMutateEvent {
1271
- creator: Address;
1345
+ creator: MoveAddressType;
1272
1346
  collection: string;
1273
1347
  token: string;
1274
1348
  old_royalty_numerator: bigint;
1275
1349
  old_royalty_denominator: bigint;
1276
- old_royalty_payee_addr: Address;
1350
+ old_royalty_payee_addr: MoveAddressType;
1277
1351
  new_royalty_numerator: bigint;
1278
1352
  new_royalty_denominator: bigint;
1279
- new_royalty_payee_addr: Address;
1353
+ new_royalty_payee_addr: MoveAddressType;
1280
1354
  }
1281
1355
 
1282
1356
  export namespace RoyaltyMutateEvent {
@@ -1323,7 +1397,7 @@ export namespace token_event_store {
1323
1397
  }
1324
1398
 
1325
1399
  export interface UriMutationEvent {
1326
- creator: Address;
1400
+ creator: MoveAddressType;
1327
1401
  collection: string;
1328
1402
  token: string;
1329
1403
  old_uri: string;