@sodax/sdk 2.0.0-rc.2 → 2.0.0-rc.4
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 +8 -60
- package/dist/index.cjs +28 -39
- package/dist/index.d.cts +21 -108
- package/dist/index.d.ts +21 -108
- package/dist/index.mjs +34 -43
- package/package.json +22 -21
- package/ai-exported/AGENTS.md +0 -99
- package/ai-exported/integration/README.md +0 -41
- package/ai-exported/integration/ai-rules.md +0 -75
- package/ai-exported/integration/architecture.md +0 -519
- package/ai-exported/integration/chain-specifics.md +0 -189
- package/ai-exported/integration/features/README.md +0 -19
- package/ai-exported/integration/features/auxiliary-services.md +0 -189
- package/ai-exported/integration/features/bridge.md +0 -136
- package/ai-exported/integration/features/dex.md +0 -182
- package/ai-exported/integration/features/icx-bnusd-baln.md +0 -181
- package/ai-exported/integration/features/money-market.md +0 -198
- package/ai-exported/integration/features/staking.md +0 -166
- package/ai-exported/integration/features/swap.md +0 -207
- package/ai-exported/integration/quickstart.md +0 -213
- package/ai-exported/integration/recipes/README.md +0 -21
- package/ai-exported/integration/recipes/backend-server-init.md +0 -69
- package/ai-exported/integration/recipes/chain-key-narrowing.md +0 -65
- package/ai-exported/integration/recipes/gas-estimation.md +0 -33
- package/ai-exported/integration/recipes/initialize-sodax.md +0 -53
- package/ai-exported/integration/recipes/raw-tx-flow.md +0 -71
- package/ai-exported/integration/recipes/result-and-errors.md +0 -104
- package/ai-exported/integration/recipes/signed-tx-flow.md +0 -46
- package/ai-exported/integration/recipes/testing.md +0 -101
- package/ai-exported/integration/reference/README.md +0 -18
- package/ai-exported/integration/reference/chain-keys.md +0 -67
- package/ai-exported/integration/reference/error-codes.md +0 -165
- package/ai-exported/integration/reference/glossary.md +0 -32
- package/ai-exported/integration/reference/public-api.md +0 -138
- package/ai-exported/integration/reference/wallet-providers.md +0 -62
- package/ai-exported/migration/README.md +0 -58
- package/ai-exported/migration/ai-rules.md +0 -80
- package/ai-exported/migration/breaking-changes/architecture.md +0 -342
- package/ai-exported/migration/breaking-changes/result-and-errors.md +0 -363
- package/ai-exported/migration/breaking-changes/type-system.md +0 -321
- package/ai-exported/migration/checklist.md +0 -61
- package/ai-exported/migration/features/README.md +0 -35
- package/ai-exported/migration/features/auxiliary-services.md +0 -156
- package/ai-exported/migration/features/bridge.md +0 -125
- package/ai-exported/migration/features/dex.md +0 -143
- package/ai-exported/migration/features/icx-bnusd-baln.md +0 -151
- package/ai-exported/migration/features/money-market.md +0 -214
- package/ai-exported/migration/features/staking.md +0 -138
- package/ai-exported/migration/features/swap.md +0 -198
- package/ai-exported/migration/recipes.md +0 -288
- package/ai-exported/migration/reference/README.md +0 -18
- package/ai-exported/migration/reference/deleted-exports.md +0 -126
- package/ai-exported/migration/reference/error-code-crosswalk.md +0 -104
- package/ai-exported/migration/reference/return-shapes.md +0 -49
- package/ai-exported/migration/reference/sodax-config.md +0 -52
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -98,73 +98,21 @@ How to setup local development
|
|
|
98
98
|
|
|
99
99
|
## AI agent docs
|
|
100
100
|
|
|
101
|
-
`@sodax/sdk`
|
|
101
|
+
AI-readable docs for `@sodax/sdk` (and the other `@sodax/*` packages) are shipped via [`@sodax/skills`](https://github.com/icon-project/sodax-sdks/tree/main/packages/skills) — a separate npm package bundling Claude-Code SKILL.md files and a long-form knowledge tree.
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
**Recommended: [`skills` CLI](https://github.com/vercel-labs/skills)** — from your project root:
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
```
|
|
108
|
-
> Read node_modules/@sodax/sdk/ai-exported/AGENTS.md and integrate
|
|
109
|
-
> SODAX cross-chain swaps from Arbitrum to Stellar into my Node service.
|
|
110
|
-
|
|
111
|
-
> Read node_modules/@sodax/sdk/ai-exported/AGENTS.md. My code uses
|
|
112
|
-
> @sodax/sdk v1 — port my call sites to v2.
|
|
113
|
-
|
|
114
|
-
> Look up the v2 SodaxError code for a relay timeout in
|
|
115
|
-
> node_modules/@sodax/sdk/ai-exported/integration/reference/error-codes.md.
|
|
105
|
+
```bash
|
|
106
|
+
npx skills@latest add icon-project/sodax-sdks/packages/skills
|
|
116
107
|
```
|
|
117
108
|
|
|
118
|
-
|
|
109
|
+
**npm + `AGENTS.md` pointer** (fallback for web chats, or when you prefer a devDependency over the CLI):
|
|
119
110
|
|
|
111
|
+
```bash
|
|
112
|
+
pnpm add -D @sodax/skills
|
|
120
113
|
```
|
|
121
|
-
ai-exported/
|
|
122
|
-
├── AGENTS.md # Tool-neutral entry point — start here
|
|
123
|
-
├── integration/ # Building NEW v2 code
|
|
124
|
-
│ ├── README.md, ai-rules.md # Index + DO / DO NOT / workflow for agents
|
|
125
|
-
│ ├── quickstart.md # Install + initialize + first-run troubleshooting
|
|
126
|
-
│ ├── architecture.md # Type system + design concepts (Result, ChainKeys, …)
|
|
127
|
-
│ ├── chain-specifics.md # Non-EVM quirks (Stellar, BTC, Solana, ICON, NEAR)
|
|
128
|
-
│ ├── features/ # 7 feature pages: swap, money-market, staking, bridge,
|
|
129
|
-
│ │ # dex, icx-bnusd-baln, auxiliary-services
|
|
130
|
-
│ ├── recipes/ # 8 copy-pasteable patterns: init, signed-/raw-tx flow,
|
|
131
|
-
│ │ # error handling, narrowing, testing, gas, backend init
|
|
132
|
-
│ └── reference/ # 5 lookup tables: chain keys, wallet providers,
|
|
133
|
-
│ # error codes, public API surface, glossary
|
|
134
|
-
└── migration/ # Porting EXISTING v1 code to v2
|
|
135
|
-
├── README.md, ai-rules.md # Index + workflow for porting agents
|
|
136
|
-
├── checklist.md # 17-step cross-cutting checklist
|
|
137
|
-
├── breaking-changes/ # 3 cross-cutting changes: type-system, architecture,
|
|
138
|
-
│ # result-and-errors
|
|
139
|
-
├── features/ # 7 per-feature porting playbooks (same names as
|
|
140
|
-
│ # integration/features/)
|
|
141
|
-
├── recipes.md # Codemods + error-shape and Result adapters
|
|
142
|
-
└── reference/ # 4 reference tables: deleted exports, sodax-config
|
|
143
|
-
# reshape, error-code crosswalk, return-shape diffs
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Scope
|
|
147
|
-
|
|
148
|
-
This tree documents `@sodax/sdk` (the Core SDK) only. It assumes:
|
|
149
|
-
|
|
150
|
-
- **TypeScript** — examples are TS; the SDK ships dual ESM/CJS.
|
|
151
|
-
- **Runtime-agnostic** — Node.js, browsers, bundled apps. **No React or Next.js content** — the SDK is UI-framework-agnostic and the docs reflect that.
|
|
152
|
-
- **`@sodax/types` is re-exported** through `@sodax/sdk`'s barrel; consumers don't add it as a separate dependency.
|
|
153
|
-
|
|
154
|
-
`@sodax/wallet-sdk-core` is **mentioned** in a few places as a pointer — it's a separate SODAX package that ships ready-made `I*WalletProvider` implementations for all 9 chain families. Consumers can install it separately or implement the wallet-provider interfaces themselves. React-layer packages (`@sodax/wallet-sdk-react`, `@sodax/dapp-kit`) are **out of scope here** and may have their own `ai-exported/` trees in their respective packages.
|
|
155
|
-
|
|
156
|
-
### Integrity guarantees
|
|
157
|
-
|
|
158
|
-
Every release passes four CI checks against `ai-exported/`:
|
|
159
|
-
|
|
160
|
-
| Guard | What it catches |
|
|
161
|
-
|---|---|
|
|
162
|
-
| `check:ai-exported` | Each top-level `sodax.X` reference matches a real public member of the `Sodax` class in `src/shared/entities/Sodax.ts`. (Shallow — `sodax.partners.invented` would still pass.) |
|
|
163
|
-
| `check:ai-scope` | No accidental sibling-package, React, or Next.js content leaks in. |
|
|
164
|
-
| `check:ai-links` | Every relative link between markdown files resolves. |
|
|
165
|
-
| `check:ai-imports` | Every `import … from '@sodax/sdk'` example in the docs typechecks against the SDK source. |
|
|
166
114
|
|
|
167
|
-
|
|
115
|
+
Then point your agent at `node_modules/@sodax/skills/AGENTS.md`. See [docs/ai-integration-guide.md](https://github.com/icon-project/sodax-sdks/blob/main/docs/ai-integration-guide.md) for all install modes and per-tool wiring.
|
|
168
116
|
|
|
169
117
|
***
|
|
170
118
|
|
package/dist/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@ var transactions = require('@stacks/transactions');
|
|
|
8
8
|
var chains = require('viem/chains');
|
|
9
9
|
var rlp = require('rlp');
|
|
10
10
|
var network = require('@stacks/network');
|
|
11
|
-
var
|
|
11
|
+
var bitcoinjsLib = require('bitcoinjs-lib');
|
|
12
12
|
var ecc = require('@bitcoinerlab/secp256k1');
|
|
13
13
|
var infinitySdk = require('@pancakeswap/infinity-sdk');
|
|
14
14
|
var transactions$1 = require('@mysten/sui/transactions');
|
|
@@ -44,9 +44,7 @@ function _interopNamespace(e) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
var rlp__namespace = /*#__PURE__*/_interopNamespace(rlp);
|
|
47
|
-
var bitcoin__namespace = /*#__PURE__*/_interopNamespace(bitcoin);
|
|
48
47
|
var ecc__namespace = /*#__PURE__*/_interopNamespace(ecc);
|
|
49
|
-
var anchor__namespace = /*#__PURE__*/_interopNamespace(anchor);
|
|
50
48
|
var BN__default = /*#__PURE__*/_interopDefault(BN);
|
|
51
49
|
var IconSdkRaw__namespace = /*#__PURE__*/_interopNamespace(IconSdkRaw);
|
|
52
50
|
var BigNumber5__default = /*#__PURE__*/_interopDefault(BigNumber5);
|
|
@@ -518,7 +516,7 @@ var SodaTokens = {
|
|
|
518
516
|
sodaNEAR: {
|
|
519
517
|
symbol: "sodaNEAR",
|
|
520
518
|
name: "SODA NEAR",
|
|
521
|
-
decimals:
|
|
519
|
+
decimals: 18,
|
|
522
520
|
address: "0xf4ba497c9b805e4bd88a8a9e6a7b8f74984c3e39",
|
|
523
521
|
chainKey: ChainKeys.SONIC_MAINNET,
|
|
524
522
|
hubAsset: "0xf4ba497c9b805e4bd88a8a9e6a7b8f74984c3e39",
|
|
@@ -3233,7 +3231,8 @@ var moneyMarketSupportedTokens = {
|
|
|
3233
3231
|
spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.HYPE,
|
|
3234
3232
|
spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.bnUSD,
|
|
3235
3233
|
spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.SODA,
|
|
3236
|
-
spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.USDT0
|
|
3234
|
+
spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.USDT0,
|
|
3235
|
+
spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.USDC
|
|
3237
3236
|
],
|
|
3238
3237
|
[ChainKeys.LIGHTLINK_MAINNET]: [
|
|
3239
3238
|
spokeChainConfig[ChainKeys.LIGHTLINK_MAINNET].supportedTokens.ETH,
|
|
@@ -3517,7 +3516,6 @@ var swapSupportedTokens = {
|
|
|
3517
3516
|
spokeChainConfig[ChainKeys.SONIC_MAINNET].supportedTokens.USDT,
|
|
3518
3517
|
spokeChainConfig[ChainKeys.SONIC_MAINNET].supportedTokens.wS,
|
|
3519
3518
|
spokeChainConfig[ChainKeys.SONIC_MAINNET].supportedTokens.SODA,
|
|
3520
|
-
spokeChainConfig[ChainKeys.SONIC_MAINNET].supportedTokens.bnUSD,
|
|
3521
3519
|
...Object.values(SodaTokens)
|
|
3522
3520
|
],
|
|
3523
3521
|
[ChainKeys.AVALANCHE_MAINNET]: [
|
|
@@ -3899,7 +3897,7 @@ function isValidWalletProviderForChainKey(chainKey, walletProvider) {
|
|
|
3899
3897
|
}
|
|
3900
3898
|
|
|
3901
3899
|
// ../types/dist/index.js
|
|
3902
|
-
var CONFIG_VERSION =
|
|
3900
|
+
var CONFIG_VERSION = 202;
|
|
3903
3901
|
function isEvmSpokeChainConfig(value) {
|
|
3904
3902
|
return typeof value === "object" && value !== null && value.chain.type === "EVM" && value.chain.key !== HUB_CHAIN_KEY;
|
|
3905
3903
|
}
|
|
@@ -14700,7 +14698,7 @@ function normalizePsbtToBase64(signedPsbt) {
|
|
|
14700
14698
|
}
|
|
14701
14699
|
|
|
14702
14700
|
// src/shared/services/spoke/BitcoinSpokeService.ts
|
|
14703
|
-
|
|
14701
|
+
bitcoinjsLib.initEccLib(ecc__namespace);
|
|
14704
14702
|
var BITCOIN_DEFAULT_FEE_RATE = 3;
|
|
14705
14703
|
var DUST_THRESHOLD = 546;
|
|
14706
14704
|
var BitcoinSpokeService = class {
|
|
@@ -14720,7 +14718,7 @@ var BitcoinSpokeService = class {
|
|
|
14720
14718
|
this.maxTimeoutMs = chainConfig.pollingConfig.maxTimeoutMs;
|
|
14721
14719
|
}
|
|
14722
14720
|
getBtcNetwork(chainId) {
|
|
14723
|
-
return this.config.getChainConfig(chainId).network === "MAINNET" ?
|
|
14721
|
+
return this.config.getChainConfig(chainId).network === "MAINNET" ? bitcoinjsLib.networks.bitcoin : bitcoinjsLib.networks.testnet;
|
|
14724
14722
|
}
|
|
14725
14723
|
async getBalance(tokenAddress, walletAddress) {
|
|
14726
14724
|
if (!tokenAddress || tokenAddress === "0x" || tokenAddress === "BTC") {
|
|
@@ -14732,7 +14730,7 @@ var BitcoinSpokeService = class {
|
|
|
14732
14730
|
}
|
|
14733
14731
|
async fetchScriptPubKey(utxo) {
|
|
14734
14732
|
const txHex = await this.fetchRawTransaction(utxo.txid);
|
|
14735
|
-
const tx =
|
|
14733
|
+
const tx = bitcoinjsLib.Transaction.fromHex(txHex);
|
|
14736
14734
|
const out = tx.outs[utxo.vout];
|
|
14737
14735
|
if (!out) {
|
|
14738
14736
|
throw new Error(`UTXO not found: ${utxo.txid}:${utxo.vout}`);
|
|
@@ -14834,7 +14832,7 @@ var BitcoinSpokeService = class {
|
|
|
14834
14832
|
* Build a priority Bitcoin transaction with proper fee calculation
|
|
14835
14833
|
*/
|
|
14836
14834
|
async buildBitcoinTransaction(utxos, outputs, changeAddress, chainId, walletProvider, feeRate) {
|
|
14837
|
-
const psbt = new
|
|
14835
|
+
const psbt = new bitcoinjsLib.Psbt({ network: this.getBtcNetwork(chainId) });
|
|
14838
14836
|
const effectiveFeeRate = feeRate ?? await this.getFeeRateEstimate();
|
|
14839
14837
|
const walletAddress = await walletProvider.getWalletAddress();
|
|
14840
14838
|
const addressType = detectBitcoinAddressType(walletAddress);
|
|
@@ -14865,7 +14863,7 @@ var BitcoinSpokeService = class {
|
|
|
14865
14863
|
throw new Error("Missing public key for P2SH-P2WPKH input");
|
|
14866
14864
|
}
|
|
14867
14865
|
const pubKeyHex = await walletProvider.getPublicKey();
|
|
14868
|
-
const redeemScript =
|
|
14866
|
+
const redeemScript = bitcoinjsLib.payments.p2wpkh({
|
|
14869
14867
|
pubkey: Buffer.from(pubKeyHex, "hex"),
|
|
14870
14868
|
network: this.getBtcNetwork(chainId)
|
|
14871
14869
|
}).output;
|
|
@@ -15022,14 +15020,14 @@ var BitcoinSpokeService = class {
|
|
|
15022
15020
|
const psbt = await this.buildBitcoinTransaction(utxos, outputs, walletAddress, srcChainKey, walletProvider);
|
|
15023
15021
|
const OP_RADFI_SODAX_DATA = 49;
|
|
15024
15022
|
const payload = Buffer.concat([Buffer.from([OP_RADFI_SODAX_DATA]), Buffer.from(data.slice(2), "hex")]);
|
|
15025
|
-
const OP_RETURN =
|
|
15026
|
-
const OP_12 =
|
|
15023
|
+
const OP_RETURN = bitcoinjsLib.opcodes.OP_RETURN;
|
|
15024
|
+
const OP_12 = bitcoinjsLib.opcodes.OP_12;
|
|
15027
15025
|
if (OP_RETURN === void 0 || OP_12 === void 0) {
|
|
15028
15026
|
throw new Error("bitcoinjs-lib opcodes OP_RETURN or OP_12 are undefined");
|
|
15029
15027
|
}
|
|
15030
|
-
const
|
|
15028
|
+
const compiledScript = bitcoinjsLib.script.compile([OP_RETURN, OP_12, payload]);
|
|
15031
15029
|
psbt.addOutput({
|
|
15032
|
-
script:
|
|
15030
|
+
script: compiledScript,
|
|
15033
15031
|
value: 0
|
|
15034
15032
|
});
|
|
15035
15033
|
return psbt;
|
|
@@ -21631,7 +21629,7 @@ var SonicSpokeService = class {
|
|
|
21631
21629
|
}
|
|
21632
21630
|
/**
|
|
21633
21631
|
* Deposit tokens to the spoke chain using the Sonic wallet abstraction.
|
|
21634
|
-
* @param {
|
|
21632
|
+
* @param {DepositParams<SonicChainKey, Raw>} params - The parameters for the deposit
|
|
21635
21633
|
* @returns {Promise<TxReturnType<SonicChainKey, Raw>>} A promise that resolves to the transaction hash
|
|
21636
21634
|
*/
|
|
21637
21635
|
async deposit(params) {
|
|
@@ -21860,9 +21858,6 @@ var SuiSpokeService = class {
|
|
|
21860
21858
|
}
|
|
21861
21859
|
return coin;
|
|
21862
21860
|
}
|
|
21863
|
-
static getAddressBCSBytes(suiaddress) {
|
|
21864
|
-
return viem.toHex(bcs.bcs.Address.serialize(suiaddress).toBytes());
|
|
21865
|
-
}
|
|
21866
21861
|
encodeSimulationParams(token, assetManager) {
|
|
21867
21862
|
const encoder2 = new TextEncoder();
|
|
21868
21863
|
return {
|
|
@@ -21977,8 +21972,7 @@ var SuiSpokeService = class {
|
|
|
21977
21972
|
}
|
|
21978
21973
|
/**
|
|
21979
21974
|
* Get the balance of the token in the spoke chain.
|
|
21980
|
-
* @param {
|
|
21981
|
-
* @param {SuiSpokeProvider} spokeProvider - The spoke provider.
|
|
21975
|
+
* @param {GetDepositParams<SuiChainKey>} params - The src chain key, src address, and token address.
|
|
21982
21976
|
* @returns {Promise<bigint>} The balance of the token.
|
|
21983
21977
|
*/
|
|
21984
21978
|
async getDeposit(params) {
|
|
@@ -22002,7 +21996,7 @@ var SuiSpokeService = class {
|
|
|
22002
21996
|
}
|
|
22003
21997
|
/**
|
|
22004
21998
|
* Fetch the asset manager config from the spoke chain.
|
|
22005
|
-
* @param {
|
|
21999
|
+
* @param {SuiChainKey} chainId - The Sui chain key.
|
|
22006
22000
|
* @returns {Promise<string>} The asset manager config.
|
|
22007
22001
|
*/
|
|
22008
22002
|
async fetchAssetManagerAddress(chainId) {
|
|
@@ -22011,7 +22005,7 @@ var SuiSpokeService = class {
|
|
|
22011
22005
|
}
|
|
22012
22006
|
/**
|
|
22013
22007
|
* Fetch the latest asset manager package id from the spoke chain.
|
|
22014
|
-
* @param {
|
|
22008
|
+
* @param {SuiChainKey} chainId - The Sui chain key.
|
|
22015
22009
|
* @returns {Promise<string>} The latest asset manager package id.
|
|
22016
22010
|
*/
|
|
22017
22011
|
async fetchLatestAssetManagerPackageId(chainId) {
|
|
@@ -22625,11 +22619,11 @@ async function getProvider(base58PublicKey, rpcUrl) {
|
|
|
22625
22619
|
signAllTransactions: () => Promise.reject()
|
|
22626
22620
|
};
|
|
22627
22621
|
const connection = new web3_js.Connection(rpcUrl);
|
|
22628
|
-
return new
|
|
22622
|
+
return new anchor.AnchorProvider(connection, wallet, { commitment: "confirmed" });
|
|
22629
22623
|
}
|
|
22630
22624
|
async function getAssetManagerIdl(assetManager, provider) {
|
|
22631
22625
|
try {
|
|
22632
|
-
const idl = await
|
|
22626
|
+
const idl = await anchor.Program.fetchIdl(new web3_js.PublicKey(assetManager), provider);
|
|
22633
22627
|
if (!idl) {
|
|
22634
22628
|
throw new Error("asset manager idl not available");
|
|
22635
22629
|
}
|
|
@@ -22641,7 +22635,7 @@ async function getAssetManagerIdl(assetManager, provider) {
|
|
|
22641
22635
|
}
|
|
22642
22636
|
async function getConnectionIdl(connection, provider) {
|
|
22643
22637
|
try {
|
|
22644
|
-
const idl = await
|
|
22638
|
+
const idl = await anchor.Program.fetchIdl(new web3_js.PublicKey(connection), provider);
|
|
22645
22639
|
if (!idl) {
|
|
22646
22640
|
throw new Error("asset manager idl not available");
|
|
22647
22641
|
}
|
|
@@ -22654,12 +22648,12 @@ async function getConnectionIdl(connection, provider) {
|
|
|
22654
22648
|
async function getAssetManagerProgram(base58PublicKey, rpcUrl, assetManager) {
|
|
22655
22649
|
const provider = await getProvider(base58PublicKey, rpcUrl);
|
|
22656
22650
|
const idl = await getAssetManagerIdl(assetManager, provider);
|
|
22657
|
-
return new
|
|
22651
|
+
return new anchor.Program(idl, provider);
|
|
22658
22652
|
}
|
|
22659
22653
|
async function getConnectionProgram(base58PublicKey, rpcUrl, connection) {
|
|
22660
22654
|
const provider = await getProvider(base58PublicKey, rpcUrl);
|
|
22661
22655
|
const idl = await getConnectionIdl(connection, provider);
|
|
22662
|
-
return new
|
|
22656
|
+
return new anchor.Program(idl, provider);
|
|
22663
22657
|
}
|
|
22664
22658
|
function getSolanaAddressBytes(address) {
|
|
22665
22659
|
return `0x${Buffer.from(address.toBytes()).toString("hex")}`;
|
|
@@ -22971,7 +22965,7 @@ var IconSpokeService = class {
|
|
|
22971
22965
|
}
|
|
22972
22966
|
/**
|
|
22973
22967
|
* Deposit tokens to the spoke chain.
|
|
22974
|
-
* @param {
|
|
22968
|
+
* @param {DepositParams<IconChainKey, R>} params - The parameters for the deposit
|
|
22975
22969
|
* @param {IconSpokeProviderType} spokeProvider - The provider for the spoke chain
|
|
22976
22970
|
* @param {EvmHubProvider} hubProvider - The provider for the hub chain
|
|
22977
22971
|
* @param {boolean} raw - The return type raw or just transaction hash
|
|
@@ -28051,7 +28045,7 @@ var MigrationService = class {
|
|
|
28051
28045
|
);
|
|
28052
28046
|
const hubWalletAddress = await this.hubProvider.getUserHubWalletAddress(
|
|
28053
28047
|
params.srcAddress,
|
|
28054
|
-
ChainKeys.
|
|
28048
|
+
ChainKeys.ICON_MAINNET
|
|
28055
28049
|
);
|
|
28056
28050
|
const coreParams = {
|
|
28057
28051
|
srcChainKey: ChainKeys.ICON_MAINNET,
|
|
@@ -29151,11 +29145,7 @@ var BridgeService = class {
|
|
|
29151
29145
|
* checking theoretical bridgeability without requiring both chains to be in the active config.
|
|
29152
29146
|
* @returns `true` if the tokens share the same hub vault; `false` otherwise.
|
|
29153
29147
|
*/
|
|
29154
|
-
isBridgeable({
|
|
29155
|
-
from,
|
|
29156
|
-
to,
|
|
29157
|
-
unchecked = false
|
|
29158
|
-
}) {
|
|
29148
|
+
isBridgeable({ from, to, unchecked = false }) {
|
|
29159
29149
|
try {
|
|
29160
29150
|
if (!unchecked) {
|
|
29161
29151
|
bridgeInvariant(this.config.isValidSpokeChainKey(from.chainKey), `Invalid spoke chain (${from.chainKey})`, {
|
|
@@ -34349,7 +34339,8 @@ var UiPoolDataProviderService = class {
|
|
|
34349
34339
|
// The borrow index must also come from the bnUSD debt token.
|
|
34350
34340
|
// User debt is stored scaled by bnUSD's index, so reading it back requires the same index.
|
|
34351
34341
|
// Using the vault's index here would inflate the displayed debt amount.
|
|
34352
|
-
variableBorrowIndex: bnUSDReserve.variableBorrowIndex
|
|
34342
|
+
variableBorrowIndex: bnUSDReserve.variableBorrowIndex,
|
|
34343
|
+
borrowingEnabled: bnUSDReserve.borrowingEnabled
|
|
34353
34344
|
};
|
|
34354
34345
|
return [
|
|
34355
34346
|
[
|
|
@@ -37135,5 +37126,3 @@ exports.waitForTransactionReceipt = waitForTransactionReceipt;
|
|
|
37135
37126
|
exports.waitUntilIntentExecuted = waitUntilIntentExecuted;
|
|
37136
37127
|
exports.walletFactoryAbi = walletFactoryAbi;
|
|
37137
37128
|
exports.wrappedSonicAbi = wrappedSonicAbi;
|
|
37138
|
-
//# sourceMappingURL=index.cjs.map
|
|
37139
|
-
//# sourceMappingURL=index.cjs.map
|