@mysten/pas 0.0.1 → 0.0.3
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/CHANGELOG.md +15 -0
- package/README.md +107 -1
- package/dist/client.d.mts.map +1 -1
- package/dist/contracts/utils/index.mjs.map +1 -1
- package/dist/error.d.mts.map +1 -1
- package/dist/types.d.mts +0 -1
- package/dist/types.d.mts.map +1 -1
- package/package.json +60 -58
- package/src/contracts/utils/index.ts +4 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @mysten/pas
|
|
2
|
+
|
|
3
|
+
## 0.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6fd995d: Use type imports in generated code for verbatimModuleSyntax compatibility
|
|
8
|
+
|
|
9
|
+
## 0.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fd00b1d: Adds a README file
|
|
14
|
+
- Updated dependencies [c769abb]
|
|
15
|
+
- @mysten/sui@2.9.0
|
package/README.md
CHANGED
|
@@ -1 +1,107 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @mysten/pas
|
|
2
|
+
|
|
3
|
+
TypeScript SDK for the [Permissioned Assets Standard](https://github.com/MystenLabs/pas) (PAS) on
|
|
4
|
+
Sui.
|
|
5
|
+
|
|
6
|
+
PAS lets asset issuers define transfer policies that are enforced on-chain. The SDK handles policy
|
|
7
|
+
resolution, account derivation, and transaction building so callers work with a simple intent-based
|
|
8
|
+
API.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @mysten/pas
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Setup
|
|
17
|
+
|
|
18
|
+
The PAS client plugs into any Sui client via the `$extend` pattern:
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
22
|
+
import { pas } from '@mysten/pas';
|
|
23
|
+
|
|
24
|
+
const client = new SuiGrpcClient({ network: 'testnet' }).$extend(pas());
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The client auto-selects the correct on-chain package config for the connected network (mainnet or
|
|
28
|
+
testnet). For custom deployments (e.g. during localnet / CI testing) you can pass a `packageConfig`
|
|
29
|
+
explicitly:
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
const client = new SuiGrpcClient({ network: 'testnet' }).$extend(
|
|
33
|
+
pas({
|
|
34
|
+
packageConfig: {
|
|
35
|
+
packageId: '0x...',
|
|
36
|
+
namespaceId: '0x...',
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
39
|
+
);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Reading data
|
|
43
|
+
|
|
44
|
+
Every PAS user has a deterministic **Account** address derived from their wallet address. You can
|
|
45
|
+
derive it locally — no network call needed — and then use regular Sui queries against it:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
const accountAddress = client.pas.deriveAccountAddress(ownerAddress);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Once you have the account address, use the standard core client to query balances, objects, or any
|
|
52
|
+
other on-chain state:
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
const DEMO_USD = '0xabc...::demo_usd::DEMO_USD';
|
|
56
|
+
|
|
57
|
+
const [walletBalance, accountBalance] = await Promise.all([
|
|
58
|
+
client.core.getBalance({ owner: ownerAddress, coinType: DEMO_USD }),
|
|
59
|
+
client.core.getBalance({ owner: accountAddress, coinType: DEMO_USD }),
|
|
60
|
+
]);
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Other derivation helpers are available for policies and templates:
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
const policyAddress = client.pas.derivePolicyAddress(assetType);
|
|
67
|
+
const templateRegistryAddress = client.pas.deriveTemplateRegistryAddress();
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Writing transactions
|
|
71
|
+
|
|
72
|
+
Transactions use an intent-based API. You add intents to a `Transaction` and the SDK resolves them
|
|
73
|
+
at build time — fetching policies, approval templates, and creating accounts as needed.
|
|
74
|
+
|
|
75
|
+
### Transferring a permissioned asset
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
import { Transaction } from '@mysten/sui/transactions';
|
|
79
|
+
|
|
80
|
+
const DEMO_USD = '0xabc...::demo_usd::DEMO_USD';
|
|
81
|
+
|
|
82
|
+
const tx = new Transaction();
|
|
83
|
+
tx.add(
|
|
84
|
+
client.pas.call.sendBalance({
|
|
85
|
+
from: senderAddress, // The sender address (NOT the account address)
|
|
86
|
+
to: recipientAddress, // the recipient wallet address. NOT the account address.
|
|
87
|
+
amount: 1_000_000,
|
|
88
|
+
assetType: DEMO_USD,
|
|
89
|
+
}),
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// .. sign and execute
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Under the hood, `sendBalance` will:
|
|
96
|
+
|
|
97
|
+
1. Derive the sender and recipient Account addresses.
|
|
98
|
+
2. Create any accounts that don't exist yet.
|
|
99
|
+
3. Fetch the issuer's `Policy` for the asset type and resolve the required approval template
|
|
100
|
+
commands.
|
|
101
|
+
4. Build the full PTB (auth, request, approvals, resolve) in a single transaction.
|
|
102
|
+
|
|
103
|
+
## More resources
|
|
104
|
+
|
|
105
|
+
- [PAS repository](https://github.com/MystenLabs/pas) — Move contracts, architecture docs, and a
|
|
106
|
+
full working example app
|
|
107
|
+
- [`@mysten/pas` on npm](https://www.npmjs.com/package/@mysten/pas)
|
package/dist/client.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.mts","names":[],"sources":["../src/client.ts"],"
|
|
1
|
+
{"version":3,"file":"client.d.mts","names":[],"sources":["../src/client.ts"],"mappings":";;;;;iBAqBgB,GAAA,mCAAA,CAAA;EACf,aAAA;EACA,IAAA;EAAA,GACG;AAAA,IACD,UAAA,CAAW,IAAA;EACb,IAAA,EAAM,IAAA;EACN,QAAA,GAAW,MAAA,EAAQ,iBAAA,KAAsB,SAAA;AAAA;AAAA,cAS7B,SAAA;EAAA;cAGA,MAAA,EAAQ,eAAA;EAhBpB;;;EAgDA,gBAAA,CAAA,GAAgB,gBAAA;EA5CG;;;;;;EAsDnB,oBAAA,CAAqB,KAAA;EA1DrB;;;;;;;EAqEA,mBAAA,CAAoB,SAAA;EAjED;;;;;EA0EnB,6BAAA,CAAA;EAjEqB;;;;;;EA2ErB,qBAAA,CAAsB,gBAAA;;;;;;MASlB,IAAA,CAAA;;;;;;;;;;;;;;;;;;eAjDY,yBAAA,CAAA,WAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/contracts/utils/index.ts"],"sourcesContent":["import {\n\tbcs,\n\
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/contracts/utils/index.ts"],"sourcesContent":["import {\n\tbcs,\n\ttype BcsType,\n\ttype TypeTag,\n\tTypeTagSerializer,\n\tBcsStruct,\n\tBcsEnum,\n\tBcsTuple,\n} from '@mysten/sui/bcs';\nimport { normalizeSuiAddress } from '@mysten/sui/utils';\nimport { type TransactionArgument, isArgument } from '@mysten/sui/transactions';\nimport { type ClientWithCoreApi, type SuiClientTypes } from '@mysten/sui/client';\nimport { PASClientError } from '../../error.js';\n\nconst MOVE_STDLIB_ADDRESS = normalizeSuiAddress('0x1');\nconst SUI_FRAMEWORK_ADDRESS = normalizeSuiAddress('0x2');\n\nexport type RawTransactionArgument<T> = T | TransactionArgument;\n\nexport interface GetOptions<\n\tInclude extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {},\n> extends SuiClientTypes.GetObjectOptions<Include> {\n\tclient: ClientWithCoreApi;\n}\n\nexport interface GetManyOptions<\n\tInclude extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {},\n> extends SuiClientTypes.GetObjectsOptions<Include> {\n\tclient: ClientWithCoreApi;\n}\n\nexport function getPureBcsSchema(typeTag: string | TypeTag): BcsType<any> | null {\n\tconst parsedTag = typeof typeTag === 'string' ? TypeTagSerializer.parseFromStr(typeTag) : typeTag;\n\n\tif ('u8' in parsedTag) {\n\t\treturn bcs.U8;\n\t} else if ('u16' in parsedTag) {\n\t\treturn bcs.U16;\n\t} else if ('u32' in parsedTag) {\n\t\treturn bcs.U32;\n\t} else if ('u64' in parsedTag) {\n\t\treturn bcs.U64;\n\t} else if ('u128' in parsedTag) {\n\t\treturn bcs.U128;\n\t} else if ('u256' in parsedTag) {\n\t\treturn bcs.U256;\n\t} else if ('address' in parsedTag) {\n\t\treturn bcs.Address;\n\t} else if ('bool' in parsedTag) {\n\t\treturn bcs.Bool;\n\t} else if ('vector' in parsedTag) {\n\t\tconst type = getPureBcsSchema(parsedTag.vector);\n\t\treturn type ? bcs.vector(type) : null;\n\t} else if ('struct' in parsedTag) {\n\t\tconst structTag = parsedTag.struct;\n\t\tconst pkg = normalizeSuiAddress(structTag.address);\n\n\t\tif (pkg === MOVE_STDLIB_ADDRESS) {\n\t\t\tif (\n\t\t\t\t(structTag.module === 'ascii' || structTag.module === 'string') &&\n\t\t\t\tstructTag.name === 'String'\n\t\t\t) {\n\t\t\t\treturn bcs.String;\n\t\t\t}\n\n\t\t\tif (structTag.module === 'option' && structTag.name === 'Option') {\n\t\t\t\tconst type = getPureBcsSchema(structTag.typeParams[0]);\n\t\t\t\treturn type ? bcs.option(type) : null;\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tpkg === SUI_FRAMEWORK_ADDRESS &&\n\t\t\tstructTag.module === 'object' &&\n\t\t\t(structTag.name === 'ID' || structTag.name === 'UID')\n\t\t) {\n\t\t\treturn bcs.Address;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function normalizeMoveArguments(\n\targs: unknown[] | object,\n\targTypes: readonly (string | null)[],\n\tparameterNames?: string[],\n) {\n\tconst argLen = Array.isArray(args) ? args.length : Object.keys(args).length;\n\tif (parameterNames && argLen !== parameterNames.length) {\n\t\tthrow new PASClientError(\n\t\t\t`Invalid number of arguments, expected ${parameterNames.length}, got ${argLen}`,\n\t\t);\n\t}\n\n\tconst normalizedArgs: TransactionArgument[] = [];\n\n\tlet index = 0;\n\tfor (const [i, argType] of argTypes.entries()) {\n\t\tif (argType === '0x2::clock::Clock') {\n\t\t\tnormalizedArgs.push((tx) => tx.object.clock());\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (argType === '0x2::random::Random') {\n\t\t\tnormalizedArgs.push((tx) => tx.object.random());\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (argType === '0x2::deny_list::DenyList') {\n\t\t\tnormalizedArgs.push((tx) => tx.object.denyList());\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (argType === '0x3::sui_system::SuiSystemState') {\n\t\t\tnormalizedArgs.push((tx) => tx.object.system());\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet arg;\n\t\tif (Array.isArray(args)) {\n\t\t\tif (index >= args.length) {\n\t\t\t\tthrow new PASClientError(\n\t\t\t\t\t`Invalid number of arguments, expected at least ${index + 1}, got ${args.length}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\targ = args[index];\n\t\t} else {\n\t\t\tif (!parameterNames) {\n\t\t\t\tthrow new PASClientError(`Expected arguments to be passed as an array`);\n\t\t\t}\n\t\t\tconst name = parameterNames[index];\n\t\t\targ = args[name as keyof typeof args];\n\n\t\t\tif (arg === undefined) {\n\t\t\t\tthrow new PASClientError(`Parameter ${name} is required`);\n\t\t\t}\n\t\t}\n\n\t\tindex += 1;\n\n\t\tif (typeof arg === 'function' || isArgument(arg)) {\n\t\t\tnormalizedArgs.push(arg as TransactionArgument);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst type = argTypes[i];\n\t\tconst bcsType = type === null ? null : getPureBcsSchema(type);\n\n\t\tif (bcsType) {\n\t\t\tconst bytes = bcsType.serialize(arg as never);\n\t\t\tnormalizedArgs.push((tx) => tx.pure(bytes));\n\t\t\tcontinue;\n\t\t} else if (typeof arg === 'string') {\n\t\t\tnormalizedArgs.push((tx) => tx.object(arg));\n\t\t\tcontinue;\n\t\t}\n\n\t\tthrow new PASClientError(`Invalid argument ${stringify(arg)} for type ${type}`);\n\t}\n\n\treturn normalizedArgs;\n}\n\nexport class MoveStruct<\n\tT extends Record<string, BcsType<any>>,\n\tconst Name extends string = string,\n> extends BcsStruct<T, Name> {\n\tasync get<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({\n\t\tobjectId,\n\t\t...options\n\t}: GetOptions<Include>): Promise<\n\t\tSuiClientTypes.Object<Include & { content: true; json: true }> & {\n\t\t\tjson: BcsStruct<T>['$inferType'];\n\t\t}\n\t> {\n\t\tconst [res] = await this.getMany<Include>({\n\t\t\t...options,\n\t\t\tobjectIds: [objectId],\n\t\t});\n\n\t\treturn res;\n\t}\n\n\tasync getMany<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({\n\t\tclient,\n\t\t...options\n\t}: GetManyOptions<Include>): Promise<\n\t\tArray<\n\t\t\tSuiClientTypes.Object<Include & { content: true; json: true }> & {\n\t\t\t\tjson: BcsStruct<T>['$inferType'];\n\t\t\t}\n\t\t>\n\t> {\n\t\tconst response = (await client.core.getObjects({\n\t\t\t...options,\n\t\t\tinclude: {\n\t\t\t\t...options.include,\n\t\t\t\tcontent: true,\n\t\t\t},\n\t\t})) as SuiClientTypes.GetObjectsResponse<Include & { content: true }>;\n\n\t\treturn response.objects.map((obj) => {\n\t\t\tif (obj instanceof Error) {\n\t\t\t\tthrow obj;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...obj,\n\t\t\t\tjson: this.parse(obj.content),\n\t\t\t};\n\t\t});\n\t}\n}\n\nexport class MoveEnum<\n\tT extends Record<string, BcsType<any> | null>,\n\tconst Name extends string,\n> extends BcsEnum<T, Name> {}\n\nexport class MoveTuple<\n\tconst T extends readonly BcsType<any>[],\n\tconst Name extends string,\n> extends BcsTuple<T, Name> {}\n\nfunction stringify(val: unknown) {\n\tif (typeof val === 'object') {\n\t\treturn JSON.stringify(val, (val: unknown) => val);\n\t}\n\tif (typeof val === 'bigint') {\n\t\treturn val.toString();\n\t}\n\n\treturn val;\n}\n"],"mappings":";;;;;AAcA,MAAM,sBAAsB,oBAAoB,MAAM;AACtD,MAAM,wBAAwB,oBAAoB,MAAM;AAqJxD,IAAa,aAAb,cAGU,UAAmB;CAC5B,MAAM,IAAiF,EACtF,UACA,GAAG,WAKF;EACD,MAAM,CAAC,OAAO,MAAM,KAAK,QAAiB;GACzC,GAAG;GACH,WAAW,CAAC,SAAS;GACrB,CAAC;AAEF,SAAO;;CAGR,MAAM,QAAqF,EAC1F,QACA,GAAG,WAOF;AASD,UARkB,MAAM,OAAO,KAAK,WAAW;GAC9C,GAAG;GACH,SAAS;IACR,GAAG,QAAQ;IACX,SAAS;IACT;GACD,CAAC,EAEc,QAAQ,KAAK,QAAQ;AACpC,OAAI,eAAe,MAClB,OAAM;AAGP,UAAO;IACN,GAAG;IACH,MAAM,KAAK,MAAM,IAAI,QAAQ;IAC7B;IACA;;;AAIJ,IAAa,WAAb,cAGU,QAAiB;AAE3B,IAAa,YAAb,cAGU,SAAkB"}
|
package/dist/error.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.mts","names":[],"sources":["../src/error.ts"],"
|
|
1
|
+
{"version":3,"file":"error.d.mts","names":[],"sources":["../src/error.ts"],"mappings":";;AAMA;;cAAa,cAAA,SAAuB,KAAA;cACvB,OAAA;AAAA;AAAA,cAMA,mBAAA,SAA4B,cAAA;cAC5B,SAAA,UAAmB,OAAA;AAAA;AAAA,cAMnB,2BAAA,SAAoC,cAAA;cACpC,QAAA,UAAkB,SAAA;AAAA"}
|
package/dist/types.d.mts
CHANGED
package/dist/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;AAQA;UAAiB,gBAAA;;EAEhB,SAAA;EAEW;EAAX,WAAA;AAAA;;;;UAMgB,eAAA;EAIhB;EAFA,SAAA,EAAW,iBAAA;EAEqB;EAAhC,aAAA,GAAgB,gBAAA;AAAA;;;;UAMA,UAAA;EAEhB;EAAA,IAAA,GAAO,IAAA;EAEP;EAAA,aAAA,GAAgB,gBAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,59 +1,61 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
2
|
+
"name": "@mysten/pas",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Permissioned Assets Standard SDK",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"author": "Mysten Labs <build@mystenlabs.com>",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "./dist/index.mjs",
|
|
10
|
+
"types": "./dist/index.d.mts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.mts",
|
|
14
|
+
"import": "./dist/index.mjs",
|
|
15
|
+
"default": "./dist/index.mjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"files": [
|
|
20
|
+
"CHANGELOG.md",
|
|
21
|
+
"dist",
|
|
22
|
+
"src"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/MystenLabs/ts-sdks.git"
|
|
30
|
+
},
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/mystenlabs/ts-sdks/issues"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^25.0.8",
|
|
36
|
+
"ts-retry-promise": "^0.8.1",
|
|
37
|
+
"tsdown": "0.20.0-beta.1",
|
|
38
|
+
"typescript": "^5.9.3",
|
|
39
|
+
"vitest": "^4.0.17",
|
|
40
|
+
"@mysten/codegen": "^0.8.4",
|
|
41
|
+
"@mysten/sui": "^2.15.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@mysten/sui": "^2.15.0"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
|
48
|
+
"build": "rm -rf dist && tsc --noEmit && tsdown",
|
|
49
|
+
"test": "pnpm test:typecheck && pnpm test:unit",
|
|
50
|
+
"test:typecheck": "tsc -p ./test",
|
|
51
|
+
"test:unit": "vitest run unit __tests__",
|
|
52
|
+
"test:e2e": "vitest run e2e",
|
|
53
|
+
"codegen": "sui-ts-codegen generate && pnpm lint:fix",
|
|
54
|
+
"prettier:check": "prettier -c --ignore-unknown .",
|
|
55
|
+
"prettier:fix": "prettier -w --ignore-unknown .",
|
|
56
|
+
"oxlint:check": "oxlint .",
|
|
57
|
+
"oxlint:fix": "oxlint --fix",
|
|
58
|
+
"lint": "pnpm run oxlint:check && pnpm run prettier:check",
|
|
59
|
+
"lint:fix": "pnpm run oxlint:fix && pnpm run prettier:fix"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bcs,
|
|
3
|
-
BcsType,
|
|
4
|
-
TypeTag,
|
|
3
|
+
type BcsType,
|
|
4
|
+
type TypeTag,
|
|
5
5
|
TypeTagSerializer,
|
|
6
6
|
BcsStruct,
|
|
7
7
|
BcsEnum,
|
|
8
8
|
BcsTuple,
|
|
9
9
|
} from '@mysten/sui/bcs';
|
|
10
10
|
import { normalizeSuiAddress } from '@mysten/sui/utils';
|
|
11
|
-
import { TransactionArgument, isArgument } from '@mysten/sui/transactions';
|
|
12
|
-
import { ClientWithCoreApi, SuiClientTypes } from '@mysten/sui/client';
|
|
11
|
+
import { type TransactionArgument, isArgument } from '@mysten/sui/transactions';
|
|
12
|
+
import { type ClientWithCoreApi, type SuiClientTypes } from '@mysten/sui/client';
|
|
13
13
|
import { PASClientError } from '../../error.js';
|
|
14
14
|
|
|
15
15
|
const MOVE_STDLIB_ADDRESS = normalizeSuiAddress('0x1');
|