carbon-js-sdk 0.11.16-beta.2 → 0.11.16

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.
Files changed (54) hide show
  1. package/lib/CarbonSDK.d.ts +2 -4
  2. package/lib/CarbonSDK.js +0 -4
  3. package/lib/clients/CarbonQueryClient.d.ts +0 -2
  4. package/lib/clients/CarbonQueryClient.js +83 -85
  5. package/lib/clients/HydrogenClient.d.ts +0 -1
  6. package/lib/clients/HydrogenClient.js +3 -12
  7. package/lib/clients/TokenClient.d.ts +2 -5
  8. package/lib/clients/TokenClient.js +2 -64
  9. package/lib/clients/index.d.ts +0 -1
  10. package/lib/clients/index.js +1 -3
  11. package/lib/codec/Switcheo/carbon/cdp/asset_params.d.ts +2 -0
  12. package/lib/codec/Switcheo/carbon/cdp/asset_params.js +21 -8
  13. package/lib/codec/Switcheo/carbon/coin/export.d.ts +2 -2
  14. package/lib/codec/Switcheo/carbon/coin/export.js +2 -6
  15. package/lib/codec/Switcheo/carbon/coin/query.d.ts +0 -21
  16. package/lib/codec/Switcheo/carbon/coin/query.js +1 -88
  17. package/lib/codec/Switcheo/carbon/coin/tx.d.ts +0 -24
  18. package/lib/codec/Switcheo/carbon/coin/tx.js +1 -125
  19. package/lib/codec/Switcheo/carbon/oracle/export.d.ts +2 -2
  20. package/lib/codec/Switcheo/carbon/oracle/export.js +6 -2
  21. package/lib/codec/Switcheo/carbon/oracle/genesis.d.ts +2 -1
  22. package/lib/codec/Switcheo/carbon/oracle/genesis.js +26 -11
  23. package/lib/codec/Switcheo/carbon/oracle/oracle.d.ts +24 -0
  24. package/lib/codec/Switcheo/carbon/oracle/oracle.js +152 -1
  25. package/lib/codec/Switcheo/carbon/oracle/query.d.ts +28 -1
  26. package/lib/codec/Switcheo/carbon/oracle/query.js +169 -1
  27. package/lib/codec/Switcheo/carbon/pricing/params.d.ts +0 -2
  28. package/lib/codec/Switcheo/carbon/pricing/params.js +0 -40
  29. package/lib/codec/carbon-models.d.ts +0 -1
  30. package/lib/codec/carbon-models.js +1 -2
  31. package/lib/codec/cosmos/ics23/v1/proofs.d.ts +1 -4
  32. package/lib/codec/index.d.ts +0 -64
  33. package/lib/codec/index.js +192 -1623
  34. package/lib/constant/network.d.ts +0 -4
  35. package/lib/constant/network.js +0 -23
  36. package/lib/constant/web3Config.d.ts +0 -2
  37. package/lib/constant/web3Config.js +9 -30
  38. package/lib/eth/abis/index.d.ts +1 -2
  39. package/lib/eth/abis/index.js +1 -3
  40. package/lib/modules/admin.js +1 -0
  41. package/lib/modules/index.d.ts +0 -1
  42. package/lib/modules/index.js +0 -1
  43. package/lib/provider/amino/AminoTypesMap.js +1 -1
  44. package/lib/provider/amino/types/index.d.ts +0 -1
  45. package/lib/provider/amino/types/index.js +1 -3
  46. package/lib/provider/amino/utils.d.ts +0 -2
  47. package/lib/provider/amino/utils.js +8 -17
  48. package/lib/provider/metamask/MetaMask.js +0 -15
  49. package/lib/util/blockchain.d.ts +6 -15
  50. package/lib/util/blockchain.js +4 -46
  51. package/lib/util/tx.d.ts +0 -64
  52. package/lib/wallet/CarbonSigner.js +9 -1
  53. package/lib/wallet/CarbonWallet.js +2 -0
  54. package/package.json +2 -2
@@ -2,11 +2,11 @@
2
2
  import { Network, NetworkConfig, Network as _Network } from "./constant";
3
3
  import { Tendermint37Client } from "@cosmjs/tendermint-rpc";
4
4
  import * as clients from "./clients";
5
- import { CarbonQueryClient, AxelarBridgeClient, ETHClient, HydrogenClient, InsightsQueryClient, NEOClient, TokenClient, ZILClient } from "./clients";
5
+ import { CarbonQueryClient, ETHClient, HydrogenClient, InsightsQueryClient, NEOClient, TokenClient, ZILClient } from "./clients";
6
6
  import GasFee from "./clients/GasFee";
7
7
  import GrpcQueryClient from "./clients/GrpcQueryClient";
8
8
  import N3Client from "./clients/N3Client";
9
- import { AdminModule, AllianceModule, BankModule, BridgeModule, BrokerModule, CDPModule, CoinModule, ERC20Module, EvmMergeModule, EvmModule, FeeModule, GovModule, IBCModule, LeverageModule, LiquidityPoolModule, MarketModule, OracleModule, OrderModule, PerpspoolModule, PositionModule, ProfileModule, SubAccountModule, XChainModule } from "./modules";
9
+ import { AdminModule, AllianceModule, BankModule, BrokerModule, CDPModule, CoinModule, ERC20Module, EvmMergeModule, EvmModule, FeeModule, GovModule, IBCModule, LeverageModule, LiquidityPoolModule, MarketModule, OracleModule, OrderModule, PerpspoolModule, PositionModule, ProfileModule, SubAccountModule, XChainModule } from "./modules";
10
10
  import { GrantModule } from "./modules/grant";
11
11
  import { StakingModule } from "./modules/staking";
12
12
  import { CosmosLedger, Keplr, LeapExtended } from "./provider";
@@ -95,14 +95,12 @@ declare class CarbonSDK {
95
95
  xchain: XChainModule;
96
96
  evm: EvmModule;
97
97
  evmmerge: EvmMergeModule;
98
- bridge: BridgeModule;
99
98
  neo: NEOClient;
100
99
  eth: ETHClient;
101
100
  bsc: ETHClient;
102
101
  arbitrum: ETHClient;
103
102
  polygon: ETHClient;
104
103
  okc: ETHClient;
105
- axelarBridgeClient: AxelarBridgeClient;
106
104
  zil: ZILClient;
107
105
  n3: N3Client;
108
106
  chainId: string;
package/lib/CarbonSDK.js CHANGED
@@ -120,7 +120,6 @@ class CarbonSDK {
120
120
  this.xchain = new modules_1.XChainModule(this);
121
121
  this.evm = new modules_1.EvmModule(this);
122
122
  this.evmmerge = new modules_1.EvmMergeModule(this);
123
- this.bridge = new modules_1.BridgeModule(this);
124
123
  this.neo = clients_1.NEOClient.instance({
125
124
  configProvider: this,
126
125
  blockchain: blockchain_1.Blockchain.Neo,
@@ -158,9 +157,6 @@ class CarbonSDK {
158
157
  blockchain: blockchain_1.Blockchain.Okc,
159
158
  tokenClient: this.token,
160
159
  });
161
- this.axelarBridgeClient = clients_1.AxelarBridgeClient.instance({
162
- configProvider: this,
163
- });
164
160
  }
165
161
  static instance(opts = DEFAULT_SDK_INIT_OPTS) {
166
162
  var _a, _b, _c, _d;
@@ -6,7 +6,6 @@ import { QueryClientImpl as CoinQueryClient } from "../codec/Switcheo/carbon/coi
6
6
  import { QueryClientImpl as AuthQueryClient } from "../codec/cosmos/auth/v1beta1/query";
7
7
  import { QueryClientImpl as BankQueryClient } from "../codec/cosmos/bank/v1beta1/query";
8
8
  import { QueryClientImpl as NativeBankQueryClient } from "../codec/Switcheo/carbon/bank/query";
9
- import { QueryClientImpl as BridgeQueryClient } from "../codec/Switcheo/carbon/bridge/query";
10
9
  import { ServiceClientImpl as CosmosTmClient } from "../codec/cosmos/base/tendermint/v1beta1/query";
11
10
  import { QueryClientImpl as DistributionQueryClient } from "../codec/cosmos/distribution/v1beta1/query";
12
11
  import { QueryClientImpl as EvidenceQueryClient } from "../codec/cosmos/evidence/v1beta1/query";
@@ -70,7 +69,6 @@ export interface CarbonQueryClientOpts {
70
69
  declare class CarbonQueryClient {
71
70
  adl: ADLQueryClient;
72
71
  book: BookQueryClient;
73
- bridge: BridgeQueryClient;
74
72
  broker: BrokerQueryClient;
75
73
  coin: CoinQueryClient;
76
74
  cdp: CDPQueryClient;
@@ -11,48 +11,47 @@ const query_5 = require("../codec/Switcheo/carbon/coin/query");
11
11
  const query_6 = require("../codec/cosmos/auth/v1beta1/query");
12
12
  const query_7 = require("../codec/cosmos/bank/v1beta1/query");
13
13
  const query_8 = require("../codec/Switcheo/carbon/bank/query");
14
- const query_9 = require("../codec/Switcheo/carbon/bridge/query");
15
- const query_10 = require("../codec/cosmos/base/tendermint/v1beta1/query");
16
- const query_11 = require("../codec/cosmos/distribution/v1beta1/query");
17
- const query_12 = require("../codec/cosmos/evidence/v1beta1/query");
18
- const query_13 = require("../codec/cosmos/gov/v1/query");
19
- const query_14 = require("../codec/cosmos/group/v1/query");
20
- const query_15 = require("../codec/cosmos/mint/v1beta1/query");
21
- const query_16 = require("../codec/cosmos/params/v1beta1/query");
22
- const query_17 = require("../codec/cosmos/slashing/v1beta1/query");
23
- const query_18 = require("../codec/cosmos/staking/v1beta1/query");
24
- const query_19 = require("../codec/cosmos/upgrade/v1beta1/query");
25
- const query_20 = require("../codec/ethermint/evm/v1/query");
26
- const query_21 = require("../codec/cosmos/authz/v1beta1/query");
27
- const query_22 = require("../codec/cosmos/feegrant/v1beta1/query");
28
- const query_23 = require("../codec/Switcheo/carbon/evmmerge/query");
29
- const query_24 = require("../codec/Switcheo/carbon/evmbank/query");
30
- const query_25 = require("../codec/ethermint/feemarket/v1/query");
31
- const query_26 = require("../codec/Switcheo/carbon/fee/query");
32
- const query_27 = require("../codec/Switcheo/carbon/headersync/query");
33
- const query_28 = require("../codec/ibc/applications/interchain_accounts/controller/v1/query");
34
- const query_29 = require("../codec/ibc/applications/interchain_accounts/host/v1/query");
35
- const query_30 = require("../codec/ibc/applications/transfer/v1/query");
36
- const query_31 = require("../codec/ibc/core/client/v1/query");
37
- const query_32 = require("../codec/ibc/core/connection/v1/query");
38
- const query_33 = require("../codec/ibc/core/channel/v1/query");
39
- const query_34 = require("../codec/Switcheo/carbon/inflation/query");
40
- const query_35 = require("../codec/Switcheo/carbon/insurance/query");
41
- const query_36 = require("../codec/Switcheo/carbon/leverage/query");
42
- const query_37 = require("../codec/Switcheo/carbon/liquidation/query");
43
- const query_38 = require("../codec/Switcheo/carbon/liquiditypool/query");
44
- const query_39 = require("../codec/Switcheo/carbon/market/query");
45
- const query_40 = require("../codec/Switcheo/carbon/marketstats/query");
46
- const query_41 = require("../codec/Switcheo/carbon/misc/query");
47
- const query_42 = require("../codec/Switcheo/carbon/oracle/query");
48
- const query_43 = require("../codec/Switcheo/carbon/order/query");
49
- const query_44 = require("../codec/Switcheo/carbon/position/query");
50
- const query_45 = require("../codec/Switcheo/carbon/pricing/query");
51
- const query_46 = require("../codec/Switcheo/carbon/profile/query");
52
- const query_47 = require("../codec/Switcheo/carbon/subaccount/query");
53
- const query_48 = require("../codec/alliance/alliance/query");
54
- const query_49 = require("../codec/Switcheo/carbon/perpspool/query");
55
- const query_50 = require("../codec/Switcheo/carbon/erc20/query");
14
+ const query_9 = require("../codec/cosmos/base/tendermint/v1beta1/query");
15
+ const query_10 = require("../codec/cosmos/distribution/v1beta1/query");
16
+ const query_11 = require("../codec/cosmos/evidence/v1beta1/query");
17
+ const query_12 = require("../codec/cosmos/gov/v1/query");
18
+ const query_13 = require("../codec/cosmos/group/v1/query");
19
+ const query_14 = require("../codec/cosmos/mint/v1beta1/query");
20
+ const query_15 = require("../codec/cosmos/params/v1beta1/query");
21
+ const query_16 = require("../codec/cosmos/slashing/v1beta1/query");
22
+ const query_17 = require("../codec/cosmos/staking/v1beta1/query");
23
+ const query_18 = require("../codec/cosmos/upgrade/v1beta1/query");
24
+ const query_19 = require("../codec/ethermint/evm/v1/query");
25
+ const query_20 = require("../codec/cosmos/authz/v1beta1/query");
26
+ const query_21 = require("../codec/cosmos/feegrant/v1beta1/query");
27
+ const query_22 = require("../codec/Switcheo/carbon/evmmerge/query");
28
+ const query_23 = require("../codec/Switcheo/carbon/evmbank/query");
29
+ const query_24 = require("../codec/ethermint/feemarket/v1/query");
30
+ const query_25 = require("../codec/Switcheo/carbon/fee/query");
31
+ const query_26 = require("../codec/Switcheo/carbon/headersync/query");
32
+ const query_27 = require("../codec/ibc/applications/interchain_accounts/controller/v1/query");
33
+ const query_28 = require("../codec/ibc/applications/interchain_accounts/host/v1/query");
34
+ const query_29 = require("../codec/ibc/applications/transfer/v1/query");
35
+ const query_30 = require("../codec/ibc/core/client/v1/query");
36
+ const query_31 = require("../codec/ibc/core/connection/v1/query");
37
+ const query_32 = require("../codec/ibc/core/channel/v1/query");
38
+ const query_33 = require("../codec/Switcheo/carbon/inflation/query");
39
+ const query_34 = require("../codec/Switcheo/carbon/insurance/query");
40
+ const query_35 = require("../codec/Switcheo/carbon/leverage/query");
41
+ const query_36 = require("../codec/Switcheo/carbon/liquidation/query");
42
+ const query_37 = require("../codec/Switcheo/carbon/liquiditypool/query");
43
+ const query_38 = require("../codec/Switcheo/carbon/market/query");
44
+ const query_39 = require("../codec/Switcheo/carbon/marketstats/query");
45
+ const query_40 = require("../codec/Switcheo/carbon/misc/query");
46
+ const query_41 = require("../codec/Switcheo/carbon/oracle/query");
47
+ const query_42 = require("../codec/Switcheo/carbon/order/query");
48
+ const query_43 = require("../codec/Switcheo/carbon/position/query");
49
+ const query_44 = require("../codec/Switcheo/carbon/pricing/query");
50
+ const query_45 = require("../codec/Switcheo/carbon/profile/query");
51
+ const query_46 = require("../codec/Switcheo/carbon/subaccount/query");
52
+ const query_47 = require("../codec/alliance/alliance/query");
53
+ const query_48 = require("../codec/Switcheo/carbon/perpspool/query");
54
+ const query_49 = require("../codec/Switcheo/carbon/erc20/query");
56
55
  const stargate_1 = require("@cosmjs/stargate");
57
56
  const BlockchainClient_1 = __importDefault(require("./BlockchainClient"));
58
57
  class CarbonQueryClient {
@@ -61,59 +60,58 @@ class CarbonQueryClient {
61
60
  const rpcClient = (_a = opts.grpcClient) !== null && _a !== void 0 ? _a : (0, stargate_1.createProtobufRpcClient)(new stargate_1.QueryClient(opts.tmClient));
62
61
  this.chain = BlockchainClient_1.default.connectWithTm(opts.tmClient);
63
62
  this.adl = new query_1.QueryClientImpl(rpcClient);
64
- this.alliance = new query_48.QueryClientImpl(rpcClient);
63
+ this.alliance = new query_47.QueryClientImpl(rpcClient);
65
64
  this.book = new query_2.QueryClientImpl(rpcClient);
66
- this.bridge = new query_9.QueryClientImpl(rpcClient);
67
65
  this.broker = new query_3.QueryClientImpl(rpcClient);
68
66
  this.coin = new query_5.QueryClientImpl(rpcClient);
69
67
  this.cdp = new query_4.QueryClientImpl(rpcClient);
70
- this.fee = new query_26.QueryClientImpl(rpcClient);
71
- this.inflation = new query_34.QueryClientImpl(rpcClient);
72
- this.insurance = new query_35.QueryClientImpl(rpcClient);
73
- this.leverage = new query_36.QueryClientImpl(rpcClient);
74
- this.liquidation = new query_37.QueryClientImpl(rpcClient);
75
- this.liquiditypool = new query_38.QueryClientImpl(rpcClient);
76
- this.market = new query_39.QueryClientImpl(rpcClient);
77
- this.marketstats = new query_40.QueryClientImpl(rpcClient);
78
- this.misc = new query_41.QueryClientImpl(rpcClient);
79
- this.oracle = new query_42.QueryClientImpl(rpcClient);
80
- this.order = new query_43.QueryClientImpl(rpcClient);
81
- this.position = new query_44.QueryClientImpl(rpcClient);
82
- this.pricing = new query_45.QueryClientImpl(rpcClient);
83
- this.profile = new query_46.QueryClientImpl(rpcClient);
84
- this.subaccount = new query_47.QueryClientImpl(rpcClient);
85
- this.headersync = new query_27.QueryClientImpl(rpcClient);
86
- this.evmmerge = new query_23.QueryClientImpl(rpcClient);
87
- this.evmbank = new query_24.QueryClientImpl(rpcClient);
88
- this.perpspool = new query_49.QueryClientImpl(rpcClient);
68
+ this.fee = new query_25.QueryClientImpl(rpcClient);
69
+ this.inflation = new query_33.QueryClientImpl(rpcClient);
70
+ this.insurance = new query_34.QueryClientImpl(rpcClient);
71
+ this.leverage = new query_35.QueryClientImpl(rpcClient);
72
+ this.liquidation = new query_36.QueryClientImpl(rpcClient);
73
+ this.liquiditypool = new query_37.QueryClientImpl(rpcClient);
74
+ this.market = new query_38.QueryClientImpl(rpcClient);
75
+ this.marketstats = new query_39.QueryClientImpl(rpcClient);
76
+ this.misc = new query_40.QueryClientImpl(rpcClient);
77
+ this.oracle = new query_41.QueryClientImpl(rpcClient);
78
+ this.order = new query_42.QueryClientImpl(rpcClient);
79
+ this.position = new query_43.QueryClientImpl(rpcClient);
80
+ this.pricing = new query_44.QueryClientImpl(rpcClient);
81
+ this.profile = new query_45.QueryClientImpl(rpcClient);
82
+ this.subaccount = new query_46.QueryClientImpl(rpcClient);
83
+ this.headersync = new query_26.QueryClientImpl(rpcClient);
84
+ this.evmmerge = new query_22.QueryClientImpl(rpcClient);
85
+ this.evmbank = new query_23.QueryClientImpl(rpcClient);
86
+ this.perpspool = new query_48.QueryClientImpl(rpcClient);
89
87
  this.auth = new query_6.QueryClientImpl(rpcClient);
90
88
  this.bank = new query_7.QueryClientImpl(rpcClient);
91
89
  this.nativeBank = new query_8.QueryClientImpl(rpcClient);
92
- this.distribution = new query_11.QueryClientImpl(rpcClient);
93
- this.evidence = new query_12.QueryClientImpl(rpcClient);
94
- this.grant = new query_21.QueryClientImpl(rpcClient);
95
- this.feegrant = new query_22.QueryClientImpl(rpcClient);
96
- this.group = new query_14.QueryClientImpl(rpcClient);
97
- this.gov = new query_13.QueryClientImpl(rpcClient);
98
- this.mint = new query_15.QueryClientImpl(rpcClient);
99
- this.params = new query_16.QueryClientImpl(rpcClient);
100
- this.slashing = new query_17.QueryClientImpl(rpcClient);
101
- this.staking = new query_18.QueryClientImpl(rpcClient);
102
- this.upgrade = new query_19.QueryClientImpl(rpcClient);
103
- this.cosmosTm = new query_10.ServiceClientImpl(rpcClient);
104
- this.alliance = new query_48.QueryClientImpl(rpcClient);
105
- this.erc20 = new query_50.QueryClientImpl(rpcClient);
90
+ this.distribution = new query_10.QueryClientImpl(rpcClient);
91
+ this.evidence = new query_11.QueryClientImpl(rpcClient);
92
+ this.grant = new query_20.QueryClientImpl(rpcClient);
93
+ this.feegrant = new query_21.QueryClientImpl(rpcClient);
94
+ this.group = new query_13.QueryClientImpl(rpcClient);
95
+ this.gov = new query_12.QueryClientImpl(rpcClient);
96
+ this.mint = new query_14.QueryClientImpl(rpcClient);
97
+ this.params = new query_15.QueryClientImpl(rpcClient);
98
+ this.slashing = new query_16.QueryClientImpl(rpcClient);
99
+ this.staking = new query_17.QueryClientImpl(rpcClient);
100
+ this.upgrade = new query_18.QueryClientImpl(rpcClient);
101
+ this.cosmosTm = new query_9.ServiceClientImpl(rpcClient);
102
+ this.alliance = new query_47.QueryClientImpl(rpcClient);
103
+ this.erc20 = new query_49.QueryClientImpl(rpcClient);
106
104
  this.ibc = {
107
- controller: new query_28.QueryClientImpl(rpcClient),
108
- host: new query_29.QueryClientImpl(rpcClient),
109
- transfer: new query_30.QueryClientImpl(rpcClient),
110
- client: new query_31.QueryClientImpl(rpcClient),
111
- connection: new query_32.QueryClientImpl(rpcClient),
112
- channel: new query_33.QueryClientImpl(rpcClient),
105
+ controller: new query_27.QueryClientImpl(rpcClient),
106
+ host: new query_28.QueryClientImpl(rpcClient),
107
+ transfer: new query_29.QueryClientImpl(rpcClient),
108
+ client: new query_30.QueryClientImpl(rpcClient),
109
+ connection: new query_31.QueryClientImpl(rpcClient),
110
+ channel: new query_32.QueryClientImpl(rpcClient),
113
111
  };
114
112
  this.ethermint = {
115
- evm: new query_20.QueryClientImpl(rpcClient),
116
- feeMarket: new query_25.QueryClientImpl(rpcClient),
113
+ evm: new query_19.QueryClientImpl(rpcClient),
114
+ feeMarket: new query_24.QueryClientImpl(rpcClient),
117
115
  };
118
116
  }
119
117
  }
@@ -8,7 +8,6 @@ export declare const HydrogenEndpoints: {
8
8
  transfer_payloads: string;
9
9
  relays: string;
10
10
  fee_quote: string;
11
- bridge_fee: string;
12
11
  };
13
12
  declare class HydrogenClient {
14
13
  private config;
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.HydrogenEndpoints = void 0;
16
16
  const constant_1 = require("../constant");
17
17
  const util_1 = require("../util");
18
- const blockchain_1 = require("../util/blockchain");
19
18
  const dayjs_1 = __importDefault(require("dayjs"));
20
19
  exports.HydrogenEndpoints = {
21
20
  // Status api
@@ -26,8 +25,6 @@ exports.HydrogenEndpoints = {
26
25
  relays: "/relays",
27
26
  // Fee service api
28
27
  fee_quote: "/fee_quote",
29
- // Bridge fees
30
- bridge_fee: "/bridge_fee",
31
28
  };
32
29
  const formatDateField = (value) => {
33
30
  if (typeof value !== "string")
@@ -76,8 +73,6 @@ const getBridgeBlockchainFromId = (bridgeId) => {
76
73
  return 'Polynetwork';
77
74
  case 2:
78
75
  return 'Ibc';
79
- case 3:
80
- return 'Axelar';
81
76
  default:
82
77
  return 'Polynetwork';
83
78
  }
@@ -89,17 +84,13 @@ class HydrogenClient {
89
84
  var _a, _b, _c, _d;
90
85
  if (typeof value !== "object")
91
86
  return value;
92
- // brdg tokens will all be chain_id 0 which will also be deprecated in future
93
- // hence for brdg tokens cannot use chain_id to differentiate between blockchains
94
- const isBridgeToken = this.tokenClient.isBridgedToken(value.carbon_token_id);
95
- return Object.assign(Object.assign({}, value), { created_at: formatDateField((_a = value.created_at) === null || _a === void 0 ? void 0 : _a.toString()), updated_at: formatDateField((_b = value.updated_at) === null || _b === void 0 ? void 0 : _b.toString()), source_blockchain: isBridgeToken ? (0, blockchain_1.getFormattedBlockchainName)(value.source_blockchain) : this.tokenClient.getBlockchainV2FromIDs(Number(value.from_chain_id), value.bridge_id), bridging_blockchain: getBridgeBlockchainFromId(value.bridge_id), destination_blockchain: isBridgeToken ? (0, blockchain_1.getFormattedBlockchainName)(value.destination_blockchain) : this.tokenClient.getBlockchainV2FromIDs(Number(value.to_chain_id), value.bridge_id), source_event: this.formatChainEventV2(value.source_event, (_c = value.source_blockchain) !== null && _c !== void 0 ? _c : ''), bridging_event: this.formatChainEventV2(value.bridging_event, getBridgeBlockchainFromId(value.bridge_id)), destination_event: this.formatChainEventV2(value.destination_event, (_d = value.destination_blockchain) !== null && _d !== void 0 ? _d : ''), relay: this.formatRelaysTransfersV2(value.relay) });
87
+ return Object.assign(Object.assign({}, value), { created_at: formatDateField((_a = value.created_at) === null || _a === void 0 ? void 0 : _a.toString()), updated_at: formatDateField((_b = value.updated_at) === null || _b === void 0 ? void 0 : _b.toString()), source_blockchain: this.tokenClient.getBlockchainV2FromIDs(Number(value.from_chain_id), value.bridge_id), bridging_blockchain: getBridgeBlockchainFromId(value.bridge_id), destination_blockchain: this.tokenClient.getBlockchainV2FromIDs(Number(value.to_chain_id), value.bridge_id), source_event: this.formatChainEventV2(value.source_event, (_c = value.source_blockchain) !== null && _c !== void 0 ? _c : ''), bridging_event: this.formatChainEventV2(value.bridging_event, getBridgeBlockchainFromId(value.bridge_id)), destination_event: this.formatChainEventV2(value.destination_event, (_d = value.destination_blockchain) !== null && _d !== void 0 ? _d : ''), relay: this.formatRelaysTransfersV2(value.relay) });
96
88
  };
97
89
  this.formatCrossChainTransferDetailedV2 = (value) => {
98
90
  if (!value || typeof value !== "object")
99
91
  return value;
100
- const isBridgeToken = this.tokenClient.isBridgedToken(value.carbon_token_id);
101
- const source_blockchain = isBridgeToken ? (0, blockchain_1.getFormattedBlockchainName)(value.source_blockchain) : this.tokenClient.getBlockchainV2FromIDs(Number(value.from_chain_id), value.bridge_id);
102
- const destination_blockchain = isBridgeToken ? (0, blockchain_1.getFormattedBlockchainName)(value.destination_blockchain) : this.tokenClient.getBlockchainV2FromIDs(Number(value.to_chain_id), value.bridge_id);
92
+ const source_blockchain = this.tokenClient.getBlockchainV2FromIDs(Number(value.from_chain_id), value.bridge_id);
93
+ const destination_blockchain = this.tokenClient.getBlockchainV2FromIDs(Number(value.to_chain_id), value.bridge_id);
103
94
  const bridging_blockchain = getBridgeBlockchainFromId(value.bridge_id);
104
95
  return Object.assign(Object.assign({}, this.formatCrossChainTransferV2(value)), { source_event: this.formatChainEventV2(value.source_event, source_blockchain !== null && source_blockchain !== void 0 ? source_blockchain : ''), bridging_event: this.formatChainEventV2(value.bridging_event, bridging_blockchain), destination_event: this.formatChainEventV2(value.destination_event, destination_blockchain !== null && destination_blockchain !== void 0 ? destination_blockchain : '') });
105
96
  };
@@ -2,7 +2,7 @@ import { Carbon } from "../CarbonSDK";
2
2
  import { NetworkConfigProvider } from "../constant";
3
3
  import { GetFeeQuoteResponse } from "../hydrogen/feeQuote";
4
4
  import { BlockchainUtils, TypeUtils } from "../util";
5
- import { AxelarBridge, BlockchainV2, BridgeMap, IbcBridge } from '../util/blockchain';
5
+ import { BlockchainV2, BridgeMap, IbcBridge } from '../util/blockchain';
6
6
  import BigNumber from "bignumber.js";
7
7
  import CarbonQueryClient from "./CarbonQueryClient";
8
8
  declare class TokenClient {
@@ -57,21 +57,18 @@ declare class TokenClient {
57
57
  isNativeToken(denom: string): boolean;
58
58
  isNativeStablecoin(denom: string): boolean;
59
59
  isGroupedToken(denom: string): boolean;
60
- isBridgedToken(denom: string): boolean;
61
60
  isCarbonToken(token?: Carbon.Coin.Token | null): boolean;
62
61
  getDepositTokenFor(tokenDenom: string, chain: BlockchainUtils.Blockchain | BlockchainUtils.BlockchainV2, version?: string): Carbon.Coin.Token | undefined;
63
62
  getAllTokens(): Promise<Carbon.Coin.Token[]>;
64
63
  reloadTokens(): Promise<TypeUtils.SimpleMap<Carbon.Coin.Token>>;
65
64
  getBridges(): Promise<BridgeMap>;
66
65
  matchChainsWithDifferentChainIds(bridges: Carbon.Coin.Bridge[]): Promise<IbcBridge[]>;
67
- mapBridgesFromConnections(): Promise<AxelarBridge[]>;
68
66
  getIbcBlockchainNames(): string[];
69
- getAxelarBlockchainNames(): string[];
70
67
  getIbcBridgeFromBlockchainV2: (blockchain: BlockchainV2 | undefined) => IbcBridge | undefined;
71
68
  getIbcChainFromBlockchainV2: (blockchain: BlockchainV2 | undefined) => string | undefined;
72
69
  getPolynetworkBlockchainNames(): string[];
73
70
  getAllBlockchainNames(): string[];
74
- getBridgesFromBridgeId(bridgeId: number): Carbon.Coin.Bridge[] | IbcBridge[] | AxelarBridge[];
71
+ getBridgesFromBridgeId(bridgeId: number): Carbon.Coin.Bridge[] | IbcBridge[];
75
72
  getIbcTokens(): TypeUtils.SimpleMap<Carbon.Coin.Token>;
76
73
  getPolyNetworkTokens(): TypeUtils.SimpleMap<Carbon.Coin.Token>;
77
74
  getBlockchainV2FromIDs(chainId: number, bridgeId: number): BlockchainV2 | undefined;
@@ -48,7 +48,7 @@ class TokenClient {
48
48
  this.wrapperMap = {};
49
49
  this.poolTokens = {};
50
50
  this.cdpTokens = {};
51
- this.bridges = { polynetwork: [], ibc: [], axelar: [] };
51
+ this.bridges = { polynetwork: [], ibc: [] };
52
52
  this.symbols = {};
53
53
  this.usdValues = {};
54
54
  this.commonAssetNames = constant_1.CommonAssetName;
@@ -113,7 +113,6 @@ class TokenClient {
113
113
  return blockchain;
114
114
  }
115
115
  getBlockchainV2(denom) {
116
- var _a;
117
116
  if (!denom)
118
117
  return undefined;
119
118
  const token = this.tokens[denom];
@@ -122,13 +121,6 @@ class TokenClient {
122
121
  // pool and cdp tokens are on the Native blockchain, hence 0
123
122
  return 'Native';
124
123
  }
125
- if (this.isBridgedToken(denom)) {
126
- // brdg tokens will all be chain_id 0 which will also be deprecated in future
127
- // hence for brdg tokens cannot use chain_id to differentiate between blockchains
128
- const bridgeList = this.bridges.axelar;
129
- const chainName = (_a = bridgeList.find((bridge) => bridge.bridgeAddress === token.bridgeAddress)) === null || _a === void 0 ? void 0 : _a.chainName;
130
- return chainName;
131
- }
132
124
  const bridge = this.getBridgeFromToken(token);
133
125
  return bridge === null || bridge === void 0 ? void 0 : bridge.chainName;
134
126
  }
@@ -348,10 +340,6 @@ class TokenClient {
348
340
  const groupedTokenRegex = new RegExp(/^cgt\/\d+$/);
349
341
  return groupedTokenRegex.test(denom);
350
342
  }
351
- isBridgedToken(denom) {
352
- const bridgedTokenRegex = new RegExp(/^brdg\//);
353
- return bridgedTokenRegex.test(denom);
354
- }
355
343
  isCarbonToken(token) {
356
344
  return Boolean(token && (this.isNativeToken(token.denom) || token.bridgeId.eq(0)));
357
345
  }
@@ -439,7 +427,6 @@ class TokenClient {
439
427
  return bridge.bridgeId.toNumber() === blockchain_1.BRIDGE_IDS.ibc;
440
428
  });
441
429
  const ibcBridges = yield this.matchChainsWithDifferentChainIds(unmatchedIbcBridgeList);
442
- const axelarBridges = yield this.mapBridgesFromConnections();
443
430
  const polynetworkBridges = allBridges.bridges.reduce((prev, bridge) => {
444
431
  if (bridge.bridgeId.toNumber() !== blockchain_1.BRIDGE_IDS.polynetwork)
445
432
  return prev;
@@ -449,7 +436,6 @@ class TokenClient {
449
436
  Object.assign(this.bridges, {
450
437
  polynetwork: polynetworkBridges,
451
438
  ibc: ibcBridges,
452
- axelar: axelarBridges,
453
439
  });
454
440
  return this.bridges;
455
441
  });
@@ -508,60 +494,14 @@ class TokenClient {
508
494
  return newBridges;
509
495
  });
510
496
  }
511
- mapBridgesFromConnections() {
512
- return __awaiter(this, void 0, void 0, function* () {
513
- const newBridges = [];
514
- try {
515
- const results = yield this.query.bridge.ConnectionAll({
516
- bridgeId: new long_1.default(0),
517
- pagination: pagination_1.PageRequest.fromPartial({
518
- limit: new long_1.default(10000),
519
- }),
520
- });
521
- const connections = results.connections;
522
- connections.forEach(connection => {
523
- newBridges.push({
524
- name: `${connection.chainDisplayName} via Axelar`,
525
- bridgeId: new long_1.default(blockchain_1.BRIDGE_IDS.axelar),
526
- chainId: new long_1.default(blockchain_1.BRIDGE_IDS.axelar),
527
- bridgeAddress: connection.connectionId,
528
- chain_id_name: connection.chainId,
529
- chainName: connection.chainDisplayName,
530
- bridgeName: 'Axelar',
531
- bridgeAddresses: [],
532
- enabled: connection.isEnabled,
533
- });
534
- });
535
- }
536
- catch (err) {
537
- console.error(err);
538
- }
539
- finally {
540
- const chainMap = {};
541
- newBridges.forEach((bridge) => {
542
- const chainId = bridge.chain_id_name;
543
- if (chainMap[chainId]) {
544
- bridge.chainName = chainMap[chainId];
545
- }
546
- else {
547
- chainMap[chainId] = bridge.chainName;
548
- }
549
- });
550
- }
551
- return newBridges;
552
- });
553
- }
554
497
  getIbcBlockchainNames() {
555
498
  return this.bridges.ibc.map(bridge => bridge.chainName);
556
499
  }
557
- getAxelarBlockchainNames() {
558
- return this.bridges.axelar.map(bridge => bridge.chainName);
559
- }
560
500
  getPolynetworkBlockchainNames() {
561
501
  return this.bridges.polynetwork.map(bridge => bridge.chainName);
562
502
  }
563
503
  getAllBlockchainNames() {
564
- return this.getIbcBlockchainNames().concat(this.getPolynetworkBlockchainNames()).concat(this.getAxelarBlockchainNames());
504
+ return this.getIbcBlockchainNames().concat(this.getPolynetworkBlockchainNames());
565
505
  }
566
506
  getBridgesFromBridgeId(bridgeId) {
567
507
  switch (bridgeId) {
@@ -569,8 +509,6 @@ class TokenClient {
569
509
  return this.bridges.polynetwork;
570
510
  case blockchain_1.BRIDGE_IDS.ibc:
571
511
  return this.bridges.ibc;
572
- case blockchain_1.BRIDGE_IDS.axelar:
573
- return this.bridges.axelar;
574
512
  default:
575
513
  return this.bridges.polynetwork;
576
514
  }
@@ -1,4 +1,3 @@
1
- export { default as AxelarBridgeClient } from "./AxelarBridgeClient";
2
1
  export { default as BatchQueryClient } from "./BatchQueryClient";
3
2
  export { default as BlockchainClient } from "./BlockchainClient";
4
3
  export { default as CarbonQueryClient } from "./CarbonQueryClient";
@@ -3,9 +3,7 @@ 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.ZILClient = exports.TokenClient = exports.NEOClient = exports.InsightsQueryClient = exports.HydrogenClient = exports.ETHClient = exports.CarbonQueryClient = exports.BlockchainClient = exports.BatchQueryClient = exports.AxelarBridgeClient = void 0;
7
- var AxelarBridgeClient_1 = require("./AxelarBridgeClient");
8
- Object.defineProperty(exports, "AxelarBridgeClient", { enumerable: true, get: function () { return __importDefault(AxelarBridgeClient_1).default; } });
6
+ exports.ZILClient = exports.TokenClient = exports.NEOClient = exports.InsightsQueryClient = exports.HydrogenClient = exports.ETHClient = exports.CarbonQueryClient = exports.BlockchainClient = exports.BatchQueryClient = void 0;
9
7
  var BatchQueryClient_1 = require("./BatchQueryClient");
10
8
  Object.defineProperty(exports, "BatchQueryClient", { enumerable: true, get: function () { return __importDefault(BatchQueryClient_1).default; } });
11
9
  var BlockchainClient_1 = require("./BlockchainClient");
@@ -3,6 +3,8 @@ import _m0 from "protobufjs/minimal";
3
3
  export declare const protobufPackage = "Switcheo.carbon.cdp";
4
4
  export interface AssetParams {
5
5
  denom: string;
6
+ /** deprecated: oracle_id is now on pricing */
7
+ oracleId: string;
6
8
  rateStrategyName: string;
7
9
  allowRepayStablecoinInterest: boolean;
8
10
  loanToValue: string;
@@ -11,6 +11,7 @@ const wrappers_1 = require("../../../google/protobuf/wrappers");
11
11
  exports.protobufPackage = "Switcheo.carbon.cdp";
12
12
  const baseAssetParams = {
13
13
  denom: "",
14
+ oracleId: "",
14
15
  rateStrategyName: "",
15
16
  allowRepayStablecoinInterest: false,
16
17
  loanToValue: "",
@@ -24,6 +25,9 @@ exports.AssetParams = {
24
25
  if (message.denom !== "") {
25
26
  writer.uint32(10).string(message.denom);
26
27
  }
28
+ if (message.oracleId !== "") {
29
+ writer.uint32(18).string(message.oracleId);
30
+ }
27
31
  if (message.rateStrategyName !== "") {
28
32
  writer.uint32(26).string(message.rateStrategyName);
29
33
  }
@@ -57,6 +61,9 @@ exports.AssetParams = {
57
61
  case 1:
58
62
  message.denom = reader.string();
59
63
  break;
64
+ case 2:
65
+ message.oracleId = reader.string();
66
+ break;
60
67
  case 3:
61
68
  message.rateStrategyName = reader.string();
62
69
  break;
@@ -91,6 +98,10 @@ exports.AssetParams = {
91
98
  object.denom !== undefined && object.denom !== null
92
99
  ? String(object.denom)
93
100
  : "";
101
+ message.oracleId =
102
+ object.oracleId !== undefined && object.oracleId !== null
103
+ ? String(object.oracleId)
104
+ : "";
94
105
  message.rateStrategyName =
95
106
  object.rateStrategyName !== undefined && object.rateStrategyName !== null
96
107
  ? String(object.rateStrategyName)
@@ -127,6 +138,7 @@ exports.AssetParams = {
127
138
  toJSON(message) {
128
139
  const obj = {};
129
140
  message.denom !== undefined && (obj.denom = message.denom);
141
+ message.oracleId !== undefined && (obj.oracleId = message.oracleId);
130
142
  message.rateStrategyName !== undefined &&
131
143
  (obj.rateStrategyName = message.rateStrategyName);
132
144
  message.allowRepayStablecoinInterest !== undefined &&
@@ -142,17 +154,18 @@ exports.AssetParams = {
142
154
  return obj;
143
155
  },
144
156
  fromPartial(object) {
145
- var _a, _b, _c, _d, _e, _f, _g, _h;
157
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
146
158
  const message = Object.assign({}, baseAssetParams);
147
159
  message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : "";
148
- message.rateStrategyName = (_b = object.rateStrategyName) !== null && _b !== void 0 ? _b : "";
160
+ message.oracleId = (_b = object.oracleId) !== null && _b !== void 0 ? _b : "";
161
+ message.rateStrategyName = (_c = object.rateStrategyName) !== null && _c !== void 0 ? _c : "";
149
162
  message.allowRepayStablecoinInterest =
150
- (_c = object.allowRepayStablecoinInterest) !== null && _c !== void 0 ? _c : false;
151
- message.loanToValue = (_d = object.loanToValue) !== null && _d !== void 0 ? _d : "";
152
- message.liquidationThreshold = (_e = object.liquidationThreshold) !== null && _e !== void 0 ? _e : "";
153
- message.liquidationDiscount = (_f = object.liquidationDiscount) !== null && _f !== void 0 ? _f : "";
154
- message.supplyCap = (_g = object.supplyCap) !== null && _g !== void 0 ? _g : "";
155
- message.borrowCap = (_h = object.borrowCap) !== null && _h !== void 0 ? _h : "";
163
+ (_d = object.allowRepayStablecoinInterest) !== null && _d !== void 0 ? _d : false;
164
+ message.loanToValue = (_e = object.loanToValue) !== null && _e !== void 0 ? _e : "";
165
+ message.liquidationThreshold = (_f = object.liquidationThreshold) !== null && _f !== void 0 ? _f : "";
166
+ message.liquidationDiscount = (_g = object.liquidationDiscount) !== null && _g !== void 0 ? _g : "";
167
+ message.supplyCap = (_h = object.supplyCap) !== null && _h !== void 0 ? _h : "";
168
+ message.borrowCap = (_j = object.borrowCap) !== null && _j !== void 0 ? _j : "";
156
169
  return message;
157
170
  },
158
171
  };
@@ -3,6 +3,6 @@ export { NewTokenEvent, SyncTokenEvent, BindTokenEvent, UnbindTokenEvent, LinkTo
3
3
  export { GenesisState_WrapperMappingsEntry } from "./genesis";
4
4
  export { TokenGroup, TokenGroupDetails, GroupedTokenConfig } from "./group";
5
5
  export { CreateTokenProposal } from "./proposal";
6
- export { QueryGetTokenRequest, QueryGetTokenResponse, QueryAllTokenRequest, QueryAllTokenResponse, QueryGetLockedCoinsRequest, QueryGetLockedCoinsResponse, QueryAllWrapperMappingsRequest, QueryAllWrapperMappingsResponse, QueryAllWrapperMappingsResponse_WrapperMappingsEntry, QueryGetBalancesRequest, QueryGetBalancesResponse, QueryTotalBalancesRequest, QueryTotalBalancesResponse, QueryGetBridgeRequest, QueryGetBridgeResponse, QueryAllBridgeRequest, QueryAllBridgeResponse, QueryGetTokenGroupRequest, QueryGetTokenGroupResponse, QueryAllTokenGroupsRequest, QueryAllTokenGroupsResponse, QueryTokenGroupMappingsRequest, QueryTokenGroupMappingsResponse, QueryTokenGroupMappingsResponse_TokenGroupMappingsEntry, QueryPolyBlacklistRequest, QueryPolyBlacklistResponse } from "./query";
6
+ export { QueryGetTokenRequest, QueryGetTokenResponse, QueryAllTokenRequest, QueryAllTokenResponse, QueryGetLockedCoinsRequest, QueryGetLockedCoinsResponse, QueryAllWrapperMappingsRequest, QueryAllWrapperMappingsResponse, QueryAllWrapperMappingsResponse_WrapperMappingsEntry, QueryGetBalancesRequest, QueryGetBalancesResponse, QueryTotalBalancesRequest, QueryTotalBalancesResponse, QueryGetBridgeRequest, QueryGetBridgeResponse, QueryAllBridgeRequest, QueryAllBridgeResponse, QueryGetTokenGroupRequest, QueryGetTokenGroupResponse, QueryAllTokenGroupsRequest, QueryAllTokenGroupsResponse, QueryTokenGroupMappingsRequest, QueryTokenGroupMappingsResponse, QueryTokenGroupMappingsResponse_TokenGroupMappingsEntry } from "./query";
7
7
  export { Token, BalanceChange, Metadata, LockedCoins, LockedCoinsRecord, PositionPool, TokenBalance } from "./token";
8
- export { MsgCreateToken, CreateTokenParams, MsgCreateTokenResponse, MsgSyncToken, MsgSyncTokenResponse, MsgMintToken, MsgMintTokenResponse, MsgBindToken, MsgBindTokenResponse, MsgUnbindToken, MsgUnbindTokenResponse, MsgLinkToken, MsgLinkTokenResponse, MsgWithdraw, MsgWithdrawResponse, MsgAdminWithdraw, MsgAdminWithdrawResponse, MsgAuthorizeBridge, MsgAuthorizeBridgeResponse, MsgDeauthorizeBridge, MsgDeauthorizeBridgeResponse, MsgEditBridgeName, MsgEditBridgeNameResponse, MsgRemoveBridge, MsgRemoveBridgeResponse, MsgUpdateToken, UpdateTokenParams, MsgUpdateTokenResponse, MsgAddBridgeAddress, MsgAddBridgeAddressResponse, MsgRemoveBridgeAddress, MsgRemoveBridgeAddressResponse, MsgCreateGroup, MsgCreateGroupResponse, MsgUpdateGroup, UpdateGroupParams, MsgUpdateGroupResponse, MsgRegisterToGroup, MsgRegisterToGroupResponse, MsgDeregisterFromGroup, MsgDeregisterFromGroupResponse, MsgDepositToGroup, MsgDepositToGroupResponse, MsgWithdrawFromGroup, MsgWithdrawFromGroupResponse, MsgUpdateGroupedTokenConfig, UpdateGroupedTokenConfigParams, MsgUpdateGroupedTokenConfigResponse } from "./tx";
8
+ export { MsgCreateToken, CreateTokenParams, MsgCreateTokenResponse, MsgSyncToken, MsgSyncTokenResponse, MsgMintToken, MsgMintTokenResponse, MsgBindToken, MsgBindTokenResponse, MsgUnbindToken, MsgUnbindTokenResponse, MsgLinkToken, MsgLinkTokenResponse, MsgWithdraw, MsgWithdrawResponse, MsgAuthorizeBridge, MsgAuthorizeBridgeResponse, MsgDeauthorizeBridge, MsgDeauthorizeBridgeResponse, MsgEditBridgeName, MsgEditBridgeNameResponse, MsgRemoveBridge, MsgRemoveBridgeResponse, MsgUpdateToken, UpdateTokenParams, MsgUpdateTokenResponse, MsgAddBridgeAddress, MsgAddBridgeAddressResponse, MsgRemoveBridgeAddress, MsgRemoveBridgeAddressResponse, MsgCreateGroup, MsgCreateGroupResponse, MsgUpdateGroup, UpdateGroupParams, MsgUpdateGroupResponse, MsgRegisterToGroup, MsgRegisterToGroupResponse, MsgDeregisterFromGroup, MsgDeregisterFromGroupResponse, MsgDepositToGroup, MsgDepositToGroupResponse, MsgWithdrawFromGroup, MsgWithdrawFromGroupResponse, MsgUpdateGroupedTokenConfig, UpdateGroupedTokenConfigParams, MsgUpdateGroupedTokenConfigResponse } from "./tx";