@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 +1 -1
- package/src/services/solana.ts +45 -16
package/package.json
CHANGED
package/src/services/solana.ts
CHANGED
|
@@ -16,36 +16,65 @@ export interface SolanaService {
|
|
|
16
16
|
}): Promise<{ signature: string }>;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Redeem BTC.b or LBTC on Solana to receive BTC
|
|
20
20
|
*
|
|
21
|
-
* Burns
|
|
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
|
|
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
|
-
* @
|
|
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
|
-
|
|
30
|
+
redeemForBtc(args: {
|
|
29
31
|
amount: string;
|
|
30
32
|
btcAddress: string;
|
|
31
33
|
network: string;
|
|
32
|
-
|
|
34
|
+
env?: Env;
|
|
35
|
+
tokenMint: string;
|
|
36
|
+
}): Promise<{ signature: string }>;
|
|
33
37
|
|
|
34
38
|
/**
|
|
35
|
-
* Redeem
|
|
39
|
+
* Redeem tokens via Asset Router's generic `redeem` instruction.
|
|
36
40
|
*
|
|
37
|
-
* Burns
|
|
38
|
-
*
|
|
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
|
|
41
|
-
* @param args.
|
|
42
|
-
* @param args.network - Solana network
|
|
43
|
-
* @returns
|
|
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
|
-
|
|
49
|
+
redeem(args: {
|
|
46
50
|
amount: string;
|
|
47
|
-
|
|
51
|
+
recipient: string;
|
|
48
52
|
network: string;
|
|
49
53
|
env?: Env;
|
|
50
|
-
|
|
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
|
}
|