@typemove/aptos 1.2.6-rc.4 → 1.2.6-rc.5
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/Readme.md +20 -5
- package/dist/esm/codegen/run.js +1 -1
- package/dist/esm/codegen/run.js.map +1 -1
- package/package.json +2 -2
- package/src/codegen/run.ts +1 -1
package/Readme.md
CHANGED
|
@@ -17,13 +17,28 @@ pnpm add @typemove/aptos
|
|
|
17
17
|
|
|
18
18
|
### Code Generation
|
|
19
19
|
```typescript
|
|
20
|
-
yarn typemove-aptos
|
|
20
|
+
yarn typemove-aptos [--target-dir] [--network] [--abi-dir] <location>
|
|
21
21
|
```
|
|
22
|
+
- `location`: Directory of ABI json files or address of account to generate types for
|
|
23
|
+
- `target-dir`: Directory to output generated files (default: "./types")
|
|
24
|
+
- `network`: Network to use, could be either "mainnet", "testnet" or any node URL (default: "mainnet")
|
|
25
|
+
- `abi-dir`: Directory to store downloaded ABI. Only useful if <location> is address (default: "./abis")
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
Use `yarn typemove-aptos --help` to see detail description.
|
|
28
|
+
|
|
29
|
+
A few examples:
|
|
30
|
+
- generate types for an address on mainnet:
|
|
31
|
+
```typescript
|
|
32
|
+
yarn typemove-aptos --target-dir ./src/types --abi-dir ./src/abis 0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af
|
|
33
|
+
```
|
|
34
|
+
- generate types for local ABI files stored in `./src/abis`:
|
|
35
|
+
```typescript
|
|
36
|
+
yarn typemove-aptos --target-dir ./src/types ./src/abis
|
|
37
|
+
```
|
|
38
|
+
- generate types using local node:
|
|
39
|
+
```typescript
|
|
40
|
+
yarn typemove-aptos --network http://localhost:8080 0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af
|
|
41
|
+
```
|
|
27
42
|
|
|
28
43
|
### Decode object
|
|
29
44
|
|
package/dist/esm/codegen/run.js
CHANGED
|
@@ -22,7 +22,7 @@ program
|
|
|
22
22
|
.argument('<location>', 'Directory of ABI json files or address of account to generate types for')
|
|
23
23
|
.option('-a, --abi-dir <dir>', 'Directory to store downloaded ABI. Only useful if <location> is address', './abis')
|
|
24
24
|
.option('-t, --target-dir <dir>', 'Directory to output generated files', './types')
|
|
25
|
-
.option('-n, --network <mainnet|testnet|$url>', '
|
|
25
|
+
.option('-n, --network <mainnet|testnet|$url>', 'Network to use, could be either "mainnet", "testnet" or any node URL', 'mainnet')
|
|
26
26
|
.action(async (location, options) => {
|
|
27
27
|
let endpoint = options.network;
|
|
28
28
|
if (endpoint == 'mainnet') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/codegen/run.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9C,IAAI,GAAG,GAAG,SAAS,CAAA;AACnB,IAAI;IACF,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;CACpC;AAAC,OAAO,CAAC,EAAE;IACV,GAAG,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;CACvC;AAED,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;AAE7B,OAAO;KACJ,IAAI,CAAC,gBAAgB,CAAC;KACtB,WAAW,CAAC,kDAAkD,CAAC;KAC/D,kBAAkB,EAAE;KACpB,OAAO,CAAC,GAAG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
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typemove/aptos",
|
|
3
|
-
"version": "1.2.6-rc.
|
|
3
|
+
"version": "1.2.6-rc.5",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"commander": "^11.1.0",
|
|
35
35
|
"prettier": "^3.0.3",
|
|
36
36
|
"radash": "^11.0.0",
|
|
37
|
-
"@typemove/move": "1.2.6-rc.
|
|
37
|
+
"@typemove/move": "1.2.6-rc.5"
|
|
38
38
|
},
|
|
39
39
|
"url": "https://github.com/sentioxyz/typemove",
|
|
40
40
|
"scripts": {
|
package/src/codegen/run.ts
CHANGED
|
@@ -26,7 +26,7 @@ program
|
|
|
26
26
|
.option('-t, --target-dir <dir>', 'Directory to output generated files', './types')
|
|
27
27
|
.option(
|
|
28
28
|
'-n, --network <mainnet|testnet|$url>',
|
|
29
|
-
'
|
|
29
|
+
'Network to use, could be either "mainnet", "testnet" or any node URL',
|
|
30
30
|
'mainnet'
|
|
31
31
|
)
|
|
32
32
|
.action(async (location, options) => {
|