example-js-sdk 0.0.6 → 0.0.7
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 +134 -52
- package/lib/OrbixSDK.d.ts +145 -0
- package/lib/{CarbonSDK.js → OrbixSDK.js} +52 -52
- package/lib/clients/ETHClient.d.ts +10 -10
- package/lib/clients/ETHClient.js +4 -4
- package/lib/clients/{CarbonQueryClient.d.ts → OrbixQueryClient.d.ts} +4 -4
- package/lib/clients/{CarbonQueryClient.js → OrbixQueryClient.js} +2 -2
- package/lib/clients/TokenClient.d.ts +26 -26
- package/lib/clients/TokenClient.js +5 -5
- package/lib/clients/index.d.ts +1 -1
- package/lib/clients/index.js +3 -3
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.js +253 -253
- package/lib/constant/eip712.d.ts +1 -1
- package/lib/constant/eip712.js +3 -3
- package/lib/constant/generic.d.ts +1 -1
- package/lib/constant/generic.js +2 -2
- package/lib/constant/ibc.d.ts +0 -1
- package/lib/constant/ibc.js +0 -32
- package/lib/constant/network.d.ts +2 -2
- package/lib/constant/network.js +3 -3
- package/lib/constant/node.js +2 -74
- package/lib/constant/web3Config.d.ts +5 -5
- package/lib/constant/web3Config.js +18 -22
- package/lib/index.d.ts +3 -3
- package/lib/index.js +7 -7
- package/lib/insights/balance.d.ts +2 -2
- package/lib/modules/admin.d.ts +23 -23
- package/lib/modules/admin.js +43 -43
- package/lib/modules/alliance.d.ts +6 -6
- package/lib/modules/alliance.js +5 -5
- package/lib/modules/bank.d.ts +2 -2
- package/lib/modules/bank.js +1 -1
- package/lib/modules/base.d.ts +4 -4
- package/lib/modules/bridge.d.ts +3 -3
- package/lib/modules/bridge.js +5 -5
- package/lib/modules/broker.d.ts +3 -3
- package/lib/modules/broker.js +2 -2
- package/lib/modules/coin.d.ts +8 -8
- package/lib/modules/coin.js +7 -7
- package/lib/modules/evm.d.ts +2 -2
- package/lib/modules/evm.js +1 -1
- package/lib/modules/evmmerge.d.ts +2 -2
- package/lib/modules/evmmerge.js +3 -3
- package/lib/modules/gov.d.ts +4 -4
- package/lib/modules/gov.js +3 -3
- package/lib/modules/grant.d.ts +4 -4
- package/lib/modules/grant.js +6 -6
- package/lib/modules/ibc.d.ts +3 -3
- package/lib/modules/ibc.js +2 -2
- package/lib/modules/leverage.d.ts +3 -3
- package/lib/modules/leverage.js +2 -2
- package/lib/modules/market.d.ts +15 -15
- package/lib/modules/market.js +7 -7
- package/lib/modules/order.d.ts +8 -8
- package/lib/modules/order.js +7 -7
- package/lib/modules/perpspool.d.ts +14 -14
- package/lib/modules/perpspool.js +23 -23
- package/lib/modules/position.d.ts +3 -3
- package/lib/modules/position.js +2 -2
- package/lib/modules/staking.d.ts +6 -6
- package/lib/modules/subaccount.d.ts +4 -4
- package/lib/modules/subaccount.js +3 -3
- package/lib/provider/amino/types/admin.js +12 -12
- package/lib/provider/amino/types/bank.js +2 -2
- package/lib/provider/amino/types/bridge.js +3 -3
- package/lib/provider/amino/types/broker.js +2 -2
- package/lib/provider/amino/types/coin.js +5 -5
- package/lib/provider/amino/types/evm.js +2 -2
- package/lib/provider/amino/types/evmmerge.js +2 -2
- package/lib/provider/amino/types/feemarket.js +2 -2
- package/lib/provider/amino/types/gov.js +17 -17
- package/lib/provider/amino/types/grant.js +6 -6
- package/lib/provider/amino/types/group.js +4 -4
- package/lib/provider/amino/types/ibc.js +2 -2
- package/lib/provider/amino/types/leverage.js +2 -2
- package/lib/provider/amino/types/market.js +7 -7
- package/lib/provider/amino/types/order.js +5 -5
- package/lib/provider/amino/types/perpspool.js +11 -11
- package/lib/provider/amino/types/position.js +2 -2
- package/lib/provider/amino/types/staking.js +5 -5
- package/lib/provider/amino/types/subaccount.js +4 -4
- package/lib/provider/keplr/KeplrAccount.d.ts +3 -3
- package/lib/provider/keplr/KeplrAccount.js +8 -8
- package/lib/provider/leap/LeapAccount.d.ts +3 -3
- package/lib/provider/leap/LeapAccount.js +7 -7
- package/lib/provider/metamask/MetaMask.d.ts +8 -8
- package/lib/provider/metamask/MetaMask.js +17 -17
- package/lib/provider/rainbowKit/RainbowKitAccount.d.ts +7 -7
- package/lib/provider/rainbowKit/RainbowKitAccount.js +12 -12
- package/lib/provider/sdk/SDKProvider.d.ts +4 -4
- package/lib/util/alliance.js +1 -1
- package/lib/util/blockchain.d.ts +5 -5
- package/lib/util/blockchain.js +11 -11
- package/lib/util/eip712.d.ts +2 -2
- package/lib/util/eip712.js +1 -1
- package/lib/util/ethermint.d.ts +4 -4
- package/lib/util/ethermint.js +1 -1
- package/lib/util/external.d.ts +2 -2
- package/lib/util/gov.js +16 -16
- package/lib/util/index.d.ts +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/legacyEIP712.js +1 -1
- package/lib/util/network.d.ts +1 -1
- package/lib/util/network.js +7 -7
- package/lib/util/provider.js +1 -1
- package/lib/util/tx.d.ts +3 -3
- package/lib/util/tx.js +9 -9
- package/lib/wallet/{CarbonSigner.d.ts → OrbixSigner.d.ts} +19 -19
- package/lib/wallet/{CarbonSigner.js → OrbixSigner.js} +19 -19
- package/lib/wallet/{CarbonSigningClient.d.ts → OrbixSigningClient.d.ts} +3 -3
- package/lib/wallet/{CarbonSigningClient.js → OrbixSigningClient.js} +9 -9
- package/lib/wallet/{CarbonWallet.d.ts → OrbixWallet.d.ts} +38 -38
- package/lib/wallet/{CarbonWallet.js → OrbixWallet.js} +39 -39
- package/lib/wallet/index.d.ts +2 -2
- package/lib/wallet/index.js +2 -2
- package/package.json +1 -1
- package/lib/CarbonSDK.d.ts +0 -145
- /package/lib/codec/{carbon-models.d.ts → orbix-models.d.ts} +0 -0
- /package/lib/codec/{carbon-models.js → orbix-models.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import OrbixSDK, { Orbix } from "../OrbixSDK";
|
|
2
2
|
import { EthNetworkConfig, NetworkConfig, NetworkConfigProvider } from "../constant";
|
|
3
3
|
import { BlockchainV2, EVMChain } from "../util/blockchain";
|
|
4
4
|
import { TokenInitInfo, TokensWithExternalBalance } from "../util/external";
|
|
@@ -19,8 +19,8 @@ interface ETHTxParams {
|
|
|
19
19
|
nonce?: number;
|
|
20
20
|
}
|
|
21
21
|
export interface BridgeParams {
|
|
22
|
-
fromToken:
|
|
23
|
-
toToken:
|
|
22
|
+
fromToken: Orbix.Coin.Token;
|
|
23
|
+
toToken: Orbix.Coin.Token;
|
|
24
24
|
amount: BigNumber;
|
|
25
25
|
fromAddress: string;
|
|
26
26
|
recoveryAddress: string;
|
|
@@ -35,11 +35,11 @@ export interface BridgeParams {
|
|
|
35
35
|
export interface LockParams extends ETHTxParams {
|
|
36
36
|
address: Uint8Array;
|
|
37
37
|
amount: BigNumber;
|
|
38
|
-
token:
|
|
38
|
+
token: Orbix.Coin.Token;
|
|
39
39
|
signCompleteCallback?: () => void;
|
|
40
40
|
}
|
|
41
41
|
export interface ApproveERC20Params extends ETHTxParams {
|
|
42
|
-
token:
|
|
42
|
+
token: Orbix.Coin.Token;
|
|
43
43
|
spenderAddress?: string;
|
|
44
44
|
amount?: BigNumber;
|
|
45
45
|
signCompleteCallback?: () => void;
|
|
@@ -54,10 +54,10 @@ export declare class ETHClient {
|
|
|
54
54
|
readonly tokenClient: TokenClient;
|
|
55
55
|
readonly rpcURL: string;
|
|
56
56
|
private constructor();
|
|
57
|
-
static instance(opts: ETHClientOpts):
|
|
58
|
-
getExternalBalances(api:
|
|
57
|
+
static instance(opts: ETHClientOpts): OrbixSDK.ETHClient;
|
|
58
|
+
getExternalBalances(api: OrbixSDK, address: string, whitelistDenoms?: string[], version?: string): Promise<TokensWithExternalBalance[]>;
|
|
59
59
|
approveERC20(params: ApproveERC20Params): Promise<EthersTransactionResponse>;
|
|
60
|
-
checkAllowanceERC20(token:
|
|
60
|
+
checkAllowanceERC20(token: Orbix.Coin.Token, owner: string, spender: string): Promise<BigNumber>;
|
|
61
61
|
bridgeTokens(params: BridgeParams): Promise<EthersTransactionResponse>;
|
|
62
62
|
lockDeposit(params: LockParams): Promise<EthersTransactionResponse>;
|
|
63
63
|
getDepositContractAddress(swthBech32Address: string, ownerEthAddress: string): Promise<string>;
|
|
@@ -65,7 +65,7 @@ export declare class ETHClient {
|
|
|
65
65
|
address: string;
|
|
66
66
|
signature: string;
|
|
67
67
|
}>, overrideFee?: ethers.BigNumber): Promise<Response | "insufficient balance">;
|
|
68
|
-
getDepositFeeAmount(token:
|
|
68
|
+
getDepositFeeAmount(token: Orbix.Coin.Token, depositAddress: string): Promise<ethers.BigNumber>;
|
|
69
69
|
isContract(address: string): Promise<boolean>;
|
|
70
70
|
retrieveERC20Info(address: string): Promise<TokenInitInfo>;
|
|
71
71
|
static formatWithdrawalAddress(address: string): string;
|
|
@@ -80,7 +80,7 @@ export declare class ETHClient {
|
|
|
80
80
|
*
|
|
81
81
|
* @param token
|
|
82
82
|
*/
|
|
83
|
-
getTargetProxyHash(token:
|
|
83
|
+
getTargetProxyHash(token: Orbix.Coin.Token): string;
|
|
84
84
|
getProvider(): ethers.providers.JsonRpcProvider;
|
|
85
85
|
getNetworkConfig(): NetworkConfig;
|
|
86
86
|
getConfig(): EthNetworkConfig;
|
package/lib/clients/ETHClient.js
CHANGED
|
@@ -23,7 +23,7 @@ class ETHClient {
|
|
|
23
23
|
}
|
|
24
24
|
static instance(opts) {
|
|
25
25
|
const { configProvider, blockchain, tokenClient, rpcURL } = opts;
|
|
26
|
-
if (!util_1.BlockchainUtils.isEvmChain(blockchain) || blockchain === '
|
|
26
|
+
if (!util_1.BlockchainUtils.isEvmChain(blockchain) || blockchain === 'Orbix') {
|
|
27
27
|
throw new Error(`unsupported blockchain - ${blockchain}`);
|
|
28
28
|
}
|
|
29
29
|
return new ETHClient(configProvider, blockchain, tokenClient, rpcURL);
|
|
@@ -91,18 +91,18 @@ class ETHClient {
|
|
|
91
91
|
if (!recoveryAddress.match(recoveryAddrRegex)) {
|
|
92
92
|
throw new Error("Invalid recovery address");
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const orbixNetwork = networkConfig.network;
|
|
95
95
|
const fromTokenId = fromToken.id;
|
|
96
96
|
const fromTokenAddress = (0, generic_1.appendHexPrefix)(fromToken.tokenAddress);
|
|
97
97
|
const toTokenDenom = toToken.denom;
|
|
98
|
-
const recoveryAddressHex = ethers_1.ethers.utils.hexlify(util_1.AddressUtils.SWTHAddress.getAddressBytes(recoveryAddress,
|
|
98
|
+
const recoveryAddressHex = ethers_1.ethers.utils.hexlify(util_1.AddressUtils.SWTHAddress.getAddressBytes(recoveryAddress, orbixNetwork));
|
|
99
99
|
const fromAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(fromTokenId));
|
|
100
100
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(toTokenDenom));
|
|
101
101
|
const nonce = await this.getTxNonce(fromAddress, params.nonce, rpcProvider);
|
|
102
102
|
const contract = new ethers_1.ethers.Contract(this.getBridgeEntranceAddr(), eth_1.ABIs.bridgeEntrance, rpcProvider);
|
|
103
103
|
const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
|
|
104
104
|
const tokenCreator = fromToken.creator;
|
|
105
|
-
const targetAddressBytes = util_1.AddressUtils.SWTHAddress.getAddressBytes(tokenCreator,
|
|
105
|
+
const targetAddressBytes = util_1.AddressUtils.SWTHAddress.getAddressBytes(tokenCreator, orbixNetwork);
|
|
106
106
|
const targetProxyHash = ethers_1.ethers.utils.hexlify(targetAddressBytes);
|
|
107
107
|
const ethAmount = fromToken.tokenAddress === constant_1.NativeTokenHash ? amount : number_1.BN_ZERO;
|
|
108
108
|
const bridgeResultTx = await contract.connect(signer).lock(fromTokenAddress, // the asset to deposit (from) (0x00 if eth)
|
|
@@ -58,11 +58,11 @@ export interface EthermintClientGroup {
|
|
|
58
58
|
evm: EthermintEVMQueryClient;
|
|
59
59
|
feeMarket: EthermintFeeMarketQueryClient;
|
|
60
60
|
}
|
|
61
|
-
export interface
|
|
61
|
+
export interface OrbixQueryClientOpts {
|
|
62
62
|
tmClient: Tendermint37Client;
|
|
63
63
|
grpcClient?: GrpcQueryClient;
|
|
64
64
|
}
|
|
65
|
-
declare class
|
|
65
|
+
declare class OrbixQueryClient {
|
|
66
66
|
adl: ADLQueryClient;
|
|
67
67
|
book: BookQueryClient;
|
|
68
68
|
bridge: BridgeQueryClient;
|
|
@@ -103,6 +103,6 @@ declare class CarbonQueryClient {
|
|
|
103
103
|
evmmerge: EvmMergeQueryClient;
|
|
104
104
|
evmbank: EvmBankQueryClient;
|
|
105
105
|
admin: AdminQueryClient;
|
|
106
|
-
constructor(opts:
|
|
106
|
+
constructor(opts: OrbixQueryClientOpts);
|
|
107
107
|
}
|
|
108
|
-
export default
|
|
108
|
+
export default OrbixQueryClient;
|
|
@@ -50,7 +50,7 @@ const query_44 = require("../codec/Mememax/orbix/perpspool/query");
|
|
|
50
50
|
const query_45 = require("../codec/Mememax/orbix/admin/query");
|
|
51
51
|
const stargate_1 = require("@cosmjs/stargate");
|
|
52
52
|
const BlockchainClient_1 = __importDefault(require("./BlockchainClient"));
|
|
53
|
-
class
|
|
53
|
+
class OrbixQueryClient {
|
|
54
54
|
constructor(opts) {
|
|
55
55
|
const rpcClient = opts.grpcClient ?? (0, stargate_1.createProtobufRpcClient)(new stargate_1.QueryClient(opts.tmClient));
|
|
56
56
|
this.chain = BlockchainClient_1.default.connectWithTm(opts.tmClient);
|
|
@@ -106,4 +106,4 @@ class CarbonQueryClient {
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
exports.default =
|
|
109
|
+
exports.default = OrbixQueryClient;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Orbix } from "../OrbixSDK";
|
|
2
2
|
import { NetworkConfigProvider } from "../constant";
|
|
3
3
|
import { GetFeeQuoteResponse } from "../hydrogen/feeQuote";
|
|
4
4
|
import { BlockchainUtils, TypeUtils } from "../util";
|
|
5
5
|
import { AxelarBridge, BlockchainV2, BridgeMap, IbcBridge } from '../util/blockchain';
|
|
6
6
|
import BigNumber from "bignumber.js";
|
|
7
|
-
import
|
|
7
|
+
import OrbixQueryClient from "./OrbixQueryClient";
|
|
8
8
|
declare class TokenClient {
|
|
9
|
-
readonly query:
|
|
9
|
+
readonly query: OrbixQueryClient;
|
|
10
10
|
readonly configProvider: NetworkConfigProvider;
|
|
11
11
|
static Blacklist: Partial<TypeUtils.NetworkMap<string[]>>;
|
|
12
|
-
readonly tokens: TypeUtils.SimpleMap<
|
|
12
|
+
readonly tokens: TypeUtils.SimpleMap<Orbix.Coin.Token>;
|
|
13
13
|
readonly wrapperMap: TypeUtils.SimpleMap<string>;
|
|
14
|
-
readonly poolTokens: TypeUtils.SimpleMap<
|
|
15
|
-
readonly cdpTokens: TypeUtils.SimpleMap<
|
|
14
|
+
readonly poolTokens: TypeUtils.SimpleMap<Orbix.Coin.Token>;
|
|
15
|
+
readonly cdpTokens: TypeUtils.SimpleMap<Orbix.Coin.Token>;
|
|
16
16
|
readonly bridges: BridgeMap;
|
|
17
17
|
readonly symbols: TypeUtils.SimpleMap<string>;
|
|
18
18
|
readonly usdValues: TypeUtils.SimpleMap<BigNumber>;
|
|
@@ -21,7 +21,7 @@ declare class TokenClient {
|
|
|
21
21
|
initialUsdValuesLoaded: boolean;
|
|
22
22
|
private additionalGeckoDenoms;
|
|
23
23
|
private constructor();
|
|
24
|
-
static instance(query:
|
|
24
|
+
static instance(query: OrbixQueryClient, configProvider: NetworkConfigProvider): TokenClient;
|
|
25
25
|
initialize(): Promise<void>;
|
|
26
26
|
registerGeckoIdMap(map: TypeUtils.SimpleMap<string>): void;
|
|
27
27
|
getCommonDenom(denom: string): string;
|
|
@@ -36,8 +36,8 @@ declare class TokenClient {
|
|
|
36
36
|
getUSDValue(denom: string): BigNumber | undefined;
|
|
37
37
|
toHuman(denom: string, unitlessAmt: BigNumber): BigNumber;
|
|
38
38
|
toUnitless(denom: string, humanAmt: BigNumber): BigNumber;
|
|
39
|
-
tokenForId(id: string):
|
|
40
|
-
tokenForDenom(denom: string):
|
|
39
|
+
tokenForId(id: string): Orbix.Coin.Token | undefined;
|
|
40
|
+
tokenForDenom(denom: string): Orbix.Coin.Token | undefined;
|
|
41
41
|
getFeeInfo(denom: string): Promise<GetFeeQuoteResponse>;
|
|
42
42
|
getTokenName(denom: string, overrideMap?: TypeUtils.SimpleMap<string>): string;
|
|
43
43
|
getTokenDesc(denom: string): string;
|
|
@@ -52,21 +52,21 @@ declare class TokenClient {
|
|
|
52
52
|
static isCdpIbcDenom(denom: string): boolean;
|
|
53
53
|
isWrappedToken(denom?: string): boolean;
|
|
54
54
|
hasWrappedToken(denom?: string): boolean;
|
|
55
|
-
getWrappedTokens(denom: string):
|
|
56
|
-
getWrappedToken(denom: string, blockchain?: BlockchainUtils.Blockchain | BlockchainUtils.BlockchainV2, version?: string):
|
|
57
|
-
getSourceToken(denom: string):
|
|
58
|
-
getNativeToken():
|
|
59
|
-
getNativeStablecoin():
|
|
55
|
+
getWrappedTokens(denom: string): Orbix.Coin.Token[];
|
|
56
|
+
getWrappedToken(denom: string, blockchain?: BlockchainUtils.Blockchain | BlockchainUtils.BlockchainV2, version?: string): Orbix.Coin.Token | null;
|
|
57
|
+
getSourceToken(denom: string): Orbix.Coin.Token | null;
|
|
58
|
+
getNativeToken(): Orbix.Coin.Token | undefined;
|
|
59
|
+
getNativeStablecoin(): Orbix.Coin.Token | undefined;
|
|
60
60
|
isNativeToken(denom: string): boolean;
|
|
61
61
|
isNativeStablecoin(denom: string): boolean;
|
|
62
62
|
isGroupChequeDenom(denom: string): boolean;
|
|
63
63
|
isBridgedToken(denom: string): boolean;
|
|
64
|
-
|
|
65
|
-
getDepositTokenFor(tokenDenom: string, chain: BlockchainUtils.Blockchain | BlockchainUtils.BlockchainV2, version?: string):
|
|
66
|
-
getAllTokens(): Promise<
|
|
67
|
-
reloadTokens(): Promise<TypeUtils.SimpleMap<
|
|
64
|
+
isOrbixToken(token?: Orbix.Coin.Token | null): boolean;
|
|
65
|
+
getDepositTokenFor(tokenDenom: string, chain: BlockchainUtils.Blockchain | BlockchainUtils.BlockchainV2, version?: string): Orbix.Coin.Token | undefined;
|
|
66
|
+
getAllTokens(): Promise<Orbix.Coin.Token[]>;
|
|
67
|
+
reloadTokens(): Promise<TypeUtils.SimpleMap<Orbix.Coin.Token>>;
|
|
68
68
|
getBridges(): Promise<BridgeMap>;
|
|
69
|
-
matchChainsWithDifferentChainIds(bridges:
|
|
69
|
+
matchChainsWithDifferentChainIds(bridges: Orbix.Coin.Bridge[]): Promise<IbcBridge[]>;
|
|
70
70
|
mapBridgesFromConnections(): Promise<AxelarBridge[]>;
|
|
71
71
|
getIbcBlockchainNames(): string[];
|
|
72
72
|
getAxelarBlockchainNames(): string[];
|
|
@@ -74,18 +74,18 @@ declare class TokenClient {
|
|
|
74
74
|
getIbcChainFromBlockchainV2: (blockchain: BlockchainV2 | undefined) => string | undefined;
|
|
75
75
|
getPolynetworkBlockchainNames(): string[];
|
|
76
76
|
getAllBlockchainNames(): string[];
|
|
77
|
-
getBridgesFromBridgeId(bridgeId: number):
|
|
78
|
-
getIbcTokens(): TypeUtils.SimpleMap<
|
|
79
|
-
getPolyNetworkTokens(): TypeUtils.SimpleMap<
|
|
77
|
+
getBridgesFromBridgeId(bridgeId: number): Orbix.Coin.Bridge[] | IbcBridge[] | AxelarBridge[];
|
|
78
|
+
getIbcTokens(): TypeUtils.SimpleMap<Orbix.Coin.Token>;
|
|
79
|
+
getPolyNetworkTokens(): TypeUtils.SimpleMap<Orbix.Coin.Token>;
|
|
80
80
|
getBlockchainV2FromIDs(chainId: number, bridgeId: number): BlockchainV2 | undefined;
|
|
81
|
-
getBridgeFromToken(token:
|
|
82
|
-
getIbcChainIdFromToken(token:
|
|
83
|
-
getCdpUnderlyingToken(cdpDenom: string):
|
|
81
|
+
getBridgeFromToken(token: Orbix.Coin.Token | null | undefined): Orbix.Coin.Bridge | IbcBridge | undefined;
|
|
82
|
+
getIbcChainIdFromToken(token: Orbix.Coin.Token | null): string | undefined;
|
|
83
|
+
getCdpUnderlyingToken(cdpDenom: string): Orbix.Coin.Token | undefined;
|
|
84
84
|
reloadWrapperMap(): Promise<TypeUtils.SimpleMap<string>>;
|
|
85
85
|
reloadDenomGeckoMap(): Promise<void>;
|
|
86
86
|
reloadUSDValues(denoms?: string[]): Promise<TypeUtils.SimpleMap<BigNumber>>;
|
|
87
87
|
getUSDValuesFromCoinGecko(geckoIds: string[]): Promise<any>;
|
|
88
|
-
processTokenPrices(tokenPrices:
|
|
88
|
+
processTokenPrices(tokenPrices: Orbix.Pricing.TokenPrice[]): TypeUtils.SimpleMap<BigNumber>;
|
|
89
89
|
getUSDValuesFromPricingModule(): Promise<TypeUtils.SimpleMap<BigNumber>>;
|
|
90
90
|
getDenomToGeckoIdMap(): Promise<TypeUtils.SimpleMap<string>>;
|
|
91
91
|
setCommonAssetConfig(): void;
|
|
@@ -341,7 +341,7 @@ class TokenClient {
|
|
|
341
341
|
const bridgedTokenRegex = new RegExp(/^brdg\//);
|
|
342
342
|
return bridgedTokenRegex.test(denom);
|
|
343
343
|
}
|
|
344
|
-
|
|
344
|
+
isOrbixToken(token) {
|
|
345
345
|
return Boolean(token && (this.isNativeToken(token.denom) || token.bridgeId.eq(0)));
|
|
346
346
|
}
|
|
347
347
|
getDepositTokenFor(tokenDenom, chain, version = "V1") {
|
|
@@ -573,7 +573,7 @@ class TokenClient {
|
|
|
573
573
|
}
|
|
574
574
|
getBlockchainV2FromIDs(chainId, bridgeId) {
|
|
575
575
|
if ((chainId === 5 && bridgeId === 1) || (chainId === 0 && bridgeId === 2))
|
|
576
|
-
return "
|
|
576
|
+
return "Orbix";
|
|
577
577
|
const bridgeList = this.getBridgesFromBridgeId(bridgeId);
|
|
578
578
|
return bridgeList.find(bridge => bridge.chainId.toNumber() === chainId)?.chainName ?? undefined;
|
|
579
579
|
}
|
|
@@ -626,10 +626,10 @@ class TokenClient {
|
|
|
626
626
|
return coinIds;
|
|
627
627
|
}, []);
|
|
628
628
|
const geckoIdToUsdPriceMap = await this.getUSDValuesFromCoinGecko(geckoIds);
|
|
629
|
-
const
|
|
629
|
+
const orbixTokenPrices = await this.getUSDValuesFromPricingModule();
|
|
630
630
|
const uscStablecoin = this.getNativeStablecoin();
|
|
631
|
-
// add
|
|
632
|
-
Object.entries(
|
|
631
|
+
// add orbix token prices first
|
|
632
|
+
Object.entries(orbixTokenPrices).forEach(([key, value]) => {
|
|
633
633
|
this.usdValues[key] = value;
|
|
634
634
|
});
|
|
635
635
|
//store price based on denoms
|
package/lib/clients/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as BatchQueryClient } from "./BatchQueryClient";
|
|
2
2
|
export { default as BlockchainClient } from "./BlockchainClient";
|
|
3
|
-
export { default as
|
|
3
|
+
export { default as OrbixQueryClient } from "./OrbixQueryClient";
|
|
4
4
|
export { default as ETHClient } from "./ETHClient";
|
|
5
5
|
export { default as HydrogenClient } from "./HydrogenClient";
|
|
6
6
|
export { default as InsightsQueryClient } from "./InsightsQueryClient";
|
package/lib/clients/index.js
CHANGED
|
@@ -3,13 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TokenClient = exports.InsightsQueryClient = exports.HydrogenClient = exports.ETHClient = exports.
|
|
6
|
+
exports.TokenClient = exports.InsightsQueryClient = exports.HydrogenClient = exports.ETHClient = exports.OrbixQueryClient = exports.BlockchainClient = exports.BatchQueryClient = void 0;
|
|
7
7
|
var BatchQueryClient_1 = require("./BatchQueryClient");
|
|
8
8
|
Object.defineProperty(exports, "BatchQueryClient", { enumerable: true, get: function () { return __importDefault(BatchQueryClient_1).default; } });
|
|
9
9
|
var BlockchainClient_1 = require("./BlockchainClient");
|
|
10
10
|
Object.defineProperty(exports, "BlockchainClient", { enumerable: true, get: function () { return __importDefault(BlockchainClient_1).default; } });
|
|
11
|
-
var
|
|
12
|
-
Object.defineProperty(exports, "
|
|
11
|
+
var OrbixQueryClient_1 = require("./OrbixQueryClient");
|
|
12
|
+
Object.defineProperty(exports, "OrbixQueryClient", { enumerable: true, get: function () { return __importDefault(OrbixQueryClient_1).default; } });
|
|
13
13
|
var ETHClient_1 = require("./ETHClient");
|
|
14
14
|
Object.defineProperty(exports, "ETHClient", { enumerable: true, get: function () { return __importDefault(ETHClient_1).default; } });
|
|
15
15
|
var HydrogenClient_1 = require("./HydrogenClient");
|
package/lib/codec/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Registry } from "@cosmjs/proto-signing";
|
|
2
2
|
export * from "./cosmos-models";
|
|
3
3
|
export * as IBC from "./ibc-models";
|
|
4
|
-
export * as
|
|
4
|
+
export * as Orbix from "./orbix-models";
|
|
5
5
|
export declare const registry: Registry;
|
|
6
6
|
export declare const TxTypes: {
|
|
7
7
|
MsgSetTradingFlag: string;
|