@arkade-os/sdk 0.5.0-rc.2 → 0.5.0-rc.21
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 +90 -83
- package/dist/adapters/expo.cjs +5 -6
- package/dist/adapters/expo.d.cts +4 -4
- package/dist/adapters/expo.d.ts +4 -4
- package/dist/adapters/expo.js +3 -4
- package/dist/{asyncStorageTaskQueue-C5rBYlru.d.ts → asyncStorageTaskQueue-aL7K14e4.d.ts} +2 -2
- package/dist/{asyncStorageTaskQueue-BuDvgWh6.d.cts → asyncStorageTaskQueue-x8ok3tJy.d.cts} +2 -2
- package/dist/{chunk-ISO4TI5J.js → chunk-4FDNOLBO.js} +566 -459
- package/dist/chunk-4FDNOLBO.js.map +1 -0
- package/dist/{chunk-JZWLXNHV.cjs → chunk-5XBH5SAL.cjs} +574 -464
- package/dist/chunk-5XBH5SAL.cjs.map +1 -0
- package/dist/{chunk-3R476TDV.js → chunk-CXHJGED6.js} +293 -1071
- package/dist/chunk-CXHJGED6.js.map +1 -0
- package/dist/{chunk-ZRNQV6HV.js → chunk-EXFU6MTA.js} +4578 -4396
- package/dist/chunk-EXFU6MTA.js.map +1 -0
- package/dist/{chunk-43FKNLX4.cjs → chunk-GVF4OCTL.cjs} +357 -1114
- package/dist/chunk-GVF4OCTL.cjs.map +1 -0
- package/dist/{chunk-HLCGYOIH.cjs → chunk-HIZNPHB2.cjs} +37 -36
- package/dist/chunk-HIZNPHB2.cjs.map +1 -0
- package/dist/{chunk-4PKLULWT.js → chunk-JZAEFOE4.js} +109 -246
- package/dist/chunk-JZAEFOE4.js.map +1 -0
- package/dist/{chunk-ZOTXDOS5.js → chunk-LNJPVLIC.js} +30 -29
- package/dist/chunk-LNJPVLIC.js.map +1 -0
- package/dist/{chunk-NVZJSKZS.cjs → chunk-Q7PC3NHX.cjs} +121 -257
- package/dist/chunk-Q7PC3NHX.cjs.map +1 -0
- package/dist/{chunk-GMZZQXV5.cjs → chunk-R5OFJ23O.cjs} +4961 -4767
- package/dist/chunk-R5OFJ23O.cjs.map +1 -0
- package/dist/{chunk-6DNR46C7.js → chunk-S2WWOVFC.js} +7 -5
- package/dist/chunk-S2WWOVFC.js.map +1 -0
- package/dist/{chunk-D25O4EGY.cjs → chunk-VZMLADXQ.cjs} +12 -10
- package/dist/chunk-VZMLADXQ.cjs.map +1 -0
- package/dist/contracts/handlers/index.cjs +9 -10
- package/dist/contracts/handlers/index.d.cts +5 -5
- package/dist/contracts/handlers/index.d.ts +5 -5
- package/dist/contracts/handlers/index.js +2 -3
- package/dist/{delegate-BAX5QftB.d.ts → delegate-BT5iON1T.d.ts} +1 -1
- package/dist/{delegate-1yp1HyP7.d.cts → delegate-u6kXTtWY.d.cts} +1 -1
- package/dist/index-BCnhItOQ.d.cts +639 -0
- package/dist/{index-DUxufw76.d.cts → index-CK5QbTmZ.d.cts} +1387 -2404
- package/dist/{index-DUxufw76.d.ts → index-CK5QbTmZ.d.ts} +1387 -2404
- package/dist/index-D1D4cR-G.d.ts +639 -0
- package/dist/index.cjs +375 -340
- package/dist/index.d.cts +784 -1197
- package/dist/index.d.ts +784 -1197
- package/dist/index.js +4 -5
- package/dist/repositories/realm/index.cjs +201 -106
- package/dist/repositories/realm/index.cjs.map +1 -1
- package/dist/repositories/realm/index.d.cts +28 -16
- package/dist/repositories/realm/index.d.ts +28 -16
- package/dist/repositories/realm/index.js +190 -95
- package/dist/repositories/realm/index.js.map +1 -1
- package/dist/repositories/sqlite/index.cjs +301 -189
- package/dist/repositories/sqlite/index.cjs.map +1 -1
- package/dist/repositories/sqlite/index.d.cts +32 -21
- package/dist/repositories/sqlite/index.d.ts +32 -21
- package/dist/repositories/sqlite/index.js +294 -182
- package/dist/repositories/sqlite/index.js.map +1 -1
- package/dist/{taskRunner-D_iPiZIi.d.ts → taskRunner-BeYR6NpQ.d.ts} +2 -2
- package/dist/{taskRunner-Dr3NStc0.d.cts → taskRunner-Csey3EYJ.d.cts} +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 +10 -16
- package/dist/wallet/expo/background.d.ts +10 -16
- package/dist/wallet/expo/background.js +6 -7
- package/dist/wallet/expo/background.js.map +1 -1
- package/dist/wallet/expo/index.cjs +16 -23
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +6 -9
- package/dist/wallet/expo/index.d.ts +6 -9
- package/dist/wallet/expo/index.js +8 -15
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/wallet-DG3Qmbmt.d.cts +1848 -0
- package/dist/wallet-DzSLMxBZ.d.ts +1848 -0
- package/dist/worker/expo/index.cjs +9 -10
- package/dist/worker/expo/index.cjs.map +1 -1
- package/dist/worker/expo/index.d.cts +6 -6
- package/dist/worker/expo/index.d.ts +6 -6
- package/dist/worker/expo/index.js +5 -6
- package/dist/worker/expo/index.js.map +1 -1
- package/package.json +12 -51
- 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-6DNR46C7.js.map +0 -1
- package/dist/chunk-D25O4EGY.cjs.map +0 -1
- package/dist/chunk-GMZZQXV5.cjs.map +0 -1
- package/dist/chunk-HLCGYOIH.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-ZOTXDOS5.js.map +0 -1
- package/dist/chunk-ZRNQV6HV.js.map +0 -1
- package/dist/hdWalletCapable-CmEU0NP1.d.ts +0 -2232
- package/dist/hdWalletCapable-eJgaT-ec.d.cts +0 -2232
- package/dist/index-Bem5vKzX.d.ts +0 -850
- package/dist/index-C0IanN1m.d.cts +0 -11
- package/dist/index-C0IanN1m.d.ts +0 -11
- package/dist/index-W_oMcOmG.d.cts +0 -850
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { W as WalletRepository, B as ExtendedVirtualCoin,
|
|
2
|
-
export {
|
|
1
|
+
import { W as WalletRepository, P as PageRequest, O as Outpoint, D as PageResult, B as ExtendedVirtualCoin, F as ScriptVtxoCursor, H as ScriptVtxoPageOptions, J as StoredVtxo, K as VtxoRepositoryKey, E as ExtendedCoin, L as TransactionHistoryPageFilter, M as TransactionHistoryPageCursor, h as ArkTransaction, Q as WalletState, C as ContractRepository, U as ContractFilter, z as Contract, X as IntentRepository, Y as ArkIntent, Z as IntentPageFilter, _ as VirtualTxRepository, $ as VirtualTx, a0 as VtxoBranch } from '../../index-CK5QbTmZ.js';
|
|
2
|
+
export { a1 as ChainedTxType } from '../../index-CK5QbTmZ.js';
|
|
3
3
|
import '@scure/btc-signer/utils.js';
|
|
4
|
-
import '@scure/btc-signer/transaction.js';
|
|
5
|
-
import '@scure/btc-signer';
|
|
6
4
|
import '@scure/btc-signer/psbt.js';
|
|
5
|
+
import '@scure/btc-signer';
|
|
6
|
+
import '@scure/btc-signer/transaction.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Minimal SQL execution interface that consumers implement
|
|
@@ -39,7 +39,7 @@ interface SQLiteWalletRepositoryOptions {
|
|
|
39
39
|
*/
|
|
40
40
|
declare class SQLiteWalletRepository implements WalletRepository {
|
|
41
41
|
private readonly db;
|
|
42
|
-
readonly version:
|
|
42
|
+
readonly version: 2;
|
|
43
43
|
private initPromise;
|
|
44
44
|
private readonly prefix;
|
|
45
45
|
private readonly tables;
|
|
@@ -49,13 +49,15 @@ declare class SQLiteWalletRepository implements WalletRepository {
|
|
|
49
49
|
/**
|
|
50
50
|
* Bring the `vtxos` table to the current schema (v1 = `script` NOT NULL).
|
|
51
51
|
*
|
|
52
|
-
*
|
|
52
|
+
* Four cases:
|
|
53
53
|
* - Fresh install: create the v1 schema directly.
|
|
54
54
|
* - Legacy install without a `script` column: add it, backfill from
|
|
55
55
|
* `address`, then rebuild the table with NOT NULL (SQLite cannot add
|
|
56
56
|
* the NOT NULL constraint in place).
|
|
57
57
|
* - Legacy install with a nullable `script` column: backfill the NULLs
|
|
58
58
|
* and rebuild.
|
|
59
|
+
* - 0.4.x install: `script` is already NOT NULL but `virtual_status_json
|
|
60
|
+
* NOT NULL` is still there, and `saveVtxos` no longer writes it.
|
|
59
61
|
*
|
|
60
62
|
* The backfill derives `script` from the Ark address, matching what the
|
|
61
63
|
* indexer would have returned — new rows from the indexer always carry a
|
|
@@ -70,19 +72,35 @@ declare class SQLiteWalletRepository implements WalletRepository {
|
|
|
70
72
|
* leave the next startup seeing no `vtxos` table.
|
|
71
73
|
*/
|
|
72
74
|
private migrateVtxosTable;
|
|
75
|
+
/**
|
|
76
|
+
* Copy the canonical VTXO facts out of the legacy `virtual_status_json` blob.
|
|
77
|
+
*
|
|
78
|
+
* Scoped to rows that still have `is_swept` NULL, which is what "never backfilled" looks
|
|
79
|
+
* like: the copy writes 0 or 1 to every row it touches, so a second pass — a later column
|
|
80
|
+
* addition, say — cannot overwrite what an indexer sync has since corrected. Rows whose blob
|
|
81
|
+
* is missing or corrupt are left alone: a migration must not be stopped by one bad row, and
|
|
82
|
+
* the next sync repairs it.
|
|
83
|
+
*/
|
|
84
|
+
private backfillCanonicalVtxoColumns;
|
|
73
85
|
private vtxosCreateSql;
|
|
86
|
+
/**
|
|
87
|
+
* `INSERT OR REPLACE` rows, as many to a statement as the parameter budget allows.
|
|
88
|
+
* No enclosing transaction: on the shared connection it would take in other repos' writes.
|
|
89
|
+
*/
|
|
90
|
+
private insertOrReplace;
|
|
74
91
|
[Symbol.asyncDispose](): Promise<void>;
|
|
75
92
|
clear(): Promise<void>;
|
|
76
|
-
|
|
93
|
+
getVtxosPage(address: string, page: PageRequest<Outpoint>): Promise<PageResult<ExtendedVirtualCoin, Outpoint>>;
|
|
77
94
|
saveVtxos(address: string, vtxos: ExtendedVirtualCoin[]): Promise<void>;
|
|
78
95
|
deleteVtxos(address: string): Promise<void>;
|
|
79
|
-
|
|
96
|
+
getVtxosForScriptPage(script: string, page: PageRequest<ScriptVtxoCursor>, options?: ScriptVtxoPageOptions): Promise<PageResult<StoredVtxo, ScriptVtxoCursor>>;
|
|
80
97
|
saveVtxosForScript(key: VtxoRepositoryKey, vtxos: ExtendedVirtualCoin[]): Promise<void>;
|
|
81
98
|
deleteVtxosForScript(script: string): Promise<void>;
|
|
82
|
-
|
|
83
|
-
|
|
99
|
+
getUtxosPage(address: string, page: PageRequest<Outpoint>): Promise<PageResult<ExtendedCoin, Outpoint>>;
|
|
100
|
+
private pageByAddress;
|
|
101
|
+
saveUtxos(addressOrBatch: string | ReadonlyMap<string, ExtendedCoin[]>, utxos?: ExtendedCoin[]): Promise<void>;
|
|
84
102
|
deleteUtxos(address: string): Promise<void>;
|
|
85
|
-
|
|
103
|
+
getTransactionHistoryPage(filter: TransactionHistoryPageFilter, page: PageRequest<TransactionHistoryPageCursor>): Promise<PageResult<ArkTransaction, TransactionHistoryPageCursor>>;
|
|
86
104
|
saveTransactions(address: string, txs: ArkTransaction[]): Promise<void>;
|
|
87
105
|
deleteTransactions(address: string): Promise<void>;
|
|
88
106
|
getWalletState(): Promise<WalletState | null>;
|
|
@@ -104,7 +122,7 @@ interface SQLiteContractRepositoryOptions {
|
|
|
104
122
|
*/
|
|
105
123
|
declare class SQLiteContractRepository implements ContractRepository {
|
|
106
124
|
private readonly db;
|
|
107
|
-
readonly version:
|
|
125
|
+
readonly version: 3;
|
|
108
126
|
private initPromise;
|
|
109
127
|
private readonly prefix;
|
|
110
128
|
private readonly table;
|
|
@@ -114,15 +132,10 @@ declare class SQLiteContractRepository implements ContractRepository {
|
|
|
114
132
|
private addColumnIfMissing;
|
|
115
133
|
[Symbol.asyncDispose](): Promise<void>;
|
|
116
134
|
clear(): Promise<void>;
|
|
117
|
-
|
|
135
|
+
getContractsPage(filter: ContractFilter | undefined, page: PageRequest): Promise<PageResult<Contract>>;
|
|
118
136
|
saveContract(contract: Contract): Promise<void>;
|
|
119
137
|
deleteContract(script: string): Promise<void>;
|
|
120
138
|
private addFilterCondition;
|
|
121
|
-
/**
|
|
122
|
-
* Same as {@link addFilterCondition}, except a row predating the
|
|
123
|
-
* column stores NULL and must match `"watched"`.
|
|
124
|
-
*/
|
|
125
|
-
private addWatchCondition;
|
|
126
139
|
}
|
|
127
140
|
|
|
128
141
|
declare class SQLiteIntentRepository implements IntentRepository {
|
|
@@ -136,10 +149,9 @@ declare class SQLiteIntentRepository implements IntentRepository {
|
|
|
136
149
|
});
|
|
137
150
|
private ensureInit;
|
|
138
151
|
private init;
|
|
139
|
-
private withTx;
|
|
140
152
|
clear(): Promise<void>;
|
|
141
153
|
saveIntent(intent: ArkIntent): Promise<void>;
|
|
142
|
-
|
|
154
|
+
getIntentsPage(filter: IntentPageFilter | undefined, page: PageRequest): Promise<PageResult<ArkIntent>>;
|
|
143
155
|
getLockedVtxoOutpoints(): Promise<Outpoint[]>;
|
|
144
156
|
[Symbol.asyncDispose](): Promise<void>;
|
|
145
157
|
}
|
|
@@ -156,7 +168,6 @@ declare class SQLiteVirtualTxRepository implements VirtualTxRepository {
|
|
|
156
168
|
});
|
|
157
169
|
private ensureInit;
|
|
158
170
|
private init;
|
|
159
|
-
private tx;
|
|
160
171
|
clear(): Promise<void>;
|
|
161
172
|
upsertVirtualTxs(txs: VirtualTx[]): Promise<void>;
|
|
162
173
|
getVirtualTx(txid: string): Promise<VirtualTx | null>;
|