@lombard.finance/sdk-solana 2.0.1 → 2.0.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/dist/index.cjs +1 -1
- package/dist/index.js +23 -22
- package/dist/index2.cjs +47 -47
- package/dist/index2.js +6103 -6029
- package/dist/sendBridgeTransaction.cjs +1 -1
- package/dist/sendBridgeTransaction.js +19 -19
- package/package.json +1 -1
- package/src/bridge/sendBridgeTransaction.ts +2 -2
- package/src/const/__tests__/rpcUrls.test.ts +73 -0
- package/src/const/errors.ts +0 -1
- package/src/const/getConfig.ts +30 -15
- package/src/const/rpcUrls.ts +53 -7
- package/src/idl/asset_router.json +182 -1532
- package/src/idl/bridge.json +139 -1185
- package/src/idl/consortium.json +62 -498
- package/src/idl/getAssetRouterIdl.ts +1 -3
- package/src/idl/getConsortiumIdl.ts +1 -3
- package/src/idl/getLbtcIdl.ts +4 -1
- package/src/idl/getMailboxIdl.ts +1 -3
- package/src/idl/lombard_token_pool.json +92 -932
- package/src/idl/mailbox.json +114 -1018
- package/src/idl/ratio_oracle.json +35 -332
- package/src/services/SolanaServiceImpl.test.ts +5 -4
- package/src/stories/components/ConnectButton/ConnectButton.tsx +2 -2
- package/src/stories/components/NetworkSelector/NetworkSelector.tsx +1 -1
- package/src/stories/components/OutputSelector/OutputSelector.tsx +4 -4
- package/src/stories/components/SelectField/SelectField.tsx +2 -3
- package/src/stories/hooks/useFetchOutputs.ts +1 -1
- package/src/stories/utils/fromCamelCase.ts +1 -1
- package/src/types/sdkTypes.ts +7 -0
- package/src/utils/createDebugLogger.ts +1 -1
- package/src/web3Sdk/claimToken/claimBtcb.ts +19 -5
- package/src/web3Sdk/claimToken/claimLbtcGmp.ts +55 -25
- package/src/web3Sdk/claimToken/claimToken.stories.tsx +4 -3
- package/src/web3Sdk/claimToken/claimToken.ts +16 -6
- package/src/web3Sdk/claimToken/shared.ts +18 -12
- package/src/web3Sdk/claimToken/utils/__tests__/signatureUtils.test.ts +10 -4
- package/src/web3Sdk/claimToken/utils/signatureUtils.ts +3 -1
- package/src/web3Sdk/deposit/deposit.stories.tsx +1 -4
- package/src/web3Sdk/deposit/deposit.test.ts +67 -37
- package/src/web3Sdk/deposit/deposit.ts +14 -14
- package/src/web3Sdk/detectWallet/detectWallet.test.ts +2 -2
- package/src/web3Sdk/getBalance/getBalance.test.ts +1 -1
- package/src/web3Sdk/getBalance/getBalance.ts +2 -1
- package/src/web3Sdk/getTokenFeeConfig/getTokenFeeConfig.stories.tsx +8 -18
- package/src/web3Sdk/getTokenFeeConfig/getTokenFeeConfig.ts +2 -4
- package/src/web3Sdk/redeem/redeem.stories.tsx +17 -8
- package/src/web3Sdk/redeem/redeem.test.ts +45 -13
- package/src/web3Sdk/redeem/redeem.ts +46 -20
- package/src/web3Sdk/redeemToken/redeemBtcb.ts +28 -12
- package/src/web3Sdk/redeemToken/redeemForBtc.stories.tsx +6 -6
- package/src/web3Sdk/redeemToken/redeemForBtc.test.ts +43 -13
- package/src/web3Sdk/redeemToken/redeemForBtc.ts +27 -14
- package/src/web3Sdk/redeemToken/redeemLbtc.ts +28 -12
- package/src/web3Sdk/redeemToken/shared.test.ts +6 -2
- package/src/web3Sdk/redeemToken/shared.ts +1 -3
|
@@ -7,9 +7,7 @@ import assetRouterIdl from './asset_router.json';
|
|
|
7
7
|
export const getAssetRouterIdl = (env: Env): Idl => {
|
|
8
8
|
const config = getConfig(env);
|
|
9
9
|
if (!config.assetRouter) {
|
|
10
|
-
throw new Error(
|
|
11
|
-
`Asset Router program not configured for env: ${env}`,
|
|
12
|
-
);
|
|
10
|
+
throw new Error(`Asset Router program not configured for env: ${env}`);
|
|
13
11
|
}
|
|
14
12
|
const programIdl = { ...assetRouterIdl } as unknown as Idl;
|
|
15
13
|
programIdl.address = config.assetRouter;
|
|
@@ -7,9 +7,7 @@ import consortiumIdl from './consortium.json';
|
|
|
7
7
|
export const getConsortiumIdl = (env: Env): Idl => {
|
|
8
8
|
const config = getConfig(env);
|
|
9
9
|
if (!config.consortium) {
|
|
10
|
-
throw new Error(
|
|
11
|
-
`Consortium program not configured for env: ${env}`,
|
|
12
|
-
);
|
|
10
|
+
throw new Error(`Consortium program not configured for env: ${env}`);
|
|
13
11
|
}
|
|
14
12
|
const programIdl = { ...consortiumIdl } as unknown as Idl;
|
|
15
13
|
programIdl.address = config.consortium;
|
package/src/idl/getLbtcIdl.ts
CHANGED
|
@@ -5,6 +5,9 @@ import lbtcIdl from './lbtc.json';
|
|
|
5
5
|
|
|
6
6
|
export const getLbtcIdl = (network: SolanaNetwork) => {
|
|
7
7
|
const config = getConfig(networkToEnv[network]);
|
|
8
|
-
const programIdl = {
|
|
8
|
+
const programIdl = {
|
|
9
|
+
...lbtcIdl,
|
|
10
|
+
address: config.lbtcProgramId,
|
|
11
|
+
} as unknown as Lbtc;
|
|
9
12
|
return programIdl;
|
|
10
13
|
};
|
package/src/idl/getMailboxIdl.ts
CHANGED
|
@@ -7,9 +7,7 @@ import mailboxIdl from './mailbox.json';
|
|
|
7
7
|
export const getMailboxIdl = (env: Env): Idl => {
|
|
8
8
|
const config = getConfig(env);
|
|
9
9
|
if (!config.mailbox) {
|
|
10
|
-
throw new Error(
|
|
11
|
-
`Mailbox program not configured for env: ${env}`,
|
|
12
|
-
);
|
|
10
|
+
throw new Error(`Mailbox program not configured for env: ${env}`);
|
|
13
11
|
}
|
|
14
12
|
const programIdl = { ...mailboxIdl } as unknown as Idl;
|
|
15
13
|
programIdl.address = config.mailbox;
|