@thalalabs/surf 0.0.13 → 0.0.15
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.
- package/.changeset/README.md +1 -1
- package/.github/dependabot.yml +3 -3
- package/.github/workflows/publish.yml +2 -2
- package/CHANGELOG.md +12 -0
- package/README.md +18 -11
- package/build/cjs/abi/aggregator.js +56 -74
- package/build/cjs/abi/aggregator.js.map +1 -1
- package/build/cjs/abi/aptos_coin.js +98 -125
- package/build/cjs/abi/aptos_coin.js.map +1 -1
- package/build/cjs/abi/coin.js +456 -587
- package/build/cjs/abi/coin.js.map +1 -1
- package/build/cjs/abi/event.js +66 -106
- package/build/cjs/abi/event.js.map +1 -1
- package/build/cjs/abi/fixed_point64.js +287 -320
- package/build/cjs/abi/fixed_point64.js.map +1 -1
- package/build/cjs/abi/guid.js +84 -129
- package/build/cjs/abi/guid.js.map +1 -1
- package/build/cjs/abi/optional_aggregator.js +79 -108
- package/build/cjs/abi/optional_aggregator.js.map +1 -1
- package/build/cjs/abi/table.js +131 -222
- package/build/cjs/abi/table.js.map +1 -1
- package/build/cjs/core/Client.js +6 -2
- package/build/cjs/core/Client.js.map +1 -1
- package/build/cjs/core/createEntryPayload.js.map +1 -1
- package/build/cjs/core/createViewPayload.js +10 -6
- package/build/cjs/core/createViewPayload.js.map +1 -1
- package/build/cjs/ensureTypes.js +11 -10
- package/build/cjs/ensureTypes.js.map +1 -1
- package/build/cjs/index.js.map +1 -1
- package/build/esm/abi/aggregator.js +56 -74
- package/build/esm/abi/aggregator.js.map +1 -1
- package/build/esm/abi/aptos_coin.js +98 -125
- package/build/esm/abi/aptos_coin.js.map +1 -1
- package/build/esm/abi/coin.js +456 -587
- package/build/esm/abi/coin.js.map +1 -1
- package/build/esm/abi/event.js +66 -106
- package/build/esm/abi/event.js.map +1 -1
- package/build/esm/abi/fixed_point64.js +287 -320
- package/build/esm/abi/fixed_point64.js.map +1 -1
- package/build/esm/abi/guid.js +84 -129
- package/build/esm/abi/guid.js.map +1 -1
- package/build/esm/abi/optional_aggregator.js +79 -108
- package/build/esm/abi/optional_aggregator.js.map +1 -1
- package/build/esm/abi/table.js +131 -222
- package/build/esm/abi/table.js.map +1 -1
- package/build/esm/core/Client.js +6 -2
- package/build/esm/core/Client.js.map +1 -1
- package/build/esm/core/createEntryPayload.js.map +1 -1
- package/build/esm/core/createViewPayload.js +10 -6
- package/build/esm/core/createViewPayload.js.map +1 -1
- package/build/esm/ensureTypes.js +11 -10
- package/build/esm/ensureTypes.js.map +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/types/abi/aggregator.d.ts.map +1 -1
- package/build/types/abi/aptos_coin.d.ts.map +1 -1
- package/build/types/abi/coin.d.ts.map +1 -1
- package/build/types/abi/event.d.ts.map +1 -1
- package/build/types/abi/fixed_point64.d.ts.map +1 -1
- package/build/types/abi/guid.d.ts.map +1 -1
- package/build/types/abi/optional_aggregator.d.ts.map +1 -1
- package/build/types/abi/table.d.ts.map +1 -1
- package/build/types/core/Client.d.ts.map +1 -1
- package/build/types/ensureTypes.d.ts.map +1 -1
- package/build/types/index.d.ts +2 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/types/client/abiClient.d.ts +2 -0
- package/build/types/types/client/abiClient.d.ts.map +1 -1
- package/build/types/types/convertor/argsConvertor.d.ts +1 -1
- package/build/types/types/convertor/argsConvertor.d.ts.map +1 -1
- package/build/types/types/convertor/structConvertor.d.ts.map +1 -1
- package/build/types/types/moveTypes.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/abi/aggregator.ts +73 -91
- package/src/abi/aptos_coin.ts +117 -144
- package/src/abi/coin.ts +646 -777
- package/src/abi/event.ts +83 -123
- package/src/abi/fixed_point64.ts +340 -373
- package/src/abi/guid.ts +102 -147
- package/src/abi/optional_aggregator.ts +103 -132
- package/src/abi/table.ts +181 -272
- package/src/core/Client.ts +6 -1
- package/src/core/__tests__/accountResource.test.ts +54 -14
- package/src/core/__tests__/createEntryPayload.test.ts +244 -250
- package/src/core/__tests__/createViewPayload.test.ts +44 -58
- package/src/core/__tests__/option.test.ts +1 -1
- package/src/core/__tests__/submitTransaction.test.ts +14 -0
- package/src/core/__tests__/useABI.test.ts +72 -63
- package/src/core/__tests__/view.test.ts +76 -60
- package/src/core/__tests__/view_vector.test.ts +14 -0
- package/src/core/createEntryPayload.ts +4 -5
- package/src/core/createViewPayload.ts +12 -8
- package/src/ensureTypes.ts +31 -28
- package/src/index.ts +8 -8
- package/src/types/client/abiClient.ts +2 -0
- package/src/types/convertor/argsConvertor.ts +3 -1
- package/src/types/convertor/structConvertor.ts +16 -15
- package/src/types/moveTypes.ts +5 -1
package/.changeset/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# How to upgrade the version
|
|
2
2
|
|
|
3
|
-
- Run `yarn changeset` and provide a description of your change.
|
|
3
|
+
- Run `yarn changeset` and provide a description of your change.
|
|
4
4
|
- Commit the `.md` file generated by `changeset` along with your code changes, then create the PR.
|
|
5
5
|
- After your PR merged, Github Workflow will create a PR called "Version Packages" to update the version in `package.json` and the `CHANGELOG.md`.
|
|
6
6
|
- Once the "Version Packages" PR is merged, Github Workflow will publish a new version to NPM.
|
package/.github/dependabot.yml
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
version: 2
|
|
7
7
|
updates:
|
|
8
|
-
- package-ecosystem:
|
|
9
|
-
directory:
|
|
8
|
+
- package-ecosystem: 'npm' # See documentation for possible values
|
|
9
|
+
directory: '/' # Location of package manifests
|
|
10
10
|
schedule:
|
|
11
|
-
interval:
|
|
11
|
+
interval: 'weekly'
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @thalalabs/surf
|
|
2
2
|
|
|
3
|
+
## 0.0.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ccfd874: add string and Uint8Array support for vector<u8> as input type
|
|
8
|
+
|
|
9
|
+
## 0.0.14
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 661f925: Add ledger version arguments for view and resource functions
|
|
14
|
+
|
|
3
15
|
## 0.0.13
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -90,18 +90,22 @@ There are two ways to call a view function with the client:
|
|
|
90
90
|
```typescript
|
|
91
91
|
// Option 1. Use the `useABI` interface
|
|
92
92
|
const [balance] = await client.useABI(COIN_ABI).view.balance({
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
arguments: ['0x1'],
|
|
94
|
+
type_arguments: ['0x1::aptos_coin::AptosCoin'],
|
|
95
|
+
ledger_version: '562606728', // ledger_version is optional
|
|
95
96
|
});
|
|
96
97
|
|
|
97
98
|
// Option 2. Create payload and use the `view` interface
|
|
98
|
-
import { createViewPayload } from
|
|
99
|
+
import { createViewPayload } from '@thalalabs/surf';
|
|
99
100
|
const viewPayload = createViewPayload(COIN_ABI, {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
function: 'balance',
|
|
102
|
+
arguments: ['0x1'],
|
|
103
|
+
type_arguments: ['0x1::aptos_coin::AptosCoin'],
|
|
103
104
|
});
|
|
104
|
-
const [balance] = await client.view(
|
|
105
|
+
const [balance] = await client.view(
|
|
106
|
+
viewPayload,
|
|
107
|
+
{ ledger_version: '562606728' }, // ledger_version is optional
|
|
108
|
+
);
|
|
105
109
|
```
|
|
106
110
|
|
|
107
111
|
Both of the interfaces can provide type safety.
|
|
@@ -132,7 +136,7 @@ const entryPayload = createEntryPayload(COIN_ABI, {
|
|
|
132
136
|
});
|
|
133
137
|
|
|
134
138
|
const { hash } = await client.submitTransaction(
|
|
135
|
-
entryPayload,
|
|
139
|
+
entryPayload,
|
|
136
140
|
{ account },
|
|
137
141
|
);
|
|
138
142
|
```
|
|
@@ -160,7 +164,7 @@ const entryPayload = createEntryPayload(COIN_ABI, {
|
|
|
160
164
|
});
|
|
161
165
|
|
|
162
166
|
const { hash } = await client.simulateTransaction(
|
|
163
|
-
entryPayload,
|
|
167
|
+
entryPayload,
|
|
164
168
|
{ account }
|
|
165
169
|
);
|
|
166
170
|
```
|
|
@@ -171,8 +175,9 @@ To get account resource with type safety:
|
|
|
171
175
|
|
|
172
176
|
```typescript
|
|
173
177
|
const { data } = await client.useABI(COIN_ABI).resource.CoinStore({
|
|
174
|
-
|
|
175
|
-
|
|
178
|
+
type_arguments: ['0x1::aptos_coin::AptosCoin'],
|
|
179
|
+
account: '0x1',
|
|
180
|
+
ledger_version: '562606728', // ledger_version is optional
|
|
176
181
|
});
|
|
177
182
|
|
|
178
183
|
// Get property in the struct with type safety
|
|
@@ -184,6 +189,7 @@ console.log(data.coin.value);
|
|
|
184
189
|
```
|
|
185
190
|
|
|
186
191
|
Some fields of a stuct may reference external modules.To inference the type of a nested struct, it needs the ABI of the external module. Surf currently only built-in some of the ABIs from 0x1, so that it can inference types like `0x1::coin::Coin`. The type of an unidentifiable field would be `object`. Developer can provide additional modules to Surf like this:
|
|
192
|
+
|
|
187
193
|
```TypeScript
|
|
188
194
|
import { DefaultABITable } from "@thalalabs/surf";
|
|
189
195
|
type ABITAble = DefaultABITable & {
|
|
@@ -212,6 +218,7 @@ Surf support some special types like `0x1::object::Object`, `0x1::option::Option
|
|
|
212
218
|
Learning more backgrounds and design details from this [blog post](https://thalalabs.medium.com/introducing-surf-type-safe-typescript-interfaces-react-hooks-for-aptos-39527f41bc39).
|
|
213
219
|
|
|
214
220
|
## TODOs
|
|
221
|
+
|
|
215
222
|
Compared to [Viem](https://viem.sh/), Surf is still in its infancy. Any contribution is welcome and appreciated. Here are some TODOs:
|
|
216
223
|
|
|
217
224
|
- [ ] Deploy a dedicated smart contract on the testnet for Surf to run tests that cover all data types. Currently, Surf has some tests running in CI, but they do not cover all types.
|
|
@@ -2,95 +2,77 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AGGREGATOR_ABI = void 0;
|
|
4
4
|
exports.AGGREGATOR_ABI = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
address: '0x1',
|
|
6
|
+
name: 'aggregator',
|
|
7
|
+
friends: [],
|
|
8
|
+
exposed_functions: [
|
|
9
9
|
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"u128"
|
|
18
|
-
],
|
|
19
|
-
"return": []
|
|
10
|
+
name: 'add',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
is_entry: false,
|
|
13
|
+
is_view: false,
|
|
14
|
+
generic_type_params: [],
|
|
15
|
+
params: ['&mut 0x1::aggregator::Aggregator', 'u128'],
|
|
16
|
+
return: [],
|
|
20
17
|
},
|
|
21
18
|
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
],
|
|
30
|
-
"return": []
|
|
19
|
+
name: 'destroy',
|
|
20
|
+
visibility: 'public',
|
|
21
|
+
is_entry: false,
|
|
22
|
+
is_view: false,
|
|
23
|
+
generic_type_params: [],
|
|
24
|
+
params: ['0x1::aggregator::Aggregator'],
|
|
25
|
+
return: [],
|
|
31
26
|
},
|
|
32
27
|
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
],
|
|
41
|
-
"return": [
|
|
42
|
-
"u128"
|
|
43
|
-
]
|
|
28
|
+
name: 'limit',
|
|
29
|
+
visibility: 'public',
|
|
30
|
+
is_entry: false,
|
|
31
|
+
is_view: false,
|
|
32
|
+
generic_type_params: [],
|
|
33
|
+
params: ['&0x1::aggregator::Aggregator'],
|
|
34
|
+
return: ['u128'],
|
|
44
35
|
},
|
|
45
36
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
],
|
|
54
|
-
"return": [
|
|
55
|
-
"u128"
|
|
56
|
-
]
|
|
37
|
+
name: 'read',
|
|
38
|
+
visibility: 'public',
|
|
39
|
+
is_entry: false,
|
|
40
|
+
is_view: false,
|
|
41
|
+
generic_type_params: [],
|
|
42
|
+
params: ['&0x1::aggregator::Aggregator'],
|
|
43
|
+
return: ['u128'],
|
|
57
44
|
},
|
|
58
45
|
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
],
|
|
68
|
-
"return": []
|
|
69
|
-
}
|
|
46
|
+
name: 'sub',
|
|
47
|
+
visibility: 'public',
|
|
48
|
+
is_entry: false,
|
|
49
|
+
is_view: false,
|
|
50
|
+
generic_type_params: [],
|
|
51
|
+
params: ['&mut 0x1::aggregator::Aggregator', 'u128'],
|
|
52
|
+
return: [],
|
|
53
|
+
},
|
|
70
54
|
],
|
|
71
|
-
|
|
55
|
+
structs: [
|
|
72
56
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"generic_type_params": [],
|
|
79
|
-
"fields": [
|
|
57
|
+
name: 'Aggregator',
|
|
58
|
+
is_native: false,
|
|
59
|
+
abilities: ['store'],
|
|
60
|
+
generic_type_params: [],
|
|
61
|
+
fields: [
|
|
80
62
|
{
|
|
81
|
-
|
|
82
|
-
|
|
63
|
+
name: 'handle',
|
|
64
|
+
type: 'address',
|
|
83
65
|
},
|
|
84
66
|
{
|
|
85
|
-
|
|
86
|
-
|
|
67
|
+
name: 'key',
|
|
68
|
+
type: 'address',
|
|
87
69
|
},
|
|
88
70
|
{
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
]
|
|
71
|
+
name: 'limit',
|
|
72
|
+
type: 'u128',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
],
|
|
95
77
|
};
|
|
96
78
|
//# sourceMappingURL=aggregator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregator.js","sourceRoot":"","sources":["../../../src/abi/aggregator.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;
|
|
1
|
+
{"version":3,"file":"aggregator.js","sourceRoot":"","sources":["../../../src/abi/aggregator.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,EAAE;IACX,iBAAiB,EAAE;QACjB;YACE,IAAI,EAAE,KAAK;YACX,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;YACd,mBAAmB,EAAE,EAAE;YACvB,MAAM,EAAE,CAAC,kCAAkC,EAAE,MAAM,CAAC;YACpD,MAAM,EAAE,EAAE;SACX;QACD;YACE,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;YACd,mBAAmB,EAAE,EAAE;YACvB,MAAM,EAAE,CAAC,6BAA6B,CAAC;YACvC,MAAM,EAAE,EAAE;SACX;QACD;YACE,IAAI,EAAE,OAAO;YACb,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;YACd,mBAAmB,EAAE,EAAE;YACvB,MAAM,EAAE,CAAC,8BAA8B,CAAC;YACxC,MAAM,EAAE,CAAC,MAAM,CAAC;SACjB;QACD;YACE,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;YACd,mBAAmB,EAAE,EAAE;YACvB,MAAM,EAAE,CAAC,8BAA8B,CAAC;YACxC,MAAM,EAAE,CAAC,MAAM,CAAC;SACjB;QACD;YACE,IAAI,EAAE,KAAK;YACX,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;YACd,mBAAmB,EAAE,EAAE;YACvB,MAAM,EAAE,CAAC,kCAAkC,EAAE,MAAM,CAAC;YACpD,MAAM,EAAE,EAAE;SACX;KACF;IACD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,YAAY;YAClB,SAAS,EAAE,KAAK;YAChB,SAAS,EAAE,CAAC,OAAO,CAAC;YACpB,mBAAmB,EAAE,EAAE;YACvB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,SAAS;iBAChB;gBACD;oBACE,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,SAAS;iBAChB;gBACD;oBACE,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,MAAM;iBACb;aACF;SACF;KACF;CACO,CAAC"}
|
|
@@ -2,157 +2,130 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.APTOS_COIN_ABI = void 0;
|
|
4
4
|
exports.APTOS_COIN_ABI = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
],
|
|
10
|
-
"exposed_functions": [
|
|
5
|
+
address: '0x1',
|
|
6
|
+
name: 'aptos_coin',
|
|
7
|
+
friends: ['0x1::genesis'],
|
|
8
|
+
exposed_functions: [
|
|
11
9
|
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
],
|
|
20
|
-
"return": []
|
|
10
|
+
name: 'claim_mint_capability',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
is_entry: true,
|
|
13
|
+
is_view: false,
|
|
14
|
+
generic_type_params: [],
|
|
15
|
+
params: ['&signer'],
|
|
16
|
+
return: [],
|
|
21
17
|
},
|
|
22
18
|
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
name: 'configure_accounts_for_test',
|
|
20
|
+
visibility: 'friend',
|
|
21
|
+
is_entry: false,
|
|
22
|
+
is_view: false,
|
|
23
|
+
generic_type_params: [],
|
|
24
|
+
params: [
|
|
25
|
+
'&signer',
|
|
26
|
+
'&signer',
|
|
27
|
+
'0x1::coin::MintCapability<0x1::aptos_coin::AptosCoin>',
|
|
32
28
|
],
|
|
33
|
-
|
|
29
|
+
return: [],
|
|
34
30
|
},
|
|
35
31
|
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"address"
|
|
44
|
-
],
|
|
45
|
-
"return": []
|
|
32
|
+
name: 'delegate_mint_capability',
|
|
33
|
+
visibility: 'public',
|
|
34
|
+
is_entry: true,
|
|
35
|
+
is_view: false,
|
|
36
|
+
generic_type_params: [],
|
|
37
|
+
params: ['signer', 'address'],
|
|
38
|
+
return: [],
|
|
46
39
|
},
|
|
47
40
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
],
|
|
56
|
-
"return": []
|
|
41
|
+
name: 'destroy_mint_cap',
|
|
42
|
+
visibility: 'friend',
|
|
43
|
+
is_entry: false,
|
|
44
|
+
is_view: false,
|
|
45
|
+
generic_type_params: [],
|
|
46
|
+
params: ['&signer'],
|
|
47
|
+
return: [],
|
|
57
48
|
},
|
|
58
49
|
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
],
|
|
67
|
-
"return": [
|
|
68
|
-
"bool"
|
|
69
|
-
]
|
|
50
|
+
name: 'has_mint_capability',
|
|
51
|
+
visibility: 'public',
|
|
52
|
+
is_entry: false,
|
|
53
|
+
is_view: false,
|
|
54
|
+
generic_type_params: [],
|
|
55
|
+
params: ['&signer'],
|
|
56
|
+
return: ['bool'],
|
|
70
57
|
},
|
|
71
58
|
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
59
|
+
name: 'initialize',
|
|
60
|
+
visibility: 'friend',
|
|
61
|
+
is_entry: false,
|
|
62
|
+
is_view: false,
|
|
63
|
+
generic_type_params: [],
|
|
64
|
+
params: ['&signer'],
|
|
65
|
+
return: [
|
|
66
|
+
'0x1::coin::BurnCapability<0x1::aptos_coin::AptosCoin>',
|
|
67
|
+
'0x1::coin::MintCapability<0x1::aptos_coin::AptosCoin>',
|
|
79
68
|
],
|
|
80
|
-
"return": [
|
|
81
|
-
"0x1::coin::BurnCapability<0x1::aptos_coin::AptosCoin>",
|
|
82
|
-
"0x1::coin::MintCapability<0x1::aptos_coin::AptosCoin>"
|
|
83
|
-
]
|
|
84
69
|
},
|
|
85
70
|
{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"u64"
|
|
95
|
-
],
|
|
96
|
-
"return": []
|
|
97
|
-
}
|
|
71
|
+
name: 'mint',
|
|
72
|
+
visibility: 'public',
|
|
73
|
+
is_entry: true,
|
|
74
|
+
is_view: false,
|
|
75
|
+
generic_type_params: [],
|
|
76
|
+
params: ['&signer', 'address', 'u64'],
|
|
77
|
+
return: [],
|
|
78
|
+
},
|
|
98
79
|
],
|
|
99
|
-
|
|
80
|
+
structs: [
|
|
100
81
|
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"generic_type_params": [],
|
|
107
|
-
"fields": [
|
|
82
|
+
name: 'AptosCoin',
|
|
83
|
+
is_native: false,
|
|
84
|
+
abilities: ['key'],
|
|
85
|
+
generic_type_params: [],
|
|
86
|
+
fields: [
|
|
108
87
|
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
]
|
|
88
|
+
name: 'dummy_field',
|
|
89
|
+
type: 'bool',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
113
92
|
},
|
|
114
93
|
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"generic_type_params": [],
|
|
121
|
-
"fields": [
|
|
94
|
+
name: 'DelegatedMintCapability',
|
|
95
|
+
is_native: false,
|
|
96
|
+
abilities: ['store'],
|
|
97
|
+
generic_type_params: [],
|
|
98
|
+
fields: [
|
|
122
99
|
{
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
]
|
|
100
|
+
name: 'to',
|
|
101
|
+
type: 'address',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
127
104
|
},
|
|
128
105
|
{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"generic_type_params": [],
|
|
135
|
-
"fields": [
|
|
106
|
+
name: 'Delegations',
|
|
107
|
+
is_native: false,
|
|
108
|
+
abilities: ['key'],
|
|
109
|
+
generic_type_params: [],
|
|
110
|
+
fields: [
|
|
136
111
|
{
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
]
|
|
112
|
+
name: 'inner',
|
|
113
|
+
type: 'vector<0x1::aptos_coin::DelegatedMintCapability>',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
141
116
|
},
|
|
142
117
|
{
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"generic_type_params": [],
|
|
149
|
-
"fields": [
|
|
118
|
+
name: 'MintCapStore',
|
|
119
|
+
is_native: false,
|
|
120
|
+
abilities: ['key'],
|
|
121
|
+
generic_type_params: [],
|
|
122
|
+
fields: [
|
|
150
123
|
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
]
|
|
155
|
-
}
|
|
156
|
-
]
|
|
124
|
+
name: 'mint_cap',
|
|
125
|
+
type: '0x1::coin::MintCapability<0x1::aptos_coin::AptosCoin>',
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
],
|
|
157
130
|
};
|
|
158
131
|
//# sourceMappingURL=aptos_coin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aptos_coin.js","sourceRoot":"","sources":["../../../src/abi/aptos_coin.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;
|
|
1
|
+
{"version":3,"file":"aptos_coin.js","sourceRoot":"","sources":["../../../src/abi/aptos_coin.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,CAAC,cAAc,CAAC;IACzB,iBAAiB,EAAE;QACjB;YACE,IAAI,EAAE,uBAAuB;YAC7B,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;YACd,mBAAmB,EAAE,EAAE;YACvB,MAAM,EAAE,CAAC,SAAS,CAAC;YACnB,MAAM,EAAE,EAAE;SACX;QACD;YACE,IAAI,EAAE,6BAA6B;YACnC,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;YACd,mBAAmB,EAAE,EAAE;YACvB,MAAM,EAAE;gBACN,SAAS;gBACT,SAAS;gBACT,uDAAuD;aACxD;YACD,MAAM,EAAE,EAAE;SACX;QACD;YACE,IAAI,EAAE,0BAA0B;YAChC,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;YAC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