@lombard.finance/sdk-common 3.5.0 → 4.0.0-canary.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lombard.finance/sdk-common",
3
- "version": "3.5.0",
3
+ "version": "4.0.0-canary.6",
4
4
  "description": "Shared utilities and types for the Lombard SDK packages",
5
5
  "exports": {
6
6
  ".": {
@@ -16,36 +16,65 @@ export interface SolanaService {
16
16
  }): Promise<{ signature: string }>;
17
17
 
18
18
  /**
19
- * Unstake LBTC on Solana to receive BTC
19
+ * Redeem BTC.b or LBTC on Solana to receive BTC
20
20
  *
21
- * Burns LBTC on Solana and releases BTC to the provided Bitcoin address.
21
+ * Burns the source token on Solana and sends a GMP message to trigger
22
+ * a BTC payout to the specified Bitcoin address.
22
23
  *
23
- * @param args.amount - Amount of LBTC to unstake in base units (satoshis)
24
+ * @param args.amount - Amount to redeem in base units (satoshis)
24
25
  * @param args.btcAddress - Bitcoin address to receive BTC
25
26
  * @param args.network - Solana network ('mainnet-beta', 'devnet', 'testnet')
26
- * @returns Transaction signature
27
+ * @param args.tokenMint - Source SPL mint: must be the environment’s LBTC or BTC.b mint.
28
+ * @returns `{ signature }` — base58 Solana transaction signature for the initiating burn/GMP transaction (not a Bitcoin payout txid).
27
29
  */
28
- unstake(args: {
30
+ redeemForBtc(args: {
29
31
  amount: string;
30
32
  btcAddress: string;
31
33
  network: string;
32
- }): Promise<{ txHash: string }>;
34
+ env?: Env;
35
+ tokenMint: string;
36
+ }): Promise<{ signature: string }>;
33
37
 
34
38
  /**
35
- * Redeem BTC.b on Solana to receive BTC
39
+ * Redeem tokens via Asset Router's generic `redeem` instruction.
36
40
  *
37
- * Burns BTC.b on Solana and sends a GMP message to trigger
38
- * a BTC payout to the specified Bitcoin address.
41
+ * Burns the source token (default LBTC) and sends a GMP message through
42
+ * the Mailbox to route the destination token (default BTC.b) to the recipient.
39
43
  *
40
- * @param args.amount - Amount of BTC.b to redeem in base units (satoshis)
41
- * @param args.btcAddress - Bitcoin address to receive BTC
42
- * @param args.network - Solana network ('mainnet-beta', 'devnet', 'testnet')
43
- * @returns Transaction signature
44
+ * @param args.amount - Amount in base units (satoshis)
45
+ * @param args.recipient - Owner wallet (Solana base58); the SDK derives the native_mint ATA for the GMP payload from on-chain Asset Router config
46
+ * @param args.network - Solana network
47
+ * @returns `{ signature }` — base58 Solana transaction signature for the submitted transaction.
44
48
  */
45
- redeemForBtc(args: {
49
+ redeem(args: {
46
50
  amount: string;
47
- btcAddress: string;
51
+ recipient: string;
48
52
  network: string;
49
53
  env?: Env;
50
- }): Promise<{ txHash: string }>;
54
+ tokenMint?: string;
55
+ toLchainId?: string;
56
+ toTokenAddress?: string;
57
+ }): Promise<{ signature: string }>;
58
+
59
+ /**
60
+ * Deposit source token (default BTC.b) to receive destination token (default LBTC)
61
+ * via Asset Router's `deposit` instruction.
62
+ *
63
+ * Burns the source token and sends a GMP message through the Mailbox
64
+ * to mint the destination token to the recipient.
65
+ *
66
+ * @param args.amount - Amount in base units (satoshis)
67
+ * @param args.recipient - Owner wallet (Solana base58); the SDK derives the destination mint ATA for the GMP payload
68
+ * @param args.network - Solana network
69
+ * @returns `{ signature }` — base58 Solana transaction signature for the submitted transaction.
70
+ */
71
+ deposit(args: {
72
+ amount: string;
73
+ recipient: string;
74
+ network: string;
75
+ env?: Env;
76
+ sourceTokenMint?: string;
77
+ toLchainId?: string;
78
+ toTokenAddress?: string;
79
+ }): Promise<{ signature: string }>;
51
80
  }