@mysten/sui 2.7.0 → 2.8.0
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 +13 -0
- package/dist/bcs/bcs.d.mts +6 -6
- package/dist/cryptography/signature.d.mts +6 -6
- package/dist/grpc/proto/sui/rpc/v2/ledger_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.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
- package/dist/keypairs/passkey/keypair.d.mts +11 -4
- package/dist/keypairs/passkey/keypair.d.mts.map +1 -1
- package/dist/keypairs/passkey/keypair.mjs +19 -6
- package/dist/keypairs/passkey/keypair.mjs.map +1 -1
- package/dist/transactions/Transaction.d.mts +6 -6
- package/dist/transactions/Transaction.d.mts.map +1 -1
- package/dist/version.mjs +2 -2
- package/dist/version.mjs.map +1 -1
- package/dist/zklogin/bcs.d.mts +14 -14
- package/docs/bcs.md +131 -0
- package/docs/clients/core.md +601 -0
- package/docs/clients/graphql.md +99 -0
- package/docs/clients/grpc.md +152 -0
- package/docs/clients/index.md +93 -0
- package/docs/clients/json-rpc.md +235 -0
- package/docs/cryptography/keypairs.md +258 -0
- package/docs/cryptography/multisig.md +192 -0
- package/docs/cryptography/passkey.md +111 -0
- package/docs/cryptography/webcrypto-signer.md +81 -0
- package/docs/executors.md +147 -0
- package/docs/faucet.md +26 -0
- package/docs/hello-sui.md +114 -0
- package/docs/index.md +54 -0
- package/docs/install.md +61 -0
- package/docs/llm-docs.md +32 -0
- package/docs/llms-index.md +60 -0
- package/docs/migrations/0.38.md +57 -0
- package/docs/migrations/sui-1.0.md +453 -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 +157 -0
- package/docs/migrations/sui-2.0/json-rpc-migration.md +383 -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 +42 -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 +94 -0
- package/docs/plugins.md +255 -0
- package/docs/sdk-building.md +340 -0
- package/docs/transaction-building/basics.md +297 -0
- package/docs/transaction-building/gas.md +62 -0
- package/docs/transaction-building/intents.md +61 -0
- package/docs/transaction-building/offline.md +71 -0
- package/docs/transaction-building/sponsored-transactions.md +22 -0
- package/docs/utils/derived_objects.md +59 -0
- package/docs/utils/index.md +52 -0
- package/docs/zklogin.md +78 -0
- package/package.json +5 -3
- package/src/keypairs/passkey/keypair.ts +20 -6
- package/src/version.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @mysten/sui.js
|
|
2
2
|
|
|
3
|
+
## 2.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e51dc5d: Add credentialId support to PasskeyKeypair for targeted credential selection during
|
|
8
|
+
signing
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 43e69f8: Add embedded LLM-friendly docs to published packages
|
|
13
|
+
- Updated dependencies [43e69f8]
|
|
14
|
+
- @mysten/bcs@2.0.3
|
|
15
|
+
|
|
3
16
|
## 2.7.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/dist/bcs/bcs.d.mts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { TypeTag as TypeTag$1 } from "./types.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_bcs830 from "@mysten/bcs";
|
|
3
3
|
import { BcsType } from "@mysten/bcs";
|
|
4
4
|
|
|
5
5
|
//#region src/bcs/bcs.d.ts
|
|
6
6
|
|
|
7
7
|
declare const TypeTag: BcsType<string, string | TypeTag$1, string>;
|
|
8
|
-
declare function IntentMessage<T extends BcsType<any>>(T: T):
|
|
9
|
-
intent:
|
|
10
|
-
scope:
|
|
8
|
+
declare function IntentMessage<T extends BcsType<any>>(T: T): _mysten_bcs830.BcsStruct<{
|
|
9
|
+
intent: _mysten_bcs830.BcsStruct<{
|
|
10
|
+
scope: _mysten_bcs830.BcsEnum<{
|
|
11
11
|
TransactionData: null;
|
|
12
12
|
TransactionEffects: null;
|
|
13
13
|
CheckpointSummary: null;
|
|
14
14
|
PersonalMessage: null;
|
|
15
15
|
}, "IntentScope">;
|
|
16
|
-
version:
|
|
16
|
+
version: _mysten_bcs830.BcsEnum<{
|
|
17
17
|
V0: null;
|
|
18
18
|
}, "IntentVersion">;
|
|
19
|
-
appId:
|
|
19
|
+
appId: _mysten_bcs830.BcsEnum<{
|
|
20
20
|
Sui: null;
|
|
21
21
|
}, "AppId">;
|
|
22
22
|
}, string>;
|
|
@@ -33,6 +33,12 @@ declare function parseSerializedSignature(serializedSignature: string): {
|
|
|
33
33
|
clientDataJson: string;
|
|
34
34
|
userSignature: Uint8Array<ArrayBuffer>;
|
|
35
35
|
publicKey: Uint8Array<ArrayBuffer>;
|
|
36
|
+
} | {
|
|
37
|
+
serializedSignature: string;
|
|
38
|
+
signatureScheme: "ED25519" | "Secp256k1" | "Secp256r1";
|
|
39
|
+
signature: Uint8Array<ArrayBuffer>;
|
|
40
|
+
publicKey: Uint8Array<ArrayBuffer>;
|
|
41
|
+
bytes: Uint8Array<ArrayBuffer>;
|
|
36
42
|
} | {
|
|
37
43
|
serializedSignature: string;
|
|
38
44
|
signatureScheme: "ZkLogin";
|
|
@@ -57,12 +63,6 @@ declare function parseSerializedSignature(serializedSignature: string): {
|
|
|
57
63
|
};
|
|
58
64
|
signature: Uint8Array<ArrayBufferLike>;
|
|
59
65
|
publicKey: Uint8Array<ArrayBuffer>;
|
|
60
|
-
} | {
|
|
61
|
-
serializedSignature: string;
|
|
62
|
-
signatureScheme: "ED25519" | "Secp256k1" | "Secp256r1";
|
|
63
|
-
signature: Uint8Array<ArrayBuffer>;
|
|
64
|
-
publicKey: Uint8Array<ArrayBuffer>;
|
|
65
|
-
bytes: Uint8Array<ArrayBuffer>;
|
|
66
66
|
} | {
|
|
67
67
|
serializedSignature: string;
|
|
68
68
|
signatureScheme: "MultiSig";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BatchGetObjectsRequest, BatchGetObjectsResponse, BatchGetTransactionsRequest, BatchGetTransactionsResponse, GetCheckpointRequest, GetCheckpointResponse, GetEpochRequest, GetEpochResponse, GetObjectRequest, GetObjectResponse, GetServiceInfoRequest, GetServiceInfoResponse, GetTransactionRequest, GetTransactionResponse } from "./ledger_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime0 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc0 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/ledger_service.client.d.ts
|
|
@@ -46,9 +46,9 @@ interface ILedgerServiceClient {
|
|
|
46
46
|
declare class LedgerServiceClient implements ILedgerServiceClient, ServiceInfo {
|
|
47
47
|
private readonly _transport;
|
|
48
48
|
typeName: string;
|
|
49
|
-
methods:
|
|
49
|
+
methods: _protobuf_ts_runtime_rpc0.MethodInfo<any, any>[];
|
|
50
50
|
options: {
|
|
51
|
-
[extensionName: string]:
|
|
51
|
+
[extensionName: string]: _protobuf_ts_runtime0.JsonValue;
|
|
52
52
|
};
|
|
53
53
|
constructor(_transport: RpcTransport);
|
|
54
54
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GetBalanceRequest, GetBalanceResponse, GetCoinInfoRequest, GetCoinInfoResponse, ListBalancesRequest, ListBalancesResponse, ListDynamicFieldsRequest, ListDynamicFieldsResponse, ListOwnedObjectsRequest, ListOwnedObjectsResponse } from "./state_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime5 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc5 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/state_service.client.d.ts
|
|
@@ -36,9 +36,9 @@ interface IStateServiceClient {
|
|
|
36
36
|
declare class StateServiceClient implements IStateServiceClient, ServiceInfo {
|
|
37
37
|
private readonly _transport;
|
|
38
38
|
typeName: string;
|
|
39
|
-
methods:
|
|
39
|
+
methods: _protobuf_ts_runtime_rpc5.MethodInfo<any, any>[];
|
|
40
40
|
options: {
|
|
41
|
-
[extensionName: string]:
|
|
41
|
+
[extensionName: string]: _protobuf_ts_runtime5.JsonValue;
|
|
42
42
|
};
|
|
43
43
|
constructor(_transport: RpcTransport);
|
|
44
44
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SubscribeCheckpointsRequest, SubscribeCheckpointsResponse } from "./subscription_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime4 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc4 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServerStreamingCall, ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/subscription_service.client.d.ts
|
|
@@ -32,9 +32,9 @@ interface ISubscriptionServiceClient {
|
|
|
32
32
|
declare class SubscriptionServiceClient implements ISubscriptionServiceClient, ServiceInfo {
|
|
33
33
|
private readonly _transport;
|
|
34
34
|
typeName: string;
|
|
35
|
-
methods:
|
|
35
|
+
methods: _protobuf_ts_runtime_rpc4.MethodInfo<any, any>[];
|
|
36
36
|
options: {
|
|
37
|
-
[extensionName: string]:
|
|
37
|
+
[extensionName: string]: _protobuf_ts_runtime4.JsonValue;
|
|
38
38
|
};
|
|
39
39
|
constructor(_transport: RpcTransport);
|
|
40
40
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.mts","names":[],"sources":["../../../../../../src/grpc/proto/sui/rpc/v2/transaction.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA0BA;;;;AAkCc,UAlCG,WAAA,CAkCH;EAAqB;AAOnC;AAiCA;;;EAkCgB,GAAA,CAAA,EAtGT,GAsGS;EAAS;AAiBzB;AAsCA;;;EA4BiB,MAAA,CAAA,EAAA,MAAA;EAYJ;;;;;EAqCmC,OAAA,CAAA,EAAA,MAAA;EASpC;AAuFZ;AAoBA;EAYc,IAAA,CAAA,EA1VN,eA0VM;EAYO;;;EA8BR,MAAA,CAAA,EAAA,MAAA;EAWO;;;EA6BH,UAAA,CAAQ,EApaX,UAoaW;EAqCR;AAmBjB;AAmBA;EAqBiB,UAAO,CAAA,EAhgBV,
|
|
1
|
+
{"version":3,"file":"transaction.d.mts","names":[],"sources":["../../../../../../src/grpc/proto/sui/rpc/v2/transaction.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA0BA;;;;AAkCc,UAlCG,WAAA,CAkCH;EAAqB;AAOnC;AAiCA;;;EAkCgB,GAAA,CAAA,EAtGT,GAsGS;EAAS;AAiBzB;AAsCA;;;EA4BiB,MAAA,CAAA,EAAA,MAAA;EAY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;;;cAyB1B,SAAO;cAEd,0BAAA,SAAmC,YAAY;;;;;;cAkCxC,uBAAqB;cAE5B,gBAAA,SAAyB,YAAY;;;;;;cAiE9B,aAAW;cAElB,kBAAA,SAA2B,YAAY;;;;;;cA+BhC,eAAa;cAEpB,uBAAA,SAAgC,YAAY;;;;;;cAUrC,oBAAkB;cAEzB,4BAAA,SAAqC,YAAY;;;;;;cAsD1C,yBAAuB;cAE9B,sBAAA,SAA+B,YAAY;;;;;;cA0BpC,mBAAiB;cAExB,wBAAA,SAAiC,YAAY;;;;;;cAiBtC,qBAAmB;cAE1B,0CAAA,SAAmD,YAAY;;;;;;cAiBxD,uCAAqC;cAG5C,6BAAA,SAAsC,YAAY;;;;;;cAwC3C,0BAAwB;cAE/B,cAAA,SAAuB,YAAY;;;;;;cAmB5B,WAAS;cAEhB,0BAAA,SAAmC,YAAY;;;;;;cAgBxC,uBAAqB;cAE5B,8BAAA,SAAuC,YAAY;;;;;;cAgD5C,2BAAyB;cAEhC,6BAAA,SAAsC,YAAY;;;;;;cAyB3C,0BAAwB;cAE/B,8BAAA,SAAuC,YAAY;;;;;;cAiB5C,2BAAyB;cAEhC,6BAAA,SAAsC,YAAY;;;;;;cA2B3C,0BAAwB;cAE/B,sCAAA,SAA+C,YAAY;;;;;;cAWpD,mCAAiC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExecuteTransactionRequest, ExecuteTransactionResponse, SimulateTransactionRequest, SimulateTransactionResponse } from "./transaction_execution_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime1 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc1 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.ts
|
|
@@ -24,9 +24,9 @@ interface ITransactionExecutionServiceClient {
|
|
|
24
24
|
declare class TransactionExecutionServiceClient implements ITransactionExecutionServiceClient, ServiceInfo {
|
|
25
25
|
private readonly _transport;
|
|
26
26
|
typeName: string;
|
|
27
|
-
methods:
|
|
27
|
+
methods: _protobuf_ts_runtime_rpc1.MethodInfo<any, any>[];
|
|
28
28
|
options: {
|
|
29
|
-
[extensionName: string]:
|
|
29
|
+
[extensionName: string]: _protobuf_ts_runtime1.JsonValue;
|
|
30
30
|
};
|
|
31
31
|
constructor(_transport: RpcTransport);
|
|
32
32
|
/**
|
|
@@ -11,13 +11,13 @@ type DeepPartial<T> = T extends object ? { [P in keyof T]?: DeepPartial<T[P]> }
|
|
|
11
11
|
type BrowserPasswordProviderOptions = Pick<DeepPartial<PublicKeyCredentialCreationOptions>, DeepPartialConfigKeys> & Omit<Partial<PublicKeyCredentialCreationOptions>, DeepPartialConfigKeys | 'pubKeyCredParams' | 'challenge'>;
|
|
12
12
|
interface PasskeyProvider {
|
|
13
13
|
create(): Promise<RegistrationCredential>;
|
|
14
|
-
get(challenge: Uint8Array): Promise<AuthenticationCredential>;
|
|
14
|
+
get(challenge: Uint8Array, credentialId?: Uint8Array): Promise<AuthenticationCredential>;
|
|
15
15
|
}
|
|
16
16
|
declare class BrowserPasskeyProvider implements PasskeyProvider {
|
|
17
17
|
#private;
|
|
18
18
|
constructor(name: string, options: BrowserPasswordProviderOptions);
|
|
19
19
|
create(): Promise<RegistrationCredential>;
|
|
20
|
-
get(challenge: Uint8Array): Promise<AuthenticationCredential>;
|
|
20
|
+
get(challenge: Uint8Array, credentialId?: Uint8Array): Promise<AuthenticationCredential>;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* @experimental
|
|
@@ -26,6 +26,7 @@ declare class BrowserPasskeyProvider implements PasskeyProvider {
|
|
|
26
26
|
declare class PasskeyKeypair extends Signer {
|
|
27
27
|
private publicKey;
|
|
28
28
|
private provider;
|
|
29
|
+
private credentialId?;
|
|
29
30
|
/**
|
|
30
31
|
* Get the key scheme of passkey,
|
|
31
32
|
*/
|
|
@@ -44,7 +45,13 @@ declare class PasskeyKeypair extends Signer {
|
|
|
44
45
|
* If there are existing passkey wallet, use `signAndRecover` to identify the correct
|
|
45
46
|
* public key and then initialize the instance. See usage in `signAndRecover`.
|
|
46
47
|
*/
|
|
47
|
-
constructor(publicKey: Uint8Array, provider: PasskeyProvider);
|
|
48
|
+
constructor(publicKey: Uint8Array, provider: PasskeyProvider, credentialId?: Uint8Array);
|
|
49
|
+
/**
|
|
50
|
+
* Return the credential ID for this passkey, if available.
|
|
51
|
+
* The credential ID is captured when creating a new passkey via `getPasskeyInstance`
|
|
52
|
+
* and can be used to constrain which credential the browser selects during signing.
|
|
53
|
+
*/
|
|
54
|
+
getCredentialId(): Uint8Array | undefined;
|
|
48
55
|
/**
|
|
49
56
|
* Creates an instance of Passkey signer invoking the passkey from navigator.
|
|
50
57
|
* Note that this will invoke the passkey device to create a fresh credential.
|
|
@@ -93,7 +100,7 @@ declare class PasskeyKeypair extends Signer {
|
|
|
93
100
|
* const testMessage2 = new TextEncoder().encode('Hello world 2!');
|
|
94
101
|
* const possiblePks2 = await PasskeyKeypair.signAndRecover(provider, testMessage2);
|
|
95
102
|
* const commonPk = findCommonPublicKey(possiblePks, possiblePks2);
|
|
96
|
-
* const signer = new PasskeyKeypair(
|
|
103
|
+
* const signer = new PasskeyKeypair(commonPk.toRawBytes(), provider);
|
|
97
104
|
* ```
|
|
98
105
|
*
|
|
99
106
|
* @param provider - the passkey provider.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keypair.d.mts","names":[],"sources":["../../../src/keypairs/passkey/keypair.ts"],"sourcesContent":[],"mappings":";;;;;;;;KAsBK,qBAAA;KAEA,iBAAiB,iCAEP,KAAK,YAAY,EAAE,KANiD,GAQhF,CANE;AAEA,KAMO,8BAAA,GAAiC,IAN7B,CAOf,WAPe,CAOH,kCAPG,CAAA,EAQf,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;;;;AAuDA;EAQiB,WAAA,CAAA,SAAA,EAkBO,UAlBP,EAAA,QAAA,EAkB6B,eAlB7B,EAAA,YAAA,CAAA,EAkB6D,UAlB7D;EAkBO;;;;;EAwB6C,eAAA,CAAA,CAAA,EAZjD,UAYiD,GAAA,SAAA;EAAR;;;;;;;;EAoEU,OAAA,kBAAA,CAAA,QAAA,EApE5B,eAoE4B,CAAA,EApEV,OAoEU,CApEF,cAoEE,CAAA;EAAR;;;EAqDnD,YAAA,CAAA,CAAA,EAvGK,SAuGL;EAAR;;;AA6BJ;EAA0C,IAAA,CAAA,IAAA,EA5HxB,UA4HwB,CAAA,EA5Hd,OA4Hc,CA5Hd,UA4Hc,CA5Hd,WA4Hc,CAAA,CAAA;EAAmB;;;;wBAlFhC,oBAAoB,cAAc,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAmD3D,0BACD,aACP,QAAQ;;;;;;;;;;iBA6BI,mBAAA,OAA0B,mBAAmB,cAAc"}
|
|
@@ -45,11 +45,15 @@ var BrowserPasskeyProvider = class {
|
|
|
45
45
|
}
|
|
46
46
|
} });
|
|
47
47
|
}
|
|
48
|
-
async get(challenge) {
|
|
48
|
+
async get(challenge, credentialId) {
|
|
49
49
|
return await navigator.credentials.get({ publicKey: {
|
|
50
50
|
challenge,
|
|
51
51
|
userVerification: this.#options.authenticatorSelection?.userVerification || "required",
|
|
52
|
-
timeout: this.#options.timeout ?? 6e4
|
|
52
|
+
timeout: this.#options.timeout ?? 6e4,
|
|
53
|
+
...credentialId && { allowCredentials: [{
|
|
54
|
+
type: "public-key",
|
|
55
|
+
id: credentialId
|
|
56
|
+
}] }
|
|
53
57
|
} });
|
|
54
58
|
}
|
|
55
59
|
};
|
|
@@ -78,10 +82,19 @@ var PasskeyKeypair = class PasskeyKeypair extends Signer {
|
|
|
78
82
|
* If there are existing passkey wallet, use `signAndRecover` to identify the correct
|
|
79
83
|
* public key and then initialize the instance. See usage in `signAndRecover`.
|
|
80
84
|
*/
|
|
81
|
-
constructor(publicKey, provider) {
|
|
85
|
+
constructor(publicKey, provider, credentialId) {
|
|
82
86
|
super();
|
|
83
87
|
this.publicKey = publicKey;
|
|
84
88
|
this.provider = provider;
|
|
89
|
+
this.credentialId = credentialId;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Return the credential ID for this passkey, if available.
|
|
93
|
+
* The credential ID is captured when creating a new passkey via `getPasskeyInstance`
|
|
94
|
+
* and can be used to constrain which credential the browser selects during signing.
|
|
95
|
+
*/
|
|
96
|
+
getCredentialId() {
|
|
97
|
+
return this.credentialId;
|
|
85
98
|
}
|
|
86
99
|
/**
|
|
87
100
|
* Creates an instance of Passkey signer invoking the passkey from navigator.
|
|
@@ -97,7 +110,7 @@ var PasskeyKeypair = class PasskeyKeypair extends Signer {
|
|
|
97
110
|
else {
|
|
98
111
|
const derSPKI = credential.response.getPublicKey();
|
|
99
112
|
const pubkeyUncompressed = parseDerSPKI(new Uint8Array(derSPKI));
|
|
100
|
-
return new PasskeyKeypair(p256.Point.fromBytes(pubkeyUncompressed).toBytes(true), provider);
|
|
113
|
+
return new PasskeyKeypair(p256.Point.fromBytes(pubkeyUncompressed).toBytes(true), provider, new Uint8Array(credential.rawId));
|
|
101
114
|
}
|
|
102
115
|
}
|
|
103
116
|
/**
|
|
@@ -111,7 +124,7 @@ var PasskeyKeypair = class PasskeyKeypair extends Signer {
|
|
|
111
124
|
* This is sent to passkey as the challenge field.
|
|
112
125
|
*/
|
|
113
126
|
async sign(data) {
|
|
114
|
-
const credential = await this.provider.get(data);
|
|
127
|
+
const credential = await this.provider.get(data, this.credentialId);
|
|
115
128
|
const authenticatorData = new Uint8Array(credential.response.authenticatorData);
|
|
116
129
|
const clientDataJSON = new Uint8Array(credential.response.clientDataJSON);
|
|
117
130
|
const clientDataJSONString = new TextDecoder().decode(clientDataJSON);
|
|
@@ -168,7 +181,7 @@ var PasskeyKeypair = class PasskeyKeypair extends Signer {
|
|
|
168
181
|
* const testMessage2 = new TextEncoder().encode('Hello world 2!');
|
|
169
182
|
* const possiblePks2 = await PasskeyKeypair.signAndRecover(provider, testMessage2);
|
|
170
183
|
* const commonPk = findCommonPublicKey(possiblePks, possiblePks2);
|
|
171
|
-
* const signer = new PasskeyKeypair(
|
|
184
|
+
* const signer = new PasskeyKeypair(commonPk.toRawBytes(), provider);
|
|
172
185
|
* ```
|
|
173
186
|
*
|
|
174
187
|
* @param provider - the passkey provider.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keypair.mjs","names":["#name","#options","secp256r1"],"sources":["../../../src/keypairs/passkey/keypair.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { toBase64 } from '@mysten/bcs';\nimport { p256 as secp256r1 } from '@noble/curves/nist.js';\nimport { blake2b } from '@noble/hashes/blake2.js';\nimport { sha256 } from '@noble/hashes/sha2.js';\nimport { randomBytes } from '@noble/hashes/utils.js';\n\nimport { PasskeyAuthenticator } from '../../bcs/bcs.js';\nimport type { IntentScope, SignatureWithBytes } from '../../cryptography/index.js';\nimport { messageWithIntent, SIGNATURE_SCHEME_TO_FLAG, Signer } from '../../cryptography/index.js';\nimport type { PublicKey } from '../../cryptography/publickey.js';\nimport type { SignatureScheme } from '../../cryptography/signature-scheme.js';\nimport {\n\tparseDerSPKI,\n\tPASSKEY_PUBLIC_KEY_SIZE,\n\tPASSKEY_SIGNATURE_SIZE,\n\tPasskeyPublicKey,\n} from './publickey.js';\nimport type { AuthenticationCredential, RegistrationCredential } from './types.js';\n\ntype DeepPartialConfigKeys = 'rp' | 'user' | 'authenticatorSelection';\n\ntype DeepPartial<T> = T extends object\n\t? {\n\t\t\t[P in keyof T]?: DeepPartial<T[P]>;\n\t\t}\n\t: T;\n\nexport type BrowserPasswordProviderOptions = Pick<\n\tDeepPartial<PublicKeyCredentialCreationOptions>,\n\tDeepPartialConfigKeys\n> &\n\tOmit<\n\t\tPartial<PublicKeyCredentialCreationOptions>,\n\t\tDeepPartialConfigKeys | 'pubKeyCredParams' | 'challenge'\n\t>;\n\nexport interface PasskeyProvider {\n\tcreate(): Promise<RegistrationCredential>;\n\tget(challenge: Uint8Array): Promise<AuthenticationCredential>;\n}\n\n// Default browser implementation\nexport class BrowserPasskeyProvider implements PasskeyProvider {\n\t#name: string;\n\t#options: BrowserPasswordProviderOptions;\n\n\tconstructor(name: string, options: BrowserPasswordProviderOptions) {\n\t\tthis.#name = name;\n\t\tthis.#options = options;\n\t}\n\n\tasync create(): Promise<RegistrationCredential> {\n\t\treturn (await navigator.credentials.create({\n\t\t\tpublicKey: {\n\t\t\t\ttimeout: this.#options.timeout ?? 60000,\n\t\t\t\t...this.#options,\n\t\t\t\trp: {\n\t\t\t\t\tname: this.#name,\n\t\t\t\t\t...this.#options.rp,\n\t\t\t\t},\n\t\t\t\tuser: {\n\t\t\t\t\tname: this.#name,\n\t\t\t\t\tdisplayName: this.#name,\n\t\t\t\t\t...this.#options.user,\n\t\t\t\t\tid: randomBytes(10) as BufferSource,\n\t\t\t\t},\n\t\t\t\tchallenge: new TextEncoder().encode('Create passkey wallet on Sui'),\n\t\t\t\tpubKeyCredParams: [{ alg: -7, type: 'public-key' }],\n\t\t\t\tauthenticatorSelection: {\n\t\t\t\t\tauthenticatorAttachment: 'cross-platform',\n\t\t\t\t\tresidentKey: 'required',\n\t\t\t\t\trequireResidentKey: true,\n\t\t\t\t\tuserVerification: 'required',\n\t\t\t\t\t...this.#options.authenticatorSelection,\n\t\t\t\t},\n\t\t\t},\n\t\t})) as RegistrationCredential;\n\t}\n\n\tasync get(challenge: Uint8Array): Promise<AuthenticationCredential> {\n\t\treturn (await navigator.credentials.get({\n\t\t\tpublicKey: {\n\t\t\t\tchallenge: challenge as BufferSource,\n\t\t\t\tuserVerification: this.#options.authenticatorSelection?.userVerification || 'required',\n\t\t\t\ttimeout: this.#options.timeout ?? 60000,\n\t\t\t},\n\t\t})) as AuthenticationCredential;\n\t}\n}\n\n/**\n * @experimental\n * A passkey signer used for signing transactions. This is a client side implementation for [SIP-9](https://github.com/sui-foundation/sips/blob/main/sips/sip-9.md).\n */\nexport class PasskeyKeypair extends Signer {\n\tprivate publicKey: Uint8Array;\n\tprivate provider: PasskeyProvider;\n\n\t/**\n\t * Get the key scheme of passkey,\n\t */\n\tgetKeyScheme(): SignatureScheme {\n\t\treturn 'Passkey';\n\t}\n\n\t/**\n\t * Creates an instance of Passkey signer. If no passkey wallet had created before,\n\t * use `getPasskeyInstance`. For example:\n\t * ```\n\t * let provider = new BrowserPasskeyProvider('Sui Passkey Example',{\n\t * \t rpName: 'Sui Passkey Example',\n\t * \t rpId: window.location.hostname,\n\t * } as BrowserPasswordProviderOptions);\n\t * const signer = await PasskeyKeypair.getPasskeyInstance(provider);\n\t * ```\n\t *\n\t * If there are existing passkey wallet, use `signAndRecover` to identify the correct\n\t * public key and then initialize the instance. See usage in `signAndRecover`.\n\t */\n\tconstructor(publicKey: Uint8Array, provider: PasskeyProvider) {\n\t\tsuper();\n\t\tthis.publicKey = publicKey;\n\t\tthis.provider = provider;\n\t}\n\n\t/**\n\t * Creates an instance of Passkey signer invoking the passkey from navigator.\n\t * Note that this will invoke the passkey device to create a fresh credential.\n\t * Should only be called if passkey wallet is created for the first time.\n\t *\n\t * @param provider - the passkey provider.\n\t * @returns the passkey instance.\n\t */\n\tstatic async getPasskeyInstance(provider: PasskeyProvider): Promise<PasskeyKeypair> {\n\t\t// create a passkey secp256r1 with the provider.\n\t\tconst credential = await provider.create();\n\n\t\tif (!credential.response.getPublicKey()) {\n\t\t\tthrow new Error('Invalid credential create response');\n\t\t} else {\n\t\t\tconst derSPKI = credential.response.getPublicKey()!;\n\t\t\tconst pubkeyUncompressed = parseDerSPKI(new Uint8Array(derSPKI));\n\t\t\tconst pubkey = secp256r1.Point.fromBytes(pubkeyUncompressed);\n\t\t\tconst pubkeyCompressed = pubkey.toBytes(true);\n\t\t\treturn new PasskeyKeypair(pubkeyCompressed, provider);\n\t\t}\n\t}\n\n\t/**\n\t * Return the public key for this passkey.\n\t */\n\tgetPublicKey(): PublicKey {\n\t\treturn new PasskeyPublicKey(this.publicKey);\n\t}\n\n\t/**\n\t * Return the signature for the provided data (i.e. blake2b(intent_message)).\n\t * This is sent to passkey as the challenge field.\n\t */\n\tasync sign(data: Uint8Array) {\n\t\t// asks the passkey to sign over challenge as the data.\n\t\tconst credential = await this.provider.get(data);\n\n\t\t// parse authenticatorData (as bytes), clientDataJSON (decoded as string).\n\t\tconst authenticatorData = new Uint8Array(credential.response.authenticatorData);\n\t\tconst clientDataJSON = new Uint8Array(credential.response.clientDataJSON); // response.clientDataJSON is already UTF-8 encoded JSON\n\t\tconst decoder = new TextDecoder();\n\t\tconst clientDataJSONString: string = decoder.decode(clientDataJSON);\n\n\t\tconst sig = secp256r1.Signature.fromBytes(new Uint8Array(credential.response.signature), 'der');\n\t\tconst normalizedSig = sig.hasHighS()\n\t\t\t? new secp256r1.Signature(sig.r, secp256r1.Point.Fn.neg(sig.s))\n\t\t\t: sig;\n\n\t\tconst normalized = normalizedSig.toBytes('compact');\n\n\t\tif (\n\t\t\tnormalized.length !== PASSKEY_SIGNATURE_SIZE ||\n\t\t\tthis.publicKey.length !== PASSKEY_PUBLIC_KEY_SIZE\n\t\t) {\n\t\t\tthrow new Error('Invalid signature or public key length');\n\t\t}\n\n\t\t// construct userSignature as flag || sig || pubkey for the secp256r1 signature.\n\t\tconst arr = new Uint8Array(1 + normalized.length + this.publicKey.length);\n\t\tarr.set([SIGNATURE_SCHEME_TO_FLAG['Secp256r1']]);\n\t\tarr.set(normalized, 1);\n\t\tarr.set(this.publicKey, 1 + normalized.length);\n\n\t\t// serialize all fields into a passkey signature according to https://github.com/sui-foundation/sips/blob/main/sips/sip-9.md#signature-encoding\n\t\treturn PasskeyAuthenticator.serialize({\n\t\t\tauthenticatorData: authenticatorData,\n\t\t\tclientDataJson: clientDataJSONString,\n\t\t\tuserSignature: arr,\n\t\t}).toBytes();\n\t}\n\n\t/**\n\t * This overrides the base class implementation that accepts the raw bytes and signs its\n\t * digest of the intent message, then serialize it with the passkey flag.\n\t */\n\tasync signWithIntent(bytes: Uint8Array, intent: IntentScope): Promise<SignatureWithBytes> {\n\t\t// prepend it into an intent message and computes the digest.\n\t\tconst intentMessage = messageWithIntent(intent, bytes);\n\t\tconst digest = blake2b(intentMessage, { dkLen: 32 });\n\n\t\t// sign the digest.\n\t\tconst signature = await this.sign(digest);\n\n\t\t// prepend with the passkey flag.\n\t\tconst serializedSignature = new Uint8Array(1 + signature.length);\n\t\tserializedSignature.set([SIGNATURE_SCHEME_TO_FLAG[this.getKeyScheme()]]);\n\t\tserializedSignature.set(signature, 1);\n\t\treturn {\n\t\t\tsignature: toBase64(serializedSignature),\n\t\t\tbytes: toBase64(bytes),\n\t\t};\n\t}\n\n\t/**\n\t * Given a message, asks the passkey device to sign it and return all (up to 4) possible public keys.\n\t * See: https://bitcoin.stackexchange.com/questions/81232/how-is-public-key-extracted-from-message-digital-signature-address\n\t *\n\t * This is useful if the user previously created passkey wallet with the origin, but the wallet session\n\t * does not have the public key / address. By calling this method twice with two different messages, the\n\t * wallet can compare the returned public keys and uniquely identify the previously created passkey wallet\n\t * using `findCommonPublicKey`.\n\t *\n\t * Alternatively, one call can be made and all possible public keys should be checked onchain to see if\n\t * there is any assets.\n\t *\n\t * Once the correct public key is identified, a passkey instance can then be initialized with this public key.\n\t *\n\t * Example usage to recover wallet with two signing calls:\n\t * ```\n\t * let provider = new BrowserPasskeyProvider('Sui Passkey Example',{\n\t * rpName: 'Sui Passkey Example',\n\t * \t rpId: window.location.hostname,\n\t * } as BrowserPasswordProviderOptions);\n\t * const testMessage = new TextEncoder().encode('Hello world!');\n\t * const possiblePks = await PasskeyKeypair.signAndRecover(provider, testMessage);\n\t * const testMessage2 = new TextEncoder().encode('Hello world 2!');\n\t * const possiblePks2 = await PasskeyKeypair.signAndRecover(provider, testMessage2);\n\t * const commonPk = findCommonPublicKey(possiblePks, possiblePks2);\n\t * const signer = new PasskeyKeypair(provider, commonPk.toRawBytes());\n\t * ```\n\t *\n\t * @param provider - the passkey provider.\n\t * @param message - the message to sign.\n\t * @returns all possible public keys.\n\t */\n\tstatic async signAndRecover(\n\t\tprovider: PasskeyProvider,\n\t\tmessage: Uint8Array,\n\t): Promise<PublicKey[]> {\n\t\tconst credential = await provider.get(message);\n\t\tconst fullMessage = messageFromAssertionResponse(credential.response);\n\t\tconst sig = secp256r1.Signature.fromBytes(new Uint8Array(credential.response.signature), 'der');\n\n\t\tconst res = [];\n\t\tconst msgHash = sha256(fullMessage);\n\t\tfor (let i = 0; i < 4; i++) {\n\t\t\tconst s = sig.addRecoveryBit(i);\n\t\t\ttry {\n\t\t\t\tconst pubkey = s.recoverPublicKey(msgHash);\n\t\t\t\tconst pk = new PasskeyPublicKey(pubkey.toBytes(true));\n\t\t\t\tres.push(pk);\n\t\t\t} catch {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}\n}\n\n/**\n * Finds the unique public key that exists in both arrays, throws error if the common\n * pubkey does not equal to one.\n *\n * @param arr1 - The first pubkeys array.\n * @param arr2 - The second pubkeys array.\n * @returns The only common pubkey in both arrays.\n */\nexport function findCommonPublicKey(arr1: PublicKey[], arr2: PublicKey[]): PublicKey {\n\tconst matchingPubkeys: PublicKey[] = [];\n\tfor (const pubkey1 of arr1) {\n\t\tfor (const pubkey2 of arr2) {\n\t\t\tif (pubkey1.equals(pubkey2)) {\n\t\t\t\tmatchingPubkeys.push(pubkey1);\n\t\t\t}\n\t\t}\n\t}\n\tif (matchingPubkeys.length !== 1) {\n\t\tthrow new Error('No unique public key found');\n\t}\n\treturn matchingPubkeys[0];\n}\n\n/**\n * Constructs the message that the passkey signature is produced over as authenticatorData || sha256(clientDataJSON).\n */\nfunction messageFromAssertionResponse(response: AuthenticatorAssertionResponse): Uint8Array {\n\tconst authenticatorData = new Uint8Array(response.authenticatorData);\n\tconst clientDataJSON = new Uint8Array(response.clientDataJSON);\n\tconst clientDataJSONDigest = sha256(clientDataJSON);\n\treturn new Uint8Array([...authenticatorData, ...clientDataJSONDigest]);\n}\n"],"mappings":";;;;;;;;;;;;AA6CA,IAAa,yBAAb,MAA+D;CAC9D;CACA;CAEA,YAAY,MAAc,SAAyC;AAClE,QAAKA,OAAQ;AACb,QAAKC,UAAW;;CAGjB,MAAM,SAA0C;AAC/C,SAAQ,MAAM,UAAU,YAAY,OAAO,EAC1C,WAAW;GACV,SAAS,MAAKA,QAAS,WAAW;GAClC,GAAG,MAAKA;GACR,IAAI;IACH,MAAM,MAAKD;IACX,GAAG,MAAKC,QAAS;IACjB;GACD,MAAM;IACL,MAAM,MAAKD;IACX,aAAa,MAAKA;IAClB,GAAG,MAAKC,QAAS;IACjB,IAAI,YAAY,GAAG;IACnB;GACD,WAAW,IAAI,aAAa,CAAC,OAAO,+BAA+B;GACnE,kBAAkB,CAAC;IAAE,KAAK;IAAI,MAAM;IAAc,CAAC;GACnD,wBAAwB;IACvB,yBAAyB;IACzB,aAAa;IACb,oBAAoB;IACpB,kBAAkB;IAClB,GAAG,MAAKA,QAAS;IACjB;GACD,EACD,CAAC;;CAGH,MAAM,IAAI,WAA0D;AACnE,SAAQ,MAAM,UAAU,YAAY,IAAI,EACvC,WAAW;GACC;GACX,kBAAkB,MAAKA,QAAS,wBAAwB,oBAAoB;GAC5E,SAAS,MAAKA,QAAS,WAAW;GAClC,EACD,CAAC;;;;;;;AAQJ,IAAa,iBAAb,MAAa,uBAAuB,OAAO;;;;CAO1C,eAAgC;AAC/B,SAAO;;;;;;;;;;;;;;;;CAiBR,YAAY,WAAuB,UAA2B;AAC7D,SAAO;AACP,OAAK,YAAY;AACjB,OAAK,WAAW;;;;;;;;;;CAWjB,aAAa,mBAAmB,UAAoD;EAEnF,MAAM,aAAa,MAAM,SAAS,QAAQ;AAE1C,MAAI,CAAC,WAAW,SAAS,cAAc,CACtC,OAAM,IAAI,MAAM,qCAAqC;OAC/C;GACN,MAAM,UAA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"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { toBase64 } from '@mysten/bcs';\nimport { p256 as secp256r1 } from '@noble/curves/nist.js';\nimport { blake2b } from '@noble/hashes/blake2.js';\nimport { sha256 } from '@noble/hashes/sha2.js';\nimport { randomBytes } from '@noble/hashes/utils.js';\n\nimport { PasskeyAuthenticator } from '../../bcs/bcs.js';\nimport type { IntentScope, SignatureWithBytes } from '../../cryptography/index.js';\nimport { messageWithIntent, SIGNATURE_SCHEME_TO_FLAG, Signer } from '../../cryptography/index.js';\nimport type { PublicKey } from '../../cryptography/publickey.js';\nimport type { SignatureScheme } from '../../cryptography/signature-scheme.js';\nimport {\n\tparseDerSPKI,\n\tPASSKEY_PUBLIC_KEY_SIZE,\n\tPASSKEY_SIGNATURE_SIZE,\n\tPasskeyPublicKey,\n} from './publickey.js';\nimport type { AuthenticationCredential, RegistrationCredential } from './types.js';\n\ntype DeepPartialConfigKeys = 'rp' | 'user' | 'authenticatorSelection';\n\ntype DeepPartial<T> = T extends object\n\t? {\n\t\t\t[P in keyof T]?: DeepPartial<T[P]>;\n\t\t}\n\t: T;\n\nexport type BrowserPasswordProviderOptions = Pick<\n\tDeepPartial<PublicKeyCredentialCreationOptions>,\n\tDeepPartialConfigKeys\n> &\n\tOmit<\n\t\tPartial<PublicKeyCredentialCreationOptions>,\n\t\tDeepPartialConfigKeys | 'pubKeyCredParams' | 'challenge'\n\t>;\n\nexport interface PasskeyProvider {\n\tcreate(): Promise<RegistrationCredential>;\n\tget(challenge: Uint8Array, credentialId?: Uint8Array): Promise<AuthenticationCredential>;\n}\n\n// Default browser implementation\nexport class BrowserPasskeyProvider implements PasskeyProvider {\n\t#name: string;\n\t#options: BrowserPasswordProviderOptions;\n\n\tconstructor(name: string, options: BrowserPasswordProviderOptions) {\n\t\tthis.#name = name;\n\t\tthis.#options = options;\n\t}\n\n\tasync create(): Promise<RegistrationCredential> {\n\t\treturn (await navigator.credentials.create({\n\t\t\tpublicKey: {\n\t\t\t\ttimeout: this.#options.timeout ?? 60000,\n\t\t\t\t...this.#options,\n\t\t\t\trp: {\n\t\t\t\t\tname: this.#name,\n\t\t\t\t\t...this.#options.rp,\n\t\t\t\t},\n\t\t\t\tuser: {\n\t\t\t\t\tname: this.#name,\n\t\t\t\t\tdisplayName: this.#name,\n\t\t\t\t\t...this.#options.user,\n\t\t\t\t\tid: randomBytes(10) as BufferSource,\n\t\t\t\t},\n\t\t\t\tchallenge: new TextEncoder().encode('Create passkey wallet on Sui'),\n\t\t\t\tpubKeyCredParams: [{ alg: -7, type: 'public-key' }],\n\t\t\t\tauthenticatorSelection: {\n\t\t\t\t\tauthenticatorAttachment: 'cross-platform',\n\t\t\t\t\tresidentKey: 'required',\n\t\t\t\t\trequireResidentKey: true,\n\t\t\t\t\tuserVerification: 'required',\n\t\t\t\t\t...this.#options.authenticatorSelection,\n\t\t\t\t},\n\t\t\t},\n\t\t})) as RegistrationCredential;\n\t}\n\n\tasync get(challenge: Uint8Array, credentialId?: Uint8Array): Promise<AuthenticationCredential> {\n\t\treturn (await navigator.credentials.get({\n\t\t\tpublicKey: {\n\t\t\t\tchallenge: challenge as BufferSource,\n\t\t\t\tuserVerification: this.#options.authenticatorSelection?.userVerification || 'required',\n\t\t\t\ttimeout: this.#options.timeout ?? 60000,\n\t\t\t\t...(credentialId && {\n\t\t\t\t\tallowCredentials: [{ type: 'public-key' as const, id: credentialId as BufferSource }],\n\t\t\t\t}),\n\t\t\t},\n\t\t})) as AuthenticationCredential;\n\t}\n}\n\n/**\n * @experimental\n * A passkey signer used for signing transactions. This is a client side implementation for [SIP-9](https://github.com/sui-foundation/sips/blob/main/sips/sip-9.md).\n */\nexport class PasskeyKeypair extends Signer {\n\tprivate publicKey: Uint8Array;\n\tprivate provider: PasskeyProvider;\n\tprivate credentialId?: Uint8Array;\n\n\t/**\n\t * Get the key scheme of passkey,\n\t */\n\tgetKeyScheme(): SignatureScheme {\n\t\treturn 'Passkey';\n\t}\n\n\t/**\n\t * Creates an instance of Passkey signer. If no passkey wallet had created before,\n\t * use `getPasskeyInstance`. For example:\n\t * ```\n\t * let provider = new BrowserPasskeyProvider('Sui Passkey Example',{\n\t * \t rpName: 'Sui Passkey Example',\n\t * \t rpId: window.location.hostname,\n\t * } as BrowserPasswordProviderOptions);\n\t * const signer = await PasskeyKeypair.getPasskeyInstance(provider);\n\t * ```\n\t *\n\t * If there are existing passkey wallet, use `signAndRecover` to identify the correct\n\t * public key and then initialize the instance. See usage in `signAndRecover`.\n\t */\n\tconstructor(publicKey: Uint8Array, provider: PasskeyProvider, credentialId?: Uint8Array) {\n\t\tsuper();\n\t\tthis.publicKey = publicKey;\n\t\tthis.provider = provider;\n\t\tthis.credentialId = credentialId;\n\t}\n\n\t/**\n\t * Return the credential ID for this passkey, if available.\n\t * The credential ID is captured when creating a new passkey via `getPasskeyInstance`\n\t * and can be used to constrain which credential the browser selects during signing.\n\t */\n\tgetCredentialId(): Uint8Array | undefined {\n\t\treturn this.credentialId;\n\t}\n\n\t/**\n\t * Creates an instance of Passkey signer invoking the passkey from navigator.\n\t * Note that this will invoke the passkey device to create a fresh credential.\n\t * Should only be called if passkey wallet is created for the first time.\n\t *\n\t * @param provider - the passkey provider.\n\t * @returns the passkey instance.\n\t */\n\tstatic async getPasskeyInstance(provider: PasskeyProvider): Promise<PasskeyKeypair> {\n\t\t// create a passkey secp256r1 with the provider.\n\t\tconst credential = await provider.create();\n\n\t\tif (!credential.response.getPublicKey()) {\n\t\t\tthrow new Error('Invalid credential create response');\n\t\t} else {\n\t\t\tconst derSPKI = credential.response.getPublicKey()!;\n\t\t\tconst pubkeyUncompressed = parseDerSPKI(new Uint8Array(derSPKI));\n\t\t\tconst pubkey = secp256r1.Point.fromBytes(pubkeyUncompressed);\n\t\t\tconst pubkeyCompressed = pubkey.toBytes(true);\n\t\t\treturn new PasskeyKeypair(pubkeyCompressed, provider, new Uint8Array(credential.rawId));\n\t\t}\n\t}\n\n\t/**\n\t * Return the public key for this passkey.\n\t */\n\tgetPublicKey(): PublicKey {\n\t\treturn new PasskeyPublicKey(this.publicKey);\n\t}\n\n\t/**\n\t * Return the signature for the provided data (i.e. blake2b(intent_message)).\n\t * This is sent to passkey as the challenge field.\n\t */\n\tasync sign(data: Uint8Array) {\n\t\t// asks the passkey to sign over challenge as the data.\n\t\tconst credential = await this.provider.get(data, this.credentialId);\n\n\t\t// parse authenticatorData (as bytes), clientDataJSON (decoded as string).\n\t\tconst authenticatorData = new Uint8Array(credential.response.authenticatorData);\n\t\tconst clientDataJSON = new Uint8Array(credential.response.clientDataJSON); // response.clientDataJSON is already UTF-8 encoded JSON\n\t\tconst decoder = new TextDecoder();\n\t\tconst clientDataJSONString: string = decoder.decode(clientDataJSON);\n\n\t\tconst sig = secp256r1.Signature.fromBytes(new Uint8Array(credential.response.signature), 'der');\n\t\tconst normalizedSig = sig.hasHighS()\n\t\t\t? new secp256r1.Signature(sig.r, secp256r1.Point.Fn.neg(sig.s))\n\t\t\t: sig;\n\n\t\tconst normalized = normalizedSig.toBytes('compact');\n\n\t\tif (\n\t\t\tnormalized.length !== PASSKEY_SIGNATURE_SIZE ||\n\t\t\tthis.publicKey.length !== PASSKEY_PUBLIC_KEY_SIZE\n\t\t) {\n\t\t\tthrow new Error('Invalid signature or public key length');\n\t\t}\n\n\t\t// construct userSignature as flag || sig || pubkey for the secp256r1 signature.\n\t\tconst arr = new Uint8Array(1 + normalized.length + this.publicKey.length);\n\t\tarr.set([SIGNATURE_SCHEME_TO_FLAG['Secp256r1']]);\n\t\tarr.set(normalized, 1);\n\t\tarr.set(this.publicKey, 1 + normalized.length);\n\n\t\t// serialize all fields into a passkey signature according to https://github.com/sui-foundation/sips/blob/main/sips/sip-9.md#signature-encoding\n\t\treturn PasskeyAuthenticator.serialize({\n\t\t\tauthenticatorData: authenticatorData,\n\t\t\tclientDataJson: clientDataJSONString,\n\t\t\tuserSignature: arr,\n\t\t}).toBytes();\n\t}\n\n\t/**\n\t * This overrides the base class implementation that accepts the raw bytes and signs its\n\t * digest of the intent message, then serialize it with the passkey flag.\n\t */\n\tasync signWithIntent(bytes: Uint8Array, intent: IntentScope): Promise<SignatureWithBytes> {\n\t\t// prepend it into an intent message and computes the digest.\n\t\tconst intentMessage = messageWithIntent(intent, bytes);\n\t\tconst digest = blake2b(intentMessage, { dkLen: 32 });\n\n\t\t// sign the digest.\n\t\tconst signature = await this.sign(digest);\n\n\t\t// prepend with the passkey flag.\n\t\tconst serializedSignature = new Uint8Array(1 + signature.length);\n\t\tserializedSignature.set([SIGNATURE_SCHEME_TO_FLAG[this.getKeyScheme()]]);\n\t\tserializedSignature.set(signature, 1);\n\t\treturn {\n\t\t\tsignature: toBase64(serializedSignature),\n\t\t\tbytes: toBase64(bytes),\n\t\t};\n\t}\n\n\t/**\n\t * Given a message, asks the passkey device to sign it and return all (up to 4) possible public keys.\n\t * See: https://bitcoin.stackexchange.com/questions/81232/how-is-public-key-extracted-from-message-digital-signature-address\n\t *\n\t * This is useful if the user previously created passkey wallet with the origin, but the wallet session\n\t * does not have the public key / address. By calling this method twice with two different messages, the\n\t * wallet can compare the returned public keys and uniquely identify the previously created passkey wallet\n\t * using `findCommonPublicKey`.\n\t *\n\t * Alternatively, one call can be made and all possible public keys should be checked onchain to see if\n\t * there is any assets.\n\t *\n\t * Once the correct public key is identified, a passkey instance can then be initialized with this public key.\n\t *\n\t * Example usage to recover wallet with two signing calls:\n\t * ```\n\t * let provider = new BrowserPasskeyProvider('Sui Passkey Example',{\n\t * rpName: 'Sui Passkey Example',\n\t * \t rpId: window.location.hostname,\n\t * } as BrowserPasswordProviderOptions);\n\t * const testMessage = new TextEncoder().encode('Hello world!');\n\t * const possiblePks = await PasskeyKeypair.signAndRecover(provider, testMessage);\n\t * const testMessage2 = new TextEncoder().encode('Hello world 2!');\n\t * const possiblePks2 = await PasskeyKeypair.signAndRecover(provider, testMessage2);\n\t * const commonPk = findCommonPublicKey(possiblePks, possiblePks2);\n\t * const signer = new PasskeyKeypair(commonPk.toRawBytes(), provider);\n\t * ```\n\t *\n\t * @param provider - the passkey provider.\n\t * @param message - the message to sign.\n\t * @returns all possible public keys.\n\t */\n\tstatic async signAndRecover(\n\t\tprovider: PasskeyProvider,\n\t\tmessage: Uint8Array,\n\t): Promise<PublicKey[]> {\n\t\tconst credential = await provider.get(message);\n\t\tconst fullMessage = messageFromAssertionResponse(credential.response);\n\t\tconst sig = secp256r1.Signature.fromBytes(new Uint8Array(credential.response.signature), 'der');\n\n\t\tconst res = [];\n\t\tconst msgHash = sha256(fullMessage);\n\t\tfor (let i = 0; i < 4; i++) {\n\t\t\tconst s = sig.addRecoveryBit(i);\n\t\t\ttry {\n\t\t\t\tconst pubkey = s.recoverPublicKey(msgHash);\n\t\t\t\tconst pk = new PasskeyPublicKey(pubkey.toBytes(true));\n\t\t\t\tres.push(pk);\n\t\t\t} catch {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}\n}\n\n/**\n * Finds the unique public key that exists in both arrays, throws error if the common\n * pubkey does not equal to one.\n *\n * @param arr1 - The first pubkeys array.\n * @param arr2 - The second pubkeys array.\n * @returns The only common pubkey in both arrays.\n */\nexport function findCommonPublicKey(arr1: PublicKey[], arr2: PublicKey[]): PublicKey {\n\tconst matchingPubkeys: PublicKey[] = [];\n\tfor (const pubkey1 of arr1) {\n\t\tfor (const pubkey2 of arr2) {\n\t\t\tif (pubkey1.equals(pubkey2)) {\n\t\t\t\tmatchingPubkeys.push(pubkey1);\n\t\t\t}\n\t\t}\n\t}\n\tif (matchingPubkeys.length !== 1) {\n\t\tthrow new Error('No unique public key found');\n\t}\n\treturn matchingPubkeys[0];\n}\n\n/**\n * Constructs the message that the passkey signature is produced over as authenticatorData || sha256(clientDataJSON).\n */\nfunction messageFromAssertionResponse(response: AuthenticatorAssertionResponse): Uint8Array {\n\tconst authenticatorData = new Uint8Array(response.authenticatorData);\n\tconst clientDataJSON = new Uint8Array(response.clientDataJSON);\n\tconst clientDataJSONDigest = sha256(clientDataJSON);\n\treturn new Uint8Array([...authenticatorData, ...clientDataJSONDigest]);\n}\n"],"mappings":";;;;;;;;;;;;AA6CA,IAAa,yBAAb,MAA+D;CAC9D;CACA;CAEA,YAAY,MAAc,SAAyC;AAClE,QAAKA,OAAQ;AACb,QAAKC,UAAW;;CAGjB,MAAM,SAA0C;AAC/C,SAAQ,MAAM,UAAU,YAAY,OAAO,EAC1C,WAAW;GACV,SAAS,MAAKA,QAAS,WAAW;GAClC,GAAG,MAAKA;GACR,IAAI;IACH,MAAM,MAAKD;IACX,GAAG,MAAKC,QAAS;IACjB;GACD,MAAM;IACL,MAAM,MAAKD;IACX,aAAa,MAAKA;IAClB,GAAG,MAAKC,QAAS;IACjB,IAAI,YAAY,GAAG;IACnB;GACD,WAAW,IAAI,aAAa,CAAC,OAAO,+BAA+B;GACnE,kBAAkB,CAAC;IAAE,KAAK;IAAI,MAAM;IAAc,CAAC;GACnD,wBAAwB;IACvB,yBAAyB;IACzB,aAAa;IACb,oBAAoB;IACpB,kBAAkB;IAClB,GAAG,MAAKA,QAAS;IACjB;GACD,EACD,CAAC;;CAGH,MAAM,IAAI,WAAuB,cAA8D;AAC9F,SAAQ,MAAM,UAAU,YAAY,IAAI,EACvC,WAAW;GACC;GACX,kBAAkB,MAAKA,QAAS,wBAAwB,oBAAoB;GAC5E,SAAS,MAAKA,QAAS,WAAW;GAClC,GAAI,gBAAgB,EACnB,kBAAkB,CAAC;IAAE,MAAM;IAAuB,IAAI;IAA8B,CAAC,EACrF;GACD,EACD,CAAC;;;;;;;AAQJ,IAAa,iBAAb,MAAa,uBAAuB,OAAO;;;;CAQ1C,eAAgC;AAC/B,SAAO;;;;;;;;;;;;;;;;CAiBR,YAAY,WAAuB,UAA2B,cAA2B;AACxF,SAAO;AACP,OAAK,YAAY;AACjB,OAAK,WAAW;AAChB,OAAK,eAAe;;;;;;;CAQrB,kBAA0C;AACzC,SAAO,KAAK;;;;;;;;;;CAWb,aAAa,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,OADN,IAAI,WAAW,SAAS,eAAe,CACX;AACnD,QAAO,IAAI,WAAW,CAAC,GAAG,mBAAmB,GAAG,qBAAqB,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { createPure } from "./pure.mjs";
|
|
|
8
8
|
import { SignatureWithBytes, Signer } from "../cryptography/keypair.mjs";
|
|
9
9
|
import "../cryptography/index.mjs";
|
|
10
10
|
import { ClientWithCoreApi } from "../client/core.mjs";
|
|
11
|
-
import * as
|
|
11
|
+
import * as _mysten_bcs810 from "@mysten/bcs";
|
|
12
12
|
import { SerializedBcs } from "@mysten/bcs";
|
|
13
13
|
import { InferInput } from "valibot";
|
|
14
14
|
|
|
@@ -77,7 +77,7 @@ declare class Transaction {
|
|
|
77
77
|
getData(): {
|
|
78
78
|
version: 2;
|
|
79
79
|
sender?: string | null | undefined;
|
|
80
|
-
expiration?:
|
|
80
|
+
expiration?: _mysten_bcs810.EnumOutputShapeWithKeys<{
|
|
81
81
|
None: true;
|
|
82
82
|
Epoch: string | number;
|
|
83
83
|
ValidDuring: {
|
|
@@ -99,8 +99,8 @@ declare class Transaction {
|
|
|
99
99
|
digest: string;
|
|
100
100
|
}[] | null;
|
|
101
101
|
};
|
|
102
|
-
inputs:
|
|
103
|
-
Object:
|
|
102
|
+
inputs: _mysten_bcs810.EnumOutputShapeWithKeys<{
|
|
103
|
+
Object: _mysten_bcs810.EnumOutputShapeWithKeys<{
|
|
104
104
|
ImmOrOwnedObject: {
|
|
105
105
|
objectId: string;
|
|
106
106
|
version: string | number;
|
|
@@ -139,13 +139,13 @@ declare class Transaction {
|
|
|
139
139
|
Balance: string;
|
|
140
140
|
$kind: "Balance";
|
|
141
141
|
};
|
|
142
|
-
withdrawFrom:
|
|
142
|
+
withdrawFrom: _mysten_bcs810.EnumOutputShapeWithKeys<{
|
|
143
143
|
Sender: true;
|
|
144
144
|
Sponsor: true;
|
|
145
145
|
}, "Sender" | "Sponsor">;
|
|
146
146
|
};
|
|
147
147
|
}, "Object" | "Pure" | "FundsWithdrawal" | "UnresolvedPure" | "UnresolvedObject">[];
|
|
148
|
-
commands:
|
|
148
|
+
commands: _mysten_bcs810.EnumOutputShapeWithKeys<{
|
|
149
149
|
MoveCall: {
|
|
150
150
|
package: string;
|
|
151
151
|
module: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.d.mts","names":[],"sources":["../../src/transactions/Transaction.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;KAoCY,yBAAA,GACT,QAAQ,kBAAkB;;;WAEtB,gBACC,QAAQ,kBAAkB;EAJtB,KAAA,EAAA,OAAA;EACiB,IAAA,CAAA,EAAA,MAAA;CAAlB,CAAA,CAAA,GAIR,qBAJQ,CAIc,yBAJd,CAAA;AAAR,KAMS,iBAAA,GAAoB,OAN7B,CAMqC,QANrC,EAAA;EAEI,MAAA,EAAA,OAAA;CAC2B,CAAA,GAIjC,OAJiC,CAIzB,QAJyB,EAAA;EAAlB,YAAA,EAAA,OAAA;CAAR,CAAA,EAAA;AACiB,KAKb,yBAAA,GACT,OANsB,CAMd,QANc,EAAA;EAAtB,MAAA,EAAA,OAAA;CAAqB,CAAA,GAAA,SAOZ,OAPY,CAOJ,QAPI,EAAA;EAEZ,YAAA,EAAA,OAAiB;CAAW,CAAA,EAAA;AAAR,KAOpB,qBAPoB,CAAA,UAQrB,yBARqB,GAAA,IAAA,GAQc,yBARd,GAAA,IAAA,CAAA,GAAA,CAAA,EAAA,EASvB,WATuB,EAAA,GASP,OATO,CASC,CATD,GAAA,IAAA,CAAA;cA0E1B,iBAzEG,EAAA,KAAA;UA2EC,WAAA,SAAoB,uBA3E7B,CAAA;EAAO,MAAA,EA4EC,MA5ED;AAER;AACW,iBA4EK,aAAA,CA5EL,GAAA,EAAA,OAAA,CAAA,EAAA,GAAA,IA4EyC,eA5EzC;AAAR,KAgFS,sBAAA,GAhFT,MAAA,GAgF2C,OAhF3C,GAgFqD,yBAhFrD;KAqFE,eAAA,GApFe;EAAR,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA5mBtD,kBAAkB,WAAW;;;;;;;;;;UA0CjC,kBACA;;;;;;;;;qBA2CW,mBAAmB;;;;;;;;;wBAQhB,mBAAmB;;;;;;;;;2BAQhB,mBAAmB;;;;;;gBAsB9B,kBAAkB,IAAI;uBACf,4BAA4B,sBAAsB,qBAC1D,gBAAgB,IAC1B;gBACW,yDACU,sBAAsB,KAC3C;oCAwGqB,sBAAsB,wDACtC,6CAA6C,UAU8B,QACjF;;qBAGY,UAAU,QAAQ;;;0BAIlB,8CACH,wCAAqC;;;;;;;MAS6C;;;;aAWnF;;;;;;YAMD;MACR;;eAWW;;;;;;iBAOI,sBAAsB;;;;iBAKtB,sBAAsB;;MAElC;4BASO,gDACD,sBAAsB,8BAA2B;;;;;eAe/C;;MAEX;;;;;;;;;;;;;;;;;;;;;;;;mBA8CqB,8BAAmC;;gBAmBrC,cAAc,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2DrB,0BAA+B,QAAQ,WAAW;;;aAW5D;MAER;mCAsJoC,8BAA2B"}
|
package/dist/version.mjs
CHANGED
package/dist/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// This file is generated by genversion.mjs. Do not edit it directly.\n\nexport const PACKAGE_VERSION = '2.
|
|
1
|
+
{"version":3,"file":"version.mjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// This file is generated by genversion.mjs. Do not edit it directly.\n\nexport const PACKAGE_VERSION = '2.8.0';\nexport const TARGETED_RPC_VERSION = '1.69.0';\n"],"mappings":";AAKA,MAAa,kBAAkB;AAC/B,MAAa,uBAAuB"}
|
package/dist/zklogin/bcs.d.mts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _mysten_bcs817 from "@mysten/bcs";
|
|
2
2
|
import { InferBcsInput } from "@mysten/bcs";
|
|
3
3
|
|
|
4
4
|
//#region src/zklogin/bcs.d.ts
|
|
5
|
-
declare const zkLoginSignature:
|
|
6
|
-
inputs:
|
|
7
|
-
proofPoints:
|
|
8
|
-
a:
|
|
5
|
+
declare const zkLoginSignature: _mysten_bcs817.BcsStruct<{
|
|
6
|
+
inputs: _mysten_bcs817.BcsStruct<{
|
|
7
|
+
proofPoints: _mysten_bcs817.BcsStruct<{
|
|
8
|
+
a: _mysten_bcs817.BcsType<string[], Iterable<string> & {
|
|
9
9
|
length: number;
|
|
10
10
|
}, string>;
|
|
11
|
-
b:
|
|
11
|
+
b: _mysten_bcs817.BcsType<string[][], Iterable<Iterable<string> & {
|
|
12
12
|
length: number;
|
|
13
13
|
}> & {
|
|
14
14
|
length: number;
|
|
15
15
|
}, string>;
|
|
16
|
-
c:
|
|
16
|
+
c: _mysten_bcs817.BcsType<string[], Iterable<string> & {
|
|
17
17
|
length: number;
|
|
18
18
|
}, string>;
|
|
19
19
|
}, string>;
|
|
20
|
-
issBase64Details:
|
|
21
|
-
value:
|
|
22
|
-
indexMod4:
|
|
20
|
+
issBase64Details: _mysten_bcs817.BcsStruct<{
|
|
21
|
+
value: _mysten_bcs817.BcsType<string, string, "string">;
|
|
22
|
+
indexMod4: _mysten_bcs817.BcsType<number, number, "u8">;
|
|
23
23
|
}, string>;
|
|
24
|
-
headerBase64:
|
|
25
|
-
addressSeed:
|
|
24
|
+
headerBase64: _mysten_bcs817.BcsType<string, string, "string">;
|
|
25
|
+
addressSeed: _mysten_bcs817.BcsType<string, string, "string">;
|
|
26
26
|
}, string>;
|
|
27
|
-
maxEpoch:
|
|
28
|
-
userSignature:
|
|
27
|
+
maxEpoch: _mysten_bcs817.BcsType<string, string | number | bigint, "u64">;
|
|
28
|
+
userSignature: _mysten_bcs817.BcsType<Uint8Array<ArrayBufferLike>, Iterable<number>, "vector<u8>">;
|
|
29
29
|
}, string>;
|
|
30
30
|
type ZkLoginSignature = InferBcsInput<typeof zkLoginSignature>;
|
|
31
31
|
type ZkLoginSignatureInputs = ZkLoginSignature['inputs'];
|