@arkade-os/sdk 0.5.13 → 0.5.15

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 (90) hide show
  1. package/README.md +55 -1
  2. package/dist/adapters/expo.cjs +6 -6
  3. package/dist/adapters/expo.d.cts +2 -2
  4. package/dist/adapters/expo.d.ts +2 -2
  5. package/dist/adapters/expo.js +3 -3
  6. package/dist/artifact-DA5YHM2k.d.cts +87 -0
  7. package/dist/artifact-DacurepK.d.ts +87 -0
  8. package/dist/{asyncStorageTaskQueue-Dhbe00Ya.d.ts → asyncStorageTaskQueue-B3umqlkb.d.ts} +1 -1
  9. package/dist/{asyncStorageTaskQueue-Y4BlVm41.d.cts → asyncStorageTaskQueue-Dq6AJHNv.d.cts} +1 -1
  10. package/dist/{chunk-TYSUFG2K.cjs → chunk-35GRSVCZ.cjs} +11 -11
  11. package/dist/{chunk-TYSUFG2K.cjs.map → chunk-35GRSVCZ.cjs.map} +1 -1
  12. package/dist/{chunk-X57WKONW.js → chunk-43APGKWL.js} +130 -22
  13. package/dist/chunk-43APGKWL.js.map +1 -0
  14. package/dist/{chunk-6WPP4UGN.cjs → chunk-CMFRCBZW.cjs} +1245 -658
  15. package/dist/chunk-CMFRCBZW.cjs.map +1 -0
  16. package/dist/{chunk-HS7TKVOZ.cjs → chunk-FKHUXSYW.cjs} +8 -4
  17. package/dist/chunk-FKHUXSYW.cjs.map +1 -0
  18. package/dist/{chunk-BP4NA7HK.js → chunk-HVUZKXB2.js} +4 -4
  19. package/dist/{chunk-BP4NA7HK.js.map → chunk-HVUZKXB2.js.map} +1 -1
  20. package/dist/{chunk-6XVTGWQK.cjs → chunk-INQAIZUO.cjs} +17 -17
  21. package/dist/{chunk-6XVTGWQK.cjs.map → chunk-INQAIZUO.cjs.map} +1 -1
  22. package/dist/{chunk-WFJPLXOE.cjs → chunk-JSYS2KX3.cjs} +18 -18
  23. package/dist/{chunk-WFJPLXOE.cjs.map → chunk-JSYS2KX3.cjs.map} +1 -1
  24. package/dist/{chunk-QSERJPTT.js → chunk-R37I633T.js} +22 -17
  25. package/dist/chunk-R37I633T.js.map +1 -0
  26. package/dist/{chunk-ACIQZLWL.cjs → chunk-UNLH3NNG.cjs} +129 -20
  27. package/dist/chunk-UNLH3NNG.cjs.map +1 -0
  28. package/dist/{chunk-TD4PKK2I.cjs → chunk-VIQF74QJ.cjs} +38 -33
  29. package/dist/chunk-VIQF74QJ.cjs.map +1 -0
  30. package/dist/{chunk-D4QH6L54.js → chunk-XPZ7TMXH.js} +4 -4
  31. package/dist/{chunk-D4QH6L54.js.map → chunk-XPZ7TMXH.js.map} +1 -1
  32. package/dist/{chunk-BA36SQY2.js → chunk-YYSHQPCG.js} +3 -3
  33. package/dist/{chunk-BA36SQY2.js.map → chunk-YYSHQPCG.js.map} +1 -1
  34. package/dist/{chunk-LHLRG2BE.js → chunk-Z4LG3CZ4.js} +8 -5
  35. package/dist/chunk-Z4LG3CZ4.js.map +1 -0
  36. package/dist/{chunk-Y3AWLHQP.js → chunk-ZECZ2MKX.js} +730 -143
  37. package/dist/chunk-ZECZ2MKX.js.map +1 -0
  38. package/dist/compiler.cjs +5 -5
  39. package/dist/compiler.cjs.map +1 -1
  40. package/dist/compiler.d.cts +10 -10
  41. package/dist/compiler.d.ts +10 -10
  42. package/dist/compiler.js +5 -5
  43. package/dist/compiler.js.map +1 -1
  44. package/dist/contracts/handlers/index.cjs +11 -11
  45. package/dist/contracts/handlers/index.d.cts +3 -3
  46. package/dist/contracts/handlers/index.d.ts +3 -3
  47. package/dist/contracts/handlers/index.js +3 -3
  48. package/dist/{index-BQwrHcOh.d.cts → index-Bi22mLsh.d.cts} +212 -43
  49. package/dist/{index-BapVvuoI.d.ts → index-CiLMmCHX.d.ts} +2 -2
  50. package/dist/{index-DuXylQrN.d.ts → index-DOdoDqvM.d.ts} +212 -43
  51. package/dist/{index-BaTItxPx.d.cts → index-DnKugm-h.d.cts} +2 -2
  52. package/dist/index.cjs +327 -327
  53. package/dist/index.d.cts +149 -114
  54. package/dist/index.d.ts +149 -114
  55. package/dist/index.js +5 -5
  56. package/dist/{program-DPzf5qsk.d.cts → program-ZWUAWy_9.d.cts} +1 -1
  57. package/dist/{program-38A2Twvj.d.ts → program-zdDO4cMt.d.ts} +1 -1
  58. package/dist/repositories/realm/index.cjs +38 -38
  59. package/dist/repositories/realm/index.d.cts +2 -2
  60. package/dist/repositories/realm/index.d.ts +2 -2
  61. package/dist/repositories/realm/index.js +6 -6
  62. package/dist/repositories/sqlite/index.cjs +36 -36
  63. package/dist/repositories/sqlite/index.d.cts +2 -2
  64. package/dist/repositories/sqlite/index.d.ts +2 -2
  65. package/dist/repositories/sqlite/index.js +6 -6
  66. package/dist/{taskRunner-BxOmg-O6.d.ts → taskRunner-CoE4Xx9K.d.ts} +1 -1
  67. package/dist/{taskRunner-D2itCXf6.d.cts → taskRunner-DFG0BN_R.d.cts} +1 -1
  68. package/dist/wallet/expo/background.cjs +15 -15
  69. package/dist/wallet/expo/background.d.cts +3 -3
  70. package/dist/wallet/expo/background.d.ts +3 -3
  71. package/dist/wallet/expo/background.js +7 -7
  72. package/dist/wallet/expo/index.cjs +19 -16
  73. package/dist/wallet/expo/index.cjs.map +1 -1
  74. package/dist/wallet/expo/index.d.cts +3 -2
  75. package/dist/wallet/expo/index.d.ts +3 -2
  76. package/dist/wallet/expo/index.js +9 -6
  77. package/dist/wallet/expo/index.js.map +1 -1
  78. package/dist/worker/expo/index.cjs +10 -10
  79. package/dist/worker/expo/index.d.cts +4 -4
  80. package/dist/worker/expo/index.d.ts +4 -4
  81. package/dist/worker/expo/index.js +6 -6
  82. package/package.json +3 -3
  83. package/dist/chunk-6WPP4UGN.cjs.map +0 -1
  84. package/dist/chunk-ACIQZLWL.cjs.map +0 -1
  85. package/dist/chunk-HS7TKVOZ.cjs.map +0 -1
  86. package/dist/chunk-LHLRG2BE.js.map +0 -1
  87. package/dist/chunk-QSERJPTT.js.map +0 -1
  88. package/dist/chunk-TD4PKK2I.cjs.map +0 -1
  89. package/dist/chunk-X57WKONW.js.map +0 -1
  90. package/dist/chunk-Y3AWLHQP.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { deserializeArkadeContractParams, serializeArkadeContractParams, ArkadeProgramScript, computeArkadeScriptPublicKey, staticWitness, resolveCsvTimelock, resolveTimelockValue, programFromArtifact, ArkadeScript } from './chunk-X57WKONW.js';
2
- import { SCRIPT_QUERY_CHUNK_SIZE, indexerPages, getNormalizedVtxos, DEFAULT_PAGE_SIZE } from './chunk-LHLRG2BE.js';
1
+ import { deserializeArkadeContractParams, serializeArkadeContractParams, ArkadeProgramScript, computeArkadeScriptPublicKey, staticWitness, resolveCsvTimelock, resolveTimelockValue, programFromArtifact, ArkadeScript } from './chunk-43APGKWL.js';
2
+ import { SCRIPT_QUERY_CHUNK_SIZE, indexerPages, getNormalizedVtxos, DEFAULT_PAGE_SIZE } from './chunk-Z4LG3CZ4.js';
3
3
  import { VtxoScript, MultisigTapscript, CSVMultisigTapscript, timelockToSequence, sequenceToTimelock, ConditionMultisigTapscript, CLTVMultisigTapscript, ConditionCSVMultisigTapscript, sequenceToCanonicalTimelock } from './chunk-GB67AGXG.js';
4
4
  import { hex } from '@scure/base';
5
5
  import { networks, expand } from '@bitcoinerlab/descriptors-scure';
@@ -1906,8 +1906,8 @@ function instantiate(doc, construction, variables, keys) {
1906
1906
  throw new Error(
1907
1907
  `unknown artifact ${construction.definition.artifact}`
1908
1908
  );
1909
- const serverKey = hex.decode(keys.serverPubkey).subarray(1);
1910
- const args = { server: serverKey };
1909
+ const operatorKey = hex.decode(keys.operatorPubkey).subarray(1);
1910
+ const args = { server: operatorKey };
1911
1911
  for (const [field, binding] of Object.entries(construction.arguments)) {
1912
1912
  if (typeof binding === "string") {
1913
1913
  const value = variables[binding.slice(1, -1)];
@@ -1925,7 +1925,7 @@ function instantiate(doc, construction, variables, keys) {
1925
1925
  if (field.type === "pubkey") args[field.name] = value.subarray(1);
1926
1926
  }
1927
1927
  return new ArkadeProgramScript(programFromArtifact(def), args, {
1928
- serverKey,
1928
+ serverKey: operatorKey,
1929
1929
  emulatorKey: hex.decode(keys.emulatorPubkey)
1930
1930
  });
1931
1931
  }
@@ -1958,15 +1958,15 @@ function executorContractParams(template, owner, keys, params) {
1958
1958
  renewalWindow: params.renewalWindow,
1959
1959
  maxFee: params.maxFee,
1960
1960
  ...template === "boarding" ? { boardingExitDelay: params.boardingExitDelay } : {},
1961
- cosignerPubKey: hex.decode(keys.cosignerPubkey),
1962
- serverPubKey: hex.decode(keys.serverPubkey),
1961
+ batchCosignerPubKey: hex.decode(keys.batchCosignerPubkey),
1962
+ operatorPubKey: hex.decode(keys.operatorPubkey),
1963
1963
  emulatorPubKey: hex.decode(keys.emulatorPubkey)
1964
1964
  });
1965
1965
  }
1966
1966
  function executorKeysOf(p) {
1967
1967
  return {
1968
- cosignerPubkey: hex.encode(p.cosignerPubKey),
1969
- serverPubkey: hex.encode(p.serverPubKey),
1968
+ batchCosignerPubkey: hex.encode(p.batchCosignerPubKey),
1969
+ operatorPubkey: hex.encode(p.operatorPubKey),
1970
1970
  emulatorPubkey: hex.encode(p.emulatorPubKey)
1971
1971
  };
1972
1972
  }
@@ -1979,7 +1979,7 @@ var ExecutorContractHandler = {
1979
1979
  const script = new DefaultVtxo.Script(
1980
1980
  {
1981
1981
  pubKey: p.owner.subarray(1),
1982
- serverPubKey: p.serverPubKey.subarray(1),
1982
+ serverPubKey: p.operatorPubKey.subarray(1),
1983
1983
  csvTimelock: sequenceToTimelock(p.boardingExitDelay ?? p.exitDelay)
1984
1984
  },
1985
1985
  derived.scripts.slice(2)
@@ -1999,8 +1999,9 @@ var ExecutorContractHandler = {
1999
1999
  renewalWindow: params.renewalWindow.toString(),
2000
2000
  maxFee: params.maxFee.toString(),
2001
2001
  ...params.boardingExitDelay !== void 0 ? { boardingExitDelay: params.boardingExitDelay.toString() } : {},
2002
- cosignerPubKey: hex.encode(params.cosignerPubKey),
2003
- serverPubKey: hex.encode(params.serverPubKey),
2002
+ batchCosignerPubKey: hex.encode(params.batchCosignerPubKey),
2003
+ // stored as serverPubKey, the name every contract type stores the operator pubkey under
2004
+ serverPubKey: hex.encode(params.operatorPubKey),
2004
2005
  emulatorPubKey: hex.encode(params.emulatorPubKey)
2005
2006
  };
2006
2007
  },
@@ -2015,8 +2016,12 @@ var ExecutorContractHandler = {
2015
2016
  renewalWindow: integer(params.renewalWindow, "renewalWindow"),
2016
2017
  maxFee: integer(params.maxFee, "maxFee"),
2017
2018
  ...params.template === "boarding" ? { boardingExitDelay: integer(params.boardingExitDelay, "boardingExitDelay") } : {},
2018
- cosignerPubKey: compressed(params.cosignerPubKey, "cosignerPubKey"),
2019
- serverPubKey: compressed(params.serverPubKey, "serverPubKey"),
2019
+ // rows stored before the Executor's key rename hold it as cosignerPubKey
2020
+ batchCosignerPubKey: compressed(
2021
+ params.batchCosignerPubKey ?? params.cosignerPubKey,
2022
+ "batchCosignerPubKey"
2023
+ ),
2024
+ operatorPubKey: compressed(params.serverPubKey, "serverPubKey"),
2020
2025
  emulatorPubKey: compressed(params.emulatorPubKey, "emulatorPubKey")
2021
2026
  };
2022
2027
  },
@@ -2073,7 +2078,7 @@ function discovered(template, descriptor, { keys, params }, deps) {
2073
2078
  type: ExecutorContractHandler.type,
2074
2079
  params: serialized,
2075
2080
  script: hex.encode(script.pkScript),
2076
- address: script.address(deps.network.hrp, hex.decode(keys.serverPubkey).subarray(1)).encode(),
2081
+ address: script.address(deps.network.hrp, hex.decode(keys.operatorPubkey).subarray(1)).encode(),
2077
2082
  scope: template === "boarding" ? "onchain" : "offchain",
2078
2083
  label: template === "renewal" ? "Delegated renewal" : "Delegated boarding",
2079
2084
  metadata: { signingDescriptor: descriptor }
@@ -2091,5 +2096,5 @@ contractHandlers.register(ArkadeContractHandler);
2091
2096
  contractHandlers.register(ExecutorContractHandler);
2092
2097
 
2093
2098
  export { ArkadeContractHandler, BoardingContractHandler, DEFAULT_TEMPLATE_IDS, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, ExecutorContractHandler, VHTLC, VHTLCContractHandler, VHTLCV2ContractHandler, WALLET_RECEIVE_SOURCE, contractHandlers, defaultVariables, delegateDiscoveryKeys, deriveDescriptorLeafCompressedPubKey, deriveDescriptorLeafPubKey, descriptorIsOurs, evenOwnerKey, executorContractParams, executorKeysOf, exitSequence, extractPubKey, identityDescriptor, isCltvSatisfied, isCsvSpendable, isMainnetDescriptor, normalizeToDescriptor, parseHDDescriptor, speculativeReceiveMetadata };
2094
- //# sourceMappingURL=chunk-QSERJPTT.js.map
2095
- //# sourceMappingURL=chunk-QSERJPTT.js.map
2099
+ //# sourceMappingURL=chunk-R37I633T.js.map
2100
+ //# sourceMappingURL=chunk-R37I633T.js.map