@sodax/wallet-sdk-react 0.0.1-rc.3 → 0.0.1-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/dist/index.cjs +7 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/xchains/icon/IconXService.ts +3 -1
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { getPublicClient, getWalletClient } from 'wagmi/actions';
|
|
|
3
3
|
import { http, createConfig, useConnections, useAccount, useConnect, useConnectors, useDisconnect, usePublicClient, useWalletClient, useSwitchChain, WagmiProvider } from 'wagmi';
|
|
4
4
|
import { mainnet, lightlinkPhoenix, nibiru as nibiru$1, polygon as polygon$1, optimism as optimism$1, sonic as sonic$1, bsc as bsc$1, base as base$1, arbitrum as arbitrum$1, avalanche as avalanche$1 } from 'wagmi/chains';
|
|
5
5
|
import { LIGHTLINK_MAINNET_CHAIN_ID, HYPEREVM_MAINNET_CHAIN_ID, NIBIRU_MAINNET_CHAIN_ID, POLYGON_MAINNET_CHAIN_ID, OPTIMISM_MAINNET_CHAIN_ID, SONIC_MAINNET_CHAIN_ID, BSC_MAINNET_CHAIN_ID, BASE_MAINNET_CHAIN_ID, ARBITRUM_MAINNET_CHAIN_ID, AVALANCHE_MAINNET_CHAIN_ID } from '@sodax/types';
|
|
6
|
-
import
|
|
6
|
+
import * as IconSdkRaw from 'icon-sdk-js';
|
|
7
7
|
import { getNetworkEndpoints, Network } from '@injectivelabs/networks';
|
|
8
8
|
import { IndexerGrpcAccountPortfolioApi, ChainGrpcWasmApi, getInjectiveAddress } from '@injectivelabs/sdk-ts';
|
|
9
9
|
import { ChainId } from '@injectivelabs/ts-types';
|
|
@@ -428,6 +428,8 @@ var EvmXConnector = class extends XConnector {
|
|
|
428
428
|
return this.connector.icon;
|
|
429
429
|
}
|
|
430
430
|
};
|
|
431
|
+
var IconSdk = "default" in IconSdkRaw.default ? IconSdkRaw.default : IconSdkRaw;
|
|
432
|
+
var { IconService: IconServiceConstructor, Builder: IconBuilder, Converter: IconConverter } = IconSdk;
|
|
431
433
|
var CHAIN_INFO = {
|
|
432
434
|
[1 /* MAINNET */]: {
|
|
433
435
|
APIEndpoint: "https://ctz.solidwallet.io/api/v3"}
|
|
@@ -435,8 +437,8 @@ var CHAIN_INFO = {
|
|
|
435
437
|
var IconXService = class _IconXService extends XService {
|
|
436
438
|
constructor() {
|
|
437
439
|
super("ICON");
|
|
438
|
-
this.iconService = new
|
|
439
|
-
new
|
|
440
|
+
this.iconService = new IconServiceConstructor(
|
|
441
|
+
new IconServiceConstructor.HttpProvider(CHAIN_INFO[1 /* MAINNET */].APIEndpoint)
|
|
440
442
|
);
|
|
441
443
|
}
|
|
442
444
|
static getInstance() {
|
|
@@ -446,7 +448,7 @@ var IconXService = class _IconXService extends XService {
|
|
|
446
448
|
return _IconXService.instance;
|
|
447
449
|
}
|
|
448
450
|
async getAggregateData(requireSuccess, calls) {
|
|
449
|
-
const rawTx = new
|
|
451
|
+
const rawTx = new IconBuilder.CallBuilder().to("cxa4aa9185e23558cff990f494c1fd2845f6cbf741").method("tryAggregate").params({ requireSuccess: IconConverter.toHex(requireSuccess ? 1 : 0), calls }).build();
|
|
450
452
|
try {
|
|
451
453
|
const result = await this.iconService.call(rawTx).execute();
|
|
452
454
|
const aggs = result["returnData"];
|