@fairmint/canton-node-sdk 0.0.277 → 0.0.279
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 +197 -14
- package/build/src/utils/external-signing/index.d.ts +2 -0
- package/build/src/utils/external-signing/index.d.ts.map +1 -1
- package/build/src/utils/external-signing/index.js +2 -0
- package/build/src/utils/external-signing/index.js.map +1 -1
- package/build/src/utils/external-signing/wallet-ownership-challenger.d.ts +93 -0
- package/build/src/utils/external-signing/wallet-ownership-challenger.d.ts.map +1 -0
- package/build/src/utils/external-signing/wallet-ownership-challenger.js +253 -0
- package/build/src/utils/external-signing/wallet-ownership-challenger.js.map +1 -0
- package/build/src/utils/external-signing/wallet-ownership.d.ts +48 -0
- package/build/src/utils/external-signing/wallet-ownership.d.ts.map +1 -0
- package/build/src/utils/external-signing/wallet-ownership.js +179 -0
- package/build/src/utils/external-signing/wallet-ownership.js.map +1 -0
- package/build/src/wallets/cip103.d.ts +100 -6
- package/build/src/wallets/cip103.d.ts.map +1 -1
- package/build/src/wallets/cip103.js +237 -107
- package/build/src/wallets/cip103.js.map +1 -1
- package/build/src/wallets/da-utilities/client.d.ts.map +1 -1
- package/build/src/wallets/da-utilities/client.js +3 -0
- package/build/src/wallets/da-utilities/client.js.map +1 -1
- package/build/src/wallets/errors.d.ts +51 -0
- package/build/src/wallets/errors.d.ts.map +1 -1
- package/build/src/wallets/errors.js +68 -1
- package/build/src/wallets/errors.js.map +1 -1
- package/build/src/wallets/holdings.d.ts +25 -0
- package/build/src/wallets/holdings.d.ts.map +1 -1
- package/build/src/wallets/holdings.js +44 -0
- package/build/src/wallets/holdings.js.map +1 -1
- package/build/src/wallets/index.d.ts +14 -7
- package/build/src/wallets/index.d.ts.map +1 -1
- package/build/src/wallets/index.js +22 -3
- package/build/src/wallets/index.js.map +1 -1
- package/build/src/wallets/notify.d.ts +7 -0
- package/build/src/wallets/notify.d.ts.map +1 -0
- package/build/src/wallets/notify.js +21 -0
- package/build/src/wallets/notify.js.map +1 -0
- package/build/src/wallets/ownership.d.ts +156 -0
- package/build/src/wallets/ownership.d.ts.map +1 -0
- package/build/src/wallets/ownership.js +269 -0
- package/build/src/wallets/ownership.js.map +1 -0
- package/build/src/wallets/session.d.ts +107 -0
- package/build/src/wallets/session.d.ts.map +1 -0
- package/build/src/wallets/session.js +371 -0
- package/build/src/wallets/session.js.map +1 -0
- package/build/src/wallets/store.d.ts +138 -0
- package/build/src/wallets/store.d.ts.map +1 -0
- package/build/src/wallets/store.js +262 -0
- package/build/src/wallets/store.js.map +1 -0
- package/build/src/wallets/templates.d.ts +15 -0
- package/build/src/wallets/templates.d.ts.map +1 -1
- package/build/src/wallets/templates.js +33 -9
- package/build/src/wallets/templates.js.map +1 -1
- package/build/src/wallets/token-registry.d.ts +15 -2
- package/build/src/wallets/token-registry.d.ts.map +1 -1
- package/build/src/wallets/token-registry.js.map +1 -1
- package/build/src/wallets/token-standard-wallet.d.ts +94 -9
- package/build/src/wallets/token-standard-wallet.d.ts.map +1 -1
- package/build/src/wallets/token-standard-wallet.js +160 -19
- package/build/src/wallets/token-standard-wallet.js.map +1 -1
- package/build/src/wallets/token-wallet.d.ts +43 -7
- package/build/src/wallets/token-wallet.d.ts.map +1 -1
- package/build/src/wallets/token-wallet.js +113 -35
- package/build/src/wallets/token-wallet.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { WalletOwnershipFailure } from '../../wallets/ownership';
|
|
2
|
+
/** Why a proof did not verify. Defined in the browser-safe wallets module, which shares it; re-exported here. */
|
|
3
|
+
export type { WalletOwnershipFailure };
|
|
4
|
+
export type WalletOwnershipVerification = {
|
|
5
|
+
readonly verified: true;
|
|
6
|
+
readonly partyId: string;
|
|
7
|
+
/** The party's namespace, which is the key's Canton fingerprint. */
|
|
8
|
+
readonly publicKeyFingerprint: string;
|
|
9
|
+
readonly domain: string;
|
|
10
|
+
readonly nonce: string;
|
|
11
|
+
/** The message's network label, as text; not proof that the party is on that network (see the module comment). */
|
|
12
|
+
readonly network?: string;
|
|
13
|
+
readonly issuedAt: string;
|
|
14
|
+
readonly expiresAt: string;
|
|
15
|
+
} | {
|
|
16
|
+
readonly verified: false;
|
|
17
|
+
readonly reason: WalletOwnershipFailure;
|
|
18
|
+
/** A sentence for logs or the user. */
|
|
19
|
+
readonly message: string;
|
|
20
|
+
};
|
|
21
|
+
export interface VerifyWalletOwnershipOptions {
|
|
22
|
+
/** The nonce the server issued for this proof (never the one in the proof). */
|
|
23
|
+
readonly expectedNonce: string;
|
|
24
|
+
/** The server's own host, as the challenge named it. */
|
|
25
|
+
readonly expectedDomain: string;
|
|
26
|
+
/** Required in the message when given. A label compared as text, not proof (see the module comment). */
|
|
27
|
+
readonly expectedNetwork?: string;
|
|
28
|
+
/** The `issuedAt` the server issued; the message must repeat it exactly when given. */
|
|
29
|
+
readonly expectedIssuedAt?: string;
|
|
30
|
+
/** The `expiresAt` the server issued; the message must repeat it exactly when given. */
|
|
31
|
+
readonly expectedExpiresAt?: string;
|
|
32
|
+
/** The party the user claims; the proof must be for it. */
|
|
33
|
+
readonly expectedPartyId?: string;
|
|
34
|
+
/** Defaults to the system clock. */
|
|
35
|
+
readonly now?: Date;
|
|
36
|
+
/** The longest validity window accepted (`expiresAt - issuedAt`). Defaults to 10 minutes. */
|
|
37
|
+
readonly maxAgeMs?: number;
|
|
38
|
+
/** How far in the future `issuedAt` may be. Defaults to 60 seconds. */
|
|
39
|
+
readonly clockSkewMs?: number;
|
|
40
|
+
}
|
|
41
|
+
export declare const DEFAULT_WALLET_OWNERSHIP_MAX_AGE_MS: number;
|
|
42
|
+
export declare const DEFAULT_WALLET_OWNERSHIP_CLOCK_SKEW_MS: number;
|
|
43
|
+
/**
|
|
44
|
+
* Verify a wallet ownership proof (see the module comment for what this does and does not establish). Never throws for
|
|
45
|
+
* a bad proof: the result says why it failed. Throws `TypeError` for invalid options.
|
|
46
|
+
*/
|
|
47
|
+
export declare function verifyWalletOwnership(proof: unknown, options: VerifyWalletOwnershipOptions): WalletOwnershipVerification;
|
|
48
|
+
//# sourceMappingURL=wallet-ownership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet-ownership.d.ts","sourceRoot":"","sources":["../../../../src/utils/external-signing/wallet-ownership.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,sBAAsB,EAAwB,MAAM,yBAAyB,CAAC;AAE5F,iHAAiH;AACjH,YAAY,EAAE,sBAAsB,EAAE,CAAC;AAEvC,MAAM,MAAM,2BAA2B,GACnC;IACE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,oEAAoE;IACpE,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kHAAkH;IAClH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,GACD;IACE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC;IACxC,uCAAuC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEN,MAAM,WAAW,4BAA4B;IAC3C,+EAA+E;IAC/E,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,wGAAwG;IACxG,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,uFAAuF;IACvF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,wFAAwF;IACxF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,2DAA2D;IAC3D,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,oCAAoC;IACpC,QAAQ,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC;IACpB,6FAA6F;IAC7F,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,mCAAmC,QAAiB,CAAC;AAClE,eAAO,MAAM,sCAAsC,QAAY,CAAC;AAqDhE;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,4BAA4B,GACpC,2BAA2B,CAwG7B"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_WALLET_OWNERSHIP_CLOCK_SKEW_MS = exports.DEFAULT_WALLET_OWNERSHIP_MAX_AGE_MS = void 0;
|
|
4
|
+
exports.verifyWalletOwnership = verifyWalletOwnership;
|
|
5
|
+
/**
|
|
6
|
+
* Server-side verification of a wallet ownership proof (`proveWalletOwnership` in the browser-safe wallets module).
|
|
7
|
+
* Node only: it uses `node:crypto` through the Canton signing helpers, so it is not exported from the wallets entry.
|
|
8
|
+
*
|
|
9
|
+
* What a `verified` result means: the party's own key signed the canonical message for this domain and this nonce,
|
|
10
|
+
* within its validity window. It rests on two facts this function checks itself, trusting nothing the browser says:
|
|
11
|
+
*
|
|
12
|
+
* 1. The Ed25519 signature over the UTF-8 bytes of the message verifies against the submitted public key.
|
|
13
|
+
* 2. The Canton fingerprint of that key (`1220` + SHA-256 of purpose 12 and the raw key) is the party's namespace (the
|
|
14
|
+
* part of the party id after `::`), which is how an external party's id is derived from its key. Loop's parties and
|
|
15
|
+
* the CIP-0103 reference wallet's are external parties of this kind.
|
|
16
|
+
*
|
|
17
|
+
* A party whose namespace is not its signing key's fingerprint (a participant-hosted party, an external party whose key
|
|
18
|
+
* was rotated, or a namespace delegation) fails with `key-not-bound-to-party`. Proving those would need the party's
|
|
19
|
+
* current topology from the ledger (its `PartyToKeyMapping` signing keys, and the namespace delegations that authorize
|
|
20
|
+
* them), which this function does not read.
|
|
21
|
+
*
|
|
22
|
+
* The caller must issue the nonce, store it, pass it as `expectedNonce`, and accept it once: this function cannot tell
|
|
23
|
+
* a replayed proof from a fresh one. Passing the issued times as `expectedIssuedAt` and `expectedExpiresAt` makes the
|
|
24
|
+
* signed text exactly the issued challenge.
|
|
25
|
+
*
|
|
26
|
+
* The message's `Network:` line (`expectedNetwork`, the result's `network`) is checked as text only. A party id is
|
|
27
|
+
* derived from its key and is the same on every network, so a verified proof does not show the party exists or is
|
|
28
|
+
* hosted on that network; a caller that needs that must look the party up on the network (Scan, or the ledger's party
|
|
29
|
+
* and topology APIs).
|
|
30
|
+
*/
|
|
31
|
+
const canton_protocol_1 = require("./canton-protocol");
|
|
32
|
+
const canton_ed25519_signer_1 = require("./canton-ed25519-signer");
|
|
33
|
+
const ownership_1 = require("../../wallets/ownership");
|
|
34
|
+
exports.DEFAULT_WALLET_OWNERSHIP_MAX_AGE_MS = 10 * 60 * 1000;
|
|
35
|
+
exports.DEFAULT_WALLET_OWNERSHIP_CLOCK_SKEW_MS = 60 * 1000;
|
|
36
|
+
const ED25519_DER_PREFIX_HEX = '302a300506032b6570032100';
|
|
37
|
+
/**
|
|
38
|
+
* The key as base64 for the Canton helpers: 64 hex characters (raw, as Loop registers it), 88 hex characters (DER
|
|
39
|
+
* SubjectPublicKeyInfo), a PEM public key, or base64/base64url of the raw or DER key (as the CIP-0103 reference wallet
|
|
40
|
+
* sends it). The helpers then accept only a 32-byte key or the exact Ed25519 DER prefix.
|
|
41
|
+
*/
|
|
42
|
+
function publicKeyBase64(value) {
|
|
43
|
+
const trimmed = value.trim();
|
|
44
|
+
const hex = trimmed.replace(/^0x/i, '');
|
|
45
|
+
if (/^[0-9a-fA-F]+$/.test(hex) &&
|
|
46
|
+
(hex.length === 64 || (hex.length === 88 && hex.toLowerCase().startsWith(ED25519_DER_PREFIX_HEX)))) {
|
|
47
|
+
return Buffer.from(hex, 'hex').toString('base64');
|
|
48
|
+
}
|
|
49
|
+
const pem = /^-----BEGIN PUBLIC KEY-----\s*([A-Za-z0-9+/=\s]+?)\s*-----END PUBLIC KEY-----$/.exec(trimmed);
|
|
50
|
+
return pem?.[1] !== undefined ? pem[1].replace(/\s+/g, '') : trimmed;
|
|
51
|
+
}
|
|
52
|
+
/** The signature as base64: 128 hex characters (Loop) or base64/base64url (the reference wallet), 64 bytes either way. */
|
|
53
|
+
function signatureBase64(value) {
|
|
54
|
+
const hex = value.trim().replace(/^0x/i, '');
|
|
55
|
+
if (/^[0-9a-fA-F]{128}$/.test(hex))
|
|
56
|
+
return (0, canton_ed25519_signer_1.normalizeCantonEd25519Signature)({ signatureHex: hex });
|
|
57
|
+
return (0, canton_ed25519_signer_1.normalizeCantonEd25519Signature)({ signatureBase64: value });
|
|
58
|
+
}
|
|
59
|
+
function readProof(proof) {
|
|
60
|
+
if (typeof proof !== 'object' || proof === null)
|
|
61
|
+
return null;
|
|
62
|
+
const record = proof;
|
|
63
|
+
const { partyId, publicKey, namespace, message, signature } = record;
|
|
64
|
+
if (typeof partyId !== 'string' ||
|
|
65
|
+
typeof publicKey !== 'string' ||
|
|
66
|
+
typeof message !== 'string' ||
|
|
67
|
+
typeof signature !== 'string' ||
|
|
68
|
+
(namespace !== undefined && typeof namespace !== 'string') ||
|
|
69
|
+
publicKey.length > 1024 ||
|
|
70
|
+
signature.length > 1024) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return { partyId, publicKey, message, signature, ...(namespace !== undefined && { namespace }) };
|
|
74
|
+
}
|
|
75
|
+
const fail = (reason, message) => ({
|
|
76
|
+
verified: false,
|
|
77
|
+
reason,
|
|
78
|
+
message,
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* Verify a wallet ownership proof (see the module comment for what this does and does not establish). Never throws for
|
|
82
|
+
* a bad proof: the result says why it failed. Throws `TypeError` for invalid options.
|
|
83
|
+
*/
|
|
84
|
+
function verifyWalletOwnership(proof, options) {
|
|
85
|
+
const maxAgeMs = options.maxAgeMs ?? exports.DEFAULT_WALLET_OWNERSHIP_MAX_AGE_MS;
|
|
86
|
+
const skewMs = options.clockSkewMs ?? exports.DEFAULT_WALLET_OWNERSHIP_CLOCK_SKEW_MS;
|
|
87
|
+
const now = (options.now ?? new Date()).getTime();
|
|
88
|
+
if (typeof options.expectedNonce !== 'string' || options.expectedNonce.length === 0) {
|
|
89
|
+
throw new TypeError('expectedNonce is required');
|
|
90
|
+
}
|
|
91
|
+
if (typeof options.expectedDomain !== 'string' || options.expectedDomain.length === 0) {
|
|
92
|
+
throw new TypeError('expectedDomain is required');
|
|
93
|
+
}
|
|
94
|
+
if (!Number.isFinite(now) || !(maxAgeMs > 0) || !(skewMs >= 0)) {
|
|
95
|
+
throw new TypeError('now, maxAgeMs and clockSkewMs must be valid');
|
|
96
|
+
}
|
|
97
|
+
const read = readProof(proof);
|
|
98
|
+
if (read === null)
|
|
99
|
+
return fail('malformed-proof', 'The proof is not { partyId, publicKey, message, signature }');
|
|
100
|
+
const fields = (0, ownership_1.parseWalletOwnershipMessage)(read.message);
|
|
101
|
+
if (fields === null)
|
|
102
|
+
return fail('malformed-message', 'The signed text is not a canonical wallet ownership message');
|
|
103
|
+
if (fields.partyId !== read.partyId) {
|
|
104
|
+
return fail('party-mismatch', 'The signed message names another party than the proof');
|
|
105
|
+
}
|
|
106
|
+
if (options.expectedPartyId !== undefined && read.partyId !== options.expectedPartyId) {
|
|
107
|
+
return fail('party-mismatch', 'The proof is for another party than expected');
|
|
108
|
+
}
|
|
109
|
+
const partyNamespace = read.partyId.slice(read.partyId.indexOf('::') + 2);
|
|
110
|
+
if (read.namespace !== undefined && read.namespace !== partyNamespace) {
|
|
111
|
+
return fail('party-mismatch', "The wallet's namespace is not the party id's namespace");
|
|
112
|
+
}
|
|
113
|
+
if (fields.domain !== options.expectedDomain) {
|
|
114
|
+
return fail('domain-mismatch', `The message was signed for ${fields.domain}, not ${options.expectedDomain}`);
|
|
115
|
+
}
|
|
116
|
+
if (fields.nonce !== options.expectedNonce) {
|
|
117
|
+
return fail('nonce-mismatch', 'The message was signed for another challenge');
|
|
118
|
+
}
|
|
119
|
+
if (options.expectedNetwork !== undefined && fields.network !== options.expectedNetwork) {
|
|
120
|
+
return fail('network-mismatch', `The message names network ${fields.network ?? '(none)'}, not ${options.expectedNetwork}`);
|
|
121
|
+
}
|
|
122
|
+
if ((options.expectedIssuedAt !== undefined && fields.issuedAt !== options.expectedIssuedAt) ||
|
|
123
|
+
(options.expectedExpiresAt !== undefined && fields.expiresAt !== options.expectedExpiresAt)) {
|
|
124
|
+
return fail('window-mismatch', 'The message names another validity window than the server issued');
|
|
125
|
+
}
|
|
126
|
+
const issuedAt = Date.parse(fields.issuedAt);
|
|
127
|
+
const expiresAt = Date.parse(fields.expiresAt);
|
|
128
|
+
if (issuedAt > now + skewMs)
|
|
129
|
+
return fail('not-yet-valid', 'The message was issued in the future');
|
|
130
|
+
if (expiresAt - issuedAt > maxAgeMs) {
|
|
131
|
+
return fail('lifetime-too-long', `The message is valid for longer than ${maxAgeMs} ms`);
|
|
132
|
+
}
|
|
133
|
+
// With the lifetime bounded above, this also bounds the message's age by maxAgeMs.
|
|
134
|
+
if (now >= expiresAt)
|
|
135
|
+
return fail('expired', 'The message has expired');
|
|
136
|
+
let fingerprint;
|
|
137
|
+
let keyBase64;
|
|
138
|
+
try {
|
|
139
|
+
keyBase64 = publicKeyBase64(read.publicKey);
|
|
140
|
+
fingerprint = (0, canton_protocol_1.deriveCantonEd25519PublicKeyFingerprint)(keyBase64);
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
return fail('unsupported-public-key', 'The public key is not an Ed25519 key in hex, base64 (raw 32 bytes or DER SubjectPublicKeyInfo) or PEM');
|
|
144
|
+
}
|
|
145
|
+
let partyFingerprint;
|
|
146
|
+
try {
|
|
147
|
+
partyFingerprint = (0, canton_protocol_1.extractPublicKeyFingerprint)(read.partyId);
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
return fail('party-mismatch', 'The party id is not of the form hint::namespace');
|
|
151
|
+
}
|
|
152
|
+
if (partyFingerprint !== fingerprint) {
|
|
153
|
+
return fail('key-not-bound-to-party', "The public key's Canton fingerprint is not the party's namespace, so the key does not prove control of the party (a participant-hosted party, or a rotated or delegated key, needs a topology lookup)");
|
|
154
|
+
}
|
|
155
|
+
let signature;
|
|
156
|
+
try {
|
|
157
|
+
signature = signatureBase64(read.signature);
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
return fail('malformed-signature', 'The signature is not 64 bytes of hex or base64');
|
|
161
|
+
}
|
|
162
|
+
try {
|
|
163
|
+
(0, canton_protocol_1.assertEd25519Signature)({ publicKeyBase64: keyBase64, payload: read.message, signatureBase64: signature });
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
return fail('bad-signature', 'The signature does not verify against the public key');
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
verified: true,
|
|
170
|
+
partyId: read.partyId,
|
|
171
|
+
publicKeyFingerprint: fingerprint,
|
|
172
|
+
domain: fields.domain,
|
|
173
|
+
nonce: fields.nonce,
|
|
174
|
+
...(fields.network !== undefined && { network: fields.network }),
|
|
175
|
+
issuedAt: fields.issuedAt,
|
|
176
|
+
expiresAt: fields.expiresAt,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=wallet-ownership.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet-ownership.js","sourceRoot":"","sources":["../../../../src/utils/external-signing/wallet-ownership.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;;;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AAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5G,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC,eAAe,EAAE,sDAAsD,CAAC,CAAC;IACvF,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,oBAAoB,EAAE,WAAW;QACjC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,GAAG,CAAC,MAAM,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;QAChE,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,SAAS,EAAE,MAAM,CAAC,SAAS;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WalletSubmitError } from './errors';
|
|
2
|
+
import type { DaNetwork } from './da-utilities/client';
|
|
2
3
|
import type { ActiveContract, ContractFilter, DisclosedContract, LedgerCommand, SubmitResult, WalletSubmission } from './types';
|
|
3
4
|
/** `prepareExecuteAndWait` params (the OpenRPC's `JsPrepareSubmissionRequest`), as far as this SDK sends them. */
|
|
4
5
|
export type Cip103PrepareExecuteParams = {
|
|
@@ -13,8 +14,22 @@ export type Cip103LedgerApiParams = {
|
|
|
13
14
|
resource: string;
|
|
14
15
|
body?: Record<string, unknown>;
|
|
15
16
|
};
|
|
16
|
-
/**
|
|
17
|
+
/** `signMessage` params (the OpenRPC's `SignMessageRequest`). */
|
|
18
|
+
export type Cip103SignMessageParams = {
|
|
19
|
+
message: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The dApp API requests this SDK makes, each in CIP-0103's `{ method, params }` form. `connect` runs the wallet's own
|
|
23
|
+
* sign-in and `disconnect` ends its session (`createCip103Session` sends both). `isConnected` answers `{ isConnected:
|
|
24
|
+
* boolean, … }`; a wallet without it answers 4200.
|
|
25
|
+
*/
|
|
17
26
|
export type Cip103Request = {
|
|
27
|
+
method: 'connect';
|
|
28
|
+
} | {
|
|
29
|
+
method: 'disconnect';
|
|
30
|
+
} | {
|
|
31
|
+
method: 'isConnected';
|
|
32
|
+
} | {
|
|
18
33
|
method: 'getPrimaryAccount';
|
|
19
34
|
} | {
|
|
20
35
|
method: 'ledgerApi';
|
|
@@ -22,6 +37,9 @@ export type Cip103Request = {
|
|
|
22
37
|
} | {
|
|
23
38
|
method: 'prepareExecuteAndWait';
|
|
24
39
|
params: Cip103PrepareExecuteParams;
|
|
40
|
+
} | {
|
|
41
|
+
method: 'signMessage';
|
|
42
|
+
params: Cip103SignMessageParams;
|
|
25
43
|
};
|
|
26
44
|
/** An event listener of CIP-0103's Provider API. */
|
|
27
45
|
export type Cip103EventListener = (...args: unknown[]) => void;
|
|
@@ -57,6 +75,8 @@ export declare const CIP103_ERROR_CODES: {
|
|
|
57
75
|
};
|
|
58
76
|
/** The numeric `code` of a provider error (`ProviderRpcError`, `JsonRpcError` or a plain object). */
|
|
59
77
|
export declare function cip103ErrorCode(error: unknown): number | undefined;
|
|
78
|
+
/** `message (CIP-0103 4200 Unsupported Method)`, so a UI can show what the wallet answered. */
|
|
79
|
+
export declare function describeError(error: unknown): string;
|
|
60
80
|
/**
|
|
61
81
|
* A provider error from `prepareExecuteAndWait` as a `WalletSubmitError`:
|
|
62
82
|
*
|
|
@@ -69,10 +89,28 @@ export declare function cip103ErrorCode(error: unknown): number | undefined;
|
|
|
69
89
|
*/
|
|
70
90
|
export declare function cip103SubmitError(error: unknown, commandId?: string): WalletSubmitError;
|
|
71
91
|
/**
|
|
72
|
-
* The
|
|
73
|
-
*
|
|
92
|
+
* The fields of the CIP-0103 `Wallet` (account) this SDK reads. `publicKey` and `namespace` are as the wallet reports
|
|
93
|
+
* them (their encoding is not specified by CIP-0103); absent when the wallet did not send them.
|
|
74
94
|
*/
|
|
95
|
+
export interface Cip103Account {
|
|
96
|
+
readonly partyId: string;
|
|
97
|
+
readonly publicKey?: string;
|
|
98
|
+
readonly namespace?: string;
|
|
99
|
+
readonly networkId?: string;
|
|
100
|
+
readonly signingProviderId?: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The wallet's primary account (`getPrimaryAccount`). The dApp runs its wallet's own connect flow first; a provider
|
|
104
|
+
* that is not connected answers 4100.
|
|
105
|
+
*/
|
|
106
|
+
export declare function primaryAccount(provider: Cip103Provider): Promise<Cip103Account>;
|
|
107
|
+
/** The wallet party: the primary account's `partyId` (`getPrimaryAccount`). */
|
|
75
108
|
export declare function primaryPartyId(provider: Cip103Provider): Promise<string>;
|
|
109
|
+
/**
|
|
110
|
+
* The CIP-0103 network id of a Canton network (`canton:devnet`), as a wallet reports it in its account's `networkId`
|
|
111
|
+
* and as a wallet ownership message names it.
|
|
112
|
+
*/
|
|
113
|
+
export declare function cip103NetworkId(network: DaNetwork): string;
|
|
76
114
|
/**
|
|
77
115
|
* Entries asked for per `/v2/state/active-contracts-page` request (`maxPageSize`). Well under the participant's default
|
|
78
116
|
* page and list limits, so a participant does not refuse it.
|
|
@@ -83,14 +121,70 @@ export declare const ACS_PAGE_SIZE = 200;
|
|
|
83
121
|
* of one filter). A read that needs more fails with `WalletReadError` instead of paging on.
|
|
84
122
|
*/
|
|
85
123
|
export declare const ACS_MAX_PAGES = 500;
|
|
124
|
+
/**
|
|
125
|
+
* Codes of a first paged ACS call after which the snapshot is read once through the unpaged
|
|
126
|
+
* `/v2/state/active-contracts` instead: the wallet does not offer the paged endpoint (4200, -32601, -32004), or refused
|
|
127
|
+
* the paged request's shape (-32602). Loop reports those cases differently (see {@link LOOP_HTTP_REFUSED_MESSAGE}). Any
|
|
128
|
+
* other failure (a rate limit, a timeout, a refused or disconnected session) is reported as it is: a second read would
|
|
129
|
+
* fail the same way and only add load.
|
|
130
|
+
*/
|
|
131
|
+
export declare const ACS_FALLBACK_CODES: ReadonlySet<number>;
|
|
132
|
+
/**
|
|
133
|
+
* Loop's message, with code -32002, for any non-OK HTTP reply of its ledger proxy other than 429 that carries no
|
|
134
|
+
* structured error (`@fivenorth/loop-sdk` `Connection.ledgerApi`): an endpoint its allowlist does not offer, a
|
|
135
|
+
* participant that serves the paged endpoint only as GET (Canton 3.5) or refuses its `maxPageSize`, or a server error.
|
|
136
|
+
* Loop's timeout or network failure is another message ("Ledger request failed or timed out") and does not fall back.
|
|
137
|
+
*/
|
|
138
|
+
export declare const LOOP_HTTP_REFUSED_MESSAGE = "Ledger access unavailable";
|
|
139
|
+
/**
|
|
140
|
+
* Whether a provider error is a rate limit: -32005, or -32603 whose message says HTTP status 429 (Loop's session check,
|
|
141
|
+
* which runs before every `ledgerApi` call, throws a plain `Error` that Loop's CIP-0103 adapter maps to -32603).
|
|
142
|
+
*/
|
|
143
|
+
export declare function isRateLimited(error: unknown): boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Waits before each retry of a read the wallet rate-limited (-32005): 0.5 s, 1 s, 2 s, 4 s, so at most five attempts
|
|
146
|
+
* over about 7.5 s. Each wait is jittered to between half and all of its value, so parallel readers spread out.
|
|
147
|
+
*/
|
|
148
|
+
export declare const DEFAULT_READ_RETRY_DELAYS_MS: readonly number[];
|
|
149
|
+
/** How reads back off when the wallet rate-limits them (-32005). Never applied to submissions. */
|
|
150
|
+
export interface WalletReadRetryOptions {
|
|
151
|
+
/** The wait before each retry, in milliseconds; defaults to {@link DEFAULT_READ_RETRY_DELAYS_MS}. Empty: no retry. */
|
|
152
|
+
readonly delaysMs?: readonly number[];
|
|
153
|
+
/** Defaults to `setTimeout`. */
|
|
154
|
+
readonly sleep?: (ms: number) => Promise<void>;
|
|
155
|
+
/** A number in [0, 1) for the jitter; defaults to `Math.random`. */
|
|
156
|
+
readonly random?: () => number;
|
|
157
|
+
}
|
|
158
|
+
/** Contracts of one ACS snapshot, read at one ledger offset. */
|
|
159
|
+
export interface AcsSnapshot {
|
|
160
|
+
readonly offset: number;
|
|
161
|
+
readonly contracts: ActiveContract[];
|
|
162
|
+
}
|
|
163
|
+
export interface AcsReadOptions {
|
|
164
|
+
/**
|
|
165
|
+
* Read at this ledger offset (one an earlier read reported) instead of the current ledger end, so a later read joins
|
|
166
|
+
* an earlier snapshot.
|
|
167
|
+
*/
|
|
168
|
+
readonly activeAtOffset?: number;
|
|
169
|
+
}
|
|
86
170
|
/** What the token actions need from a wallet: one party, its contracts, and a submit that waits for the commit. */
|
|
87
171
|
export interface Cip103Wallet {
|
|
88
172
|
readonly partyId: string;
|
|
89
|
-
/** Active contracts of `partyId` matching the filter, as one snapshot at the ledger end. */
|
|
90
|
-
listActiveContracts(filter: ContractFilter): Promise<ActiveContract[]>;
|
|
173
|
+
/** Active contracts of `partyId` matching the filter, as one snapshot at the ledger end (or at `activeAtOffset`). */
|
|
174
|
+
listActiveContracts(filter: ContractFilter, options?: AcsReadOptions): Promise<ActiveContract[]>;
|
|
175
|
+
/**
|
|
176
|
+
* Active contracts of `partyId` matching any of the filters, as one snapshot at the ledger end: one ledger-end call
|
|
177
|
+
* and one paged ACS stream whose cumulative filter carries every filter. A contract matching several is returned
|
|
178
|
+
* once. With `activeAtOffset`, the snapshot is read at that offset and the ledger end is not read.
|
|
179
|
+
*/
|
|
180
|
+
readActiveContracts(filters: readonly ContractFilter[], options?: AcsReadOptions): Promise<AcsSnapshot>;
|
|
91
181
|
/** Sign and submit as `partyId`; resolves once committed, else throws `WalletSubmitError`. Never retries. */
|
|
92
182
|
submit(submission: WalletSubmission): Promise<SubmitResult>;
|
|
93
183
|
}
|
|
184
|
+
export interface Cip103WalletOptions {
|
|
185
|
+
/** How reads back off when the wallet rate-limits them. */
|
|
186
|
+
readonly readRetry?: WalletReadRetryOptions;
|
|
187
|
+
}
|
|
94
188
|
/** The SDK's CIP-0103 client acting as `partyId` through `provider`. */
|
|
95
|
-
export declare function cip103Wallet(provider: Cip103Provider, partyId: string): Cip103Wallet;
|
|
189
|
+
export declare function cip103Wallet(provider: Cip103Provider, partyId: string, options?: Cip103WalletOptions): Cip103Wallet;
|
|
96
190
|
//# sourceMappingURL=cip103.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cip103.d.ts","sourceRoot":"","sources":["../../../src/wallets/cip103.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cip103.d.ts","sourceRoot":"","sources":["../../../src/wallets/cip103.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAmB,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAIjB,kHAAkH;AAElH,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACzC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAIF,4FAA4F;AAE5F,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,KAAK,GAAG,MAAM,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAIF,iEAAiE;AAEjE,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GACxB;IAAE,MAAM,EAAE,aAAa,CAAA;CAAE,GACzB;IAAE,MAAM,EAAE,mBAAmB,CAAA;CA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