@omnity/ree-client-ts-sdk 0.2.0 → 0.2.2
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 +21 -16
- package/dist/index.d.ts +1 -1
- package/dist/ree-sdk.js +4670 -3581
- package/dist/ree-sdk.umd.cjs +9 -4
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -192,7 +192,9 @@ function WalletComponent() {
|
|
|
192
192
|
<div>Connected: {address}</div>
|
|
193
193
|
<div>Balance: {btcBalance} BTC</div>
|
|
194
194
|
<button onClick={connectWallet}>Connect wallet</button>
|
|
195
|
-
<button onClick={executeComplexTransaction}>
|
|
195
|
+
<button onClick={executeComplexTransaction}>
|
|
196
|
+
Execute Complex Transaction
|
|
197
|
+
</button>
|
|
196
198
|
</div>
|
|
197
199
|
);
|
|
198
200
|
}
|
|
@@ -227,14 +229,18 @@ function MyComponent({ children }) {
|
|
|
227
229
|
});
|
|
228
230
|
|
|
229
231
|
const tx = await createTransaction({
|
|
232
|
+
involvedPoolAddresses: ["bc1q..."],
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
tx.addIntention({
|
|
230
236
|
poolAddress: "bc1q...",
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
237
|
+
inputCoins: [{ id: "0:0", value: depositBtcAmount }],
|
|
238
|
+
outputCoins: [],
|
|
239
|
+
action: "deposit",
|
|
240
|
+
nonce: depositOffer.nonce,
|
|
235
241
|
});
|
|
236
242
|
|
|
237
|
-
const psbt = await tx.build(
|
|
243
|
+
const psbt = await tx.build();
|
|
238
244
|
|
|
239
245
|
const signedPsbt = await signPsbt(psbt);
|
|
240
246
|
const txid = await tx.send(signedPsbt.toHex());
|
|
@@ -317,17 +323,17 @@ Transaction builder for Bitcoin and Rune transactions with multi-intention suppo
|
|
|
317
323
|
|
|
318
324
|
```typescript
|
|
319
325
|
interface Intention {
|
|
320
|
-
poolAddress: string;
|
|
321
|
-
inputCoins: CoinBalance[];
|
|
322
|
-
outputCoins: CoinBalance[];
|
|
323
|
-
action: string;
|
|
324
|
-
actionParams?: string;
|
|
325
|
-
nonce: bigint;
|
|
326
|
+
poolAddress: string; // Target pool address
|
|
327
|
+
inputCoins: CoinBalance[]; // Coins being sent to the pool
|
|
328
|
+
outputCoins: CoinBalance[]; // Coins expected from the pool
|
|
329
|
+
action: string; // Action type (swap, deposit, withdraw, etc.)
|
|
330
|
+
actionParams?: string; // Optional action parameters
|
|
331
|
+
nonce: bigint; // Unique nonce for the intention
|
|
326
332
|
}
|
|
327
333
|
|
|
328
334
|
interface CoinBalance {
|
|
329
|
-
id: string;
|
|
330
|
-
value: bigint;
|
|
335
|
+
id: string; // Coin ID ("0:0" for BTC, "840000:3" for runes)
|
|
336
|
+
value: bigint; // Amount in smallest unit
|
|
331
337
|
}
|
|
332
338
|
```
|
|
333
339
|
|
|
@@ -424,7 +430,6 @@ function TradingDashboard() {
|
|
|
424
430
|
#### Hook Usage Examples
|
|
425
431
|
|
|
426
432
|
```tsx
|
|
427
|
-
|
|
428
433
|
// Get rune info with polling
|
|
429
434
|
const { runeInfo } = useRuneInfo("840000:3", { refreshInterval: 30000 });
|
|
430
435
|
|
|
@@ -499,7 +504,7 @@ try {
|
|
|
499
504
|
paymentAddress: "bc1q...",
|
|
500
505
|
involvedPoolAddresses: ["bc1q..."],
|
|
501
506
|
});
|
|
502
|
-
|
|
507
|
+
|
|
503
508
|
transaction.addIntention({
|
|
504
509
|
poolAddress: "bc1q...",
|
|
505
510
|
inputCoins: [{ id: "0:0", value: BigInt(100000) }],
|
package/dist/index.d.ts
CHANGED