@arkade-os/sdk 0.4.68 → 0.5.0-rc.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.
- package/README.md +35 -5
- package/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +3 -3
- package/dist/adapters/indexedDB.cjs +5 -5
- package/dist/adapters/indexedDB.js +4 -4
- package/dist/{asyncStorageTaskQueue-DaZlVTbM.d.ts → asyncStorageTaskQueue-BCzN3Y45.d.ts} +1 -1
- package/dist/{asyncStorageTaskQueue-B2CcXIHU.d.cts → asyncStorageTaskQueue-CdF_ELX8.d.cts} +1 -1
- package/dist/{chunk-WCJVKFAP.cjs → chunk-5MJHZHG7.cjs} +726 -468
- package/dist/chunk-5MJHZHG7.cjs.map +1 -0
- package/dist/{chunk-EJOFL5WH.cjs → chunk-6AFUNKK7.cjs} +19 -7
- package/dist/chunk-6AFUNKK7.cjs.map +1 -0
- package/dist/{chunk-VBHXBI7F.js → chunk-6F2Q32KA.js} +298 -41
- package/dist/chunk-6F2Q32KA.js.map +1 -0
- package/dist/{chunk-GQ4NMQGR.js → chunk-ABJPM4JF.js} +4 -4
- package/dist/{chunk-GQ4NMQGR.js.map → chunk-ABJPM4JF.js.map} +1 -1
- package/dist/{chunk-PJR63FTK.cjs → chunk-CZ32XADN.cjs} +17 -17
- package/dist/{chunk-PJR63FTK.cjs.map → chunk-CZ32XADN.cjs.map} +1 -1
- package/dist/{chunk-33Q2RFET.js → chunk-FVTJJQNM.js} +3 -3
- package/dist/{chunk-33Q2RFET.js.map → chunk-FVTJJQNM.js.map} +1 -1
- package/dist/{chunk-6YUACVX4.cjs → chunk-HL7EC2Z5.cjs} +52 -53
- package/dist/chunk-HL7EC2Z5.cjs.map +1 -0
- package/dist/{chunk-G4I6PU5H.js → chunk-JYP7YXT2.js} +4 -4
- package/dist/{chunk-G4I6PU5H.js.map → chunk-JYP7YXT2.js.map} +1 -1
- package/dist/{chunk-45FKMOJH.js → chunk-KTU44AEH.js} +6 -7
- package/dist/chunk-KTU44AEH.js.map +1 -0
- package/dist/{chunk-4KCVS4ZN.cjs → chunk-PB5KJI4U.cjs} +10 -10
- package/dist/{chunk-4KCVS4ZN.cjs.map → chunk-PB5KJI4U.cjs.map} +1 -1
- package/dist/{chunk-4CMXV5SF.js → chunk-PPG6W34P.js} +18 -8
- package/dist/chunk-PPG6W34P.js.map +1 -0
- package/dist/{chunk-JGMSZIE4.cjs → chunk-RXWKCEZP.cjs} +17 -17
- package/dist/{chunk-JGMSZIE4.cjs.map → chunk-RXWKCEZP.cjs.map} +1 -1
- package/dist/contracts/handlers/index.cjs +9 -9
- 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 -2
- package/dist/{delegate-Bffc5f54.d.cts → delegate-DLIOBQ5x.d.cts} +1 -1
- package/dist/{delegate-AomVWxO_.d.ts → delegate-Dyn5L80J.d.ts} +1 -1
- package/dist/{hdWalletCapable-B5nRs3RH.d.cts → hdWalletCapable-D9tooZ6F.d.ts} +102 -27
- package/dist/{hdWalletCapable-DZdIVa23.d.ts → hdWalletCapable-Dt3MUiGE.d.cts} +102 -27
- package/dist/{index-jouvy8FD.d.ts → index-D3hmsuKs.d.cts} +6 -6
- package/dist/{index-nfyQM33h.d.cts → index-D9tXd-tN.d.ts} +6 -6
- package/dist/{index-C7RZCfoY.d.cts → index-Udm5V2xW.d.cts} +168 -19
- package/dist/{index-C7RZCfoY.d.ts → index-Udm5V2xW.d.ts} +168 -19
- package/dist/index.cjs +306 -290
- package/dist/index.d.cts +121 -29
- package/dist/index.d.ts +121 -29
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +19 -19
- package/dist/repositories/realm/index.d.cts +2 -2
- package/dist/repositories/realm/index.d.ts +2 -2
- package/dist/repositories/realm/index.js +5 -5
- package/dist/repositories/sqlite/index.cjs +18 -18
- package/dist/repositories/sqlite/index.d.cts +2 -2
- package/dist/repositories/sqlite/index.d.ts +2 -2
- package/dist/repositories/sqlite/index.js +5 -5
- package/dist/{taskRunner-D2vnpPBT.d.cts → taskRunner-DxZciNaa.d.cts} +1 -1
- package/dist/{taskRunner-DuwK9t8O.d.ts → taskRunner-ZdS16Ypm.d.ts} +1 -1
- package/dist/wallet/expo/background.cjs +14 -14
- 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 -6
- package/dist/wallet/expo/index.cjs +23 -14
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +7 -4
- package/dist/wallet/expo/index.d.ts +7 -4
- package/dist/wallet/expo/index.js +14 -5
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/worker/expo/index.cjs +9 -9
- 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 -5
- package/package.json +3 -2
- package/dist/chunk-45FKMOJH.js.map +0 -1
- package/dist/chunk-4CMXV5SF.js.map +0 -1
- package/dist/chunk-6YUACVX4.cjs.map +0 -1
- package/dist/chunk-EJOFL5WH.cjs.map +0 -1
- package/dist/chunk-VBHXBI7F.js.map +0 -1
- package/dist/chunk-WCJVKFAP.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -754,7 +754,7 @@ const wallet = await Wallet.create({
|
|
|
754
754
|
})
|
|
755
755
|
|
|
756
756
|
// Get fee information from the server
|
|
757
|
-
const { fees: feeInfo } = await wallet.
|
|
757
|
+
const { fees: feeInfo } = await wallet.getArkadeInfo();
|
|
758
758
|
|
|
759
759
|
const exitTxid = await new Ramps(wallet).offboard(
|
|
760
760
|
'bc1p...',
|
|
@@ -762,6 +762,37 @@ const exitTxid = await new Ramps(wallet).offboard(
|
|
|
762
762
|
);
|
|
763
763
|
```
|
|
764
764
|
|
|
765
|
+
`getArkadeInfo()` is part of the `IReadonlyWallet` interface, so the same call works on the
|
|
766
|
+
service-worker and Expo wallets too. It answers with the server's live `ArkadeInfo`, falling back
|
|
767
|
+
to the snapshot persisted at wallet construction when the server is unreachable.
|
|
768
|
+
|
|
769
|
+
### Talking to the server through the wallet
|
|
770
|
+
|
|
771
|
+
`getArkadeInfo()` is one of three seams that let a plugin work from a wallet alone, never a
|
|
772
|
+
server URL of its own:
|
|
773
|
+
|
|
774
|
+
| Seam | Interface | For |
|
|
775
|
+
| --- | --- | --- |
|
|
776
|
+
| `getArkadeInfo()` | `IReadonlyWallet` | Network, signer key, delays, dust, fees, limits |
|
|
777
|
+
| `getArkadeReader()` | `IReadonlyWallet` | Chain reads for scripts the wallet does not own |
|
|
778
|
+
| `getArkadeBroadcaster()` | `IWallet` | `submitTx` / `finalizeTx` |
|
|
779
|
+
|
|
780
|
+
```typescript
|
|
781
|
+
const reader = await wallet.getArkadeReader();
|
|
782
|
+
const { vtxos } = await reader.getVtxos({ scripts: [covenantScriptHex], spendableOnly: true });
|
|
783
|
+
const { txs } = await reader.getVirtualTxs([spendTxid]);
|
|
784
|
+
```
|
|
785
|
+
|
|
786
|
+
`getVtxos()` here queries the server for an arbitrary script — distinct from
|
|
787
|
+
`wallet.getVtxos()`, which answers the wallet's own outputs from local repositories. Everything
|
|
788
|
+
it returns is normalized, so each VTXO carries its canonical facts.
|
|
789
|
+
|
|
790
|
+
Broadcasting sits on `IWallet` rather than `IReadonlyWallet` on purpose: a readonly wallet must
|
|
791
|
+
not submit, and a service-worker wallet in readonly mode refuses the message outright.
|
|
792
|
+
|
|
793
|
+
All three are proxied to the worker on a service-worker wallet, so a plugin shares the wallet's
|
|
794
|
+
connection instead of opening a second one outside its rate gate and caches.
|
|
795
|
+
|
|
765
796
|
### Unilateral Exit
|
|
766
797
|
|
|
767
798
|
Unilateral exit allows you to withdraw your funds from the Arkade protocol back to the Bitcoin blockchain without requiring cooperation from the Arkade server. This process involves two main steps:
|
|
@@ -1102,13 +1133,12 @@ The `StorageAdapter` API is deprecated. Use repositories instead. If you omit `s
|
|
|
1102
1133
|
> Anything related to contract repository migration must be handled by the
|
|
1103
1134
|
> package that created the contracts. The SDK doesn't manage external contracts
|
|
1104
1135
|
> in V1; data persisted by other packages remains untouched in its original
|
|
1105
|
-
> location.
|
|
1106
|
-
> for migrating legacy `reverseSwaps` / `submarineSwaps` collections.
|
|
1136
|
+
> location.
|
|
1107
1137
|
|
|
1108
1138
|
#### Repository Versioning
|
|
1109
1139
|
|
|
1110
1140
|
`WalletRepository`, `ContractRepository`, and `SwapRepository` (in
|
|
1111
|
-
`@arkade-os/
|
|
1141
|
+
`@arkade-os/swap`) each declare a `readonly version` field with a literal
|
|
1112
1142
|
type. All built-in implementations set this to the current version. If you
|
|
1113
1143
|
maintain a custom repository implementation, TypeScript will produce a compile
|
|
1114
1144
|
error when the version is bumped, signaling that a semantic update is required:
|
|
@@ -1493,7 +1523,7 @@ For integration tests, use the root commands (`pnpm run test:integration:ts-sdk`
|
|
|
1493
1523
|
|
|
1494
1524
|
### Releasing
|
|
1495
1525
|
|
|
1496
|
-
Package-local releases are disabled. Releases run from the monorepo root and are package-scoped: `pnpm run release -- sdk patch` bumps `@arkade-os/sdk`, creates a `@arkade-os/sdk/<version>` tag, and also bumps `@arkade-os/
|
|
1526
|
+
Package-local releases are disabled. Releases run from the monorepo root and are package-scoped: `pnpm run release -- sdk patch` bumps `@arkade-os/sdk`, creates a `@arkade-os/sdk/<version>` tag, and also bumps `@arkade-os/swap` (which depends on SDK via `workspace:*`). See the [root README](../../README.md#releasing) for full flags and `pnpm run release -- --help`.
|
|
1497
1527
|
|
|
1498
1528
|
## License
|
|
1499
1529
|
|
package/dist/adapters/expo.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
3
|
+
var chunkRXWKCEZP_cjs = require('../chunk-RXWKCEZP.cjs');
|
|
4
|
+
require('../chunk-CZ32XADN.cjs');
|
|
5
|
+
require('../chunk-6AFUNKK7.cjs');
|
|
6
6
|
require('../chunk-5BLDMQED.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "ExpoArkProvider", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkRXWKCEZP_cjs.ExpoArkProvider; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "ExpoIndexerProvider", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkRXWKCEZP_cjs.ExpoIndexerProvider; }
|
|
17
17
|
});
|
|
18
18
|
//# sourceMappingURL=expo.cjs.map
|
|
19
19
|
//# sourceMappingURL=expo.cjs.map
|
package/dist/adapters/expo.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { r as RestArkProvider, o as SettlementEvent, T as TxNotificationEvent, s as RestIndexerProvider, t as SubscriptionResponse } from '../index-Udm5V2xW.cjs';
|
|
2
|
+
export { u as ArkProvider, v as IndexerProvider } from '../index-Udm5V2xW.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 { r as RestArkProvider, o as SettlementEvent, T as TxNotificationEvent, s as RestIndexerProvider, t as SubscriptionResponse } from '../index-Udm5V2xW.js';
|
|
2
|
+
export { u as ArkProvider, v as IndexerProvider } from '../index-Udm5V2xW.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,6 @@
|
|
|
1
|
-
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-JYP7YXT2.js';
|
|
2
|
+
import '../chunk-FVTJJQNM.js';
|
|
3
|
+
import '../chunk-PPG6W34P.js';
|
|
4
4
|
import '../chunk-NSBPE2FW.js';
|
|
5
5
|
//# sourceMappingURL=expo.js.map
|
|
6
6
|
//# sourceMappingURL=expo.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
3
|
+
var chunk5MJHZHG7_cjs = require('../chunk-5MJHZHG7.cjs');
|
|
4
|
+
require('../chunk-CZ32XADN.cjs');
|
|
5
|
+
require('../chunk-HL7EC2Z5.cjs');
|
|
6
|
+
require('../chunk-6AFUNKK7.cjs');
|
|
7
7
|
require('../chunk-5BLDMQED.cjs');
|
|
8
8
|
|
|
9
9
|
// src/storage/indexedDB.ts
|
|
@@ -11,7 +11,7 @@ var IndexedDBStorageAdapter = class {
|
|
|
11
11
|
dbName;
|
|
12
12
|
version;
|
|
13
13
|
db = null;
|
|
14
|
-
constructor(dbName, version =
|
|
14
|
+
constructor(dbName, version = chunk5MJHZHG7_cjs.DB_VERSION) {
|
|
15
15
|
this.dbName = dbName;
|
|
16
16
|
this.version = version;
|
|
17
17
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DB_VERSION } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
import { DB_VERSION } from '../chunk-6F2Q32KA.js';
|
|
2
|
+
import '../chunk-FVTJJQNM.js';
|
|
3
|
+
import '../chunk-KTU44AEH.js';
|
|
4
|
+
import '../chunk-PPG6W34P.js';
|
|
5
5
|
import '../chunk-NSBPE2FW.js';
|
|
6
6
|
|
|
7
7
|
// src/storage/indexedDB.ts
|