@arkade-os/sdk 0.5.0-rc.2 → 0.5.0-rc.4
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 +12 -67
- package/dist/adapters/expo.cjs +5 -6
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +3 -4
- package/dist/{asyncStorageTaskQueue-C5rBYlru.d.ts → asyncStorageTaskQueue-BCiOgs5x.d.ts} +2 -2
- package/dist/{asyncStorageTaskQueue-BuDvgWh6.d.cts → asyncStorageTaskQueue-CTIwKrt5.d.cts} +2 -2
- package/dist/{chunk-3R476TDV.js → chunk-4EZOMPAO.js} +14 -38
- package/dist/chunk-4EZOMPAO.js.map +1 -0
- package/dist/{chunk-D25O4EGY.cjs → chunk-5NLJUXXQ.cjs} +10 -10
- package/dist/{chunk-D25O4EGY.cjs.map → chunk-5NLJUXXQ.cjs.map} +1 -1
- package/dist/{chunk-JZWLXNHV.cjs → chunk-C5Y2R63Z.cjs} +25 -71
- package/dist/chunk-C5Y2R63Z.cjs.map +1 -0
- package/dist/{chunk-6DNR46C7.js → chunk-CIBGIZUW.js} +4 -4
- package/dist/{chunk-6DNR46C7.js.map → chunk-CIBGIZUW.js.map} +1 -1
- package/dist/{chunk-43FKNLX4.cjs → chunk-F7HJO5GT.cjs} +61 -85
- package/dist/chunk-F7HJO5GT.cjs.map +1 -0
- package/dist/{chunk-ISO4TI5J.js → chunk-GLZNJFAT.js} +25 -67
- package/dist/chunk-GLZNJFAT.js.map +1 -0
- package/dist/{chunk-HLCGYOIH.cjs → chunk-GPJSGLWM.cjs} +17 -17
- package/dist/{chunk-HLCGYOIH.cjs.map → chunk-GPJSGLWM.cjs.map} +1 -1
- package/dist/{chunk-ZOTXDOS5.js → chunk-MOWSLXGO.js} +4 -4
- package/dist/{chunk-ZOTXDOS5.js.map → chunk-MOWSLXGO.js.map} +1 -1
- package/dist/{chunk-ZRNQV6HV.js → chunk-PYTAH2NY.js} +167 -703
- package/dist/chunk-PYTAH2NY.js.map +1 -0
- package/dist/{chunk-NVZJSKZS.cjs → chunk-SYRQJS5N.cjs} +18 -19
- package/dist/chunk-SYRQJS5N.cjs.map +1 -0
- package/dist/{chunk-4PKLULWT.js → chunk-XHASFSDU.js} +3 -4
- package/dist/chunk-XHASFSDU.js.map +1 -0
- package/dist/{chunk-GMZZQXV5.cjs → chunk-ZHLYFRYY.cjs} +583 -1128
- package/dist/chunk-ZHLYFRYY.cjs.map +1 -0
- package/dist/contracts/handlers/index.cjs +9 -10
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/contracts/handlers/index.js +2 -3
- package/dist/{delegate-1yp1HyP7.d.cts → delegate-CpQIgTs7.d.cts} +1 -1
- package/dist/{delegate-BAX5QftB.d.ts → delegate-Dv-us16c.d.ts} +1 -1
- package/dist/{hdWalletCapable-CmEU0NP1.d.ts → hdWalletCapable-BC4Fmmht.d.ts} +7 -25
- package/dist/{hdWalletCapable-eJgaT-ec.d.cts → hdWalletCapable-DotEa5rZ.d.cts} +7 -25
- package/dist/{index-DUxufw76.d.ts → index-Czz9HSqE.d.cts} +21 -220
- package/dist/{index-DUxufw76.d.cts → index-Czz9HSqE.d.ts} +21 -220
- package/dist/{index-Bem5vKzX.d.ts → index-DUkvXxpt.d.ts} +3 -3
- package/dist/{index-W_oMcOmG.d.cts → index-DdJt5fRc.d.cts} +3 -3
- package/dist/index.cjs +291 -340
- package/dist/index.d.cts +58 -223
- package/dist/index.d.ts +58 -223
- package/dist/index.js +4 -5
- package/dist/repositories/realm/index.cjs +57 -24
- package/dist/repositories/realm/index.cjs.map +1 -1
- package/dist/repositories/realm/index.d.cts +12 -4
- package/dist/repositories/realm/index.d.ts +12 -4
- package/dist/repositories/realm/index.js +43 -10
- package/dist/repositories/realm/index.js.map +1 -1
- package/dist/repositories/sqlite/index.cjs +103 -33
- package/dist/repositories/sqlite/index.cjs.map +1 -1
- package/dist/repositories/sqlite/index.d.cts +12 -2
- package/dist/repositories/sqlite/index.d.ts +12 -2
- package/dist/repositories/sqlite/index.js +90 -20
- package/dist/repositories/sqlite/index.js.map +1 -1
- package/dist/{taskRunner-Dr3NStc0.d.cts → taskRunner-7E_Rx8bD.d.cts} +2 -2
- package/dist/{taskRunner-D_iPiZIi.d.ts → taskRunner-DUId1UJ8.d.ts} +2 -2
- package/dist/wallet/expo/background.cjs +14 -15
- package/dist/wallet/expo/background.cjs.map +1 -1
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +6 -7
- package/dist/wallet/expo/background.js.map +1 -1
- package/dist/wallet/expo/index.cjs +15 -23
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +4 -7
- package/dist/wallet/expo/index.d.ts +4 -7
- package/dist/wallet/expo/index.js +7 -15
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/worker/expo/index.cjs +9 -10
- package/dist/worker/expo/index.cjs.map +1 -1
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +5 -6
- package/dist/worker/expo/index.js.map +1 -1
- package/package.json +4 -42
- package/dist/adapters/asyncStorage.cjs +0 -48
- package/dist/adapters/asyncStorage.cjs.map +0 -1
- package/dist/adapters/asyncStorage.d.cts +0 -16
- package/dist/adapters/asyncStorage.d.ts +0 -16
- package/dist/adapters/asyncStorage.js +0 -46
- package/dist/adapters/asyncStorage.js.map +0 -1
- package/dist/adapters/fileSystem.cjs +0 -116
- package/dist/adapters/fileSystem.cjs.map +0 -1
- package/dist/adapters/fileSystem.d.cts +0 -17
- package/dist/adapters/fileSystem.d.ts +0 -17
- package/dist/adapters/fileSystem.js +0 -93
- package/dist/adapters/fileSystem.js.map +0 -1
- package/dist/adapters/indexedDB.cjs +0 -103
- package/dist/adapters/indexedDB.cjs.map +0 -1
- package/dist/adapters/indexedDB.d.cts +0 -18
- package/dist/adapters/indexedDB.d.ts +0 -18
- package/dist/adapters/indexedDB.js +0 -101
- package/dist/adapters/indexedDB.js.map +0 -1
- package/dist/adapters/localStorage.cjs +0 -50
- package/dist/adapters/localStorage.cjs.map +0 -1
- package/dist/adapters/localStorage.d.cts +0 -14
- package/dist/adapters/localStorage.d.ts +0 -14
- package/dist/adapters/localStorage.js +0 -48
- package/dist/adapters/localStorage.js.map +0 -1
- package/dist/chunk-3R476TDV.js.map +0 -1
- package/dist/chunk-43FKNLX4.cjs.map +0 -1
- package/dist/chunk-4PKLULWT.js.map +0 -1
- package/dist/chunk-5BLDMQED.cjs +0 -18
- package/dist/chunk-5BLDMQED.cjs.map +0 -1
- package/dist/chunk-GMZZQXV5.cjs.map +0 -1
- package/dist/chunk-ISO4TI5J.js.map +0 -1
- package/dist/chunk-JZWLXNHV.cjs.map +0 -1
- package/dist/chunk-NSBPE2FW.js +0 -15
- package/dist/chunk-NSBPE2FW.js.map +0 -1
- package/dist/chunk-NVZJSKZS.cjs.map +0 -1
- package/dist/chunk-ZRNQV6HV.js.map +0 -1
- package/dist/index-C0IanN1m.d.cts +0 -11
- package/dist/index-C0IanN1m.d.ts +0 -11
package/README.md
CHANGED
|
@@ -591,7 +591,6 @@ Access the `VtxoManager` from the wallet after configuring `settlementConfig`:
|
|
|
591
591
|
const manager = await wallet.getVtxoManager()
|
|
592
592
|
```
|
|
593
593
|
|
|
594
|
-
> **Migration from `renewalConfig`:** Directly initializing a `VtxoManager` with `renewalConfig` is still supported but deprecated. Prefer `settlementConfig` where `vtxoThreshold` is expressed in **seconds** instead of milliseconds.
|
|
595
594
|
|
|
596
595
|
#### Renewal: Prevent Expiration
|
|
597
596
|
|
|
@@ -1109,72 +1108,17 @@ examples.
|
|
|
1109
1108
|
|
|
1110
1109
|
### Repositories (Storage)
|
|
1111
1110
|
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
#### Migration from v1 StorageAdapter
|
|
1115
|
-
|
|
1116
|
-
> [!WARNING]
|
|
1117
|
-
> If you previously used the v1 `StorageAdapter`-based repositories, migrate
|
|
1118
|
-
> data into the new IndexedDB repositories before use:
|
|
1119
|
-
>
|
|
1120
|
-
> ```typescript
|
|
1121
|
-
> import {
|
|
1122
|
-
> IndexedDBWalletRepository,
|
|
1123
|
-
> IndexedDBContractRepository,
|
|
1124
|
-
> getMigrationStatus,
|
|
1125
|
-
> migrateWalletRepository,
|
|
1126
|
-
> rollbackMigration,
|
|
1127
|
-
> } from '@arkade-os/sdk'
|
|
1128
|
-
> import { IndexedDBStorageAdapter } from '@arkade-os/sdk/adapters/indexedDB'
|
|
1129
|
-
>
|
|
1130
|
-
> const oldStorage = new IndexedDBStorageAdapter('legacy-wallet', 1)
|
|
1131
|
-
> const newDbName = 'my-app-db'
|
|
1132
|
-
> const walletRepository = new IndexedDBWalletRepository(newDbName)
|
|
1133
|
-
>
|
|
1134
|
-
> // Check migration status before running
|
|
1135
|
-
> const status = await getMigrationStatus('wallet', oldStorage)
|
|
1136
|
-
> // status: "not-needed" | "pending" | "in-progress" | "done"
|
|
1137
|
-
>
|
|
1138
|
-
> if (status === 'pending' || status === 'in-progress') {
|
|
1139
|
-
> try {
|
|
1140
|
-
> await migrateWalletRepository(oldStorage, walletRepository, {
|
|
1141
|
-
> onchain: [ 'address-1', 'address-2' ],
|
|
1142
|
-
> offchain: [ 'onboarding-address-1' ],
|
|
1143
|
-
> })
|
|
1144
|
-
> } catch (err) {
|
|
1145
|
-
> // Reset migration flag so the next attempt starts clean
|
|
1146
|
-
> await rollbackMigration('wallet', oldStorage)
|
|
1147
|
-
> throw err
|
|
1148
|
-
> }
|
|
1149
|
-
> }
|
|
1150
|
-
> ```
|
|
1151
|
-
>
|
|
1152
|
-
> **Migration status helpers:**
|
|
1153
|
-
>
|
|
1154
|
-
> | Helper | Description |
|
|
1155
|
-
> |--------|-------------|
|
|
1156
|
-
> | `getMigrationStatus(repoType, adapter)` | Returns `"not-needed"` (no legacy DB), `"pending"`, `"in-progress"` (interrupted), or `"done"` |
|
|
1157
|
-
> | `requiresMigration(repoType, adapter)` | Returns `true` if status is `"pending"` or `"in-progress"` |
|
|
1158
|
-
> | `rollbackMigration(repoType, adapter)` | Removes the migration flag so migration can re-run from scratch |
|
|
1159
|
-
> | `MIGRATION_KEY(repoType)` | Returns the storage key used for the migration flag |
|
|
1160
|
-
>
|
|
1161
|
-
> `migrateWalletRepository` sets an `"in-progress"` flag before copying data.
|
|
1162
|
-
> If the process crashes mid-way, the flag remains as `"in-progress"` so the
|
|
1163
|
-
> next call to `getMigrationStatus` can detect the partial migration. Old data
|
|
1164
|
-
> is never deleted — re-running migration after a rollback is safe.
|
|
1165
|
-
>
|
|
1166
|
-
> Anything related to contract repository migration must be handled by the
|
|
1167
|
-
> package that created the contracts. The SDK doesn't manage external contracts
|
|
1168
|
-
> in V1; data persisted by other packages remains untouched in its original
|
|
1169
|
-
> location.
|
|
1111
|
+
Use repository implementations via `StorageConfig`. If you omit `storage`, the
|
|
1112
|
+
SDK uses IndexedDB repositories with the default database name.
|
|
1170
1113
|
|
|
1171
1114
|
#### Repository Versioning
|
|
1172
1115
|
|
|
1173
|
-
`WalletRepository`, `ContractRepository`,
|
|
1174
|
-
`@arkade-os/swap`) each
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1116
|
+
`WalletRepository`, `ContractRepository`, `IntentRepository`,
|
|
1117
|
+
`VirtualTxRepository`, and `AssetSwapRepository` (in `@arkade-os/swap`) each
|
|
1118
|
+
declare a `readonly version` field with a literal type. All built-in
|
|
1119
|
+
implementations set this to the current version. If you maintain a custom
|
|
1120
|
+
repository implementation, TypeScript will produce a compile error when the
|
|
1121
|
+
version is bumped, signaling that a semantic update is required:
|
|
1178
1122
|
|
|
1179
1123
|
```typescript
|
|
1180
1124
|
import { WalletRepository } from '@arkade-os/sdk'
|
|
@@ -1283,6 +1227,7 @@ const wallet = await Wallet.create({
|
|
|
1283
1227
|
})
|
|
1284
1228
|
```
|
|
1285
1229
|
|
|
1230
|
+
### Using with Node.js
|
|
1286
1231
|
### Using with Node.js
|
|
1287
1232
|
|
|
1288
1233
|
Node.js does not provide a global `EventSource` implementation (24.x has one behind `--experimental-eventsource`). The SDK relies on `EventSource` for Server-Sent Events during settlement (onboarding/offboarding) and contract watching, so tell it which one to use:
|
|
@@ -1406,7 +1351,7 @@ When you call `wallet.notifyIncomingFunds()` or use `waitForIncomingFunds()`, it
|
|
|
1406
1351
|
|
|
1407
1352
|
HD wallets (`walletMode: 'hd'`, or an explicit HD `DescriptorProvider`) also watch a band of *unused* offchain receive scripts around their allocation watermark, so a payment to an address that some other party issued from the same seed — a merchant backend such as BTCPay Server, or the .NET SDK driving the same wallet — arrives without the user calling `restore()`. `lookAheadWindow` (default `20`) is the per-side width of that band: the wallet watches `[watermark - N, watermark + N]`. Speculative entries are subscription-only; they become contract rows, and enter balances, only once funded.
|
|
1408
1353
|
|
|
1409
|
-
The issuer, not the wallet, picks the contract shape, so each index is watched at *every* variant the wallet could own there: `default` and `delegate`, crossed with the unilateral-exit timelock matrix and the operator's
|
|
1354
|
+
The issuer, not the wallet, picks the contract shape, so each index is watched at *every* variant the wallet could own there: `default` and `delegate`, crossed with the unilateral-exit timelock matrix and the operator's active plus retired signers. That is the candidate set `restore()` probes too, so watching and restoring cover identical scripts.
|
|
1410
1355
|
|
|
1411
1356
|
```typescript
|
|
1412
1357
|
const wallet = await Wallet.create({
|
|
@@ -1471,7 +1416,7 @@ const paths = manager.getSpendablePaths({
|
|
|
1471
1416
|
contractScript: contract.script,
|
|
1472
1417
|
vtxo,
|
|
1473
1418
|
collaborative: true,
|
|
1474
|
-
|
|
1419
|
+
walletDescriptor: myDescriptor,
|
|
1475
1420
|
})
|
|
1476
1421
|
if (paths.length > 0) {
|
|
1477
1422
|
console.log('Contract is spendable via:', paths[0].leaf)
|
|
@@ -1481,7 +1426,7 @@ if (paths.length > 0) {
|
|
|
1481
1426
|
const allPaths = await manager.getAllSpendingPaths({
|
|
1482
1427
|
contractScript: contract.script,
|
|
1483
1428
|
collaborative: true,
|
|
1484
|
-
|
|
1429
|
+
walletDescriptor: myDescriptor,
|
|
1485
1430
|
})
|
|
1486
1431
|
|
|
1487
1432
|
// Fetch contracts together with their current virtual outputs
|
package/dist/adapters/expo.cjs
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-5BLDMQED.cjs');
|
|
3
|
+
var chunkGPJSGLWM_cjs = require('../chunk-GPJSGLWM.cjs');
|
|
4
|
+
require('../chunk-SYRQJS5N.cjs');
|
|
5
|
+
require('../chunk-C5Y2R63Z.cjs');
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
Object.defineProperty(exports, "ExpoArkProvider", {
|
|
11
10
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkGPJSGLWM_cjs.ExpoArkProvider; }
|
|
13
12
|
});
|
|
14
13
|
Object.defineProperty(exports, "ExpoIndexerProvider", {
|
|
15
14
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkGPJSGLWM_cjs.ExpoIndexerProvider; }
|
|
17
16
|
});
|
|
18
17
|
//# sourceMappingURL=expo.cjs.map
|
|
19
18
|
//# sourceMappingURL=expo.cjs.map
|
package/dist/adapters/expo.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { q as RestArkProvider, n as SettlementEvent, T as TxNotificationEvent, r as RestIndexerProvider, s as SubscriptionResponse } from '../index-Czz9HSqE.cjs';
|
|
2
|
+
export { t as ArkProvider, u as IndexerProvider } from '../index-Czz9HSqE.cjs';
|
|
3
3
|
import '@scure/btc-signer/utils.js';
|
|
4
4
|
import '@scure/btc-signer/transaction.js';
|
|
5
5
|
import '@scure/btc-signer';
|
package/dist/adapters/expo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { q as RestArkProvider, n as SettlementEvent, T as TxNotificationEvent, r as RestIndexerProvider, s as SubscriptionResponse } from '../index-Czz9HSqE.js';
|
|
2
|
+
export { t as ArkProvider, u as IndexerProvider } from '../index-Czz9HSqE.js';
|
|
3
3
|
import '@scure/btc-signer/utils.js';
|
|
4
4
|
import '@scure/btc-signer/transaction.js';
|
|
5
5
|
import '@scure/btc-signer';
|
package/dist/adapters/expo.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-NSBPE2FW.js';
|
|
1
|
+
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-MOWSLXGO.js';
|
|
2
|
+
import '../chunk-XHASFSDU.js';
|
|
3
|
+
import '../chunk-GLZNJFAT.js';
|
|
5
4
|
//# sourceMappingURL=expo.js.map
|
|
6
5
|
//# sourceMappingURL=expo.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as TaskQueue, a as TaskItem, b as TaskResult } from './taskRunner-DUId1UJ8.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Minimal async key-value storage interface.
|
|
@@ -46,4 +46,4 @@ declare class AsyncStorageTaskQueue implements TaskQueue {
|
|
|
46
46
|
private writeList;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export {
|
|
49
|
+
export { type AsyncStorageLike as A, AsyncStorageTaskQueue as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as TaskQueue, a as TaskItem, b as TaskResult } from './taskRunner-7E_Rx8bD.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Minimal async key-value storage interface.
|
|
@@ -46,4 +46,4 @@ declare class AsyncStorageTaskQueue implements TaskQueue {
|
|
|
46
46
|
private writeList;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export {
|
|
49
|
+
export { type AsyncStorageLike as A, AsyncStorageTaskQueue as a };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { VtxoScript, MultisigTapscript, CSVMultisigTapscript, timelockToSequence, sequenceToTimelock, ConditionMultisigTapscript, CLTVMultisigTapscript, ConditionCSVMultisigTapscript, SCRIPT_QUERY_CHUNK_SIZE, getNormalizedVtxos, DEFAULT_PAGE_SIZE } from './chunk-
|
|
2
|
-
import { __export } from './chunk-NSBPE2FW.js';
|
|
1
|
+
import { __export, VtxoScript, MultisigTapscript, CSVMultisigTapscript, timelockToSequence, sequenceToTimelock, ConditionMultisigTapscript, CLTVMultisigTapscript, ConditionCSVMultisigTapscript, SCRIPT_QUERY_CHUNK_SIZE, getNormalizedVtxos, DEFAULT_PAGE_SIZE } from './chunk-GLZNJFAT.js';
|
|
3
2
|
import { hex } from '@scure/base';
|
|
4
3
|
import { networks, expand } from '@bitcoinerlab/descriptors-scure';
|
|
5
4
|
import { ScriptNum, OP, Script } from '@scure/btc-signer';
|
|
@@ -266,21 +265,8 @@ function resolveRole(contract, context) {
|
|
|
266
265
|
}
|
|
267
266
|
return void 0;
|
|
268
267
|
};
|
|
269
|
-
if (context.walletDescriptor)
|
|
270
|
-
|
|
271
|
-
const matchedRole = matchRole(walletDescriptorKey);
|
|
272
|
-
if (matchedRole) {
|
|
273
|
-
return matchedRole;
|
|
274
|
-
}
|
|
275
|
-
if (!walletDescriptorKey && context.walletPubKey) {
|
|
276
|
-
return matchRole(extractRawPubKey(context.walletPubKey));
|
|
277
|
-
}
|
|
278
|
-
return void 0;
|
|
279
|
-
}
|
|
280
|
-
if (context.walletPubKey) {
|
|
281
|
-
return matchRole(extractRawPubKey(context.walletPubKey));
|
|
282
|
-
}
|
|
283
|
-
return void 0;
|
|
268
|
+
if (!context.walletDescriptor) return void 0;
|
|
269
|
+
return matchRole(extractRawPubKey(context.walletDescriptor));
|
|
284
270
|
}
|
|
285
271
|
function extractPubKeyBytes(value) {
|
|
286
272
|
return hex.decode(extractPubKey(normalizeToDescriptor(value)));
|
|
@@ -1867,7 +1853,7 @@ var VHTLCContractHandler = {
|
|
|
1867
1853
|
* Select spending path based on context.
|
|
1868
1854
|
*
|
|
1869
1855
|
* Role is determined from `context.role` or by matching
|
|
1870
|
-
* `context.walletDescriptor`
|
|
1856
|
+
* `context.walletDescriptor`
|
|
1871
1857
|
* against sender/receiver in contract params.
|
|
1872
1858
|
*/
|
|
1873
1859
|
selectPath(script, contract, context) {
|
|
@@ -1914,7 +1900,7 @@ var VHTLCContractHandler = {
|
|
|
1914
1900
|
* Get all possible spending paths (no timelock checks).
|
|
1915
1901
|
*
|
|
1916
1902
|
* Role is determined from `context.role` or by matching
|
|
1917
|
-
* `context.walletDescriptor`
|
|
1903
|
+
* `context.walletDescriptor`
|
|
1918
1904
|
* against sender/receiver in contract params.
|
|
1919
1905
|
*/
|
|
1920
1906
|
getAllSpendingPaths(script, contract, context) {
|
|
@@ -2229,7 +2215,7 @@ var VHTLCV2ContractHandler = {
|
|
|
2229
2215
|
* Select spending path based on context.
|
|
2230
2216
|
*
|
|
2231
2217
|
* Role is determined from `context.role` or by matching
|
|
2232
|
-
* `context.walletDescriptor`
|
|
2218
|
+
* `context.walletDescriptor`
|
|
2233
2219
|
* against sender/receiver in contract params.
|
|
2234
2220
|
*/
|
|
2235
2221
|
selectPath(script, contract, context) {
|
|
@@ -2276,7 +2262,7 @@ var VHTLCV2ContractHandler = {
|
|
|
2276
2262
|
* Get all possible spending paths (no timelock checks).
|
|
2277
2263
|
*
|
|
2278
2264
|
* Role is determined from `context.role` or by matching
|
|
2279
|
-
* `context.walletDescriptor`
|
|
2265
|
+
* `context.walletDescriptor`
|
|
2280
2266
|
* against sender/receiver in contract params.
|
|
2281
2267
|
*/
|
|
2282
2268
|
getAllSpendingPaths(script, contract, context) {
|
|
@@ -2850,22 +2836,12 @@ function deserializeArkadeContractParams(params) {
|
|
|
2850
2836
|
|
|
2851
2837
|
// src/contracts/handlers/arkade.ts
|
|
2852
2838
|
function walletKeyFrom(context) {
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
return void 0;
|
|
2859
|
-
}
|
|
2860
|
-
};
|
|
2861
|
-
if (context.walletDescriptor) {
|
|
2862
|
-
const key = extract(context.walletDescriptor);
|
|
2863
|
-
if (key) return key;
|
|
2864
|
-
}
|
|
2865
|
-
if (context.walletPubKey) {
|
|
2866
|
-
return extract(context.walletPubKey);
|
|
2839
|
+
if (!context.walletDescriptor) return void 0;
|
|
2840
|
+
try {
|
|
2841
|
+
return extractPubKey(context.walletDescriptor).toLowerCase();
|
|
2842
|
+
} catch {
|
|
2843
|
+
return void 0;
|
|
2867
2844
|
}
|
|
2868
|
-
return void 0;
|
|
2869
2845
|
}
|
|
2870
2846
|
function staticWitness(fn, script) {
|
|
2871
2847
|
const refs = fn.def.tapscript.witness ?? [];
|
|
@@ -2987,5 +2963,5 @@ contractHandlers.register(BoardingContractHandler);
|
|
|
2987
2963
|
contractHandlers.register(ArkadeContractHandler);
|
|
2988
2964
|
|
|
2989
2965
|
export { ARKADE_OP, ARKADE_OPCODES, ARKADE_OPCODE_NAMES, ARKADE_OPCODE_VALUES, ARKADE_OPS, ArkadeContractHandler, ArkadeProgramScript, ArkadeScript, BoardingContractHandler, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, OPCODE_NAMES, OPCODE_VALUES, SUPPORTED_PROGRAM_VERSION, VHTLC, VHTLCContractHandler, VHTLCV2ContractHandler, WALLET_RECEIVE_SOURCE, arkadeScriptHash, arkadeWitnessHash, asmToBytes, bignum_exports, bytesToASM, computeArkadeScriptPublicKey, contractHandlers, deriveDescriptorLeafCompressedPubKey, deriveDescriptorLeafPubKey, descriptorIsOurs, deserializeArkadeContractParams, fromASM, getOpcodeName, getOpcodeValue, identityDescriptor, inputName, isCltvSatisfied, isCsvSpendable, isMainnetDescriptor, normalizeToDescriptor, parseArtifact, parseHDDescriptor, resolveAsm, serializeArkadeContractParams, speculativeReceiveMetadata, stringifyArtifact, toASM, toXOnly, validateProgram, witnessRefToBytes };
|
|
2990
|
-
//# sourceMappingURL=chunk-
|
|
2991
|
-
//# sourceMappingURL=chunk-
|
|
2966
|
+
//# sourceMappingURL=chunk-4EZOMPAO.js.map
|
|
2967
|
+
//# sourceMappingURL=chunk-4EZOMPAO.js.map
|