@mysten/sui 2.16.1 → 2.16.2
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 +9 -0
- package/dist/bcs/index.d.mts +20 -20
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/move_package_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/name_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
- package/dist/transactions/Transaction.d.mts +4 -4
- package/dist/transactions/data/internal.d.mts +109 -109
- package/dist/transactions/data/internal.d.mts.map +1 -1
- package/dist/transactions/data/v1.d.mts +220 -220
- package/dist/transactions/data/v1.d.mts.map +1 -1
- package/dist/transactions/data/v2.d.mts +16 -16
- package/dist/transactions/data/v2.d.mts.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/docs/bcs.md +134 -0
- package/docs/clients/core.md +622 -0
- package/docs/clients/graphql.md +101 -0
- package/docs/clients/grpc.md +210 -0
- package/docs/clients/index.md +95 -0
- package/docs/clients/json-rpc.md +239 -0
- package/docs/cryptography/keypairs.md +267 -0
- package/docs/cryptography/multisig.md +194 -0
- package/docs/cryptography/passkey.md +112 -0
- package/docs/cryptography/webcrypto-signer.md +81 -0
- package/docs/executors.md +150 -0
- package/docs/faucet.md +26 -0
- package/docs/hello-sui.md +115 -0
- package/docs/index.md +53 -0
- package/docs/install.md +61 -0
- package/docs/llm-docs.md +32 -0
- package/docs/llms-index.md +44 -0
- package/docs/migrations/0.38.md +58 -0
- package/docs/migrations/sui-1.0.md +455 -0
- package/docs/migrations/sui-2.0/agent-prompt.md +42 -0
- package/docs/migrations/sui-2.0/dapp-kit.md +350 -0
- package/docs/migrations/sui-2.0/deepbook-v3.md +33 -0
- package/docs/migrations/sui-2.0/index.md +158 -0
- package/docs/migrations/sui-2.0/json-rpc-migration.md +408 -0
- package/docs/migrations/sui-2.0/kiosk.md +120 -0
- package/docs/migrations/sui-2.0/sdk-maintainers.md +90 -0
- package/docs/migrations/sui-2.0/seal.md +14 -0
- package/docs/migrations/sui-2.0/sui.md +341 -0
- package/docs/migrations/sui-2.0/suins.md +44 -0
- package/docs/migrations/sui-2.0/wallet-builders.md +66 -0
- package/docs/migrations/sui-2.0/walrus.md +41 -0
- package/docs/migrations/sui-2.0/zksend.md +95 -0
- package/docs/plugins.md +258 -0
- package/docs/sdk-building.md +344 -0
- package/docs/transaction-building/basics.md +299 -0
- package/docs/transaction-building/gas.md +61 -0
- package/docs/transaction-building/intents.md +62 -0
- package/docs/transaction-building/offline.md +73 -0
- package/docs/transaction-building/sponsored-transactions.md +22 -0
- package/docs/utils/derived_objects.md +80 -0
- package/docs/utils/index.md +59 -0
- package/docs/zklogin.md +83 -0
- package/package.json +3 -3
- package/src/version.ts +1 -1
package/docs/zklogin.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# ZkLogin
|
|
2
|
+
|
|
3
|
+
> Zero-knowledge authentication with OAuth providers on Sui.
|
|
4
|
+
|
|
5
|
+
Utilities for working with zkLogin. Currently contains functionality to create and parse zkLogin
|
|
6
|
+
signatures and compute zkLogin addresses.
|
|
7
|
+
|
|
8
|
+
To parse a serialized zkLogin signature
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
|
|
12
|
+
const parsedSignature = await parseZkLoginSignature('BQNNMTY4NjAxMzAyO....');
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Use `getZkLoginSignature` to serialize a zkLogin signature.
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
|
|
19
|
+
const serializedSignature = await getZkLoginSignature({ inputs, maxEpoch, userSignature });
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
To compute the address for a given address seed and iss you can use `computeZkLoginAddressFromSeed`
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
|
|
26
|
+
const address = computeZkLoginAddressFromSeed(0n, 'https://accounts.google.com');
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
To compute an address from jwt:
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
|
|
33
|
+
const address = jwtToAddress(jwtAsString, salt);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
To compute an address from a parsed jwt:
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
|
|
40
|
+
const address = computeZkLoginAddress({
|
|
41
|
+
claimName,
|
|
42
|
+
claimValue,
|
|
43
|
+
iss,
|
|
44
|
+
aud,
|
|
45
|
+
userSalt: BigInt(salt),
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
To use zkLogin inside a multisig, see the [Multisig Guide](../sui/cryptography/multisig) for more
|
|
50
|
+
details.
|
|
51
|
+
|
|
52
|
+
## Legacy addresses
|
|
53
|
+
|
|
54
|
+
When zklogin was first introduced, there was an inconsistency in how the address seed was computed.
|
|
55
|
+
For backwards compatibility reasons there are 2 valid addresses for a given set of inputs. Methods
|
|
56
|
+
that produce zklogin addresses all accept a `legacyAddress` boolean flag, either as their last
|
|
57
|
+
parameter, or in their options argument.
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
|
|
61
|
+
computeZkLoginAddress,
|
|
62
|
+
computeZkLoginAddressFromSeed,
|
|
63
|
+
jwtToAddress,
|
|
64
|
+
toZkLoginPublicIdentifier,
|
|
65
|
+
genAddressSeed,
|
|
66
|
+
} from '@mysten/sui/zklogin';
|
|
67
|
+
|
|
68
|
+
const address = jwtToAddress(jwtAsString, salt, true);
|
|
69
|
+
const address = computeZkLoginAddressFromSeed(0n, 'https://accounts.google.com', true);
|
|
70
|
+
const address = computeZkLoginAddress({
|
|
71
|
+
claimName,
|
|
72
|
+
claimValue,
|
|
73
|
+
iss,
|
|
74
|
+
aud,
|
|
75
|
+
userSalt: BigInt(salt),
|
|
76
|
+
legacyAddress: true,
|
|
77
|
+
});
|
|
78
|
+
const address = toZkLoginPublicIdentifier(
|
|
79
|
+
genAddressSeed(userSalt, claimName, claimValue, aud),
|
|
80
|
+
iss,
|
|
81
|
+
{ legacyAddress: true },
|
|
82
|
+
).toSuiAddress();
|
|
83
|
+
```
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"author": "Mysten Labs <build@mystenlabs.com>",
|
|
4
4
|
"description": "Sui TypeScript API",
|
|
5
5
|
"homepage": "https://sdk.mystenlabs.com",
|
|
6
|
-
"version": "2.16.
|
|
6
|
+
"version": "2.16.2",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"files": [
|
|
@@ -168,8 +168,8 @@
|
|
|
168
168
|
"graphql": "^16.12.0",
|
|
169
169
|
"poseidon-lite": "0.2.1",
|
|
170
170
|
"valibot": "^1.2.0",
|
|
171
|
-
"@mysten/bcs": "^2.0.
|
|
172
|
-
"@mysten/utils": "^0.3.
|
|
171
|
+
"@mysten/bcs": "^2.0.5",
|
|
172
|
+
"@mysten/utils": "^0.3.3"
|
|
173
173
|
},
|
|
174
174
|
"scripts": {
|
|
175
175
|
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
package/src/version.ts
CHANGED