@sentio/sdk 2.29.0-rc.1 → 2.29.0-rc.2

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 (61) hide show
  1. package/lib/aptos/api.d.ts +2 -2
  2. package/lib/aptos/api.d.ts.map +1 -1
  3. package/lib/aptos/api.js +2 -2
  4. package/lib/aptos/api.js.map +1 -1
  5. package/lib/aptos/aptos-processor.d.ts +4 -3
  6. package/lib/aptos/aptos-processor.d.ts.map +1 -1
  7. package/lib/aptos/aptos-processor.js.map +1 -1
  8. package/lib/aptos/aptos-resource-processor-template.d.ts +1 -1
  9. package/lib/aptos/aptos-resource-processor-template.d.ts.map +1 -1
  10. package/lib/aptos/builtin/0x1.d.ts +431 -385
  11. package/lib/aptos/builtin/0x1.d.ts.map +1 -1
  12. package/lib/aptos/builtin/0x1.js.map +1 -1
  13. package/lib/aptos/builtin/0x3.d.ts +95 -55
  14. package/lib/aptos/builtin/0x3.d.ts.map +1 -1
  15. package/lib/aptos/builtin/0x3.js.map +1 -1
  16. package/lib/aptos/builtin/0x4.d.ts +18 -13
  17. package/lib/aptos/builtin/0x4.d.ts.map +1 -1
  18. package/lib/aptos/builtin/0x4.js.map +1 -1
  19. package/lib/aptos/codegen/codegen.js +3 -2
  20. package/lib/aptos/codegen/codegen.js.map +1 -1
  21. package/lib/aptos/codegen/types.test.js.map +1 -1
  22. package/lib/aptos/context.d.ts +6 -6
  23. package/lib/aptos/context.d.ts.map +1 -1
  24. package/lib/aptos/context.js +7 -5
  25. package/lib/aptos/context.js.map +1 -1
  26. package/lib/aptos/ext/aptos-dex.d.ts +2 -1
  27. package/lib/aptos/ext/aptos-dex.d.ts.map +1 -1
  28. package/lib/aptos/ext/aptos-dex.js.map +1 -1
  29. package/lib/aptos/ext/coin-event.d.ts +4 -4
  30. package/lib/aptos/ext/coin-event.d.ts.map +1 -1
  31. package/lib/aptos/ext/coin-event.js.map +1 -1
  32. package/lib/aptos/ext/coin-event.test.js.map +1 -1
  33. package/lib/aptos/index.d.ts +0 -1
  34. package/lib/aptos/index.d.ts.map +1 -1
  35. package/lib/aptos/index.js.map +1 -1
  36. package/lib/aptos/models.d.ts +2 -2
  37. package/lib/aptos/models.d.ts.map +1 -1
  38. package/lib/aptos/network.d.ts +3 -3
  39. package/lib/aptos/network.d.ts.map +1 -1
  40. package/lib/aptos/network.js +7 -4
  41. package/lib/aptos/network.js.map +1 -1
  42. package/lib/testing/aptos-facet.d.ts +4 -4
  43. package/lib/testing/aptos-facet.d.ts.map +1 -1
  44. package/lib/testing/aptos-facet.js.map +1 -1
  45. package/lib/tsup.config.ts +1 -2
  46. package/package.json +14 -15
  47. package/src/aptos/api.ts +3 -3
  48. package/src/aptos/aptos-processor.ts +9 -14
  49. package/src/aptos/aptos-resource-processor-template.ts +1 -1
  50. package/src/aptos/builtin/0x1.ts +444 -384
  51. package/src/aptos/builtin/0x3.ts +109 -48
  52. package/src/aptos/builtin/0x4.ts +35 -14
  53. package/src/aptos/codegen/codegen.ts +6 -3
  54. package/src/aptos/context.ts +19 -10
  55. package/src/aptos/ext/aptos-dex.ts +2 -8
  56. package/src/aptos/ext/coin-event.ts +7 -12
  57. package/src/aptos/index.ts +0 -10
  58. package/src/aptos/models.ts +3 -2
  59. package/src/aptos/network.ts +8 -6
  60. package/src/testing/aptos-facet.ts +7 -7
  61. package/src/tsup.config.ts +1 -2
@@ -9,8 +9,6 @@ import { MoveCoder, TypedEventInstance } from "@typemove/aptos";
9
9
 
10
10
  import { defaultMoveCoder } from "@sentio/sdk/aptos";
11
11
 
12
- import { Address } from "@typemove/aptos";
13
-
14
12
  import { CallFilter, MoveFetchConfig } from "@sentio/sdk/move";
15
13
  import {
16
14
  AptosBindOptions,
@@ -19,6 +17,15 @@ import {
19
17
  TypedFunctionPayload,
20
18
  AptosContext,
21
19
  } from "@sentio/sdk/aptos";
20
+ import {
21
+ Aptos,
22
+ Account as AptosAccount,
23
+ MoveAddressType,
24
+ PendingTransactionResponse,
25
+ InputGenerateTransactionOptions,
26
+ MoveStructId,
27
+ InputViewRequestData,
28
+ } from "@aptos-labs/ts-sdk";
22
29
 
23
30
  import * as _0x1 from "./0x1.js";
24
31
 
@@ -422,7 +429,7 @@ export namespace token {
422
429
  }
423
430
 
424
431
  export interface CreateCollectionEvent {
425
- creator: Address;
432
+ creator: MoveAddressType;
426
433
  collection_name: string;
427
434
  uri: string;
428
435
  description: string;
@@ -452,7 +459,7 @@ export namespace token {
452
459
  description: string;
453
460
  maximum: bigint;
454
461
  uri: string;
455
- royalty_payee_address: Address;
462
+ royalty_payee_address: MoveAddressType;
456
463
  royalty_points_denominator: bigint;
457
464
  royalty_points_numerator: bigint;
458
465
  name: string;
@@ -551,7 +558,7 @@ export namespace token {
551
558
  export interface Royalty {
552
559
  royalty_points_numerator: bigint;
553
560
  royalty_points_denominator: bigint;
554
- payee_address: Address;
561
+ payee_address: MoveAddressType;
555
562
  }
556
563
 
557
564
  export namespace Royalty {
@@ -608,7 +615,7 @@ export namespace token {
608
615
  }
609
616
 
610
617
  export interface TokenDataId {
611
- creator: Address;
618
+ creator: MoveAddressType;
612
619
  collection: string;
613
620
  name: string;
614
621
  }
@@ -694,7 +701,7 @@ export namespace token {
694
701
  }
695
702
 
696
703
  export interface WithdrawCapability {
697
- token_owner: Address;
704
+ token_owner: MoveAddressType;
698
705
  token_id: token.TokenId;
699
706
  amount: bigint;
700
707
  expiration_sec: bigint;
@@ -740,14 +747,18 @@ export namespace token {
740
747
  }
741
748
 
742
749
  export interface BurnPayload
743
- extends TypedFunctionPayload<[Address, string, string, bigint, bigint]> {
744
- arguments_decoded: [Address, string, string, bigint, bigint];
750
+ extends TypedFunctionPayload<
751
+ [MoveAddressType, string, string, bigint, bigint]
752
+ > {
753
+ arguments_decoded: [MoveAddressType, string, string, bigint, bigint];
745
754
  type_arguments: [];
746
755
  }
747
756
 
748
757
  export interface BurnByCreatorPayload
749
- extends TypedFunctionPayload<[Address, string, string, bigint, bigint]> {
750
- arguments_decoded: [Address, string, string, bigint, bigint];
758
+ extends TypedFunctionPayload<
759
+ [MoveAddressType, string, string, bigint, bigint]
760
+ > {
761
+ arguments_decoded: [MoveAddressType, string, string, bigint, bigint];
751
762
  type_arguments: [];
752
763
  }
753
764
 
@@ -766,7 +777,7 @@ export namespace token {
766
777
  bigint,
767
778
  bigint,
768
779
  string,
769
- Address,
780
+ MoveAddressType,
770
781
  bigint,
771
782
  bigint,
772
783
  Boolean[],
@@ -782,7 +793,7 @@ export namespace token {
782
793
  bigint,
783
794
  bigint,
784
795
  string,
785
- Address,
796
+ MoveAddressType,
786
797
  bigint,
787
798
  bigint,
788
799
  Boolean[],
@@ -795,9 +806,16 @@ export namespace token {
795
806
 
796
807
  export interface DirectTransferScriptPayload
797
808
  extends TypedFunctionPayload<
798
- [Address, Address, string, string, bigint, bigint]
809
+ [MoveAddressType, MoveAddressType, string, string, bigint, bigint]
799
810
  > {
800
- arguments_decoded: [Address, Address, string, string, bigint, bigint];
811
+ arguments_decoded: [
812
+ MoveAddressType,
813
+ MoveAddressType,
814
+ string,
815
+ string,
816
+ bigint,
817
+ bigint,
818
+ ];
801
819
  type_arguments: [];
802
820
  }
803
821
 
@@ -808,16 +826,16 @@ export namespace token {
808
826
  }
809
827
 
810
828
  export interface MintScriptPayload
811
- extends TypedFunctionPayload<[Address, string, string, bigint]> {
812
- arguments_decoded: [Address, string, string, bigint];
829
+ extends TypedFunctionPayload<[MoveAddressType, string, string, bigint]> {
830
+ arguments_decoded: [MoveAddressType, string, string, bigint];
813
831
  type_arguments: [];
814
832
  }
815
833
 
816
834
  export interface MutateTokenPropertiesPayload
817
835
  extends TypedFunctionPayload<
818
836
  [
819
- Address,
820
- Address,
837
+ MoveAddressType,
838
+ MoveAddressType,
821
839
  string,
822
840
  string,
823
841
  bigint,
@@ -828,8 +846,8 @@ export namespace token {
828
846
  ]
829
847
  > {
830
848
  arguments_decoded: [
831
- Address,
832
- Address,
849
+ MoveAddressType,
850
+ MoveAddressType,
833
851
  string,
834
852
  string,
835
853
  bigint,
@@ -849,9 +867,16 @@ export namespace token {
849
867
 
850
868
  export interface TransferWithOptInPayload
851
869
  extends TypedFunctionPayload<
852
- [Address, string, string, bigint, Address, bigint]
870
+ [MoveAddressType, string, string, bigint, MoveAddressType, bigint]
853
871
  > {
854
- arguments_decoded: [Address, string, string, bigint, Address, bigint];
872
+ arguments_decoded: [
873
+ MoveAddressType,
874
+ string,
875
+ string,
876
+ bigint,
877
+ MoveAddressType,
878
+ bigint,
879
+ ];
855
880
  type_arguments: [];
856
881
  }
857
882
  }
@@ -1124,7 +1149,7 @@ export namespace token_coin_swap {
1124
1149
 
1125
1150
  export interface TokenSwapEvent {
1126
1151
  token_id: token.TokenId;
1127
- token_buyer: Address;
1152
+ token_buyer: MoveAddressType;
1128
1153
  token_amount: bigint;
1129
1154
  coin_amount: bigint;
1130
1155
  coin_type_info: _0x1.type_info.TypeInfo;
@@ -1148,10 +1173,10 @@ export namespace token_coin_swap {
1148
1173
 
1149
1174
  export interface ListTokenForSwapPayload<T0 = any>
1150
1175
  extends TypedFunctionPayload<
1151
- [Address, string, string, bigint, bigint, bigint, bigint]
1176
+ [MoveAddressType, string, string, bigint, bigint, bigint, bigint]
1152
1177
  > {
1153
1178
  arguments_decoded: [
1154
- Address,
1179
+ MoveAddressType,
1155
1180
  string,
1156
1181
  string,
1157
1182
  bigint,
@@ -1310,7 +1335,7 @@ export namespace token_transfers {
1310
1335
  }
1311
1336
 
1312
1337
  export interface TokenCancelOfferEvent {
1313
- to_address: Address;
1338
+ to_address: MoveAddressType;
1314
1339
  token_id: token.TokenId;
1315
1340
  amount: bigint;
1316
1341
  }
@@ -1334,7 +1359,7 @@ export namespace token_transfers {
1334
1359
  }
1335
1360
 
1336
1361
  export interface TokenClaimEvent {
1337
- to_address: Address;
1362
+ to_address: MoveAddressType;
1338
1363
  token_id: token.TokenId;
1339
1364
  amount: bigint;
1340
1365
  }
@@ -1358,7 +1383,7 @@ export namespace token_transfers {
1358
1383
  }
1359
1384
 
1360
1385
  export interface TokenOfferEvent {
1361
- to_address: Address;
1386
+ to_address: MoveAddressType;
1362
1387
  token_id: token.TokenId;
1363
1388
  amount: bigint;
1364
1389
  }
@@ -1382,7 +1407,7 @@ export namespace token_transfers {
1382
1407
  }
1383
1408
 
1384
1409
  export interface TokenOfferId {
1385
- to_addr: Address;
1410
+ to_addr: MoveAddressType;
1386
1411
  token_id: token.TokenId;
1387
1412
  }
1388
1413
 
@@ -1404,28 +1429,64 @@ export namespace token_transfers {
1404
1429
 
1405
1430
  export interface CancelOfferScriptPayload
1406
1431
  extends TypedFunctionPayload<
1407
- [Address, Address, Address, string, string, bigint]
1432
+ [
1433
+ MoveAddressType,
1434
+ MoveAddressType,
1435
+ MoveAddressType,
1436
+ string,
1437
+ string,
1438
+ bigint,
1439
+ ]
1408
1440
  > {
1409
- arguments_decoded: [Address, Address, Address, string, string, bigint];
1441
+ arguments_decoded: [
1442
+ MoveAddressType,
1443
+ MoveAddressType,
1444
+ MoveAddressType,
1445
+ string,
1446
+ string,
1447
+ bigint,
1448
+ ];
1410
1449
  type_arguments: [];
1411
1450
  }
1412
1451
 
1413
1452
  export interface ClaimScriptPayload
1414
1453
  extends TypedFunctionPayload<
1415
- [Address, Address, Address, string, string, bigint]
1454
+ [
1455
+ MoveAddressType,
1456
+ MoveAddressType,
1457
+ MoveAddressType,
1458
+ string,
1459
+ string,
1460
+ bigint,
1461
+ ]
1416
1462
  > {
1417
- arguments_decoded: [Address, Address, Address, string, string, bigint];
1463
+ arguments_decoded: [
1464
+ MoveAddressType,
1465
+ MoveAddressType,
1466
+ MoveAddressType,
1467
+ string,
1468
+ string,
1469
+ bigint,
1470
+ ];
1418
1471
  type_arguments: [];
1419
1472
  }
1420
1473
 
1421
1474
  export interface OfferScriptPayload
1422
1475
  extends TypedFunctionPayload<
1423
- [Address, Address, Address, string, string, bigint, bigint]
1476
+ [
1477
+ MoveAddressType,
1478
+ MoveAddressType,
1479
+ MoveAddressType,
1480
+ string,
1481
+ string,
1482
+ bigint,
1483
+ bigint,
1484
+ ]
1424
1485
  > {
1425
1486
  arguments_decoded: [
1426
- Address,
1427
- Address,
1428
- Address,
1487
+ MoveAddressType,
1488
+ MoveAddressType,
1489
+ MoveAddressType,
1429
1490
  string,
1430
1491
  string,
1431
1492
  bigint,
@@ -1589,7 +1650,7 @@ export class token_event_store extends AptosBaseProcessor {
1589
1650
 
1590
1651
  export namespace token_event_store {
1591
1652
  export interface CollectionDescriptionMutateEvent {
1592
- creator_addr: Address;
1653
+ creator_addr: MoveAddressType;
1593
1654
  collection_name: string;
1594
1655
  old_description: string;
1595
1656
  new_description: string;
@@ -1615,7 +1676,7 @@ export namespace token_event_store {
1615
1676
  }
1616
1677
 
1617
1678
  export interface CollectionMaxiumMutateEvent {
1618
- creator_addr: Address;
1679
+ creator_addr: MoveAddressType;
1619
1680
  collection_name: string;
1620
1681
  old_maximum: bigint;
1621
1682
  new_maximum: bigint;
@@ -1641,7 +1702,7 @@ export namespace token_event_store {
1641
1702
  }
1642
1703
 
1643
1704
  export interface CollectionUriMutateEvent {
1644
- creator_addr: Address;
1705
+ creator_addr: MoveAddressType;
1645
1706
  collection_name: string;
1646
1707
  old_uri: string;
1647
1708
  new_uri: string;
@@ -1667,7 +1728,7 @@ export namespace token_event_store {
1667
1728
  }
1668
1729
 
1669
1730
  export interface DefaultPropertyMutateEvent {
1670
- creator: Address;
1731
+ creator: MoveAddressType;
1671
1732
  collection: string;
1672
1733
  token: string;
1673
1734
  keys: string[];
@@ -1695,7 +1756,7 @@ export namespace token_event_store {
1695
1756
  }
1696
1757
 
1697
1758
  export interface DescriptionMutateEvent {
1698
- creator: Address;
1759
+ creator: MoveAddressType;
1699
1760
  collection: string;
1700
1761
  token: string;
1701
1762
  old_description: string;
@@ -1721,7 +1782,7 @@ export namespace token_event_store {
1721
1782
  }
1722
1783
 
1723
1784
  export interface MaxiumMutateEvent {
1724
- creator: Address;
1785
+ creator: MoveAddressType;
1725
1786
  collection: string;
1726
1787
  token: string;
1727
1788
  old_maximum: bigint;
@@ -1769,15 +1830,15 @@ export namespace token_event_store {
1769
1830
  }
1770
1831
 
1771
1832
  export interface RoyaltyMutateEvent {
1772
- creator: Address;
1833
+ creator: MoveAddressType;
1773
1834
  collection: string;
1774
1835
  token: string;
1775
1836
  old_royalty_numerator: bigint;
1776
1837
  old_royalty_denominator: bigint;
1777
- old_royalty_payee_addr: Address;
1838
+ old_royalty_payee_addr: MoveAddressType;
1778
1839
  new_royalty_numerator: bigint;
1779
1840
  new_royalty_denominator: bigint;
1780
- new_royalty_payee_addr: Address;
1841
+ new_royalty_payee_addr: MoveAddressType;
1781
1842
  }
1782
1843
 
1783
1844
  export namespace RoyaltyMutateEvent {
@@ -1824,7 +1885,7 @@ export namespace token_event_store {
1824
1885
  }
1825
1886
 
1826
1887
  export interface UriMutationEvent {
1827
- creator: Address;
1888
+ creator: MoveAddressType;
1828
1889
  collection: string;
1829
1890
  token: string;
1830
1891
  old_uri: string;
@@ -9,8 +9,6 @@ import { MoveCoder, TypedEventInstance } from "@typemove/aptos";
9
9
 
10
10
  import { defaultMoveCoder } from "@sentio/sdk/aptos";
11
11
 
12
- import { Address } from "@typemove/aptos";
13
-
14
12
  import { CallFilter, MoveFetchConfig } from "@sentio/sdk/move";
15
13
  import {
16
14
  AptosBindOptions,
@@ -19,6 +17,15 @@ import {
19
17
  TypedFunctionPayload,
20
18
  AptosContext,
21
19
  } from "@sentio/sdk/aptos";
20
+ import {
21
+ Aptos,
22
+ Account as AptosAccount,
23
+ MoveAddressType,
24
+ PendingTransactionResponse,
25
+ InputGenerateTransactionOptions,
26
+ MoveStructId,
27
+ InputViewRequestData,
28
+ } from "@aptos-labs/ts-sdk";
22
29
 
23
30
  import * as _0x1 from "./0x1.js";
24
31
 
@@ -63,7 +70,7 @@ export class token extends AptosBaseProcessor {
63
70
  export namespace token {
64
71
  export interface BurnRef {
65
72
  inner: _0x1.option.Option<_0x1.object_.DeleteRef>;
66
- self: _0x1.option.Option<Address>;
73
+ self: _0x1.option.Option<MoveAddressType>;
67
74
  }
68
75
 
69
76
  export namespace BurnRef {
@@ -104,7 +111,7 @@ export namespace token {
104
111
  }
105
112
 
106
113
  export interface MutatorRef {
107
- self: Address;
114
+ self: MoveAddressType;
108
115
  }
109
116
 
110
117
  export namespace MutatorRef {
@@ -187,7 +194,7 @@ export namespace royalty {
187
194
  export interface Royalty {
188
195
  numerator: bigint;
189
196
  denominator: bigint;
190
- payee_address: Address;
197
+ payee_address: MoveAddressType;
191
198
  }
192
199
 
193
200
  export namespace Royalty {
@@ -250,7 +257,7 @@ export class collection extends AptosBaseProcessor {
250
257
  export namespace collection {
251
258
  export interface BurnEvent {
252
259
  index: bigint;
253
- token: Address;
260
+ token: MoveAddressType;
254
261
  }
255
262
 
256
263
  export namespace BurnEvent {
@@ -269,7 +276,7 @@ export namespace collection {
269
276
  }
270
277
 
271
278
  export interface Collection {
272
- creator: Address;
279
+ creator: MoveAddressType;
273
280
  description: string;
274
281
  name: string;
275
282
  uri: string;
@@ -306,7 +313,7 @@ export namespace collection {
306
313
 
307
314
  export interface MintEvent {
308
315
  index: bigint;
309
- token: Address;
316
+ token: MoveAddressType;
310
317
  }
311
318
 
312
319
  export namespace MintEvent {
@@ -345,7 +352,7 @@ export namespace collection {
345
352
  }
346
353
 
347
354
  export interface MutatorRef {
348
- self: Address;
355
+ self: MoveAddressType;
349
356
  }
350
357
 
351
358
  export namespace MutatorRef {
@@ -817,7 +824,16 @@ export namespace aptos_token {
817
824
 
818
825
  export interface MintSoulBoundPayload
819
826
  extends TypedFunctionPayload<
820
- [string, string, string, string, string[], string[], string[], Address]
827
+ [
828
+ string,
829
+ string,
830
+ string,
831
+ string,
832
+ string[],
833
+ string[],
834
+ string[],
835
+ MoveAddressType,
836
+ ]
821
837
  > {
822
838
  arguments_decoded: [
823
839
  string,
@@ -827,7 +843,7 @@ export namespace aptos_token {
827
843
  string[],
828
844
  string[],
829
845
  string[],
830
- Address,
846
+ MoveAddressType,
831
847
  ];
832
848
  type_arguments: [];
833
849
  }
@@ -846,9 +862,14 @@ export namespace aptos_token {
846
862
 
847
863
  export interface SetCollectionRoyaltiesCallPayload<T0 = any>
848
864
  extends TypedFunctionPayload<
849
- [_0x1.object_.Object<T0>, bigint, bigint, Address]
865
+ [_0x1.object_.Object<T0>, bigint, bigint, MoveAddressType]
850
866
  > {
851
- arguments_decoded: [_0x1.object_.Object<T0>, bigint, bigint, Address];
867
+ arguments_decoded: [
868
+ _0x1.object_.Object<T0>,
869
+ bigint,
870
+ bigint,
871
+ MoveAddressType,
872
+ ];
852
873
  type_arguments: [string];
853
874
  }
854
875
 
@@ -936,7 +957,7 @@ export class property_map extends AptosBaseProcessor {
936
957
 
937
958
  export namespace property_map {
938
959
  export interface MutatorRef {
939
- self: Address;
960
+ self: MoveAddressType;
940
961
  }
941
962
 
942
963
  export namespace MutatorRef {
@@ -4,7 +4,7 @@ import path, { join } from 'path'
4
4
  import { AptosCodegen as BaseAptosCodegen } from '@typemove/aptos/codegen'
5
5
  import { InternalMoveModule, InternalMoveStruct } from '@typemove/move'
6
6
  import { AptosNetwork, getRpcEndpoint } from '../network.js'
7
- import { MoveModuleBytecode, MoveResource } from '@typemove/aptos'
7
+ import { MoveModuleBytecode, MoveResource, Event } from '@aptos-labs/ts-sdk'
8
8
  import { SharedNetworkCodegen } from '../../move/shared-network-codegen.js'
9
9
 
10
10
  export async function codegen(
@@ -32,7 +32,7 @@ class AptosNetworkCodegen extends BaseAptosCodegen {
32
32
  MoveModuleBytecode,
33
33
  Event | MoveResource
34
34
  > {
35
- ADDRESS_TYPE = 'Address'
35
+ ADDRESS_TYPE = 'MoveAddressType'
36
36
  PREFIX = 'Aptos'
37
37
  SYSTEM_PACKAGE = '@typemove/aptos'
38
38
 
@@ -51,7 +51,10 @@ class AptosNetworkCodegen extends BaseAptosCodegen {
51
51
  return this.moduleGenerator.generateModule(module, allEventStructs)
52
52
  }
53
53
  generateImports() {
54
- return this.moduleGenerator.generateImports()
54
+ return (
55
+ this.moduleGenerator.generateImports() +
56
+ `import { Aptos, Account as AptosAccount, MoveAddressType, PendingTransactionResponse, InputGenerateTransactionOptions, MoveStructId, InputViewRequestData } from '@aptos-labs/ts-sdk'`
57
+ )
55
58
  }
56
59
  generateLoadAll(isSystem: boolean): string {
57
60
  return this.moduleGenerator.generateLoadAll(isSystem)
@@ -1,17 +1,24 @@
1
1
  import { RecordMetaData } from '@sentio/protos'
2
2
  import { type Labels, normalizeLabels } from '@sentio/sdk'
3
- import { Event, MoveModuleBytecode, MoveResource, Transaction_UserTransaction, MoveCoder } from '@sentio/sdk/aptos'
3
+ import { MoveCoder } from '@sentio/sdk/aptos'
4
+ import {
5
+ Aptos,
6
+ Event,
7
+ MoveResource,
8
+ UserTransactionResponse,
9
+ MoveModuleBytecode,
10
+ AptosConfig
11
+ } from '@aptos-labs/ts-sdk'
4
12
  import { defaultMoveCoder } from './move-coder.js'
5
13
  import { AptosNetwork } from './network.js'
6
14
  import { Endpoints } from '@sentio/runtime'
7
15
  import { ServerError, Status } from 'nice-grpc'
8
- import { AptosClient } from 'aptos-sdk'
9
16
  import { MoveAccountContext, MoveContext } from '../move/index.js'
10
17
 
11
18
  export class AptosContext extends MoveContext<AptosNetwork, MoveModuleBytecode, Event | MoveResource> {
12
19
  moduleName: string
13
20
  version: bigint
14
- transaction: Transaction_UserTransaction
21
+ transaction: UserTransactionResponse
15
22
  eventIndex: number
16
23
  coder: MoveCoder
17
24
 
@@ -20,7 +27,7 @@ export class AptosContext extends MoveContext<AptosNetwork, MoveModuleBytecode,
20
27
  network: AptosNetwork,
21
28
  address: string,
22
29
  version: bigint,
23
- transaction: Transaction_UserTransaction,
30
+ transaction: UserTransactionResponse,
24
31
  eventIndex: number,
25
32
  baseLabels: Labels | undefined
26
33
  ) {
@@ -58,12 +65,13 @@ export class AptosContext extends MoveContext<AptosNetwork, MoveModuleBytecode,
58
65
  }
59
66
  }
60
67
 
61
- getClient(): AptosClient {
62
- const chainServer = Endpoints.INSTANCE.chainServer.get(this.network)
68
+ getClient(): Aptos {
69
+ let chainServer = Endpoints.INSTANCE.chainServer.get(this.network)
63
70
  if (!chainServer) {
64
71
  throw new ServerError(Status.INTERNAL, 'RPC endpoint not provided')
65
72
  }
66
- return new AptosClient(chainServer)
73
+ chainServer = chainServer + '/v1'
74
+ return new Aptos(new AptosConfig({ fullnode: chainServer }))
67
75
  }
68
76
  }
69
77
 
@@ -103,11 +111,12 @@ export class AptosResourcesContext extends MoveAccountContext<AptosNetwork, Move
103
111
  }
104
112
  }
105
113
 
106
- getClient(): AptosClient {
107
- const chainServer = Endpoints.INSTANCE.chainServer.get(this.network)
114
+ getClient(): Aptos {
115
+ let chainServer = Endpoints.INSTANCE.chainServer.get(this.network)
108
116
  if (!chainServer) {
109
117
  throw new ServerError(Status.INTERNAL, 'RPC endpoint not provided')
110
118
  }
111
- return new AptosClient(chainServer)
119
+ chainServer = chainServer + '/v1'
120
+ return new Aptos(new AptosConfig({ fullnode: chainServer }))
112
121
  }
113
122
  }
@@ -1,14 +1,8 @@
1
1
  import { BigDecimal } from '@sentio/bigdecimal'
2
2
  import { calculateValueInUsd, getCoinInfo, whitelistCoins, whiteListed } from './coin.js'
3
- import {
4
- AptosResourcesContext,
5
- MoveResource,
6
- AptosContext,
7
- AptosNetwork,
8
- MoveModuleBytecode,
9
- Event
10
- } from '@sentio/sdk/aptos'
3
+ import { AptosResourcesContext, AptosContext, AptosNetwork } from '@sentio/sdk/aptos'
11
4
  import { MoveCoinList, MoveDex, moveGetPairValue, MovePoolAdaptor, SimpleCoinInfo } from '../../move/ext/index.js'
5
+ import { MoveResource, Event, MoveModuleBytecode } from '@aptos-labs/ts-sdk'
12
6
 
13
7
  export type PoolAdaptor<T> = MovePoolAdaptor<MoveResource, T>
14
8
 
@@ -1,13 +1,8 @@
1
- import { Event, Transaction_UserTransaction } from '@sentio/sdk/aptos'
2
- import { Types } from 'aptos-sdk' // TODO just use aptos without break test
1
+ import { Event, UserTransactionResponse, WriteSetChangeWriteResource } from '@aptos-labs/ts-sdk'
3
2
  import { coin } from '../builtin/0x1.js'
4
3
  import { parseMoveType } from '../../move/index.js'
5
4
 
6
- export function findNewCoinBalances(
7
- evt: Event,
8
- tx: Transaction_UserTransaction,
9
- coin: string
10
- ): coin.Coin<any> | undefined {
5
+ export function findNewCoinBalances(evt: Event, tx: UserTransactionResponse, coin: string): coin.Coin<any> | undefined {
11
6
  if (!tx.changes) {
12
7
  throw Error('No resource change found, did you forget set fetchOption to { resourceChanges: true } ')
13
8
  }
@@ -15,7 +10,7 @@ export function findNewCoinBalances(
15
10
  if (change.type !== 'write_resource') {
16
11
  continue
17
12
  }
18
- const writeResource = change as Types.WriteSetChange_WriteResource
13
+ const writeResource = change as WriteSetChangeWriteResource
19
14
  if (writeResource.address !== evt.guid.account_address) {
20
15
  continue
21
16
  }
@@ -40,7 +35,7 @@ interface EventHandlerState {
40
35
  }
41
36
 
42
37
  // TODO event handler name could be auto located from ABI
43
- function findResourceChangeType(evt: Event, tx: Transaction_UserTransaction, eventHandlerName: string) {
38
+ function findResourceChangeType(evt: Event, tx: UserTransactionResponse, eventHandlerName: string) {
44
39
  if (!tx.changes) {
45
40
  throw Error('No resource change found, did you forget set fetchOption to { resourceChanges: true } ')
46
41
  }
@@ -50,7 +45,7 @@ function findResourceChangeType(evt: Event, tx: Transaction_UserTransaction, eve
50
45
  continue
51
46
  }
52
47
 
53
- const writeResource = change as Types.WriteSetChange_WriteResource
48
+ const writeResource = change as WriteSetChangeWriteResource
54
49
  if (writeResource.address !== evt.guid.account_address) {
55
50
  continue
56
51
  }
@@ -72,12 +67,12 @@ function findResourceChangeType(evt: Event, tx: Transaction_UserTransaction, eve
72
67
  throw Error(errStr)
73
68
  }
74
69
 
75
- export function getDepositCoinType(evt: Event, tx: Transaction_UserTransaction) {
70
+ export function getDepositCoinType(evt: Event, tx: UserTransactionResponse) {
76
71
  const coinStore = findResourceChangeType(evt, tx, 'deposit_events')
77
72
  return parseMoveType(coinStore).typeArgs[0].getSignature()
78
73
  }
79
74
 
80
- export function getWithDrawCoinType(evt: Event, tx: Transaction_UserTransaction) {
75
+ export function getWithDrawCoinType(evt: Event, tx: UserTransactionResponse) {
81
76
  const coinStore = findResourceChangeType(evt, tx, 'withdraw_events')
82
77
  return parseMoveType(coinStore).typeArgs[0].getSignature()
83
78
  }