@typemove/aptos 1.0.0-rc.24 → 1.0.0-rc.26
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 +8 -0
- package/codegen/package.json +5 -0
- package/package.json +6 -2
package/Readme.md
CHANGED
|
@@ -26,6 +26,11 @@ yarn typemove-aptos 0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace24
|
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
### Decode object
|
|
29
|
+
|
|
30
|
+
Generated type will be like this:
|
|
31
|
+

|
|
32
|
+
|
|
33
|
+
You can write code as follows:
|
|
29
34
|
```typescript
|
|
30
35
|
import { defaultMoveCoder } from '@typemove/aptos'
|
|
31
36
|
import { stable_pool } from "./types/0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af";
|
|
@@ -36,10 +41,13 @@ const pool = await defaultMoveCoder().decodedType(stable_pool.StablePool.type(),
|
|
|
36
41
|
Checkout our [tests](./src/tests/move-coder.test.ts) for more examples。
|
|
37
42
|
|
|
38
43
|
### View function
|
|
44
|
+
Sample code is as follows:
|
|
39
45
|
```typescript
|
|
40
46
|
const aptosClient = new AptosClient("https://fullnode.mainnet.aptoslabs.com")
|
|
41
47
|
const [lpName] = await stable_pool.view.lpNameById(client, { arguments: [3n] })
|
|
42
48
|
const [poolBalances, weights, supply] = await stable_pool.view.poolInfo(client, { arguments: [lpName] })
|
|
43
49
|
```
|
|
50
|
+
IDE will show you the detail type of the function:
|
|
51
|
+

|
|
44
52
|
|
|
45
53
|
Checkout our [tests](./src/tests/move-call.test.ts) for more examples。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typemove/aptos",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.26",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
"./builtin": {
|
|
12
12
|
"import": "./dist/esm/builtin/index.js",
|
|
13
13
|
"require": "./dist/cjs/builtin/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./codgen": {
|
|
16
|
+
"import": "./dist/esm/codgen/index.js",
|
|
17
|
+
"require": "./dist/cjs/codgen/index.js"
|
|
14
18
|
}
|
|
15
19
|
},
|
|
16
20
|
"main": "./dist/cjs/index.js",
|
|
@@ -29,7 +33,7 @@
|
|
|
29
33
|
"aptos": "^1.16.0",
|
|
30
34
|
"chalk": "^5.2.0",
|
|
31
35
|
"radash": "^11.0.0",
|
|
32
|
-
"@typemove/move": "1.0.0-rc.
|
|
36
|
+
"@typemove/move": "1.0.0-rc.26"
|
|
33
37
|
},
|
|
34
38
|
"url": "https://github.com/sentioxyz/typemove",
|
|
35
39
|
"scripts": {
|