@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 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}>Execute Complex Transaction</button>
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
- sendBtcAmount: depositBtcAmount,
232
- sendRuneAmount: BigInt(0),
233
- receiveBtcAmount: BigInt(0),
234
- receiveRuneAmount: BigInt(0),
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("deposit", depositOffer.nonce);
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; // Target pool address
321
- inputCoins: CoinBalance[]; // Coins being sent to the pool
322
- outputCoins: CoinBalance[]; // Coins expected from the pool
323
- action: string; // Action type (swap, deposit, withdraw, etc.)
324
- actionParams?: string; // Optional action parameters
325
- nonce: bigint; // Unique nonce for the intention
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; // Coin ID ("0:0" for BTC, "840000:3" for runes)
330
- value: bigint; // Amount in smallest unit
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
@@ -1,5 +1,5 @@
1
1
  import { ActorSubclass } from '@dfinity/agent';
2
- import * as bitcoin from 'bitcoinjs-lib';
2
+ import * as bitcoin from "bitcoinjs-lib";
3
3
  import { IDL } from '@dfinity/candid';
4
4
  import { JSX as JSX_2 } from 'react/jsx-runtime';
5
5
  import { ReactNode } from 'react';