@laceio/sdk 0.1.1-canary.3 → 0.1.2-canary.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.
Files changed (82) hide show
  1. package/dist/{account-call-NgLhYein.cjs → account-call-7wnopBq0.cjs} +2 -1
  2. package/dist/account-call-B9d_2Xwi.js +4 -0
  3. package/dist/{account-call-DIIa2rK_.cjs → account-call-Bd4Rpbvt.cjs} +21 -12
  4. package/dist/{account-call-D68oF6bh.js → account-call-C3CkDqEC.js} +21 -12
  5. package/dist/{artefact-loader-DZPYrq-6.cjs → artefact-loader-BWWYAD7E.cjs} +1 -1
  6. package/dist/{artefact-loader-54uK5RAa.js → artefact-loader-Dik4HIfv.js} +1 -1
  7. package/dist/bitcoin.cjs +3 -3
  8. package/dist/bitcoin.js +3 -3
  9. package/dist/cardano.cjs +3 -3
  10. package/dist/cardano.d.ts +58 -3
  11. package/dist/cardano.js +3 -3
  12. package/dist/{contract-BD_312b0.js → contract-1R86jhSw.js} +1 -1
  13. package/dist/{contract-DevBp9u8.cjs → contract-MKLzYVkW.cjs} +1 -1
  14. package/dist/{device-readers-BWOmz9eD.js → device-readers-CUHYoYOH.js} +3 -3
  15. package/dist/{device-readers-CIgYZN7f.cjs → device-readers-CdxS2btd.cjs} +3 -3
  16. package/dist/{device-readers-70i7tQqU.cjs → device-readers-D_JZeNL2.cjs} +1 -1
  17. package/dist/{device-readers-B7--ezKM.js → device-readers-DwSNCGPP.js} +1 -1
  18. package/dist/{envelopes-BkH1Qdxk.js → envelopes-BGoO_v8m.js} +2 -1
  19. package/dist/{envelopes-ETZEJS_O.cjs → envelopes-CH25R-DN.cjs} +3 -2
  20. package/dist/{errors-BZ8hnhCM.cjs → errors-BIftM8ZN.cjs} +109 -5
  21. package/dist/{errors-DIJTAsLa.js → errors-DSq5wUwt.js} +80 -6
  22. package/dist/experimental.cjs +346 -72
  23. package/dist/experimental.d.ts +784 -36
  24. package/dist/experimental.js +340 -73
  25. package/dist/{gated-call-SomdJ5nj.cjs → gated-call-CDCVZIK-.cjs} +2 -1
  26. package/dist/{gated-call-DjoRPqn1.js → gated-call-D-tT7P_t.js} +164 -137
  27. package/dist/gated-call-D_VT2quk.js +4 -0
  28. package/dist/{gated-call-DJWY299W.cjs → gated-call-DgJm1Mi_.cjs} +192 -141
  29. package/dist/{grant-circuits-_1x--moV.cjs → grant-circuits-DswmW3nI.cjs} +29 -7
  30. package/dist/grant-circuits-Jxb5y1HW.js +42 -0
  31. package/dist/{grant-rules-_xJHAT2M.js → grant-rules-By07_eDi.js} +2 -11
  32. package/dist/{grant-rules-7Zqi_3BN.cjs → grant-rules-BzVTWXS7.cjs} +2 -17
  33. package/dist/grant-spend-B3Md9L0n.js +215 -0
  34. package/dist/grant-spend-oWmzRsjH.cjs +217 -0
  35. package/dist/grants-2BZ-qEVQ.js +5 -0
  36. package/dist/{grants-D61131nK.cjs → grants-BPoLSiMt.cjs} +3 -2
  37. package/dist/{grants--b0LQQzZ.cjs → grants-BoI5uwSF.cjs} +9 -3
  38. package/dist/{grants-BIs6qm3b.js → grants-CtofFu-e.js} +4 -4
  39. package/dist/index.cjs +4 -4
  40. package/dist/index.d.ts +58 -3
  41. package/dist/index.js +4 -4
  42. package/dist/{init-B5X_sGj9.cjs → init-BPU3j8sT.cjs} +1 -1
  43. package/dist/{init-ZjNDDC-T.cjs → init-BRzH6xu-2.cjs} +486 -64
  44. package/dist/{init-DU5yYX5u.js → init-CDkRynJa.js} +486 -64
  45. package/dist/{init-DS5qN63m.js → init-Cigr_tKx.js} +23 -11
  46. package/dist/{init-Cp8EJGbm.js → init-c4l6r-o-.js} +1 -1
  47. package/dist/{init-Bp9GsPS_.cjs → init-zU-_9Gsp.cjs} +22 -10
  48. package/dist/{jubjub-authoriser-BxE3oN2y.js → jubjub-authoriser-D7zDXu3V.js} +4 -4
  49. package/dist/{jubjub-authoriser-C6SDEP9I.cjs → jubjub-authoriser-Dgu6o3Sv.cjs} +4 -4
  50. package/dist/midnight.cjs +1 -1
  51. package/dist/midnight.js +3 -3
  52. package/dist/{modules-cardano-BrS68BbA.js → modules-cardano-B1nDUWqy.js} +2 -2
  53. package/dist/{modules-cardano-D843LvB0.cjs → modules-cardano-BYeYHrRm.cjs} +2 -2
  54. package/dist/{providers-BLgJ0uQs.cjs → providers-FjhM47BH.cjs} +31 -9
  55. package/dist/{providers-CwnT4vEE.js → providers-WtiSuxFu.js} +31 -9
  56. package/dist/{sdk-_yO75IHD.js → sdk-Cb-gZnS9.js} +3 -3
  57. package/dist/{sdk-Dd0MKXFz.cjs → sdk-DffwmX8b.cjs} +3 -3
  58. package/dist/{sdk-init-OMHyOGOK.js → sdk-init-Bln9rFtn.js} +3 -3
  59. package/dist/{slice-HjLXJyQG2.cjs → slice-t8Gzj55G2.cjs} +1 -0
  60. package/dist/{slice-CxKWDuBP.js → slice-t8Q1cHm-.js} +1 -0
  61. package/dist/submit-Bs77dPn_.cjs +413 -0
  62. package/dist/submit-DOv8Z0Vf.js +336 -0
  63. package/dist/{submit-bitcoin-tx-BG3Gemov.js → submit-bitcoin-tx-D6oYgH5S.js} +2 -2
  64. package/dist/{submit-bitcoin-tx-Y0CtvFN7.cjs → submit-bitcoin-tx-goFuRL7K.cjs} +2 -2
  65. package/dist/{watch-D-RoItM5.js → watch-CUEvcP-V.js} +2 -2
  66. package/package.json +1 -1
  67. package/dist/account-call-n-Nkp35e.js +0 -3
  68. package/dist/gated-call-Boy6rXdC.js +0 -3
  69. package/dist/grant-circuits-swuzEdUl.js +0 -26
  70. package/dist/grants-CSgfYlOO.js +0 -5
  71. package/dist/submit-BBYjnZu8.cjs +0 -87
  72. package/dist/submit-D_yxYM_T.js +0 -70
  73. /package/dist/{enc-key-circuits-DA2Xs3vZ.js → enc-key-circuits-B7BjgUL9.js} +0 -0
  74. /package/dist/{enc-key-circuits-C8fGAMEF.cjs → enc-key-circuits-BLrZrBVI.cjs} +0 -0
  75. /package/dist/{init-DHaMxHM1.js → init-A-VyGSNW2.js} +0 -0
  76. /package/dist/{init-zUoRG_EC2.cjs → init-BFcvPHL-.cjs} +0 -0
  77. /package/dist/{init-DrkOb-wd.cjs → init-BwkU0ruo.cjs} +0 -0
  78. /package/dist/{init-D74mn8nH2.js → init-SZ01tARX2.js} +0 -0
  79. /package/dist/{node-relay-DblH5fKv.cjs → node-relay-DWe1U0w2.cjs} +0 -0
  80. /package/dist/{node-relay-Cv0cNknM.js → node-relay-h4i5IlAQ.js} +0 -0
  81. /package/dist/{types-T0cjaR75.js → types-BHC12eSa.js} +0 -0
  82. /package/dist/{types-Zj78LtYu.cjs → types-Cc3mC8u0.cjs} +0 -0
@@ -1,4 +1,5 @@
1
1
  require("./rolldown-runtime-Br2OG8yv.cjs");
2
2
  require("./_polyfill-buffer-patch-CM8X7JiY.cjs");
3
- const require_account_call = require("./account-call-DIIa2rK_.cjs");
3
+ require("./codecs-Cswkg7Tm.cjs");
4
+ const require_account_call = require("./account-call-Bd4Rpbvt.cjs");
4
5
  exports.readAccountLedger = require_account_call.readAccountLedger;
@@ -0,0 +1,4 @@
1
+ import "./_polyfill-buffer-patch-yNxN4d5E.js";
2
+ import "./codecs-Dc1Krpbt.js";
3
+ import { a as readAccountLedger } from "./account-call-C3CkDqEC.js";
4
+ export { readAccountLedger };
@@ -1,7 +1,7 @@
1
1
  const require_bytes_vo = require("./bytes.vo-BNRquqaO.cjs");
2
- const require_providers = require("./providers-BLgJ0uQs.cjs");
3
- const require_gated_call = require("./gated-call-DJWY299W.cjs");
4
- const require_errors = require("./errors-BZ8hnhCM.cjs");
2
+ const require_errors = require("./errors-BIftM8ZN.cjs");
3
+ const require_providers = require("./providers-FjhM47BH.cjs");
4
+ const require_gated_call = require("./gated-call-DgJm1Mi_.cjs");
5
5
  const require_acc_module = require("./acc-module-4iIUv6My.cjs");
6
6
  //#region ../../packages/module/passport-account/src/infra/indexer.ts
7
7
  const TX_FIELDS = `transaction {
@@ -16,6 +16,7 @@ const ACTION_FIELDS = `
16
16
  ... on ContractUpdate { ${TX_FIELDS} }
17
17
  `;
18
18
  const isShieldedOutputEvent = (content) => content.tag === "zswapOutput";
19
+ const isShieldedInputEvent = (content) => content.tag === "zswapInput";
19
20
  const toRecord = (action) => {
20
21
  const transaction = action.transaction ?? {};
21
22
  return {
@@ -44,7 +45,8 @@ const eventBytes = (raw) => {
44
45
  * contract state through the midnight-js public data provider, the
45
46
  * complete per-address action history through the indexer's
46
47
  * contractActions subscription, and the shielded outputs a transaction
47
- * created through the ledger events the indexer keeps per transaction.
48
+ * created and the coins it spent through the ledger events the indexer
49
+ * keeps per transaction.
48
50
  */
49
51
  const createIndexerClient = ({ indexerUrl, indexerWsUrl, fetchHttp = globalThis.fetch, createSocket = (url, protocol) => new WebSocket(url, protocol), createPublicDataProvider }) => {
50
52
  const defaultProvider = async () => {
@@ -145,25 +147,32 @@ const createIndexerClient = ({ indexerUrl, indexerWsUrl, fetchHttp = globalThis.
145
147
  * The indexer keeps, per transaction, the events the ledger emitted while
146
148
  * applying it; a shielded output's event carries the commitment and the
147
149
  * tree index the ledger assigned, so the index is read, never inferred
148
- * from the transaction's position window.
150
+ * from the transaction's position window, and a shielded spend's event
151
+ * carries the nullifier the ledger recorded for the coin it consumed.
149
152
  */
150
- const queryShieldedOutputs = async (txHash) => {
153
+ const queryShieldedEvents = async (txHash) => {
151
154
  const events = ((await postQuery("transactions", `query($offset: TransactionOffset!) { transactions(offset: $offset) { hash ... on RegularTransaction { zswapLedgerEvents { raw } } } }`, { offset: { hash: stripHexPrefix(txHash) } })).data?.transactions ?? []).flatMap((transaction) => transaction.zswapLedgerEvents ?? []);
152
- if (events.length === 0) return [];
155
+ const found = {
156
+ outputs: [],
157
+ nullifiers: []
158
+ };
159
+ if (events.length === 0) return found;
153
160
  const { Event } = await import("@midnightntwrk/ledger-v9");
154
- return events.flatMap(({ raw }) => {
161
+ for (const { raw } of events) {
155
162
  const { content } = Event.deserialize(eventBytes(stripHexPrefix(raw ?? "")));
156
- return isShieldedOutputEvent(content) ? [{
163
+ if (isShieldedOutputEvent(content)) found.outputs.push({
157
164
  commitment: content.commitment.toLowerCase(),
158
165
  ...content.contract === void 0 ? {} : { contractAddress: content.contract.toLowerCase() },
159
166
  index: content.mtIndex
160
- }] : [];
161
- });
167
+ });
168
+ else if (isShieldedInputEvent(content)) found.nullifiers.push(content.nullifier.toLowerCase());
169
+ }
170
+ return found;
162
171
  };
163
172
  return {
164
173
  queryContractState: async (address) => (await provider()).queryContractState(address),
165
174
  enumerateContractActions,
166
- queryShieldedOutputs
175
+ queryShieldedEvents
167
176
  };
168
177
  };
169
178
  //#endregion
@@ -1,7 +1,7 @@
1
1
  import { n as HexBytes, t as ByteArray } from "./bytes.vo-BB7_4JK6.js";
2
- import { i as AccAddress, t as createMidnightProviders } from "./providers-CwnT4vEE.js";
3
- import { n as executeGatedCall, o as DeviceEpoch, s as UseCounter, t as connectAccountHandle } from "./gated-call-DjoRPqn1.js";
4
- import { t as AccountContractMissingError } from "./errors-DIJTAsLa.js";
2
+ import { t as AccountContractMissingError } from "./errors-DSq5wUwt.js";
3
+ import { i as AccAddress, t as createMidnightProviders } from "./providers-WtiSuxFu.js";
4
+ import { d as UseCounter, n as executeGatedCall, t as connectAccountHandle, u as DeviceEpoch } from "./gated-call-D-tT7P_t.js";
5
5
  import { i as ledger } from "./acc-module-Cmj8EsIb.js";
6
6
  //#region ../../packages/module/passport-account/src/infra/indexer.ts
7
7
  const TX_FIELDS = `transaction {
@@ -16,6 +16,7 @@ const ACTION_FIELDS = `
16
16
  ... on ContractUpdate { ${TX_FIELDS} }
17
17
  `;
18
18
  const isShieldedOutputEvent = (content) => content.tag === "zswapOutput";
19
+ const isShieldedInputEvent = (content) => content.tag === "zswapInput";
19
20
  const toRecord = (action) => {
20
21
  const transaction = action.transaction ?? {};
21
22
  return {
@@ -44,7 +45,8 @@ const eventBytes = (raw) => {
44
45
  * contract state through the midnight-js public data provider, the
45
46
  * complete per-address action history through the indexer's
46
47
  * contractActions subscription, and the shielded outputs a transaction
47
- * created through the ledger events the indexer keeps per transaction.
48
+ * created and the coins it spent through the ledger events the indexer
49
+ * keeps per transaction.
48
50
  */
49
51
  const createIndexerClient = ({ indexerUrl, indexerWsUrl, fetchHttp = globalThis.fetch, createSocket = (url, protocol) => new WebSocket(url, protocol), createPublicDataProvider }) => {
50
52
  const defaultProvider = async () => {
@@ -145,25 +147,32 @@ const createIndexerClient = ({ indexerUrl, indexerWsUrl, fetchHttp = globalThis.
145
147
  * The indexer keeps, per transaction, the events the ledger emitted while
146
148
  * applying it; a shielded output's event carries the commitment and the
147
149
  * tree index the ledger assigned, so the index is read, never inferred
148
- * from the transaction's position window.
150
+ * from the transaction's position window, and a shielded spend's event
151
+ * carries the nullifier the ledger recorded for the coin it consumed.
149
152
  */
150
- const queryShieldedOutputs = async (txHash) => {
153
+ const queryShieldedEvents = async (txHash) => {
151
154
  const events = ((await postQuery("transactions", `query($offset: TransactionOffset!) { transactions(offset: $offset) { hash ... on RegularTransaction { zswapLedgerEvents { raw } } } }`, { offset: { hash: stripHexPrefix(txHash) } })).data?.transactions ?? []).flatMap((transaction) => transaction.zswapLedgerEvents ?? []);
152
- if (events.length === 0) return [];
155
+ const found = {
156
+ outputs: [],
157
+ nullifiers: []
158
+ };
159
+ if (events.length === 0) return found;
153
160
  const { Event } = await import("@midnightntwrk/ledger-v9");
154
- return events.flatMap(({ raw }) => {
161
+ for (const { raw } of events) {
155
162
  const { content } = Event.deserialize(eventBytes(stripHexPrefix(raw ?? "")));
156
- return isShieldedOutputEvent(content) ? [{
163
+ if (isShieldedOutputEvent(content)) found.outputs.push({
157
164
  commitment: content.commitment.toLowerCase(),
158
165
  ...content.contract === void 0 ? {} : { contractAddress: content.contract.toLowerCase() },
159
166
  index: content.mtIndex
160
- }] : [];
161
- });
167
+ });
168
+ else if (isShieldedInputEvent(content)) found.nullifiers.push(content.nullifier.toLowerCase());
169
+ }
170
+ return found;
162
171
  };
163
172
  return {
164
173
  queryContractState: async (address) => (await provider()).queryContractState(address),
165
174
  enumerateContractActions,
166
- queryShieldedOutputs
175
+ queryShieldedEvents
167
176
  };
168
177
  };
169
178
  //#endregion
@@ -1,5 +1,5 @@
1
1
  const require_bytes_vo = require("./bytes.vo-BNRquqaO.cjs");
2
- const require_errors = require("./errors-BZ8hnhCM.cjs");
2
+ const require_errors = require("./errors-BIftM8ZN.cjs");
3
3
  //#region ../../packages/contract/passport/src/value-objects/acc-binding-version.vo.ts
4
4
  /** Types a string as an Account Custody Contract binding version. It checks nothing. */
5
5
  const AccBindingVersion = (value) => value;
@@ -1,5 +1,5 @@
1
1
  import { n as HexBytes } from "./bytes.vo-BB7_4JK6.js";
2
- import { a as ArtefactIntegrityError } from "./errors-DIJTAsLa.js";
2
+ import { a as ArtefactIntegrityError } from "./errors-DSq5wUwt.js";
3
3
  //#region ../../packages/contract/passport/src/value-objects/acc-binding-version.vo.ts
4
4
  /** Types a string as an Account Custody Contract binding version. It checks nothing. */
5
5
  const AccBindingVersion = (value) => value;
package/dist/bitcoin.cjs CHANGED
@@ -8,13 +8,13 @@ require("./pbkdf2-CIW-oWrm.cjs");
8
8
  require("./src-BDzYIksE.cjs");
9
9
  require("./util-Bu4W5lF4.cjs");
10
10
  const require_bytes_vo = require("./bytes.vo-BNRquqaO.cjs");
11
- const require_sdk = require("./sdk-Dd0MKXFz.cjs");
11
+ const require_sdk = require("./sdk-DffwmX8b.cjs");
12
12
  const require_time_vo = require("./time.vo-D3wWRw9L.cjs");
13
13
  require("./asyncoption-i0VbqVTq.cjs");
14
14
  const require_const = require("./const-iwzZEE_w.cjs");
15
15
  const require_account_id_vo = require("./account-id.vo-DwqFjK5u.cjs");
16
- const require_contract = require("./contract-DevBp9u8.cjs");
17
- const require_submit_bitcoin_tx = require("./submit-bitcoin-tx-Y0CtvFN7.cjs");
16
+ const require_contract = require("./contract-MKLzYVkW.cjs");
17
+ const require_submit_bitcoin_tx = require("./submit-bitcoin-tx-goFuRL7K.cjs");
18
18
  const require_types = require("./types-CLRUYpfe.cjs");
19
19
  const require_const$1 = require("./const-BhYOdznB.cjs");
20
20
  require("./bn-d3nSOIf7.cjs");
package/dist/bitcoin.js CHANGED
@@ -8,13 +8,13 @@ import "./browser-B1eMbDwh.js";
8
8
  import "./src-BFoefPv_.js";
9
9
  import "./util-Cp5cZkfK.js";
10
10
  import { n as HexBytes } from "./bytes.vo-BB7_4JK6.js";
11
- import { M as WalletId, S as WalletType, a as createInMemoryWalletEntity, c as createLaceWallet } from "./sdk-_yO75IHD.js";
11
+ import { M as WalletId, S as WalletType, a as createInMemoryWalletEntity, c as createLaceWallet } from "./sdk-Cb-gZnS9.js";
12
12
  import { r as Milliseconds } from "./time.vo-tNheinXm.js";
13
13
  import "./asyncoption-CruEYOBI.js";
14
14
  import { t as FEATURE_FLAG_NETWORK_TYPE } from "./const-CjmfjBP3.js";
15
15
  import { t as AccountId } from "./account-id.vo-OPz2v-JZ.js";
16
- import { r as LazyWalletMismatchError } from "./contract-BD_312b0.js";
17
- import { a as createBitcoinLazyInMemoryVaultModule, d as BitcoinTxBuildErrorCode, i as waitForBitcoinAccountSync, n as signBitcoinTx, o as modules_exports, r as buildBitcoinTx, t as submitBitcoinTx, u as BitcoinTxBuildError } from "./submit-bitcoin-tx-BG3Gemov.js";
16
+ import { r as LazyWalletMismatchError } from "./contract-1R86jhSw.js";
17
+ import { a as createBitcoinLazyInMemoryVaultModule, d as BitcoinTxBuildErrorCode, i as waitForBitcoinAccountSync, n as signBitcoinTx, o as modules_exports, r as buildBitcoinTx, t as submitBitcoinTx, u as BitcoinTxBuildError } from "./submit-bitcoin-tx-D6oYgH5S.js";
18
18
  import { n as BitcoinNetwork } from "./types-B8uiJn-X.js";
19
19
  import { n as BITCOIN_MEMPOOL_FEE_MARKET_FEATURE_FLAG, t as BITCOIN_FEATURE_FLAG } from "./const-CUnCl5U0.js";
20
20
  export { AccountId, BITCOIN_FEATURE_FLAG, BITCOIN_MEMPOOL_FEE_MARKET_FEATURE_FLAG, BitcoinNetwork, BitcoinNetworkId, BitcoinTxBuildError, BitcoinTxBuildErrorCode, FEATURE_FLAG_NETWORK_TYPE, HexBytes, LazyWalletMismatchError, Milliseconds, WalletId, WalletType, buildBitcoinTx, createBitcoinLazyInMemoryVaultModule, createInMemoryWalletEntity, createLaceWallet, modules_exports as m, signBitcoinTx, submitBitcoinTx, waitForBitcoinAccountSync };
package/dist/cardano.cjs CHANGED
@@ -4,15 +4,15 @@ require("./_polyfill-buffer-patch-CM8X7JiY.cjs");
4
4
  require("./codecs-Cswkg7Tm.cjs");
5
5
  require("./util-Bu4W5lF4.cjs");
6
6
  const require_bytes_vo = require("./bytes.vo-BNRquqaO.cjs");
7
- const require_sdk = require("./sdk-Dd0MKXFz.cjs");
7
+ const require_sdk = require("./sdk-DffwmX8b.cjs");
8
8
  const require_time_vo = require("./time.vo-D3wWRw9L.cjs");
9
9
  require("./asyncoption-i0VbqVTq.cjs");
10
10
  const require_key_source = require("./key-source-5oUBFiC7.cjs");
11
11
  const require_const = require("./const-iwzZEE_w.cjs");
12
12
  const require_account_id_vo = require("./account-id.vo-DwqFjK5u.cjs");
13
13
  const require_const$1 = require("./const-D-eZIS4n.cjs");
14
- const require_contract = require("./contract-DevBp9u8.cjs");
15
- const require_modules_cardano = require("./modules-cardano-D843LvB0.cjs");
14
+ const require_contract = require("./contract-MKLzYVkW.cjs");
15
+ const require_modules_cardano = require("./modules-cardano-BYeYHrRm.cjs");
16
16
  let _laceio_cardano_core = require("@laceio/cardano/core");
17
17
  let _laceio_cardano_util = require("@laceio/cardano/util");
18
18
  exports.AccountId = require_account_id_vo.AccountId;
package/dist/cardano.d.ts CHANGED
@@ -21545,7 +21545,7 @@ declare class SignerClosedError extends Error {
21545
21545
  constructor();
21546
21546
  }
21547
21547
 
21548
- type SignerFlowKind = 'add-device' | 'create-account' | 'issue-grant' | 'read-holdings' | 'remove-device' | 'revoke-all-grants' | 'revoke-grant' | 'sign-in';
21548
+ type SignerFlowKind = 'add-device' | 'create-account' | 'install-operations' | 'issue-grant' | 'read-holdings' | 'remove-device' | 'revoke-all-grants' | 'revoke-grant' | 'sign-in';
21549
21549
  /**
21550
21550
  * What the popup shows the user before it opens a key session for a flow.
21551
21551
  * A device flow carries the 32-byte entry commitment it targets as hex
@@ -21569,8 +21569,10 @@ type SignerFlowKind = 'add-device' | 'create-account' | 'issue-grant' | 'read-ho
21569
21569
  * removal, a read grant's issue, a rotating revocation or an enrolment
21570
21570
  * that hands over the keys while a read grant is live, also carries
21571
21571
  * `devices`, the live device entries as hex whose devices the new secret
21572
- * may be sealed to, the removed one left out; consent lists them. Every
21573
- * hex field other than the commitment is lowercase.
21572
+ * may be sealed to, the removed one left out; consent lists them. An
21573
+ * install-operations flow carries the `account` it upgrades and the
21574
+ * `operations` whose verifier keys the account's maintenance authority
21575
+ * signs in. Every hex field other than the commitment is lowercase.
21574
21576
  */
21575
21577
  type SignerFlow = {
21576
21578
  kind: SignerFlowKind;
@@ -21588,6 +21590,7 @@ type SignerFlow = {
21588
21590
  };
21589
21591
  devices?: string[];
21590
21592
  lockAccount?: boolean;
21593
+ operations?: string[];
21591
21594
  };
21592
21595
  /**
21593
21596
  * The account keys a request opens: the `account` they belong to, its
@@ -21768,6 +21771,58 @@ type ExtensionSignerRequestPayloads = {
21768
21771
  account: string;
21769
21772
  readPublicKey: string;
21770
21773
  };
21774
+ /**
21775
+ * One maintenance update of the keyring's account, signed by the
21776
+ * maintenance authority one of the roster keys its envelopes deliver
21777
+ * derives: `authority`, the verifying key of the account's one-key
21778
+ * committee, and `counter`, as decimal, as the chain holds them, and
21779
+ * `changes`, either the replace of that authority by the one the
21780
+ * keyring's live roster key derives, or the inserts of pinned verifier
21781
+ * keys, each key as hex. The signer builds the update from these and
21782
+ * never signs bytes it is sent. The keyring carries the live envelope
21783
+ * and, beside it, at most as many others as one request carries; the
21784
+ * answer is the signature, with the authority a replace installs, or
21785
+ * null when no roster key of those envelopes derives `authority`, so a
21786
+ * device with more envelopes pages the older ones beside the live one.
21787
+ */
21788
+ 'sign-maintenance-update': {
21789
+ networkId: string;
21790
+ keyring: SignerKeyring;
21791
+ authority: {
21792
+ tag: string;
21793
+ value: string;
21794
+ };
21795
+ counter: string;
21796
+ changes: {
21797
+ kind: 'insert-verifier-keys';
21798
+ inserts: {
21799
+ operation: string;
21800
+ verifierKey: string;
21801
+ }[];
21802
+ } | {
21803
+ kind: 'replace-authority';
21804
+ authority: {
21805
+ tag: string;
21806
+ value: string;
21807
+ };
21808
+ };
21809
+ };
21810
+ /**
21811
+ * Whether any roster key the keyring's envelopes deliver derives
21812
+ * `authority`, the verifying key of the account's one-key committee as
21813
+ * the chain holds it, which a removal and a rotating enrolment ask
21814
+ * before they rotate. The keyring is paged as for
21815
+ * `sign-maintenance-update`; the answer is a boolean and no key
21816
+ * crosses.
21817
+ */
21818
+ 'holds-maintenance-authority': {
21819
+ networkId: string;
21820
+ keyring: SignerKeyring;
21821
+ authority: {
21822
+ tag: string;
21823
+ value: string;
21824
+ };
21825
+ };
21771
21826
  'record-read': EmptyPayload;
21772
21827
  'record-write': {
21773
21828
  record: unknown;
package/dist/cardano.js CHANGED
@@ -4,14 +4,14 @@ import "./libsodium-wrappers-BhbOA8dQ.js";
4
4
  import "./codecs-Dc1Krpbt.js";
5
5
  import "./util-Cp5cZkfK.js";
6
6
  import { n as HexBytes } from "./bytes.vo-BB7_4JK6.js";
7
- import { M as WalletId, S as WalletType, a as createInMemoryWalletEntity, c as createLaceWallet } from "./sdk-_yO75IHD.js";
7
+ import { M as WalletId, S as WalletType, a as createInMemoryWalletEntity, c as createLaceWallet } from "./sdk-Cb-gZnS9.js";
8
8
  import { r as Milliseconds } from "./time.vo-tNheinXm.js";
9
9
  import "./asyncoption-CruEYOBI.js";
10
10
  import { c as RemoteSignerError, l as SignerClosedError, t as createPasskeyKeySource, u as SignerPopupBlockedError } from "./key-source-B08HukZg.js";
11
11
  import { t as FEATURE_FLAG_NETWORK_TYPE } from "./const-CjmfjBP3.js";
12
12
  import { t as AccountId } from "./account-id.vo-OPz2v-JZ.js";
13
13
  import { n as FEATURE_FLAG_CARDANO } from "./const-BJfIK_G-.js";
14
- import { r as LazyWalletMismatchError } from "./contract-BD_312b0.js";
15
- import { _ as PasskeyWalletMismatchError, a as submitCardanoTx, c as waitForNetworkInfo, d as createRemotePasskeySigner, f as createRemoteCardanoVaultModule, g as createPasskeyWalletEntity, h as createSignerClient, i as createSteelSwapProvider, l as createRemotePasskeyWalletEntity, m as RemoteSignerResultError, o as signCardanoTx, p as CardanoRemoteSignerFactory, s as createTxBuilder, t as modules_cardano_exports, v as createPasskeyVaultModule, y as createLazyInMemoryVaultModule } from "./modules-cardano-BrS68BbA.js";
14
+ import { r as LazyWalletMismatchError } from "./contract-1R86jhSw.js";
15
+ import { _ as PasskeyWalletMismatchError, a as submitCardanoTx, c as waitForNetworkInfo, d as createRemotePasskeySigner, f as createRemoteCardanoVaultModule, g as createPasskeyWalletEntity, h as createSignerClient, i as createSteelSwapProvider, l as createRemotePasskeyWalletEntity, m as RemoteSignerResultError, o as signCardanoTx, p as CardanoRemoteSignerFactory, s as createTxBuilder, t as modules_cardano_exports, v as createPasskeyVaultModule, y as createLazyInMemoryVaultModule } from "./modules-cardano-B1nDUWqy.js";
16
16
  import { n as HexBlob, r as Serialization, t as Cardano } from "./cardano-DfPwhwm-.js";
17
17
  export { AccountId, Cardano, CardanoRemoteSignerFactory, FEATURE_FLAG_CARDANO, FEATURE_FLAG_NETWORK_TYPE, HexBlob, HexBytes, LazyWalletMismatchError, Milliseconds, PasskeyWalletMismatchError, RemoteSignerError, RemoteSignerResultError, Serialization, SignerClosedError, SignerPopupBlockedError, WalletId, WalletType, createInMemoryWalletEntity, createLaceWallet, createLazyInMemoryVaultModule, createPasskeyKeySource, createPasskeyVaultModule, createPasskeyWalletEntity, createRemoteCardanoVaultModule, createRemotePasskeySigner, createRemotePasskeyWalletEntity, createSignerClient, createSteelSwapProvider, createTxBuilder, modules_cardano_exports as m, signCardanoTx, submitCardanoTx, waitForNetworkInfo };
@@ -1,4 +1,4 @@
1
- import { A as ContractName, D as storageDependencyContract, O as combineStore, _ as walletActiveStateDependencyContract, k as createMixin, v as tokensStoreContract, w as networkStoreContract, y as syncStoreContract } from "./sdk-_yO75IHD.js";
1
+ import { A as ContractName, D as storageDependencyContract, O as combineStore, _ as walletActiveStateDependencyContract, k as createMixin, v as tokensStoreContract, w as networkStoreContract, y as syncStoreContract } from "./sdk-Cb-gZnS9.js";
2
2
  import { a as inferStoreContext, n as combineContracts, r as inferContractContext } from "./store-DuBG8qh5.js";
3
3
  import { t as createSelector } from "./reselect-CGoLzEPv.js";
4
4
  import { r as tokensSelectors } from "./slice-DBpJ2QGf.js";
@@ -1,4 +1,4 @@
1
- const require_sdk = require("./sdk-Dd0MKXFz.cjs");
1
+ const require_sdk = require("./sdk-DffwmX8b.cjs");
2
2
  const require_store = require("./store-B1Lq3cEf.cjs");
3
3
  const require_reselect = require("./reselect-Bd94u0K-.cjs");
4
4
  const require_slice = require("./slice-C9TT5KhY.cjs");
@@ -1,7 +1,7 @@
1
1
  import { n as HexBytes, t as ByteArray } from "./bytes.vo-BB7_4JK6.js";
2
- import { H as isSealableX25519Key } from "./grant-rules-_xJHAT2M.js";
3
- import { f as DeviceReaderInvalidError } from "./errors-DIJTAsLa.js";
4
- import { t as decodeDevicePublicKey } from "./envelopes-BkH1Qdxk.js";
2
+ import { f as DeviceReaderInvalidError } from "./errors-DSq5wUwt.js";
3
+ import { H as isSealableX25519Key } from "./grant-rules-By07_eDi.js";
4
+ import { t as decodeDevicePublicKey } from "./envelopes-BGoO_v8m.js";
5
5
  import { a as pureCircuits } from "./acc-module-Cmj8EsIb.js";
6
6
  //#region ../../packages/module/passport-account/src/acc/device-readers.ts
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  const require_bytes_vo = require("./bytes.vo-BNRquqaO.cjs");
2
- const require_grant_rules = require("./grant-rules-7Zqi_3BN.cjs");
3
- const require_errors = require("./errors-BZ8hnhCM.cjs");
4
- const require_envelopes = require("./envelopes-ETZEJS_O.cjs");
2
+ const require_errors = require("./errors-BIftM8ZN.cjs");
3
+ const require_grant_rules = require("./grant-rules-BzVTWXS7.cjs");
4
+ const require_envelopes = require("./envelopes-CH25R-DN.cjs");
5
5
  const require_acc_module = require("./acc-module-4iIUv6My.cjs");
6
6
  //#region ../../packages/module/passport-account/src/acc/device-readers.ts
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  require("./rolldown-runtime-Br2OG8yv.cjs");
2
2
  require("./_polyfill-buffer-patch-CM8X7JiY.cjs");
3
3
  require("./codecs-Cswkg7Tm.cjs");
4
- const require_device_readers = require("./device-readers-CIgYZN7f.cjs");
4
+ const require_device_readers = require("./device-readers-CdxS2btd.cjs");
5
5
  exports.assertJoiningDevice = require_device_readers.assertJoiningDevice;
6
6
  exports.derivesEntry = require_device_readers.derivesEntry;
7
7
  exports.deviceEntryOf = require_device_readers.deviceEntryOf;
@@ -1,4 +1,4 @@
1
1
  import "./_polyfill-buffer-patch-yNxN4d5E.js";
2
2
  import "./codecs-Dc1Krpbt.js";
3
- import { i as resolveLiveReaders, n as derivesEntry, r as deviceEntryOf, t as assertJoiningDevice } from "./device-readers-BWOmz9eD.js";
3
+ import { i as resolveLiveReaders, n as derivesEntry, r as deviceEntryOf, t as assertJoiningDevice } from "./device-readers-CUHYoYOH.js";
4
4
  export { assertJoiningDevice, derivesEntry, deviceEntryOf, resolveLiveReaders };
@@ -1,5 +1,6 @@
1
1
  import { n as HexBytes, t as ByteArray } from "./bytes.vo-BB7_4JK6.js";
2
- import { A as equalBytes$1, C as aInRange, D as bytesToNumberLE, E as bytesToNumberBE, F as sha512, G as GrantScopeSalt, I as abytes$1, K as GrantId, L as hexToBytes, M as numberToBytesLE, N as randomBytes, O as concatBytes, P as validateObject, S as pow2, T as asciiToBytes, W as GrantSlot, _ as FpSqrtEven, b as mapHashToField, c as _DST_scalar, d as PrimeEdwardsPoint, f as edwards, g as FpInvertBatch, h as validatePointCons, j as numberToBytesBE, k as copyBytes, l as createHasher, m as pippenger, o as jubjub, p as createKeygen, q as sha256, s as createFROST, t as RECIPIENT_KINDS, u as expand_message_xmd, v as getMinHashLength, w as abytes, x as mod, y as isNegativeLE } from "./grant-rules-_xJHAT2M.js";
2
+ import { L as sha256 } from "./errors-DSq5wUwt.js";
3
+ import { A as equalBytes$1, C as aInRange, D as bytesToNumberLE, E as bytesToNumberBE, F as sha512, G as GrantScopeSalt, I as abytes$1, K as GrantId, L as hexToBytes, M as numberToBytesLE, N as randomBytes, O as concatBytes, P as validateObject, S as pow2, T as asciiToBytes, W as GrantSlot, _ as FpSqrtEven, b as mapHashToField, c as _DST_scalar, d as PrimeEdwardsPoint, f as edwards, g as FpInvertBatch, h as validatePointCons, j as numberToBytesBE, k as copyBytes, l as createHasher, m as pippenger, o as jubjub, p as createKeygen, s as createFROST, t as RECIPIENT_KINDS, u as expand_message_xmd, v as getMinHashLength, w as abytes, x as mod, y as isNegativeLE } from "./grant-rules-By07_eDi.js";
3
4
  //#region ../../packages/module/passport-account/node_modules/@noble/curves/abstract/montgomery.js
4
5
  /**
5
6
  * Montgomery curve methods. It's not really whole montgomery curve,
@@ -1,5 +1,6 @@
1
1
  const require_bytes_vo = require("./bytes.vo-BNRquqaO.cjs");
2
- const require_grant_rules = require("./grant-rules-7Zqi_3BN.cjs");
2
+ const require_errors = require("./errors-BIftM8ZN.cjs");
3
+ const require_grant_rules = require("./grant-rules-BzVTWXS7.cjs");
3
4
  //#region ../../packages/module/passport-account/node_modules/@noble/curves/abstract/montgomery.js
4
5
  /**
5
6
  * Montgomery curve methods. It's not really whole montgomery curve,
@@ -1282,7 +1283,7 @@ const openFrom = async ({ key, entry, nonceOffset, isTagged, plaintextLength })
1282
1283
  * reader public key. Two envelopes to the same reader share nothing on
1283
1284
  * chain, since each carries its own ephemeral key.
1284
1285
  */
1285
- const envelopeTag = (readerPublicKey, entry) => require_grant_rules.sha256(concat(ENVELOPE_TAG_DOMAIN, entry.subarray(0, RECIPIENT_TAG_OFFSET), readerPublicKey, entry.subarray(RECIPIENT_TAG_END)));
1286
+ const envelopeTag = (readerPublicKey, entry) => require_errors.sha256(concat(ENVELOPE_TAG_DOMAIN, entry.subarray(0, RECIPIENT_TAG_OFFSET), readerPublicKey, entry.subarray(RECIPIENT_TAG_END)));
1286
1287
  /** Whether an entry is a device envelope addressed to this reader public key. */
1287
1288
  const isAddressedTo = (entry, readerPublicKey) => isRecordOf(entry, DEVICE_ENVELOPE_TYPE) && equalBytes(entry.subarray(RECIPIENT_TAG_OFFSET, RECIPIENT_TAG_END), envelopeTag(readerPublicKey, entry));
1288
1289
  /**
@@ -1,5 +1,14 @@
1
1
  require("./rolldown-runtime-Br2OG8yv.cjs");
2
+ const require_codecs = require("./codecs-Cswkg7Tm.cjs");
2
3
  let ts_custom_error = require("ts-custom-error");
4
+ //#region ../../packages/lib/crypto/src/sha256.ts
5
+ /**
6
+ * SHA-256 of `bytes` as 32 raw bytes, computed synchronously so a caller
7
+ * that must stay synchronous, such as a consent screen encoding a grant
8
+ * scope, has the same digest the asynchronous Web Crypto API would give.
9
+ */
10
+ const sha256 = (bytes) => require_codecs.sha256(bytes);
11
+ //#endregion
3
12
  //#region ../../packages/contract/passport/src/errors.ts
4
13
  /**
5
14
  * Thrown when the user cancels the passkey ceremony invoked to create or
@@ -315,6 +324,21 @@ var GrantRevocationPendingError = class extends ts_custom_error.CustomError {
315
324
  }
316
325
  };
317
326
  /**
327
+ * Thrown when an agent prepares a spend its grant does not allow: an
328
+ * operation outside the grant's scope, an amount above the per-call cap
329
+ * or past the cumulative cap, a recipient the grant's pin does not admit,
330
+ * a coin of another colour or above the grant's coin bound, or a policy
331
+ * whose grant id does not derive from its own fields. Raised before
332
+ * anything is signed, so the agent learns it before it submits a call
333
+ * the contract would refuse.
334
+ */
335
+ var GrantSpendRefusedError = class extends ts_custom_error.CustomError {
336
+ code = "grant-spend-refused";
337
+ constructor(message = "The grant does not allow this spend.") {
338
+ super(message);
339
+ }
340
+ };
341
+ /**
318
342
  * Thrown when a grant is requested by a host that runs under no relying
319
343
  * party id. Every grant is bound to the origin of the host that issued it
320
344
  * through the grant id, so without one there is no id to issue under.
@@ -343,6 +367,8 @@ var GrantRosterUnsettledError = class extends ts_custom_error.CustomError {
343
367
  * maintenance authority was retired before every verifier key wave
344
368
  * landed, so no update can install the missing operations. Unrecoverable:
345
369
  * the contract is left as it stands and a new account is the only way on.
370
+ * An install of missing operations on a locked account, whose authority
371
+ * was retired at creation, raises it too, before anything is signed.
346
372
  */
347
373
  var AuthorityRetiredError = class extends ts_custom_error.CustomError {
348
374
  code = "authority-retired";
@@ -351,11 +377,13 @@ var AuthorityRetiredError = class extends ts_custom_error.CustomError {
351
377
  }
352
378
  };
353
379
  /**
354
- * Thrown when a creation that chose to lock the account resumes over an
355
- * account the chain shows activated with its maintenance authority still
356
- * live. The flow retires the authority before it activates, so the
357
- * deployment ran outside it; whoever holds the authority key keeps full
358
- * custody of the account, and a new account is the safe way on.
380
+ * Thrown when a creation resumes over an account the chain shows
381
+ * activated with its deploy-time maintenance authority still live, whether
382
+ * it chose to lock the account or to hand the authority to its devices.
383
+ * The flow retires or hands over the authority before it activates, so
384
+ * the deployment ran outside it; whoever holds the deploy-time key keeps
385
+ * full custody of the account and may have installed verifier keys no
386
+ * check has seen, and a new account is the safe way on.
359
387
  */
360
388
  var AuthorityNotRetiredError = class extends ts_custom_error.CustomError {
361
389
  code = "authority-not-retired";
@@ -389,6 +417,52 @@ var CreationArtefactMismatchError = class extends ts_custom_error.CustomError {
389
417
  super(message);
390
418
  }
391
419
  };
420
+ /**
421
+ * Thrown when the contract's maintenance authority on chain is not the
422
+ * one any roster key this device holds derives: the account is locked,
423
+ * its authority was rotated by a roster this device was never handed, or
424
+ * the keyring belongs to another account. Raised before anything is
425
+ * signed. A resumed creation raises it too when the committee on chain is
426
+ * neither the deploy-time key nor the successor the recorded creation
427
+ * installs, refused before any wave.
428
+ */
429
+ var MaintenanceAuthorityMismatchError = class extends ts_custom_error.CustomError {
430
+ code = "maintenance-authority-mismatch";
431
+ constructor(message = "No roster key this device holds derives the account's maintenance authority.") {
432
+ super(message);
433
+ }
434
+ };
435
+ /**
436
+ * Thrown when a maintenance update asks for a change the encryption key
437
+ * does not sign: a replace that installs any authority other than the one
438
+ * the live roster key derives, a verifier key that is not the one pinned
439
+ * for its operation or not in the deployed roster, or no change at all.
440
+ * An install is refused before any key is opened, a replace before
441
+ * anything is signed. A roster rotation over an account whose authority
442
+ * is live raises it too when the encryption key signs no maintenance
443
+ * update at all, as the authority could not follow the roster, and so
444
+ * does an install of missing operations, before any prompt.
445
+ */
446
+ var MaintenanceUpdateRefusedError = class extends ts_custom_error.CustomError {
447
+ code = "maintenance-update-refused";
448
+ constructor(message = "The maintenance update asks for a change the encryption key does not sign.") {
449
+ super(message);
450
+ }
451
+ };
452
+ /**
453
+ * Thrown when an install of missing operations names an operation it
454
+ * cannot install, one outside the operation roster this build deploys,
455
+ * such as a recovery circuit or another device arm, or names none at
456
+ * all. Raised before any prompt, naming every such operation; nothing is
457
+ * installed. An operation the account already holds a verifier key for
458
+ * is skipped rather than refused.
459
+ */
460
+ var OperationNotInstallableError = class extends ts_custom_error.CustomError {
461
+ code = "operation-not-installable";
462
+ constructor(message = "The account cannot install the operations asked for.") {
463
+ super(message);
464
+ }
465
+ };
392
466
  //#endregion
393
467
  Object.defineProperty(exports, "AccountContractMissingError", {
394
468
  enumerable: true,
@@ -528,12 +602,30 @@ Object.defineProperty(exports, "GrantScopeInvalidError", {
528
602
  return GrantScopeInvalidError;
529
603
  }
530
604
  });
605
+ Object.defineProperty(exports, "GrantSpendRefusedError", {
606
+ enumerable: true,
607
+ get: function() {
608
+ return GrantSpendRefusedError;
609
+ }
610
+ });
531
611
  Object.defineProperty(exports, "LastDeviceError", {
532
612
  enumerable: true,
533
613
  get: function() {
534
614
  return LastDeviceError;
535
615
  }
536
616
  });
617
+ Object.defineProperty(exports, "MaintenanceAuthorityMismatchError", {
618
+ enumerable: true,
619
+ get: function() {
620
+ return MaintenanceAuthorityMismatchError;
621
+ }
622
+ });
623
+ Object.defineProperty(exports, "MaintenanceUpdateRefusedError", {
624
+ enumerable: true,
625
+ get: function() {
626
+ return MaintenanceUpdateRefusedError;
627
+ }
628
+ });
537
629
  Object.defineProperty(exports, "NoAccountError", {
538
630
  enumerable: true,
539
631
  get: function() {
@@ -546,6 +638,12 @@ Object.defineProperty(exports, "NotAuthorisedError", {
546
638
  return NotAuthorisedError;
547
639
  }
548
640
  });
641
+ Object.defineProperty(exports, "OperationNotInstallableError", {
642
+ enumerable: true,
643
+ get: function() {
644
+ return OperationNotInstallableError;
645
+ }
646
+ });
549
647
  Object.defineProperty(exports, "PrfUnsupportedError", {
550
648
  enumerable: true,
551
649
  get: function() {
@@ -582,3 +680,9 @@ Object.defineProperty(exports, "SponsorExhaustedError", {
582
680
  return SponsorExhaustedError;
583
681
  }
584
682
  });
683
+ Object.defineProperty(exports, "sha256", {
684
+ enumerable: true,
685
+ get: function() {
686
+ return sha256;
687
+ }
688
+ });