@fairmint/canton-node-sdk 0.0.287 → 0.0.289
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 +131 -12
- package/build/src/clients/ledger-json-api/operations/v2/parties/external/allocate-external-party.d.ts +10 -2
- package/build/src/clients/ledger-json-api/operations/v2/parties/external/allocate-external-party.d.ts.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/parties/external/allocate-external-party.js +27 -3
- package/build/src/clients/ledger-json-api/operations/v2/parties/external/allocate-external-party.js.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/delete-user.js +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/delete-user.js.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/get-user.js +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/get-user.js.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/grant-user-rights.d.ts +2 -0
- package/build/src/clients/ledger-json-api/operations/v2/users/grant-user-rights.d.ts.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/grant-user-rights.js +5 -6
- package/build/src/clients/ledger-json-api/operations/v2/users/grant-user-rights.js.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/list-user-rights.d.ts +3 -0
- package/build/src/clients/ledger-json-api/operations/v2/users/list-user-rights.d.ts.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/list-user-rights.js +5 -3
- package/build/src/clients/ledger-json-api/operations/v2/users/list-user-rights.js.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/revoke-user-rights.js +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/revoke-user-rights.js.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/update-user-identity-provider.js +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/update-user-identity-provider.js.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/update-user.js +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/users/update-user.js.map +1 -1
- package/build/src/clients/ledger-json-api/schemas/operations/users.d.ts +2 -0
- package/build/src/clients/ledger-json-api/schemas/operations/users.d.ts.map +1 -1
- package/build/src/clients/ledger-json-api/schemas/operations/users.js +4 -0
- package/build/src/clients/ledger-json-api/schemas/operations/users.js.map +1 -1
- package/build/src/clients/scan-api/ScanApiClient.d.ts.map +1 -1
- package/build/src/clients/scan-api/ScanApiClient.js +2 -1
- package/build/src/clients/scan-api/ScanApiClient.js.map +1 -1
- package/build/src/core/http/HttpClient.d.ts.map +1 -1
- package/build/src/core/http/HttpClient.js +2 -1
- package/build/src/core/http/HttpClient.js.map +1 -1
- package/build/src/core/http/abort.d.ts +1 -3
- package/build/src/core/http/abort.d.ts.map +1 -1
- package/build/src/core/http/abort.js +6 -4
- package/build/src/core/http/abort.js.map +1 -1
- package/build/src/utils/external-signing/allocate-external-party.d.ts +2 -0
- package/build/src/utils/external-signing/allocate-external-party.d.ts.map +1 -1
- package/build/src/utils/external-signing/allocate-external-party.js +1 -0
- package/build/src/utils/external-signing/allocate-external-party.js.map +1 -1
- package/build/src/utils/external-signing/allocation-user-id.d.ts +6 -0
- package/build/src/utils/external-signing/allocation-user-id.d.ts.map +1 -0
- package/build/src/utils/external-signing/allocation-user-id.js +18 -0
- package/build/src/utils/external-signing/allocation-user-id.js.map +1 -0
- package/build/src/utils/external-signing/create-external-party.d.ts +6 -0
- package/build/src/utils/external-signing/create-external-party.d.ts.map +1 -1
- package/build/src/utils/external-signing/create-external-party.js +4 -1
- package/build/src/utils/external-signing/create-external-party.js.map +1 -1
- package/build/src/utils/external-signing/execute-external-transaction.d.ts +43 -10
- package/build/src/utils/external-signing/execute-external-transaction.d.ts.map +1 -1
- package/build/src/utils/external-signing/execute-external-transaction.js +42 -11
- package/build/src/utils/external-signing/execute-external-transaction.js.map +1 -1
- package/build/src/utils/external-signing/external-party-onboarding.d.ts +24 -0
- package/build/src/utils/external-signing/external-party-onboarding.d.ts.map +1 -1
- package/build/src/utils/external-signing/external-party-onboarding.js +71 -0
- package/build/src/utils/external-signing/external-party-onboarding.js.map +1 -1
- package/build/src/utils/external-signing/external-party-wallet.d.ts +110 -0
- package/build/src/utils/external-signing/external-party-wallet.d.ts.map +1 -1
- package/build/src/utils/external-signing/external-party-wallet.js +173 -1
- package/build/src/utils/external-signing/external-party-wallet.js.map +1 -1
- package/build/src/utils/external-signing/external-signing-client.d.ts +10 -0
- package/build/src/utils/external-signing/external-signing-client.d.ts.map +1 -1
- package/build/src/utils/external-signing/external-signing-client.js +4 -0
- package/build/src/utils/external-signing/external-signing-client.js.map +1 -1
- package/build/src/utils/token-standard/v1/holdings.d.ts +3 -9
- package/build/src/utils/token-standard/v1/holdings.d.ts.map +1 -1
- package/build/src/utils/token-standard/v1/holdings.js +6 -74
- package/build/src/utils/token-standard/v1/holdings.js.map +1 -1
- package/build/src/wallets/abort.d.ts +17 -0
- package/build/src/wallets/abort.d.ts.map +1 -0
- package/build/src/wallets/abort.js +98 -0
- package/build/src/wallets/abort.js.map +1 -0
- package/build/src/wallets/acs.d.ts.map +1 -1
- package/build/src/wallets/acs.js +21 -0
- package/build/src/wallets/acs.js.map +1 -1
- package/build/src/wallets/amulet/constants.d.ts +33 -0
- package/build/src/wallets/amulet/constants.d.ts.map +1 -0
- package/build/src/wallets/amulet/constants.js +34 -0
- package/build/src/wallets/amulet/constants.js.map +1 -0
- package/build/src/wallets/amulet/registry.d.ts +65 -0
- package/build/src/wallets/amulet/registry.d.ts.map +1 -0
- package/build/src/wallets/amulet/registry.js +187 -0
- package/build/src/wallets/amulet/registry.js.map +1 -0
- package/build/src/wallets/cip103.d.ts +40 -5
- package/build/src/wallets/cip103.d.ts.map +1 -1
- package/build/src/wallets/cip103.js +126 -10
- package/build/src/wallets/cip103.js.map +1 -1
- package/build/src/wallets/contracts.d.ts +32 -3
- package/build/src/wallets/contracts.d.ts.map +1 -1
- package/build/src/wallets/contracts.js +48 -11
- package/build/src/wallets/contracts.js.map +1 -1
- package/build/src/wallets/da-utilities/client.d.ts +22 -9
- package/build/src/wallets/da-utilities/client.d.ts.map +1 -1
- package/build/src/wallets/da-utilities/client.js +35 -21
- package/build/src/wallets/da-utilities/client.js.map +1 -1
- package/build/src/wallets/discovery.d.ts +78 -0
- package/build/src/wallets/discovery.d.ts.map +1 -0
- package/build/src/wallets/discovery.js +364 -0
- package/build/src/wallets/discovery.js.map +1 -0
- package/build/src/wallets/errors.d.ts +67 -8
- package/build/src/wallets/errors.d.ts.map +1 -1
- package/build/src/wallets/errors.js +108 -11
- package/build/src/wallets/errors.js.map +1 -1
- package/build/src/wallets/holding-view.d.ts +47 -0
- package/build/src/wallets/holding-view.d.ts.map +1 -0
- package/build/src/wallets/holding-view.js +121 -0
- package/build/src/wallets/holding-view.js.map +1 -0
- package/build/src/wallets/holdings.d.ts +38 -5
- package/build/src/wallets/holdings.d.ts.map +1 -1
- package/build/src/wallets/holdings.js +84 -15
- package/build/src/wallets/holdings.js.map +1 -1
- package/build/src/wallets/index.d.ts +25 -7
- package/build/src/wallets/index.d.ts.map +1 -1
- package/build/src/wallets/index.js +38 -4
- package/build/src/wallets/index.js.map +1 -1
- package/build/src/wallets/ownership.d.ts +12 -0
- package/build/src/wallets/ownership.d.ts.map +1 -1
- package/build/src/wallets/ownership.js +29 -13
- package/build/src/wallets/ownership.js.map +1 -1
- package/build/src/wallets/session.d.ts +10 -2
- package/build/src/wallets/session.d.ts.map +1 -1
- package/build/src/wallets/session.js +186 -61
- package/build/src/wallets/session.js.map +1 -1
- package/build/src/wallets/store.d.ts +14 -3
- package/build/src/wallets/store.d.ts.map +1 -1
- package/build/src/wallets/store.js +36 -16
- package/build/src/wallets/store.js.map +1 -1
- package/build/src/wallets/types.d.ts +14 -0
- package/build/src/wallets/types.d.ts.map +1 -1
- package/build/src/wallets/wallet.d.ts +53 -16
- package/build/src/wallets/wallet.d.ts.map +1 -1
- package/build/src/wallets/wallet.js +271 -93
- package/build/src/wallets/wallet.js.map +1 -1
- package/package.json +107 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holdings.d.ts","sourceRoot":"","sources":["../../../src/wallets/holdings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"holdings.d.ts","sourceRoot":"","sources":["../../../src/wallets/holdings.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,QAAQ,CAAC;AAErD,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2FAA2F;IAC3F,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,gHAAgH;IAChH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAClD;AAmFD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,GAAG,IAAI,CAWrE;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IACpC,gEAAgE;IAChE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,qDAAqD;IACrD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAS5D;AAsB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AAE,CAkCpF"}
|
|
@@ -4,11 +4,17 @@ exports.MAX_SKIPPING_COVER_CANDIDATES = void 0;
|
|
|
4
4
|
exports.parseHolding = parseHolding;
|
|
5
5
|
exports.requirePositiveAmount = requirePositiveAmount;
|
|
6
6
|
exports.selectHoldings = selectHoldings;
|
|
7
|
+
exports.isCantonCoin = isCantonCoin;
|
|
7
8
|
exports.instrumentKey = instrumentKey;
|
|
8
9
|
exports.instrumentBalances = instrumentBalances;
|
|
9
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Read a wallet party's holdings from the ACS (DA Registry holdings and Canton Coin) and pick the inputs for a transfer
|
|
12
|
+
* or burn, with exact decimal arithmetic.
|
|
13
|
+
*/
|
|
14
|
+
const constants_1 = require("./amulet/constants");
|
|
10
15
|
const decimal_1 = require("./decimal");
|
|
11
16
|
const errors_1 = require("./errors");
|
|
17
|
+
const holding_view_1 = require("./holding-view");
|
|
12
18
|
const instrument_1 = require("./instrument");
|
|
13
19
|
const json_1 = require("./json");
|
|
14
20
|
const templates_1 = require("../da-registry/templates");
|
|
@@ -24,15 +30,9 @@ function readLocked(value) {
|
|
|
24
30
|
return null;
|
|
25
31
|
return value['tag'] !== 'None';
|
|
26
32
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* its owner. Any party can create a look-alike from its own package, with the wallet party as an observer, so only
|
|
31
|
-
* those signatures make a holding real. An unreadable holding is never spendable.
|
|
32
|
-
*/
|
|
33
|
-
function parseHolding(contract) {
|
|
34
|
-
if (!(0, templates_2.isTemplate)(contract, templates_1.DA_REGISTRY_TEMPLATES.holding))
|
|
35
|
-
return null;
|
|
33
|
+
const synchronizerOf = (contract) => contract.synchronizerId !== undefined ? { synchronizerId: contract.synchronizerId } : {};
|
|
34
|
+
/** A DA Registry `Holding`, read from its create argument (`owner`, `instrument {source, id}`, `amount`, `lock`). */
|
|
35
|
+
function parseDaHolding(contract) {
|
|
36
36
|
const args = contract.createArgument;
|
|
37
37
|
const instrument = args?.['instrument'];
|
|
38
38
|
if (args === null || !(0, json_1.isRecord)(instrument))
|
|
@@ -45,9 +45,7 @@ function parseHolding(contract) {
|
|
|
45
45
|
instrumentId === null ||
|
|
46
46
|
typeof amount !== 'string' ||
|
|
47
47
|
(0, decimal_1.parseDecimalUnits)(amount) === null ||
|
|
48
|
-
locked === null
|
|
49
|
-
!contract.signatories.includes(instrumentId.admin) ||
|
|
50
|
-
!contract.signatories.includes(owner)) {
|
|
48
|
+
locked === null) {
|
|
51
49
|
return null;
|
|
52
50
|
}
|
|
53
51
|
return {
|
|
@@ -56,9 +54,65 @@ function parseHolding(contract) {
|
|
|
56
54
|
instrumentId,
|
|
57
55
|
amount,
|
|
58
56
|
locked,
|
|
59
|
-
...(contract
|
|
57
|
+
...synchronizerOf(contract),
|
|
58
|
+
source: 'da-registry',
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Canton Coin, read from its `HoldingV1` view (an interface filter returns no create argument for it). The instrument
|
|
63
|
+
* must be `Amulet`; an `Amulet` must be unlocked and a `LockedAmulet` locked, as Splice's views report them. A
|
|
64
|
+
* `LockedAmulet` is signed by its lock holders as well as the DSO and the owner (`signatory lock.holders, signatory
|
|
65
|
+
* amulet`), so every lock holder the view names must be a signatory: a view naming a holder who did not sign is not
|
|
66
|
+
* genuine.
|
|
67
|
+
*/
|
|
68
|
+
function parseAmuletHolding(contract) {
|
|
69
|
+
const view = (0, holding_view_1.holdingViewOf)(contract);
|
|
70
|
+
if (view?.instrumentId.id !== constants_1.AMULET_INSTRUMENT_ID)
|
|
71
|
+
return null;
|
|
72
|
+
if ((0, decimal_1.parseDecimalUnits)(view.amount) === null)
|
|
73
|
+
return null;
|
|
74
|
+
const locked = view.lock !== null;
|
|
75
|
+
if (locked !== (0, templates_2.isTemplate)(contract, constants_1.AMULET_TEMPLATES.lockedAmulet))
|
|
76
|
+
return null;
|
|
77
|
+
if (view.lock !== null && !view.lock.holders.every((holder) => contract.signatories.includes(holder)))
|
|
78
|
+
return null;
|
|
79
|
+
return {
|
|
80
|
+
contractId: contract.contractId,
|
|
81
|
+
owner: view.owner,
|
|
82
|
+
instrumentId: view.instrumentId,
|
|
83
|
+
amount: view.amount,
|
|
84
|
+
locked,
|
|
85
|
+
...synchronizerOf(contract),
|
|
86
|
+
source: 'amulet',
|
|
87
|
+
meta: view.meta.values,
|
|
60
88
|
};
|
|
61
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* The holding contracts the wallet counts, per source: the templates (package-name form, so the package name is checked
|
|
92
|
+
* too) and how to read them. Every rule then requires the instrument admin's and the owner's signatures (a
|
|
93
|
+
* `LockedAmulet`'s parser also requires its lock holders').
|
|
94
|
+
*/
|
|
95
|
+
const HOLDING_RULES = [
|
|
96
|
+
{ templateIds: [templates_1.DA_REGISTRY_TEMPLATES.holding], parse: parseDaHolding },
|
|
97
|
+
{ templateIds: [constants_1.AMULET_TEMPLATES.amulet, constants_1.AMULET_TEMPLATES.lockedAmulet], parse: parseAmuletHolding },
|
|
98
|
+
];
|
|
99
|
+
/**
|
|
100
|
+
* A genuine holding, or null: a DA Registry `Holding` (read from its create argument) or a Canton Coin `Amulet` or
|
|
101
|
+
* `LockedAmulet` (read from its `HoldingV1` view). Genuine: of a template in the trust table above, and signed by its
|
|
102
|
+
* instrument admin (DA's registrar, or the DSO) and its owner, and a `LockedAmulet` by every lock holder. Any party can
|
|
103
|
+
* create a look-alike from its own package, with the wallet party as an observer, so only those signatures make a
|
|
104
|
+
* holding real. An unreadable holding is never spendable.
|
|
105
|
+
*/
|
|
106
|
+
function parseHolding(contract) {
|
|
107
|
+
const rule = HOLDING_RULES.find(({ templateIds }) => templateIds.some((id) => (0, templates_2.isTemplate)(contract, id)));
|
|
108
|
+
const holding = rule?.parse(contract) ?? null;
|
|
109
|
+
if (holding === null ||
|
|
110
|
+
!contract.signatories.includes(holding.instrumentId.admin) ||
|
|
111
|
+
!contract.signatories.includes(holding.owner)) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
return holding;
|
|
115
|
+
}
|
|
62
116
|
/**
|
|
63
117
|
* Parse a positive amount (at most 10 decimal places, at most the Daml `Numeric 10` maximum 10^28 - 10^-10) to units of
|
|
64
118
|
* 10^-10. Throws `invalid-input` otherwise.
|
|
@@ -177,6 +231,14 @@ function selectHoldings(holdings, request) {
|
|
|
177
231
|
amount: (0, decimal_1.formatDecimalUnits)(needed),
|
|
178
232
|
};
|
|
179
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* Whether a holding or balance is Canton Coin (`source: 'amulet'`). Canton Coin is listed but not transferred, burnt or
|
|
236
|
+
* pre-approved through the wallet: filter it out of pickers for those actions (`balances.filter((b) =>
|
|
237
|
+
* !isCantonCoin(b))`).
|
|
238
|
+
*/
|
|
239
|
+
function isCantonCoin(entry) {
|
|
240
|
+
return entry.source === 'amulet';
|
|
241
|
+
}
|
|
180
242
|
/** Escapes `%` and `@` in one key component, so the component holds no bare `@` and the escape itself is unambiguous. */
|
|
181
243
|
const escapeKeyComponent = (text) => text.replace(/%/g, '%25').replace(/@/g, '%40');
|
|
182
244
|
/**
|
|
@@ -201,7 +263,13 @@ function instrumentBalances(holdings) {
|
|
|
201
263
|
if (units === null)
|
|
202
264
|
continue;
|
|
203
265
|
const key = instrumentKey(entry.instrumentId);
|
|
204
|
-
const total = totals.get(key) ?? {
|
|
266
|
+
const total = totals.get(key) ?? {
|
|
267
|
+
instrumentId: entry.instrumentId,
|
|
268
|
+
source: entry.source ?? 'da-registry',
|
|
269
|
+
unlocked: 0n,
|
|
270
|
+
locked: 0n,
|
|
271
|
+
count: 0,
|
|
272
|
+
};
|
|
205
273
|
if (entry.locked)
|
|
206
274
|
total.locked += units;
|
|
207
275
|
else
|
|
@@ -216,6 +284,7 @@ function instrumentBalances(holdings) {
|
|
|
216
284
|
unlocked: (0, decimal_1.formatDecimalUnits)(total.unlocked),
|
|
217
285
|
locked: (0, decimal_1.formatDecimalUnits)(total.locked),
|
|
218
286
|
holdingCount: total.count,
|
|
287
|
+
source: total.source,
|
|
219
288
|
}))
|
|
220
289
|
.sort((a, b) => compareText(a.instrumentId.id, b.instrumentId.id) || compareText(a.instrumentId.admin, b.instrumentId.admin));
|
|
221
290
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holdings.js","sourceRoot":"","sources":["../../../src/wallets/holdings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"holdings.js","sourceRoot":"","sources":["../../../src/wallets/holdings.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;GAGG;AACH,kDAA4E;AAC5E,uCAAqF;AACrF,qCAAuC;AACvC,iDAA+C;AAC/C,6CAAgE;AAChE,iCAAkD;AAClD,wDAAiE;AACjE,2CAAyC;AAqCzC;;;GAGG;AACH,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACxD,IAAI,CAAC,IAAA,eAAQ,EAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAClC,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC;AACjC,CAAC;AAED,MAAM,cAAc,GAAG,CAAC,QAAwB,EAA+B,EAAE,CAC/E,QAAQ,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAE3F,qHAAqH;AACrH,SAAS,cAAc,CAAC,QAAwB;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC;IACrC,MAAM,UAAU,GAAG,IAAI,EAAE,CAAC,YAAY,CAAC,CAAC;IACxC,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,IAAA,eAAQ,EAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IACxD,MAAM,KAAK,GAAG,IAAA,qBAAc,EAAC,IAAI,CA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E;YACV,KAAK,EAAE,CAAC;SACT,CAAC;QACF,IAAI,KAAK,CAAC,MAAM;YAAE,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC;;YACnC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC;QAC7B,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;QACjB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;SACzB,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QACtB,GAAG;QACH,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,QAAQ,EAAE,IAAA,4BAAkB,EAAC,KAAK,CAAC,QAAQ,CAAC;QAC5C,MAAM,EAAE,IAAA,4BAAkB,EAAC,KAAK,CAAC,MAAM,CAAC;QACxC,YAAY,EAAE,KAAK,CAAC,KAAK;QACzB,MAAM,EAAE,KAAK,CAAC,MAAM;KACrB,CAAC,CAAC;SACF,IAAI,CACH,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACP,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAC/G,CAAC;AACN,CAAC"}
|
|
@@ -1,24 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Browser-safe DA Utility Registry holder actions through any CIP-0103 (Canton dApp API) wallet provider. In a browser
|
|
3
|
-
* bundle import `@fairmint/canton-node-sdk/
|
|
4
|
-
*
|
|
3
|
+
* bundle import `@fairmint/canton-node-sdk/wallets`, which loads none of the SDK's Node dependencies (the deep path
|
|
4
|
+
* `@fairmint/canton-node-sdk/build/src/wallets/index.js` still works); the package root also exports it as the
|
|
5
|
+
* `Wallets` namespace (for Node).
|
|
5
6
|
*
|
|
7
|
+
* - `discoverCip103Wallets()`: the CIP-0103 wallet extensions installed in the browser, each with `load(network)` that
|
|
8
|
+
* resolves its provider (the dApp SDK's announce handshake and message channel, no dependency).
|
|
6
9
|
* - `createCip103Session({ network })`: which wallet is connected, as which party (`connect`, `restore`, `disconnect`).
|
|
7
10
|
* - `createWalletStore({ session })`: the page's observable state, typed actions (`act`), notices to show.
|
|
8
11
|
* - `createWallet(...)`: one party's token actions, for code that does not need the store.
|
|
12
|
+
* - Canton Coin, on by default (`cantonCoin: false` on `createWallet` or `createWalletStore` turns it off): `loadState()`
|
|
13
|
+
* lists the party's `Amulet` and `LockedAmulet` holdings (read through the `HoldingV1` view, `source: 'amulet'`,
|
|
14
|
+
* `isCantonCoin`) and Canton Coin transfer offers (`registry: 'amulet'`), which can be accepted, rejected or
|
|
15
|
+
* withdrawn. Holdings and offers share one DSO lookup: the pinned `cantonCoin.dsoParty`, else the `adminId` of the
|
|
16
|
+
* registry (`cantonCoin.registryUrl`, SV-1's Scan of the network by default). While it is unconfirmed, no Canton Coin
|
|
17
|
+
* is listed and `cantonCoinUnavailable` is true. Canton Coin cannot be transferred, burnt or pre-approved through the
|
|
18
|
+
* wallet.
|
|
9
19
|
* - The ownership proof's browser half (`requestWalletOwnershipVerdict`); the server half
|
|
10
20
|
* (`createWalletOwnershipChallenger`, `verifyWalletOwnership`) is Node-only and exported from the package root.
|
|
11
|
-
* - The errors, their
|
|
21
|
+
* - The errors, their guards (`isWalletError`, `isWalletSubmitError`, …: they match errors of any copy of this module,
|
|
22
|
+
* where `instanceof` does not), their user-facing descriptions (`describeWalletError`), and the data types.
|
|
23
|
+
* - Cancellation: every call that reads, fetches or acts takes an optional `signal` (`WalletCallOptions`):
|
|
24
|
+
* `WalletStore.act`, `Cip103Session.connect` and `restore`, `DiscoveredWallet.load` included. `WalletStore.dispose()`
|
|
25
|
+
* cancels the store's own work in flight the same way.
|
|
12
26
|
*/
|
|
13
27
|
export { createCip103Session, type Cip103Session, type Cip103SessionOptions, type Cip103SessionState, type ConnectedWallet, } from './session';
|
|
14
28
|
export { canAct, createWalletStore, walletActionKey, type ActionOutcome, type ActionResultOf, type UnknownOutcome, type WalletAction, type WalletActionResults, type WalletNotice, type WalletStore, type WalletStoreOptions, type WalletView, } from './store';
|
|
15
|
-
export { createWallet, type BurnRequestOptions, type BurnRequestResult, type TransferOffers, type TransferPlan, type TransferPreapprovalOptions, type TransferRequest, type TransferResult, type Wallet, type WalletOptions, type WalletState, } from './wallet';
|
|
29
|
+
export { createWallet, type BurnRequestOptions, type BurnRequestResult, type TransferOffers, type TransferPlan, type TransferPreapprovalOptions, type TransferRequest, type TransferResult, type Wallet, type WalletCallOptions, type WalletOptions, type WalletState, } from './wallet';
|
|
16
30
|
export type { Cip103Connection, Cip103EventListener, Cip103Provider, Cip103Request } from './cip103';
|
|
31
|
+
export { discoverCip103Wallets, INJECTED_WALLET_ID, type Cip103DiscoveryHost, type DiscoverCip103WalletsOptions, type DiscoveredWallet, } from './discovery';
|
|
17
32
|
export { buildWalletOwnershipMessage, proveWalletOwnership, requestWalletOwnershipVerdict, type ProveWalletOwnershipOptions, type RequestWalletOwnershipVerdictOptions, type WalletOwnershipChallenge, type WalletOwnershipChallengeFailure, type WalletOwnershipChallengeResponse, type WalletOwnershipFailure, type WalletOwnershipMessageFields, type WalletOwnershipProof, type WalletOwnershipVerdict, } from './ownership';
|
|
18
33
|
export type { DaNetwork, DaRegistryOptions, FetchLike, TransferKind } from './da-utilities/client';
|
|
19
|
-
export { describeWalletError, RegistryApiError, RegistryResponseError, WalletError, WalletReadError, WalletSignError, WalletSubmitError, type WalletErrorCode, type WalletErrorDescription, type WalletSignErrorReason, type WalletSubmitOutcome, } from './errors';
|
|
20
|
-
export type { BurnRequest, MintOffer, TransferOffer, TransferPreapproval } from './contracts';
|
|
21
|
-
export type
|
|
34
|
+
export { describeWalletError, isRegistryApiError, isRegistryResponseError, isWalletCancellation, isWalletError, isWalletReadError, isWalletSignError, isWalletSubmitError, RegistryApiError, RegistryResponseError, WalletError, WalletReadError, WalletSignError, WalletSubmitError, type WalletErrorCode, type WalletErrorDescription, type WalletSignErrorReason, type WalletSubmitCategory, type WalletSubmitErrorDetails, type WalletSubmitOutcome, } from './errors';
|
|
35
|
+
export type { BurnRequest, MintOffer, TransferOffer, TransferOfferRegistry, TransferPreapproval } from './contracts';
|
|
36
|
+
export { isCantonCoin, type Holding, type HoldingSource, type InstrumentBalance, type InstrumentMetadata, } from './holdings';
|
|
37
|
+
export { AMULET_INSTRUMENT_ID, AMULET_REGISTRY_BASE_URLS, AMULET_TEMPLATES, CANTON_COIN_METADATA, } from './amulet/constants';
|
|
38
|
+
export type { CantonCoinOptions } from './amulet/registry';
|
|
39
|
+
export { HOLDING_V1_INTERFACE_ID, readHoldingView, type HoldingView, type HoldingViewLock, type HoldingViewMetadata, } from './holding-view';
|
|
22
40
|
export type { InstrumentId, SubmitResult } from './types';
|
|
23
41
|
export { formatDecimalUnits, parseDecimalUnits } from './decimal';
|
|
24
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wallets/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wallets/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,kBA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EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACrH,OAAO,EACL,YAAY,EACZ,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseDecimalUnits = exports.formatDecimalUnits = exports.WalletSubmitError = exports.WalletSignError = exports.WalletReadError = exports.WalletError = exports.RegistryResponseError = exports.RegistryApiError = exports.describeWalletError = exports.requestWalletOwnershipVerdict = exports.proveWalletOwnership = exports.buildWalletOwnershipMessage = exports.createWallet = exports.walletActionKey = exports.createWalletStore = exports.canAct = exports.createCip103Session = void 0;
|
|
3
|
+
exports.parseDecimalUnits = exports.formatDecimalUnits = exports.readHoldingView = exports.HOLDING_V1_INTERFACE_ID = exports.CANTON_COIN_METADATA = exports.AMULET_TEMPLATES = exports.AMULET_REGISTRY_BASE_URLS = exports.AMULET_INSTRUMENT_ID = exports.isCantonCoin = exports.WalletSubmitError = exports.WalletSignError = exports.WalletReadError = exports.WalletError = exports.RegistryResponseError = exports.RegistryApiError = exports.isWalletSubmitError = exports.isWalletSignError = exports.isWalletReadError = exports.isWalletError = exports.isWalletCancellation = exports.isRegistryResponseError = exports.isRegistryApiError = exports.describeWalletError = exports.requestWalletOwnershipVerdict = exports.proveWalletOwnership = exports.buildWalletOwnershipMessage = exports.INJECTED_WALLET_ID = exports.discoverCip103Wallets = exports.createWallet = exports.walletActionKey = exports.createWalletStore = exports.canAct = exports.createCip103Session = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Browser-safe DA Utility Registry holder actions through any CIP-0103 (Canton dApp API) wallet provider. In a browser
|
|
6
|
-
* bundle import `@fairmint/canton-node-sdk/
|
|
7
|
-
*
|
|
6
|
+
* bundle import `@fairmint/canton-node-sdk/wallets`, which loads none of the SDK's Node dependencies (the deep path
|
|
7
|
+
* `@fairmint/canton-node-sdk/build/src/wallets/index.js` still works); the package root also exports it as the
|
|
8
|
+
* `Wallets` namespace (for Node).
|
|
8
9
|
*
|
|
10
|
+
* - `discoverCip103Wallets()`: the CIP-0103 wallet extensions installed in the browser, each with `load(network)` that
|
|
11
|
+
* resolves its provider (the dApp SDK's announce handshake and message channel, no dependency).
|
|
9
12
|
* - `createCip103Session({ network })`: which wallet is connected, as which party (`connect`, `restore`, `disconnect`).
|
|
10
13
|
* - `createWalletStore({ session })`: the page's observable state, typed actions (`act`), notices to show.
|
|
11
14
|
* - `createWallet(...)`: one party's token actions, for code that does not need the store.
|
|
15
|
+
* - Canton Coin, on by default (`cantonCoin: false` on `createWallet` or `createWalletStore` turns it off): `loadState()`
|
|
16
|
+
* lists the party's `Amulet` and `LockedAmulet` holdings (read through the `HoldingV1` view, `source: 'amulet'`,
|
|
17
|
+
* `isCantonCoin`) and Canton Coin transfer offers (`registry: 'amulet'`), which can be accepted, rejected or
|
|
18
|
+
* withdrawn. Holdings and offers share one DSO lookup: the pinned `cantonCoin.dsoParty`, else the `adminId` of the
|
|
19
|
+
* registry (`cantonCoin.registryUrl`, SV-1's Scan of the network by default). While it is unconfirmed, no Canton Coin
|
|
20
|
+
* is listed and `cantonCoinUnavailable` is true. Canton Coin cannot be transferred, burnt or pre-approved through the
|
|
21
|
+
* wallet.
|
|
12
22
|
* - The ownership proof's browser half (`requestWalletOwnershipVerdict`); the server half
|
|
13
23
|
* (`createWalletOwnershipChallenger`, `verifyWalletOwnership`) is Node-only and exported from the package root.
|
|
14
|
-
* - The errors, their
|
|
24
|
+
* - The errors, their guards (`isWalletError`, `isWalletSubmitError`, …: they match errors of any copy of this module,
|
|
25
|
+
* where `instanceof` does not), their user-facing descriptions (`describeWalletError`), and the data types.
|
|
26
|
+
* - Cancellation: every call that reads, fetches or acts takes an optional `signal` (`WalletCallOptions`):
|
|
27
|
+
* `WalletStore.act`, `Cip103Session.connect` and `restore`, `DiscoveredWallet.load` included. `WalletStore.dispose()`
|
|
28
|
+
* cancels the store's own work in flight the same way.
|
|
15
29
|
*/
|
|
16
30
|
var session_1 = require("./session");
|
|
17
31
|
Object.defineProperty(exports, "createCip103Session", { enumerable: true, get: function () { return session_1.createCip103Session; } });
|
|
@@ -21,18 +35,38 @@ Object.defineProperty(exports, "createWalletStore", { enumerable: true, get: fun
|
|
|
21
35
|
Object.defineProperty(exports, "walletActionKey", { enumerable: true, get: function () { return store_1.walletActionKey; } });
|
|
22
36
|
var wallet_1 = require("./wallet");
|
|
23
37
|
Object.defineProperty(exports, "createWallet", { enumerable: true, get: function () { return wallet_1.createWallet; } });
|
|
38
|
+
var discovery_1 = require("./discovery");
|
|
39
|
+
Object.defineProperty(exports, "discoverCip103Wallets", { enumerable: true, get: function () { return discovery_1.discoverCip103Wallets; } });
|
|
40
|
+
Object.defineProperty(exports, "INJECTED_WALLET_ID", { enumerable: true, get: function () { return discovery_1.INJECTED_WALLET_ID; } });
|
|
24
41
|
var ownership_1 = require("./ownership");
|
|
25
42
|
Object.defineProperty(exports, "buildWalletOwnershipMessage", { enumerable: true, get: function () { return ownership_1.buildWalletOwnershipMessage; } });
|
|
26
43
|
Object.defineProperty(exports, "proveWalletOwnership", { enumerable: true, get: function () { return ownership_1.proveWalletOwnership; } });
|
|
27
44
|
Object.defineProperty(exports, "requestWalletOwnershipVerdict", { enumerable: true, get: function () { return ownership_1.requestWalletOwnershipVerdict; } });
|
|
28
45
|
var errors_1 = require("./errors");
|
|
29
46
|
Object.defineProperty(exports, "describeWalletError", { enumerable: true, get: function () { return errors_1.describeWalletError; } });
|
|
47
|
+
Object.defineProperty(exports, "isRegistryApiError", { enumerable: true, get: function () { return errors_1.isRegistryApiError; } });
|
|
48
|
+
Object.defineProperty(exports, "isRegistryResponseError", { enumerable: true, get: function () { return errors_1.isRegistryResponseError; } });
|
|
49
|
+
Object.defineProperty(exports, "isWalletCancellation", { enumerable: true, get: function () { return errors_1.isWalletCancellation; } });
|
|
50
|
+
Object.defineProperty(exports, "isWalletError", { enumerable: true, get: function () { return errors_1.isWalletError; } });
|
|
51
|
+
Object.defineProperty(exports, "isWalletReadError", { enumerable: true, get: function () { return errors_1.isWalletReadError; } });
|
|
52
|
+
Object.defineProperty(exports, "isWalletSignError", { enumerable: true, get: function () { return errors_1.isWalletSignError; } });
|
|
53
|
+
Object.defineProperty(exports, "isWalletSubmitError", { enumerable: true, get: function () { return errors_1.isWalletSubmitError; } });
|
|
30
54
|
Object.defineProperty(exports, "RegistryApiError", { enumerable: true, get: function () { return errors_1.RegistryApiError; } });
|
|
31
55
|
Object.defineProperty(exports, "RegistryResponseError", { enumerable: true, get: function () { return errors_1.RegistryResponseError; } });
|
|
32
56
|
Object.defineProperty(exports, "WalletError", { enumerable: true, get: function () { return errors_1.WalletError; } });
|
|
33
57
|
Object.defineProperty(exports, "WalletReadError", { enumerable: true, get: function () { return errors_1.WalletReadError; } });
|
|
34
58
|
Object.defineProperty(exports, "WalletSignError", { enumerable: true, get: function () { return errors_1.WalletSignError; } });
|
|
35
59
|
Object.defineProperty(exports, "WalletSubmitError", { enumerable: true, get: function () { return errors_1.WalletSubmitError; } });
|
|
60
|
+
var holdings_1 = require("./holdings");
|
|
61
|
+
Object.defineProperty(exports, "isCantonCoin", { enumerable: true, get: function () { return holdings_1.isCantonCoin; } });
|
|
62
|
+
var constants_1 = require("./amulet/constants");
|
|
63
|
+
Object.defineProperty(exports, "AMULET_INSTRUMENT_ID", { enumerable: true, get: function () { return constants_1.AMULET_INSTRUMENT_ID; } });
|
|
64
|
+
Object.defineProperty(exports, "AMULET_REGISTRY_BASE_URLS", { enumerable: true, get: function () { return constants_1.AMULET_REGISTRY_BASE_URLS; } });
|
|
65
|
+
Object.defineProperty(exports, "AMULET_TEMPLATES", { enumerable: true, get: function () { return constants_1.AMULET_TEMPLATES; } });
|
|
66
|
+
Object.defineProperty(exports, "CANTON_COIN_METADATA", { enumerable: true, get: function () { return constants_1.CANTON_COIN_METADATA; } });
|
|
67
|
+
var holding_view_1 = require("./holding-view");
|
|
68
|
+
Object.defineProperty(exports, "HOLDING_V1_INTERFACE_ID", { enumerable: true, get: function () { return holding_view_1.HOLDING_V1_INTERFACE_ID; } });
|
|
69
|
+
Object.defineProperty(exports, "readHoldingView", { enumerable: true, get: function () { return holding_view_1.readHoldingView; } });
|
|
36
70
|
var decimal_1 = require("./decimal");
|
|
37
71
|
Object.defineProperty(exports, "formatDecimalUnits", { enumerable: true, get: function () { return decimal_1.formatDecimalUnits; } });
|
|
38
72
|
Object.defineProperty(exports, "parseDecimalUnits", { enumerable: true, get: function () { return decimal_1.parseDecimalUnits; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/wallets/index.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/wallets/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qCAMmB;AALjB,8GAAA,mBAAmB,OAAA;AAMrB,iCAaiB;AAZf,+FAAA,MAAM,OAAA;AACN,0GAAA,iBAAiB,OAAA;AACjB,wGAAA,eAAe,OAAA;AAWjB,mCAakB;AAZhB,sGAAA,YAAY,OAAA;AAcd,yCAMqB;AALnB,kHAAA,qBAAqB,OAAA;AACrB,+GAAA,kBAAkB,OAAA;AAKpB,yCAaqB;AAZnB,wHAAA,2BAA2B,OAAA;AAC3B,iHAAA,oBAAoB,OAAA;AACpB,0HAAA,6BAA6B,OAAA;AAY/B,mCAqBkB;AApBhB,6GAAA,mBAAmB,OAAA;AACnB,4GAAA,kBAAkB,OAAA;AAClB,iHAAA,uBAAuB,OAAA;AACvB,8GAAA,oBAAoB,OAAA;AACpB,uGAAA,aAAa,OAAA;AACb,2GAAA,iBAAiB,OAAA;AACjB,2GAAA,iBAAiB,OAAA;AACjB,6GAAA,mBAAmB,OAAA;AACnB,0GAAA,gBAAgB,OAAA;AAChB,+GAAA,qBAAqB,OAAA;AACrB,qGAAA,WAAW,OAAA;AACX,yGAAA,eAAe,OAAA;AACf,yGAAA,eAAe,OAAA;AACf,2GAAA,iBAAiB,OAAA;AASnB,uCAMoB;AALlB,wGAAA,YAAY,OAAA;AAMd,gDAK4B;AAJ1B,iHAAA,oBAAoB,OAAA;AACpB,sHAAA,yBAAyB,OAAA;AACzB,6GAAA,gBAAgB,OAAA;AAChB,iHAAA,oBAAoB,OAAA;AAGtB,+CAMwB;AALtB,uHAAA,uBAAuB,OAAA;AACvB,+GAAA,eAAe,OAAA;AAMjB,qCAAkE;AAAzD,6GAAA,kBAAkB,OAAA;AAAE,4GAAA,iBAAiB,OAAA"}
|
|
@@ -70,6 +70,12 @@ export interface ProveWalletOwnershipOptions {
|
|
|
70
70
|
readonly challenge: WalletOwnershipChallenge;
|
|
71
71
|
/** Defaults to the system clock; an expired challenge is refused before anything is signed. */
|
|
72
72
|
readonly now?: () => Date;
|
|
73
|
+
/**
|
|
74
|
+
* Cancels the proof: once aborted, the call rejects with an `AbortError` and the wallet is not asked to sign. A
|
|
75
|
+
* signature request already shown to the user is not withdrawn (CIP-0103 has no cancellation); its answer is
|
|
76
|
+
* ignored.
|
|
77
|
+
*/
|
|
78
|
+
readonly signal?: AbortSignal;
|
|
73
79
|
}
|
|
74
80
|
/**
|
|
75
81
|
* Ask the wallet to sign the ownership message for the challenge, as the connection's party. CIP-0103 wallets sign with
|
|
@@ -138,6 +144,12 @@ export interface RequestWalletOwnershipVerdictOptions {
|
|
|
138
144
|
readonly challengeUrl: string;
|
|
139
145
|
/** Answers `POST { token, proof }` with `{ data: WalletOwnershipVerdict }`. */
|
|
140
146
|
readonly verifyUrl: string;
|
|
147
|
+
/**
|
|
148
|
+
* Cancels the check (for example when the user leaves the page): once aborted, the call rejects with an `AbortError`,
|
|
149
|
+
* the requests in flight get the signal, and nothing more is sent. A signature request already shown to the user is
|
|
150
|
+
* not withdrawn (CIP-0103 has no cancellation); a proof signed after the abort is never sent.
|
|
151
|
+
*/
|
|
152
|
+
readonly signal?: AbortSignal;
|
|
141
153
|
}
|
|
142
154
|
/**
|
|
143
155
|
* The browser half of an ownership check, against a server that uses the SDK's challenger (or the same wire format: a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ownership.d.ts","sourceRoot":"","sources":["../../../src/wallets/ownership.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ownership.d.ts","sourceRoot":"","sources":["../../../src/wallets/ownership.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIpE,iDAAiD;AACjD,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AACtE,uDAAuD;AACvD,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,kHAAkH;AAClH,MAAM,WAAW,wBAAwB;IACvC,oGAAoG;IACpG,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,kFAAkF;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,MAAM,EAAE,+BAA+B,GAAG,sBAAsB,CAAC;IAC1E,uCAAuC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEN,MAAM,WAAW,oCAAoC;IACnD,iHAAiH;IACjH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAC3B,6FAA6F;IAC7F,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,+EAA+E;IAC/E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B;AAmDD;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,UAAU,EAAE,gBAAgB,EAC5B,OAAO,EAAE,oCAAoC,GAC5C,OAAO,CAAC,sBAAsB,CAAC,CAuBjC"}
|
|
@@ -24,6 +24,8 @@ exports.requestWalletOwnershipVerdict = requestWalletOwnershipVerdict;
|
|
|
24
24
|
* network proven must look the party up on that network (its Scan or ledger party and topology APIs).
|
|
25
25
|
*/
|
|
26
26
|
const cip103_1 = require("./cip103");
|
|
27
|
+
const abort_1 = require("./abort");
|
|
28
|
+
const abort_2 = require("../core/http/abort");
|
|
27
29
|
const client_1 = require("./da-utilities/client");
|
|
28
30
|
const errors_1 = require("./errors");
|
|
29
31
|
const json_1 = require("./json");
|
|
@@ -156,8 +158,9 @@ function readSignature(raw) {
|
|
|
156
158
|
*/
|
|
157
159
|
async function proveWalletOwnership(connection, options) {
|
|
158
160
|
const { provider, partyId, network } = connection;
|
|
159
|
-
const { challenge } = options;
|
|
160
|
-
|
|
161
|
+
const { challenge, signal } = options;
|
|
162
|
+
(0, abort_1.throwIfAborted)(signal);
|
|
163
|
+
const account = await (0, abort_1.awaitWithAbort)(async () => (0, cip103_1.primaryAccount)(provider, { signal }), signal);
|
|
161
164
|
if (account.partyId !== partyId) {
|
|
162
165
|
throw new errors_1.WalletSignError('invalid-challenge', `The wallet's primary account is ${account.partyId}, not ${partyId}; switch accounts in the wallet first`);
|
|
163
166
|
}
|
|
@@ -189,11 +192,14 @@ async function proveWalletOwnership(connection, options) {
|
|
|
189
192
|
if (!(now < Date.parse(challenge.expiresAt))) {
|
|
190
193
|
throw new errors_1.WalletSignError('invalid-challenge', 'The ownership challenge has expired; ask the server for a new one');
|
|
191
194
|
}
|
|
195
|
+
(0, abort_1.throwIfAborted)(signal);
|
|
192
196
|
let raw;
|
|
193
197
|
try {
|
|
194
|
-
raw = await provider.request({ method: 'signMessage', params: { message } });
|
|
198
|
+
raw = await (0, abort_2.awaitWithAbort)(async () => provider.request({ method: 'signMessage', params: { message } }, { signal }), signal);
|
|
195
199
|
}
|
|
196
200
|
catch (error) {
|
|
201
|
+
if (signal?.aborted === true)
|
|
202
|
+
throw error;
|
|
197
203
|
const code = (0, cip103_1.cip103ErrorCode)(error);
|
|
198
204
|
if (code === cip103_1.CIP103_ERROR_CODES.userRejected) {
|
|
199
205
|
throw new errors_1.WalletSignError('rejected-by-user', `The user declined to sign the ownership message: ${(0, cip103_1.describeError)(error)}`, code);
|
|
@@ -226,15 +232,23 @@ function isWalletOwnershipVerdict(value, partyId) {
|
|
|
226
232
|
return value['verified'] === false && typeof value['reason'] === 'string' && typeof value['message'] === 'string';
|
|
227
233
|
}
|
|
228
234
|
/** POST `body` as JSON and return the response's `data`; throws on a non-2xx answer or one without `data`. */
|
|
229
|
-
async function postForData(fetch, url, body
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
})
|
|
235
|
+
async function postForData(fetch, url, body, signal,
|
|
236
|
+
/** Whether the request carries the signed proof: an abort after it is sent is not a cancellation before submit. */
|
|
237
|
+
carriesProof) {
|
|
238
|
+
(0, abort_1.throwIfAborted)(signal);
|
|
239
|
+
const race = carriesProof ? abort_2.awaitWithAbort : abort_1.awaitWithAbort;
|
|
240
|
+
const { response, text } = await race(async () => {
|
|
241
|
+
const answer = await fetch(url, {
|
|
242
|
+
method: 'POST',
|
|
243
|
+
headers: { 'content-type': 'application/json' },
|
|
244
|
+
body: JSON.stringify(body),
|
|
245
|
+
...(signal !== undefined && { signal }),
|
|
246
|
+
});
|
|
247
|
+
return { response: answer, text: await answer.text() };
|
|
248
|
+
}, signal);
|
|
235
249
|
let json;
|
|
236
250
|
try {
|
|
237
|
-
json = JSON.parse(
|
|
251
|
+
json = JSON.parse(text);
|
|
238
252
|
}
|
|
239
253
|
catch {
|
|
240
254
|
json = undefined;
|
|
@@ -256,7 +270,9 @@ async function postForData(fetch, url, body) {
|
|
|
256
270
|
async function requestWalletOwnershipVerdict(connection, options) {
|
|
257
271
|
const { partyId, network } = connection;
|
|
258
272
|
const send = options.fetch ?? (0, client_1.globalFetch)('{ fetch } to requestWalletOwnershipVerdict');
|
|
259
|
-
const
|
|
273
|
+
const { signal } = options;
|
|
274
|
+
(0, abort_1.throwIfAborted)(signal);
|
|
275
|
+
const issued = await postForData(send, options.challengeUrl, { network, partyId }, signal, false);
|
|
260
276
|
if (!(0, json_1.isRecord)(issued) || !(0, json_1.isRecord)(issued['challenge']) || typeof issued['token'] !== 'string') {
|
|
261
277
|
throw new Error('The server answered the ownership challenge request without { challenge, token }');
|
|
262
278
|
}
|
|
@@ -265,8 +281,8 @@ async function requestWalletOwnershipVerdict(connection, options) {
|
|
|
265
281
|
if (challenge.network !== (0, cip103_1.cip103NetworkId)(network)) {
|
|
266
282
|
throw new errors_1.WalletSignError('invalid-challenge', `The server issued a challenge for ${String(challenge.network)}, not ${(0, cip103_1.cip103NetworkId)(network)}`);
|
|
267
283
|
}
|
|
268
|
-
const proof = await proveWalletOwnership(connection, { challenge });
|
|
269
|
-
const verdict = await postForData(send, options.verifyUrl, { token: issued['token'], proof });
|
|
284
|
+
const proof = await proveWalletOwnership(connection, { challenge, ...(signal !== undefined && { signal }) });
|
|
285
|
+
const verdict = await postForData(send, options.verifyUrl, { token: issued['token'], proof }, signal, true);
|
|
270
286
|
if (!isWalletOwnershipVerdict(verdict, partyId)) {
|
|
271
287
|
throw new Error('The server answered the ownership proof without a well-formed verdict for the party');
|
|
272
288
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ownership.js","sourceRoot":"","sources":["../../../src/wallets/ownership.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;;GAeG;AACH,qCAQkB;AAClB,kDAAoE;AACpE,qCAA4D;AAC5D,iCAAkD;AAElD,iDAAiD;AACpC,QAAA,sBAAsB,GAAG,+BAA+B,CAAC;AACtE,uDAAuD;AAC1C,QAAA,wBAAwB,GAAG,GAAG,CAAC;AAmC5C,MAAM,cAAc,GAAG,mEAAmE,CAAC;AAC3F,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAClD,sCAAsC;AACtC,MAAM,aAAa,GAAG,UAAU,CAAC;AACjC,MAAM,WAAW,GAAG,+CAA+C,CAAC;AAEpE,sFAAsF;AACtF,iCAAwC,KAAc;IACpD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC;AAED,0GAA0G;AAC1G,kCAAyC,KAAc;IACrD,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAChH,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,SAAS,YAAY,CAAC,MAAoC;IACxD,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5C,OAAO,oDAAoD,CAAC;IAC9D,CAAC;IACD,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1E,OAAO,gEAAgE,CAAC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SAAS,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7G,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5G,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,qFAAqF,CAAC,CAAC;IACzG,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Cip103Connection, type Cip103Provider } from './cip103';
|
|
2
2
|
import type { DaNetwork } from './da-utilities/client';
|
|
3
3
|
import { type WalletErrorDescription } from './errors';
|
|
4
|
+
import type { WalletCallOptions } from './wallet';
|
|
4
5
|
/** A connected wallet. Each session is one object: compare by identity to tell a live session from an ended one. */
|
|
5
6
|
export interface ConnectedWallet extends Cip103Connection {
|
|
6
7
|
/**
|
|
@@ -37,16 +38,23 @@ export interface Cip103Session {
|
|
|
37
38
|
* `connecting`, waits for a disconnect of this wallet still in flight, sends CIP-0103 `connect` (the wallet's own
|
|
38
39
|
* sign-in), then reads the primary account (`getPrimaryAccount`). A failure becomes `error` (4001: declined).
|
|
39
40
|
* Resolves when it settled; superseded by a newer `connect()`, `disconnect()`, `fail()` or `dispose()`.
|
|
41
|
+
* `options.signal` cancels it: the call rejects with an `AbortError` and, when it was still the session's pending
|
|
42
|
+
* connect, the session disconnects as `disconnect()` does (the wallet's own prompt cannot be closed from here). When
|
|
43
|
+
* the wallet signed in but its account was refused (another network, no account) and nothing newer changed the
|
|
44
|
+
* session since, the wallet is signed out and kept out of `restore()` all the same, and the session keeps that
|
|
45
|
+
* error.
|
|
40
46
|
*/
|
|
41
|
-
connect(provider: Cip103Provider): Promise<void>;
|
|
47
|
+
connect(provider: Cip103Provider, options?: WalletCallOptions): Promise<void>;
|
|
42
48
|
/**
|
|
43
49
|
* On page load: when the session is disconnected and the wallet answers CIP-0103 `isConnected` with `{ isConnected:
|
|
44
50
|
* true }`, reads the primary account and connects silently. It never publishes an error: any failure (4200 included)
|
|
45
51
|
* leaves the session as it was. Ignored while connecting or connected, and for a wallet the user signed out of
|
|
46
52
|
* (`disconnect()`, or a switch to another wallet) until `connect()` signs in to it again, also when the wallet still
|
|
47
53
|
* reports a session; dropped when anything else changed the session meanwhile, or a newer `restore()` started.
|
|
54
|
+
* `options.signal` cancels it: the call rejects with an `AbortError` and the restore is dropped (the session is not
|
|
55
|
+
* changed).
|
|
48
56
|
*/
|
|
49
|
-
restore(provider: Cip103Provider): Promise<void>;
|
|
57
|
+
restore(provider: Cip103Provider, options?: WalletCallOptions): Promise<void>;
|
|
50
58
|
/**
|
|
51
59
|
* The user disconnected: sends CIP-0103 `disconnect` (best-effort) to the wallets the session is on (the connected
|
|
52
60
|
* one, and the one a pending `connect()` signs in to), then publishes `disconnected`. A later `connect()` to such a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/wallets/session.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/wallets/session.ts"],"names":[],"mappings":"AASA,OAAO,EASL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAwC,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAE7F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,oHAAoH;AACpH,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,kBAAkB,G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