@thalalabs/surf 0.0.12 → 0.0.14

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 (105) hide show
  1. package/.changeset/README.md +1 -1
  2. package/.github/dependabot.yml +3 -3
  3. package/.github/workflows/publish.yml +2 -2
  4. package/CHANGELOG.md +12 -0
  5. package/README.md +22 -11
  6. package/build/cjs/abi/aggregator.js +56 -74
  7. package/build/cjs/abi/aggregator.js.map +1 -1
  8. package/build/cjs/abi/aptos_coin.js +98 -125
  9. package/build/cjs/abi/aptos_coin.js.map +1 -1
  10. package/build/cjs/abi/coin.js +456 -587
  11. package/build/cjs/abi/coin.js.map +1 -1
  12. package/build/cjs/abi/event.js +66 -106
  13. package/build/cjs/abi/event.js.map +1 -1
  14. package/build/cjs/abi/fixed_point64.js +287 -320
  15. package/build/cjs/abi/fixed_point64.js.map +1 -1
  16. package/build/cjs/abi/guid.js +84 -129
  17. package/build/cjs/abi/guid.js.map +1 -1
  18. package/build/cjs/abi/optional_aggregator.js +79 -108
  19. package/build/cjs/abi/optional_aggregator.js.map +1 -1
  20. package/build/cjs/abi/table.js +131 -222
  21. package/build/cjs/abi/table.js.map +1 -1
  22. package/build/cjs/core/Client.js +6 -2
  23. package/build/cjs/core/Client.js.map +1 -1
  24. package/build/cjs/core/createEntryPayload.js.map +1 -1
  25. package/build/cjs/core/index.js +1 -3
  26. package/build/cjs/core/index.js.map +1 -1
  27. package/build/cjs/ensureTypes.js +11 -10
  28. package/build/cjs/ensureTypes.js.map +1 -1
  29. package/build/cjs/hooks/useWalletClient.js +2 -2
  30. package/build/cjs/hooks/useWalletClient.js.map +1 -1
  31. package/build/cjs/index.js.map +1 -1
  32. package/build/esm/abi/aggregator.js +56 -74
  33. package/build/esm/abi/aggregator.js.map +1 -1
  34. package/build/esm/abi/aptos_coin.js +98 -125
  35. package/build/esm/abi/aptos_coin.js.map +1 -1
  36. package/build/esm/abi/coin.js +456 -587
  37. package/build/esm/abi/coin.js.map +1 -1
  38. package/build/esm/abi/event.js +66 -106
  39. package/build/esm/abi/event.js.map +1 -1
  40. package/build/esm/abi/fixed_point64.js +287 -320
  41. package/build/esm/abi/fixed_point64.js.map +1 -1
  42. package/build/esm/abi/guid.js +84 -129
  43. package/build/esm/abi/guid.js.map +1 -1
  44. package/build/esm/abi/optional_aggregator.js +79 -108
  45. package/build/esm/abi/optional_aggregator.js.map +1 -1
  46. package/build/esm/abi/table.js +131 -222
  47. package/build/esm/abi/table.js.map +1 -1
  48. package/build/esm/core/Client.js +6 -2
  49. package/build/esm/core/Client.js.map +1 -1
  50. package/build/esm/core/createEntryPayload.js.map +1 -1
  51. package/build/esm/core/index.js +0 -1
  52. package/build/esm/core/index.js.map +1 -1
  53. package/build/esm/ensureTypes.js +11 -10
  54. package/build/esm/ensureTypes.js.map +1 -1
  55. package/build/esm/hooks/useWalletClient.js +2 -2
  56. package/build/esm/hooks/useWalletClient.js.map +1 -1
  57. package/build/esm/index.js +1 -1
  58. package/build/esm/index.js.map +1 -1
  59. package/build/types/abi/aggregator.d.ts.map +1 -1
  60. package/build/types/abi/aptos_coin.d.ts.map +1 -1
  61. package/build/types/abi/coin.d.ts.map +1 -1
  62. package/build/types/abi/event.d.ts.map +1 -1
  63. package/build/types/abi/fixed_point64.d.ts.map +1 -1
  64. package/build/types/abi/guid.d.ts.map +1 -1
  65. package/build/types/abi/optional_aggregator.d.ts.map +1 -1
  66. package/build/types/abi/table.d.ts.map +1 -1
  67. package/build/types/core/Client.d.ts.map +1 -1
  68. package/build/types/core/index.d.ts +0 -1
  69. package/build/types/core/index.d.ts.map +1 -1
  70. package/build/types/ensureTypes.d.ts.map +1 -1
  71. package/build/types/hooks/useWalletClient.d.ts +2 -2
  72. package/build/types/hooks/useWalletClient.d.ts.map +1 -1
  73. package/build/types/index.d.ts +2 -2
  74. package/build/types/index.d.ts.map +1 -1
  75. package/build/types/types/client/abiClient.d.ts +2 -0
  76. package/build/types/types/client/abiClient.d.ts.map +1 -1
  77. package/build/types/types/convertor/argsConvertor.d.ts +1 -1
  78. package/build/types/types/convertor/argsConvertor.d.ts.map +1 -1
  79. package/build/types/types/convertor/structConvertor.d.ts.map +1 -1
  80. package/build/types/types/moveTypes.d.ts.map +1 -1
  81. package/package.json +4 -4
  82. package/src/abi/aggregator.ts +73 -91
  83. package/src/abi/aptos_coin.ts +117 -144
  84. package/src/abi/coin.ts +646 -777
  85. package/src/abi/event.ts +83 -123
  86. package/src/abi/fixed_point64.ts +340 -373
  87. package/src/abi/guid.ts +102 -147
  88. package/src/abi/optional_aggregator.ts +103 -132
  89. package/src/abi/table.ts +181 -272
  90. package/src/core/Client.ts +6 -1
  91. package/src/core/__tests__/accountResource.test.ts +54 -14
  92. package/src/core/__tests__/createEntryPayload.test.ts +244 -250
  93. package/src/core/__tests__/createViewPayload.test.ts +44 -58
  94. package/src/core/__tests__/option.test.ts +1 -1
  95. package/src/core/__tests__/useABI.test.ts +72 -63
  96. package/src/core/__tests__/view.test.ts +76 -60
  97. package/src/core/createEntryPayload.ts +4 -3
  98. package/src/core/index.ts +0 -1
  99. package/src/ensureTypes.ts +31 -28
  100. package/src/hooks/useWalletClient.ts +2 -2
  101. package/src/index.ts +8 -8
  102. package/src/types/client/abiClient.ts +2 -0
  103. package/src/types/convertor/argsConvertor.ts +1 -1
  104. package/src/types/convertor/structConvertor.ts +16 -15
  105. package/src/types/moveTypes.ts +5 -1
package/src/abi/guid.ts CHANGED
@@ -1,154 +1,109 @@
1
1
  export const GUID_ABI = {
2
- "address": "0x1",
3
- "name": "guid",
4
- "friends": [
5
- "0x1::account",
6
- "0x1::object"
7
- ],
8
- "exposed_functions": [
2
+ address: '0x1',
3
+ name: 'guid',
4
+ friends: ['0x1::account', '0x1::object'],
5
+ exposed_functions: [
6
+ {
7
+ name: 'create',
8
+ visibility: 'friend',
9
+ is_entry: false,
10
+ is_view: false,
11
+ generic_type_params: [],
12
+ params: ['address', '&mut u64'],
13
+ return: ['0x1::guid::GUID'],
14
+ },
15
+ {
16
+ name: 'create_id',
17
+ visibility: 'public',
18
+ is_entry: false,
19
+ is_view: false,
20
+ generic_type_params: [],
21
+ params: ['address', 'u64'],
22
+ return: ['0x1::guid::ID'],
23
+ },
24
+ {
25
+ name: 'creation_num',
26
+ visibility: 'public',
27
+ is_entry: false,
28
+ is_view: false,
29
+ generic_type_params: [],
30
+ params: ['&0x1::guid::GUID'],
31
+ return: ['u64'],
32
+ },
33
+ {
34
+ name: 'creator_address',
35
+ visibility: 'public',
36
+ is_entry: false,
37
+ is_view: false,
38
+ generic_type_params: [],
39
+ params: ['&0x1::guid::GUID'],
40
+ return: ['address'],
41
+ },
42
+ {
43
+ name: 'eq_id',
44
+ visibility: 'public',
45
+ is_entry: false,
46
+ is_view: false,
47
+ generic_type_params: [],
48
+ params: ['&0x1::guid::GUID', '&0x1::guid::ID'],
49
+ return: ['bool'],
50
+ },
51
+ {
52
+ name: 'id',
53
+ visibility: 'public',
54
+ is_entry: false,
55
+ is_view: false,
56
+ generic_type_params: [],
57
+ params: ['&0x1::guid::GUID'],
58
+ return: ['0x1::guid::ID'],
59
+ },
60
+ {
61
+ name: 'id_creation_num',
62
+ visibility: 'public',
63
+ is_entry: false,
64
+ is_view: false,
65
+ generic_type_params: [],
66
+ params: ['&0x1::guid::ID'],
67
+ return: ['u64'],
68
+ },
69
+ {
70
+ name: 'id_creator_address',
71
+ visibility: 'public',
72
+ is_entry: false,
73
+ is_view: false,
74
+ generic_type_params: [],
75
+ params: ['&0x1::guid::ID'],
76
+ return: ['address'],
77
+ },
78
+ ],
79
+ structs: [
80
+ {
81
+ name: 'GUID',
82
+ is_native: false,
83
+ abilities: ['drop', 'store'],
84
+ generic_type_params: [],
85
+ fields: [
9
86
  {
10
- "name": "create",
11
- "visibility": "friend",
12
- "is_entry": false,
13
- "is_view": false,
14
- "generic_type_params": [],
15
- "params": [
16
- "address",
17
- "&mut u64"
18
- ],
19
- "return": [
20
- "0x1::guid::GUID"
21
- ]
87
+ name: 'id',
88
+ type: '0x1::guid::ID',
22
89
  },
90
+ ],
91
+ },
92
+ {
93
+ name: 'ID',
94
+ is_native: false,
95
+ abilities: ['copy', 'drop', 'store'],
96
+ generic_type_params: [],
97
+ fields: [
23
98
  {
24
- "name": "create_id",
25
- "visibility": "public",
26
- "is_entry": false,
27
- "is_view": false,
28
- "generic_type_params": [],
29
- "params": [
30
- "address",
31
- "u64"
32
- ],
33
- "return": [
34
- "0x1::guid::ID"
35
- ]
99
+ name: 'creation_num',
100
+ type: 'u64',
36
101
  },
37
102
  {
38
- "name": "creation_num",
39
- "visibility": "public",
40
- "is_entry": false,
41
- "is_view": false,
42
- "generic_type_params": [],
43
- "params": [
44
- "&0x1::guid::GUID"
45
- ],
46
- "return": [
47
- "u64"
48
- ]
103
+ name: 'addr',
104
+ type: 'address',
49
105
  },
50
- {
51
- "name": "creator_address",
52
- "visibility": "public",
53
- "is_entry": false,
54
- "is_view": false,
55
- "generic_type_params": [],
56
- "params": [
57
- "&0x1::guid::GUID"
58
- ],
59
- "return": [
60
- "address"
61
- ]
62
- },
63
- {
64
- "name": "eq_id",
65
- "visibility": "public",
66
- "is_entry": false,
67
- "is_view": false,
68
- "generic_type_params": [],
69
- "params": [
70
- "&0x1::guid::GUID",
71
- "&0x1::guid::ID"
72
- ],
73
- "return": [
74
- "bool"
75
- ]
76
- },
77
- {
78
- "name": "id",
79
- "visibility": "public",
80
- "is_entry": false,
81
- "is_view": false,
82
- "generic_type_params": [],
83
- "params": [
84
- "&0x1::guid::GUID"
85
- ],
86
- "return": [
87
- "0x1::guid::ID"
88
- ]
89
- },
90
- {
91
- "name": "id_creation_num",
92
- "visibility": "public",
93
- "is_entry": false,
94
- "is_view": false,
95
- "generic_type_params": [],
96
- "params": [
97
- "&0x1::guid::ID"
98
- ],
99
- "return": [
100
- "u64"
101
- ]
102
- },
103
- {
104
- "name": "id_creator_address",
105
- "visibility": "public",
106
- "is_entry": false,
107
- "is_view": false,
108
- "generic_type_params": [],
109
- "params": [
110
- "&0x1::guid::ID"
111
- ],
112
- "return": [
113
- "address"
114
- ]
115
- }
116
- ],
117
- "structs": [
118
- {
119
- "name": "GUID",
120
- "is_native": false,
121
- "abilities": [
122
- "drop",
123
- "store"
124
- ],
125
- "generic_type_params": [],
126
- "fields": [
127
- {
128
- "name": "id",
129
- "type": "0x1::guid::ID"
130
- }
131
- ]
132
- },
133
- {
134
- "name": "ID",
135
- "is_native": false,
136
- "abilities": [
137
- "copy",
138
- "drop",
139
- "store"
140
- ],
141
- "generic_type_params": [],
142
- "fields": [
143
- {
144
- "name": "creation_num",
145
- "type": "u64"
146
- },
147
- {
148
- "name": "addr",
149
- "type": "address"
150
- }
151
- ]
152
- }
153
- ]
154
- } as const;
106
+ ],
107
+ },
108
+ ],
109
+ } as const;
@@ -1,133 +1,104 @@
1
1
  export const OPTIONAL_AGGREGATOR_ABI = {
2
- "address": "0x1",
3
- "name": "optional_aggregator",
4
- "friends": [
5
- "0x1::coin"
6
- ],
7
- "exposed_functions": [
8
- {
9
- "name": "add",
10
- "visibility": "public",
11
- "is_entry": false,
12
- "is_view": false,
13
- "generic_type_params": [],
14
- "params": [
15
- "&mut 0x1::optional_aggregator::OptionalAggregator",
16
- "u128"
17
- ],
18
- "return": []
19
- },
20
- {
21
- "name": "destroy",
22
- "visibility": "public",
23
- "is_entry": false,
24
- "is_view": false,
25
- "generic_type_params": [],
26
- "params": [
27
- "0x1::optional_aggregator::OptionalAggregator"
28
- ],
29
- "return": []
30
- },
31
- {
32
- "name": "is_parallelizable",
33
- "visibility": "public",
34
- "is_entry": false,
35
- "is_view": false,
36
- "generic_type_params": [],
37
- "params": [
38
- "&0x1::optional_aggregator::OptionalAggregator"
39
- ],
40
- "return": [
41
- "bool"
42
- ]
43
- },
44
- {
45
- "name": "new",
46
- "visibility": "friend",
47
- "is_entry": false,
48
- "is_view": false,
49
- "generic_type_params": [],
50
- "params": [
51
- "u128",
52
- "bool"
53
- ],
54
- "return": [
55
- "0x1::optional_aggregator::OptionalAggregator"
56
- ]
57
- },
58
- {
59
- "name": "read",
60
- "visibility": "public",
61
- "is_entry": false,
62
- "is_view": false,
63
- "generic_type_params": [],
64
- "params": [
65
- "&0x1::optional_aggregator::OptionalAggregator"
66
- ],
67
- "return": [
68
- "u128"
69
- ]
70
- },
71
- {
72
- "name": "sub",
73
- "visibility": "public",
74
- "is_entry": false,
75
- "is_view": false,
76
- "generic_type_params": [],
77
- "params": [
78
- "&mut 0x1::optional_aggregator::OptionalAggregator",
79
- "u128"
80
- ],
81
- "return": []
82
- },
83
- {
84
- "name": "switch",
85
- "visibility": "public",
86
- "is_entry": false,
87
- "is_view": false,
88
- "generic_type_params": [],
89
- "params": [
90
- "&mut 0x1::optional_aggregator::OptionalAggregator"
91
- ],
92
- "return": []
93
- }
94
- ],
95
- "structs": [
96
- {
97
- "name": "Integer",
98
- "is_native": false,
99
- "abilities": [
100
- "store"
101
- ],
102
- "generic_type_params": [],
103
- "fields": [
104
- {
105
- "name": "value",
106
- "type": "u128"
107
- },
108
- {
109
- "name": "limit",
110
- "type": "u128"
111
- }
112
- ]
113
- },
114
- {
115
- "name": "OptionalAggregator",
116
- "is_native": false,
117
- "abilities": [
118
- "store"
119
- ],
120
- "generic_type_params": [],
121
- "fields": [
122
- {
123
- "name": "aggregator",
124
- "type": "0x1::option::Option<0x1::aggregator::Aggregator>"
125
- },
126
- {
127
- "name": "integer",
128
- "type": "0x1::option::Option<0x1::optional_aggregator::Integer>"
129
- }
130
- ]
131
- }
132
- ]
133
- } as const;
2
+ address: '0x1',
3
+ name: 'optional_aggregator',
4
+ friends: ['0x1::coin'],
5
+ exposed_functions: [
6
+ {
7
+ name: 'add',
8
+ visibility: 'public',
9
+ is_entry: false,
10
+ is_view: false,
11
+ generic_type_params: [],
12
+ params: ['&mut 0x1::optional_aggregator::OptionalAggregator', 'u128'],
13
+ return: [],
14
+ },
15
+ {
16
+ name: 'destroy',
17
+ visibility: 'public',
18
+ is_entry: false,
19
+ is_view: false,
20
+ generic_type_params: [],
21
+ params: ['0x1::optional_aggregator::OptionalAggregator'],
22
+ return: [],
23
+ },
24
+ {
25
+ name: 'is_parallelizable',
26
+ visibility: 'public',
27
+ is_entry: false,
28
+ is_view: false,
29
+ generic_type_params: [],
30
+ params: ['&0x1::optional_aggregator::OptionalAggregator'],
31
+ return: ['bool'],
32
+ },
33
+ {
34
+ name: 'new',
35
+ visibility: 'friend',
36
+ is_entry: false,
37
+ is_view: false,
38
+ generic_type_params: [],
39
+ params: ['u128', 'bool'],
40
+ return: ['0x1::optional_aggregator::OptionalAggregator'],
41
+ },
42
+ {
43
+ name: 'read',
44
+ visibility: 'public',
45
+ is_entry: false,
46
+ is_view: false,
47
+ generic_type_params: [],
48
+ params: ['&0x1::optional_aggregator::OptionalAggregator'],
49
+ return: ['u128'],
50
+ },
51
+ {
52
+ name: 'sub',
53
+ visibility: 'public',
54
+ is_entry: false,
55
+ is_view: false,
56
+ generic_type_params: [],
57
+ params: ['&mut 0x1::optional_aggregator::OptionalAggregator', 'u128'],
58
+ return: [],
59
+ },
60
+ {
61
+ name: 'switch',
62
+ visibility: 'public',
63
+ is_entry: false,
64
+ is_view: false,
65
+ generic_type_params: [],
66
+ params: ['&mut 0x1::optional_aggregator::OptionalAggregator'],
67
+ return: [],
68
+ },
69
+ ],
70
+ structs: [
71
+ {
72
+ name: 'Integer',
73
+ is_native: false,
74
+ abilities: ['store'],
75
+ generic_type_params: [],
76
+ fields: [
77
+ {
78
+ name: 'value',
79
+ type: 'u128',
80
+ },
81
+ {
82
+ name: 'limit',
83
+ type: 'u128',
84
+ },
85
+ ],
86
+ },
87
+ {
88
+ name: 'OptionalAggregator',
89
+ is_native: false,
90
+ abilities: ['store'],
91
+ generic_type_params: [],
92
+ fields: [
93
+ {
94
+ name: 'aggregator',
95
+ type: '0x1::option::Option<0x1::aggregator::Aggregator>',
96
+ },
97
+ {
98
+ name: 'integer',
99
+ type: '0x1::option::Option<0x1::optional_aggregator::Integer>',
100
+ },
101
+ ],
102
+ },
103
+ ],
104
+ } as const;