carbon-js-sdk 0.3.10 → 0.3.12

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.
@@ -38,6 +38,7 @@ declare class TokenClient {
38
38
  static isCdpToken(denom: string): boolean;
39
39
  static isPoolToken(denom: string): boolean;
40
40
  static isIBCDenom(denom: string): boolean;
41
+ static isCdpIbcDenom(denom: string): boolean;
41
42
  isWrappedToken(denom?: string): boolean;
42
43
  hasWrappedToken(denom?: string): boolean;
43
44
  getWrappedTokens(denom: string): Token[];
@@ -132,7 +132,7 @@ class TokenClient {
132
132
  var _a;
133
133
  if (typeof denom !== 'string')
134
134
  return '';
135
- if (!TokenClient.isIBCDenom(denom)) {
135
+ if (!TokenClient.isIBCDenom(denom) && !TokenClient.isCdpIbcDenom(denom)) {
136
136
  denom = denom.toLowerCase();
137
137
  }
138
138
  const symbol = this.getSymbol(denom);
@@ -198,6 +198,9 @@ class TokenClient {
198
198
  static isIBCDenom(denom) {
199
199
  return denom.match(ibc_1.ibcTokenRegex) !== null;
200
200
  }
201
+ static isCdpIbcDenom(denom) {
202
+ return ibc_1.cibtIbcTokenRegex.test(denom);
203
+ }
201
204
  isWrappedToken(denom) {
202
205
  return !!this.wrapperMap[denom !== null && denom !== void 0 ? denom : ""];
203
206
  }
@@ -62,6 +62,7 @@ export interface ChannelConfig {
62
62
  dstChannel: string;
63
63
  }
64
64
  export declare const swthChannels: SimpleMap<ChannelConfig>;
65
+ export declare const cibtIbcTokenRegex: RegExp;
65
66
  export declare const ibcTokenRegex: RegExp;
66
67
  export declare const ibcNetworkRegex: RegExp;
67
68
  export declare const ibcDefaultGas: number;
@@ -19,9 +19,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.DefaultGasPriceStep = exports.ibcDefaultGas = exports.ibcNetworkRegex = exports.ibcTokenRegex = exports.swthChannels = exports.EmbedChainInfosInit = exports.ibcWhitelist = exports.swthIbcWhitelist = exports.ChainIds = exports.IBCAddress = void 0;
22
+ exports.DefaultGasPriceStep = exports.ibcDefaultGas = exports.ibcNetworkRegex = exports.ibcTokenRegex = exports.cibtIbcTokenRegex = exports.swthChannels = exports.EmbedChainInfosInit = exports.ibcWhitelist = exports.swthIbcWhitelist = exports.ChainIds = exports.IBCAddress = void 0;
23
23
  const bech32 = __importStar(require("bech32"));
24
24
  const generic_1 = require("./generic");
25
+ const token_1 = require("./token");
25
26
  exports.IBCAddress = {
26
27
  getAddressBytes(bech32Address, prefix) {
27
28
  const decoded = bech32.decode(bech32Address);
@@ -1727,9 +1728,10 @@ exports.swthChannels = {
1727
1728
  dstChannel: "channel-46",
1728
1729
  },
1729
1730
  };
1731
+ exports.cibtIbcTokenRegex = RegExp(`^${token_1.DenomPrefix.CDPToken}/ibc/([a-f\\d]+)$`, "i");
1730
1732
  exports.ibcTokenRegex = /^ibc\/([a-f\d]+)$/i;
1731
1733
  exports.ibcNetworkRegex = /^([a-z\d_-]+)-([\d]+)$/i;
1732
- exports.ibcDefaultGas = 150000;
1734
+ exports.ibcDefaultGas = 200000;
1733
1735
  exports.DefaultGasPriceStep = {
1734
1736
  low: 0.01,
1735
1737
  average: 0.025,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-js-sdk",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "description": "TypeScript SDK for Carbon blockchain",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",