@lombard.finance/sdk 3.5.8 → 3.5.10
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
|
@@ -35,7 +35,10 @@
|
|
|
35
35
|
"./clients/*": "./src/clients/*.ts",
|
|
36
36
|
"./utils/*": "./src/utils/*.ts"
|
|
37
37
|
},
|
|
38
|
-
"files": [
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"src"
|
|
41
|
+
],
|
|
39
42
|
"license": "MIT",
|
|
40
43
|
"name": "@lombard.finance/sdk",
|
|
41
44
|
"peerDependencies": {
|
|
@@ -56,5 +59,5 @@
|
|
|
56
59
|
},
|
|
57
60
|
"type": "module",
|
|
58
61
|
"types": "./src/index.ts",
|
|
59
|
-
"version": "3.5.
|
|
60
|
-
}
|
|
62
|
+
"version": "3.5.10"
|
|
63
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { getApiConfig } from '../../common/api-config';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
BlockchainIdentifier,
|
|
5
|
+
getChainNameById,
|
|
6
|
+
} from '../../common/blockchain-identifier';
|
|
4
7
|
import type { ChainId, SolanaChain, SuiChain } from '../../common/chains';
|
|
5
8
|
import type { IEnvParam } from '../../common/parameters';
|
|
6
9
|
import {
|
|
@@ -60,7 +63,7 @@ export interface IGenerateDepositBtcAddressParams extends IEnvParam {
|
|
|
60
63
|
signatureData?: string;
|
|
61
64
|
}
|
|
62
65
|
|
|
63
|
-
const EXTRA_PARAMS_TOKENS = [Token.BTCK];
|
|
66
|
+
const EXTRA_PARAMS_TOKENS = [Token.LBTC, Token.BTCK];
|
|
64
67
|
const SUPPORTED_TOKENS = [Token.LBTC, Token.BTCK];
|
|
65
68
|
|
|
66
69
|
/**
|
|
@@ -128,7 +131,17 @@ export async function generateDepositBtcAddress({
|
|
|
128
131
|
*/
|
|
129
132
|
let tokenDataParams = {};
|
|
130
133
|
try {
|
|
131
|
-
if (
|
|
134
|
+
if (
|
|
135
|
+
EXTRA_PARAMS_TOKENS.includes(token) &&
|
|
136
|
+
// FIXME: Refactor in order to pull in all token addresses from all supported networks to the sdk-common package.
|
|
137
|
+
// FIXME: Then remove this clause prior two token model.
|
|
138
|
+
!(
|
|
139
|
+
[
|
|
140
|
+
BlockchainIdentifier.sui,
|
|
141
|
+
BlockchainIdentifier.solana,
|
|
142
|
+
] as BlockchainIdentifier[]
|
|
143
|
+
).includes(toChain)
|
|
144
|
+
) {
|
|
132
145
|
const tokenContractInfo = getTokenContractInfo(
|
|
133
146
|
token,
|
|
134
147
|
chainId as ChainId,
|
|
@@ -136,7 +149,6 @@ export async function generateDepositBtcAddress({
|
|
|
136
149
|
);
|
|
137
150
|
tokenDataParams = {
|
|
138
151
|
token_address: tokenContractInfo.address,
|
|
139
|
-
aux_version: 1,
|
|
140
152
|
};
|
|
141
153
|
}
|
|
142
154
|
} catch (err) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
+
import { Address } from 'viem';
|
|
2
3
|
import { getApiConfig } from '../common/api-config';
|
|
3
4
|
import { IEnvParam } from '../common/parameters';
|
|
4
|
-
import { Address } from 'viem';
|
|
5
5
|
|
|
6
6
|
type Response = {
|
|
7
7
|
type: 'BALANCE_TYPE_DEFI';
|
|
@@ -18,12 +18,11 @@ type Response = {
|
|
|
18
18
|
*/
|
|
19
19
|
export async function getRewardsInfo({
|
|
20
20
|
account,
|
|
21
|
-
partnerId,
|
|
22
21
|
env,
|
|
23
|
-
}: { account: Address
|
|
22
|
+
}: { account: Address } & IEnvParam) {
|
|
24
23
|
const { baseApiUrl } = getApiConfig(env);
|
|
25
24
|
|
|
26
|
-
const url = `${baseApiUrl}/api/v1/rewards/${account}
|
|
25
|
+
const url = `${baseApiUrl}/api/v1/rewards/${account}`;
|
|
27
26
|
const { data } = await axios.get<Response>(url);
|
|
28
27
|
|
|
29
28
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Env } from '@lombard.finance/sdk-common';
|
|
1
2
|
import { Address } from 'viem';
|
|
2
3
|
import { ChainId } from '../common/chains';
|
|
3
|
-
import { Env } from '@lombard.finance/sdk-common';
|
|
4
4
|
|
|
5
5
|
export enum Token {
|
|
6
6
|
LBTC = 'LBTC',
|
|
@@ -63,6 +63,13 @@ export const TOKEN_ADDRESSES: TokenAddresses = {
|
|
|
63
63
|
},
|
|
64
64
|
[Env.dev]: {
|
|
65
65
|
// https://github.com/lombard-finance/smart-contracts/blob/2-token-model/devnet-bft.json
|
|
66
|
+
[ChainId.sepolia]: '0xc47e4b3124597FDF8DD07843D4a7052F2eE80C30',
|
|
67
|
+
[ChainId.baseSepoliaTestnet]:
|
|
68
|
+
'0xc47e4b3124597FDF8DD07843D4a7052F2eE80C30',
|
|
69
|
+
[ChainId.berachainBartioTestnet]:
|
|
70
|
+
'0xc47e4b3124597FDF8DD07843D4a7052F2eE80C30',
|
|
71
|
+
[ChainId.binanceSmartChainTestnet]:
|
|
72
|
+
'0xc47e4b3124597FDF8DD07843D4a7052F2eE80C30',
|
|
66
73
|
[ChainId.katanaTatara]: '0xc47e4b3124597FDF8DD07843D4a7052F2eE80C30',
|
|
67
74
|
},
|
|
68
75
|
},
|