@injectivelabs/sdk-ts 1.0.453 → 1.0.454

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.
@@ -8,10 +8,17 @@ export declare const getInjectiveAddress: (ethAddress: string) => string;
8
8
  /**
9
9
  * Get ethereum address from injective bech32 address
10
10
  *
11
- * @param ethAddress string
11
+ * @param injectiveAddress string
12
12
  * @returns string
13
13
  */
14
14
  export declare const getEthereumAddress: (injectiveAddress: string) => string;
15
+ /**
16
+ * Get default subaccount id from injective bech32 address
17
+ *
18
+ * @param injectiveAddress string
19
+ * @returns string
20
+ */
21
+ export declare const getDefaultSubaccountId: (injectiveAddress: string) => string;
15
22
  /** @deprecated - use getEthereumAddress */
16
23
  export declare const getAddressFromInjectiveAddress: (address: string) => string;
17
24
  //# sourceMappingURL=address.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/utils/address.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,eAAgB,MAAM,KAAG,MAIxD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,qBAAsB,MAAM,KAAG,MAQ7D,CAAA;AAED,2CAA2C;AAC3C,eAAO,MAAM,8BAA8B,YAAa,MAAM,KAAG,MAQhE,CAAA"}
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/utils/address.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,eAAgB,MAAM,KAAG,MAIxD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,qBAAsB,MAAM,KAAG,MAQ7D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,qBAAsB,MAAM,KAAG,MAIjE,CAAA;AAED,2CAA2C;AAC3C,eAAO,MAAM,8BAA8B,YAAa,MAAM,KAAG,MAQhE,CAAA"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAddressFromInjectiveAddress = exports.getEthereumAddress = exports.getInjectiveAddress = void 0;
3
+ exports.getAddressFromInjectiveAddress = exports.getDefaultSubaccountId = exports.getEthereumAddress = exports.getInjectiveAddress = void 0;
4
4
  const bech32_1 = require("bech32");
5
5
  const ethereumjs_util_1 = require("ethereumjs-util");
6
6
  /**
@@ -17,7 +17,7 @@ exports.getInjectiveAddress = getInjectiveAddress;
17
17
  /**
18
18
  * Get ethereum address from injective bech32 address
19
19
  *
20
- * @param ethAddress string
20
+ * @param injectiveAddress string
21
21
  * @returns string
22
22
  */
23
23
  const getEthereumAddress = (injectiveAddress) => {
@@ -27,6 +27,16 @@ const getEthereumAddress = (injectiveAddress) => {
27
27
  return `0x${Buffer.from(bech32_1.bech32.fromWords(bech32_1.bech32.decode(injectiveAddress).words)).toString('hex')}`;
28
28
  };
29
29
  exports.getEthereumAddress = getEthereumAddress;
30
+ /**
31
+ * Get default subaccount id from injective bech32 address
32
+ *
33
+ * @param injectiveAddress string
34
+ * @returns string
35
+ */
36
+ const getDefaultSubaccountId = (injectiveAddress) => {
37
+ return `0x${Buffer.from(bech32_1.bech32.fromWords(bech32_1.bech32.decode(injectiveAddress).words)).toString('hex')}${'0'.repeat(24)}`;
38
+ };
39
+ exports.getDefaultSubaccountId = getDefaultSubaccountId;
30
40
  /** @deprecated - use getEthereumAddress */
31
41
  const getAddressFromInjectiveAddress = (address) => {
32
42
  if (address.startsWith('0x')) {
@@ -1 +1 @@
1
- {"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/utils/address.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAC/B,qDAAyC;AAEzC;;;;;GAKG;AACI,MAAM,mBAAmB,GAAG,CAAC,UAAkB,EAAU,EAAE;IAChE,MAAM,aAAa,GAAG,yBAAO,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAA;IA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ript for building Injective applications in a browser, node, and react native environment.",
4
- "version": "1.0.453",
4
+ "version": "1.0.454",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
7
7
  "name": "Bojan Angjelkoski",
@@ -68,7 +68,7 @@
68
68
  "shx": "^0.3.2",
69
69
  "snakecase-keys": "^5.4.1"
70
70
  },
71
- "gitHead": "e40e132bfb0b2044e39dc99a65ff4d4be677b731",
71
+ "gitHead": "257113b0c7ba4716fae09359844303a5b4133850",
72
72
  "typedoc": {
73
73
  "entryPoint": "./src/index.ts",
74
74
  "readmeFile": "./README.md",