@injectivelabs/sdk-ts 1.15.23 → 1.15.25-beta.0

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.
@@ -12,9 +12,9 @@ export declare class ChainGrpcBankApi extends BaseGrpcConsumer {
12
12
  fetchBalance({ accountAddress, denom, }: {
13
13
  accountAddress: string;
14
14
  denom: string;
15
- }): Promise<import("@injectivelabs/ts-types").Coin>;
15
+ }): Promise<import("../../../../../ts-types/dist/cjs/cosmos.js").Coin>;
16
16
  fetchBalances(address: string, pagination?: PaginationOption): Promise<{
17
- balances: import("@injectivelabs/ts-types").Coin[];
17
+ balances: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin[];
18
18
  pagination: import("../../../types/pagination.js").Pagination;
19
19
  }>;
20
20
  fetchTotalSupply(pagination?: PaginationOption): Promise<{
@@ -26,7 +26,7 @@ export declare class ChainGrpcBankApi extends BaseGrpcConsumer {
26
26
  supply: import("../types/bank.js").TotalSupply;
27
27
  pagination: import("../../../types/pagination.js").Pagination;
28
28
  }>;
29
- fetchSupplyOf(denom: string): Promise<import("@injectivelabs/ts-types").Coin>;
29
+ fetchSupplyOf(denom: string): Promise<import("../../../../../ts-types/dist/cjs/cosmos.js").Coin>;
30
30
  fetchDenomsMetadata(pagination?: PaginationOption): Promise<{
31
31
  metadatas: import("../types/bank.js").Metadata[];
32
32
  pagination: import("../../../types/pagination.js").Pagination;
@@ -35,7 +35,7 @@ export declare class ChainGrpcBankApi extends BaseGrpcConsumer {
35
35
  fetchDenomOwners(denom: string, pagination?: PaginationOption): Promise<{
36
36
  denomOwners: {
37
37
  address: string;
38
- balance: import("@injectivelabs/ts-types").Coin | undefined;
38
+ balance: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
39
39
  }[];
40
40
  pagination: import("../../../types/pagination.js").Pagination;
41
41
  }>;
@@ -33,7 +33,7 @@ export declare class ChainGrpcPermissionsApi extends BaseGrpcConsumer {
33
33
  fetchVoucher({ denom, address }: {
34
34
  denom: string;
35
35
  address: string;
36
- }): Promise<import("@injectivelabs/ts-types").Coin | undefined>;
36
+ }): Promise<import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined>;
37
37
  fetchVouchers(denom: string): Promise<import("../types/permissions.js").PermissionAddressVoucher[]>;
38
38
  fetchModuleState(): Promise<{
39
39
  params: import("../types/permissions.js").PermissionsModuleParams;
@@ -25,7 +25,7 @@ export declare class ChainGrpcPermissionsTransformer {
25
25
  static roleManagersResponseToRoleManagers(response: InjectivePermissionsV1Beta1Query.QueryRoleManagersResponse): PermissionRoleManager[];
26
26
  static policyStatusesResponseToPolicyStatuses(response: InjectivePermissionsV1Beta1Query.QueryPolicyStatusesResponse): PermissionPolicyStatus[];
27
27
  static policyManagerCapabilitiesResponseToPolicyManagerCapabilities(response: InjectivePermissionsV1Beta1Query.QueryPolicyManagerCapabilitiesResponse): PermissionPolicyManagerCapability[];
28
- static voucherResponseToVoucher(response: InjectivePermissionsV1Beta1Query.QueryVoucherResponse): import("@injectivelabs/ts-types").Coin | undefined;
28
+ static voucherResponseToVoucher(response: InjectivePermissionsV1Beta1Query.QueryVoucherResponse): import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
29
29
  static vouchersResponseToVouchers(response: InjectivePermissionsV1Beta1Query.QueryVouchersResponse): PermissionAddressVoucher[];
30
30
  static moduleStateResponseToModuleState(response: InjectivePermissionsV1Beta1Query.QueryModuleStateResponse): {
31
31
  params: PermissionsModuleParams;
@@ -90,8 +90,8 @@ export declare class IndexerGrpcMitoApi extends BaseGrpcConsumer {
90
90
  vaultAddress: string;
91
91
  numberByAccount: number;
92
92
  timestamp: number;
93
- rewardedTokens: import("@injectivelabs/ts-types").Coin[];
94
- stakeAmount: import("@injectivelabs/ts-types").Coin | undefined;
93
+ rewardedTokens: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin[];
94
+ stakeAmount: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
95
95
  }[];
96
96
  pagination: import("../types/mito.js").MitoPagination | undefined;
97
97
  }>;
@@ -104,9 +104,9 @@ export declare class IndexerGrpcMitoApi extends BaseGrpcConsumer {
104
104
  vaultName: string;
105
105
  vaultAddress: string;
106
106
  lockTimestamp: number;
107
- claimableRewards: import("@injectivelabs/ts-types").Coin[];
108
- stakedAmount: import("@injectivelabs/ts-types").Coin | undefined;
109
- lockedAmount: import("@injectivelabs/ts-types").Coin | undefined;
107
+ claimableRewards: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin[];
108
+ stakedAmount: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
109
+ lockedAmount: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
110
110
  }[];
111
111
  pagination: import("../types/mito.js").MitoPagination | undefined;
112
112
  }>;
@@ -22,9 +22,9 @@ export declare class IndexerGrpcMitoStreamTransformer {
22
22
  vaultName: string;
23
23
  vaultAddress: string;
24
24
  lockTimestamp: number;
25
- claimableRewards: import("@injectivelabs/ts-types").Coin[];
26
- stakedAmount: import("@injectivelabs/ts-types").Coin | undefined;
27
- lockedAmount: import("@injectivelabs/ts-types").Coin | undefined;
25
+ claimableRewards: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin[];
26
+ stakedAmount: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
27
+ lockedAmount: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
28
28
  } | undefined;
29
29
  opType: StreamOperation;
30
30
  };
@@ -36,8 +36,8 @@ export declare class IndexerGrpcMitoStreamTransformer {
36
36
  vaultAddress: string;
37
37
  numberByAccount: number;
38
38
  timestamp: number;
39
- rewardedTokens: import("@injectivelabs/ts-types").Coin[];
40
- stakeAmount: import("@injectivelabs/ts-types").Coin | undefined;
39
+ rewardedTokens: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin[];
40
+ stakeAmount: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
41
41
  } | undefined;
42
42
  opType: StreamOperation;
43
43
  };
@@ -20,9 +20,9 @@ export declare class IndexerGrpcMitoTransformer {
20
20
  vaultName: string;
21
21
  vaultAddress: string;
22
22
  lockTimestamp: number;
23
- claimableRewards: import("@injectivelabs/ts-types").Coin[];
24
- stakedAmount: import("@injectivelabs/ts-types").Coin | undefined;
25
- lockedAmount: import("@injectivelabs/ts-types").Coin | undefined;
23
+ claimableRewards: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin[];
24
+ stakedAmount: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
25
+ lockedAmount: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
26
26
  };
27
27
  static mitoGaugeToGauge(gauge: MitoApi.Gauge): MitoGauge;
28
28
  static mitoStakingPoolToStakingPool(stakingPool: MitoApi.StakingPool): MitoStakingPool;
@@ -33,8 +33,8 @@ export declare class IndexerGrpcMitoTransformer {
33
33
  vaultAddress: string;
34
34
  numberByAccount: number;
35
35
  timestamp: number;
36
- rewardedTokens: import("@injectivelabs/ts-types").Coin[];
37
- stakeAmount: import("@injectivelabs/ts-types").Coin | undefined;
36
+ rewardedTokens: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin[];
37
+ stakeAmount: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
38
38
  };
39
39
  static mitoSubscriptionToSubscription(subscription: MitoApi.Subscription): MitoSubscription;
40
40
  static mitoLpHolderToLPHolder(holder: MitoApi.Holders): MitoHolders;
@@ -83,9 +83,9 @@ export declare class IndexerGrpcMitoTransformer {
83
83
  vaultName: string;
84
84
  vaultAddress: string;
85
85
  lockTimestamp: number;
86
- claimableRewards: import("@injectivelabs/ts-types").Coin[];
87
- stakedAmount: import("@injectivelabs/ts-types").Coin | undefined;
88
- lockedAmount: import("@injectivelabs/ts-types").Coin | undefined;
86
+ claimableRewards: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin[];
87
+ stakedAmount: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
88
+ lockedAmount: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
89
89
  }[];
90
90
  pagination: MitoPagination | undefined;
91
91
  };
@@ -97,8 +97,8 @@ export declare class IndexerGrpcMitoTransformer {
97
97
  vaultAddress: string;
98
98
  numberByAccount: number;
99
99
  timestamp: number;
100
- rewardedTokens: import("@injectivelabs/ts-types").Coin[];
101
- stakeAmount: import("@injectivelabs/ts-types").Coin | undefined;
100
+ rewardedTokens: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin[];
101
+ stakeAmount: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin | undefined;
102
102
  }[];
103
103
  pagination: MitoPagination | undefined;
104
104
  };
@@ -3,7 +3,7 @@ import { GrpcOrderType } from '../../chain/types/exchange.js';
3
3
  import { PriceLevel } from './exchange.js';
4
4
  import { TokenMeta } from './../../../types/token.js';
5
5
  import { InjectiveSpotExchangeRpc } from '@injectivelabs/indexer-proto-ts';
6
- import { Coin } from '@injectivelabs//ts-types';
6
+ import { Coin } from '@injectivelabs/ts-types';
7
7
  export interface SpotMarket {
8
8
  marketId: string;
9
9
  marketStatus: string;
@@ -10,7 +10,7 @@ export declare class IncentivesQueryTransformer {
10
10
  static contractCampaignResponseToContractCampaign(response: WasmContractQueryResponse): {
11
11
  id: number;
12
12
  name: string;
13
- rewards: import("@injectivelabs/ts-types").Coin[];
13
+ rewards: import("../../../../../ts-types/dist/cjs/cosmos.js").Coin[];
14
14
  inRound: number;
15
15
  marketId: string;
16
16
  isFunded: boolean;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Address = void 0;
4
- const bech32_1 = require("bech32");
4
+ const base_1 = require("@scure/base");
5
5
  const ethereumjs_util_1 = require("ethereumjs-util");
6
6
  const exceptions_1 = require("@injectivelabs/exceptions");
7
7
  const constants_js_1 = require("../../utils/constants.js");
@@ -28,10 +28,10 @@ class Address {
28
28
  */
29
29
  static fromBech32(bech, prefix = constants_js_1.BECH32_ADDR_ACC_PREFIX) {
30
30
  try {
31
- const address = Buffer.from(bech32_1.bech32.fromWords(bech32_1.bech32.decode(bech).words)).toString('hex');
31
+ const address = Buffer.from(base_1.bech32.fromWords(base_1.bech32.decode(bech).words)).toString('hex');
32
32
  const addressInHex = address.startsWith('0x') ? address : `0x${address}`;
33
33
  const addressBuffer = ethereumjs_util_1.Address.fromString(addressInHex.toString()).toBuffer();
34
- const bech32Address = bech32_1.bech32.encode(prefix, bech32_1.bech32.toWords(addressBuffer));
34
+ const bech32Address = base_1.bech32.encode(prefix, base_1.bech32.toWords(addressBuffer));
35
35
  return new Address(bech32Address);
36
36
  }
37
37
  catch (e) {
@@ -50,7 +50,7 @@ class Address {
50
50
  static fromHex(hex, prefix = constants_js_1.BECH32_ADDR_ACC_PREFIX) {
51
51
  const addressHex = hex.startsWith('0x') ? hex : `0x${hex}`;
52
52
  const addressBuffer = ethereumjs_util_1.Address.fromString(addressHex.toString()).toBuffer();
53
- const bech32Address = bech32_1.bech32.encode(prefix, bech32_1.bech32.toWords(addressBuffer));
53
+ const bech32Address = base_1.bech32.encode(prefix, base_1.bech32.toWords(addressBuffer));
54
54
  return new Address(bech32Address);
55
55
  }
56
56
  /**
@@ -62,7 +62,7 @@ class Address {
62
62
  const address = this.toHex();
63
63
  const addressHex = address.startsWith('0x') ? address : `0x${address}`;
64
64
  const addressBuffer = ethereumjs_util_1.Address.fromString(addressHex).toBuffer();
65
- return bech32_1.bech32.encode(prefix, bech32_1.bech32.toWords(addressBuffer));
65
+ return base_1.bech32.encode(prefix, base_1.bech32.toWords(addressBuffer));
66
66
  }
67
67
  /**
68
68
  * Return a bech32-encoded account address
@@ -95,7 +95,7 @@ class Address {
95
95
  * */
96
96
  toHex() {
97
97
  const { bech32Address } = this;
98
- const address = Buffer.from(bech32_1.bech32.fromWords(bech32_1.bech32.decode(bech32Address).words)).toString('hex');
98
+ const address = Buffer.from(base_1.bech32.fromWords(base_1.bech32.decode(bech32Address).words)).toString('hex');
99
99
  return address.startsWith('0x') ? address : `0x${address}`;
100
100
  }
101
101
  /**
@@ -1,37 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
4
  };
@@ -43,7 +10,6 @@ const secp256k1_1 = __importDefault(require("secp256k1"));
43
10
  const keccak256_1 = __importDefault(require("keccak256"));
44
11
  const PublicKey_js_1 = require("./PublicKey.js");
45
12
  const Address_js_1 = require("./Address.js");
46
- const BytesUtils = __importStar(require("@ethersproject/bytes"));
47
13
  const eth_sig_util_1 = require("@metamask/eth-sig-util");
48
14
  const index_js_1 = require("../../utils/index.js");
49
15
  const core_proto_ts_1 = require("@injectivelabs/core-proto-ts");
@@ -157,8 +123,8 @@ class PrivateKey {
157
123
  const { wallet } = this;
158
124
  const msgHash = (0, keccak256_1.default)(messageBytes);
159
125
  const signature = wallet.signingKey.sign(msgHash);
160
- const splitSignature = BytesUtils.splitSignature(signature);
161
- return BytesUtils.arrayify(BytesUtils.concat([splitSignature.r, splitSignature.s]));
126
+ const splittedSignature = ethers_1.Signature.from(signature);
127
+ return (0, ethers_1.getBytes)((0, ethers_1.concat)([splittedSignature.r, splittedSignature.s]));
162
128
  }
163
129
  /**
164
130
  * Sign the given message using the edcsa sign_deterministic function.
@@ -183,8 +149,8 @@ class PrivateKey {
183
149
  signHashed(messageHashedBytes) {
184
150
  const { wallet } = this;
185
151
  const signature = wallet.signingKey.sign(messageHashedBytes);
186
- const splitSignature = BytesUtils.splitSignature(signature);
187
- return BytesUtils.arrayify(BytesUtils.concat([splitSignature.r, splitSignature.s]));
152
+ const splittedSignature = ethers_1.Signature.from(signature);
153
+ return (0, ethers_1.getBytes)((0, ethers_1.concat)([splittedSignature.r, splittedSignature.s]));
188
154
  }
189
155
  /**
190
156
  * Sign the given message using the edcsa sign_deterministic function.
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.PublicKey = void 0;
7
7
  const index_js_1 = require("../../utils/index.js");
8
- const bech32_1 = require("bech32");
8
+ const base_1 = require("@scure/base");
9
9
  const ethereumjs_util_1 = require("ethereumjs-util");
10
10
  const secp256k1_1 = __importDefault(require("secp256k1"));
11
11
  const Address_js_1 = require("./Address.js");
@@ -53,7 +53,7 @@ class PublicKey {
53
53
  * Note: this does not convert the public key to an address.
54
54
  */
55
55
  toBech32() {
56
- return bech32_1.bech32.encode(index_js_1.BECH32_PUBKEY_ACC_PREFIX, bech32_1.bech32.toWords(Buffer.from(this.toHex(), 'hex')));
56
+ return base_1.bech32.encode(index_js_1.BECH32_PUBKEY_ACC_PREFIX, base_1.bech32.toWords(Buffer.from(this.toHex(), 'hex')));
57
57
  }
58
58
  toAddress() {
59
59
  const publicKeyHex = this.toHex();
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.removeHexPrefix = exports.addHexPrefix = exports.isCw20ContractAddress = exports.getChecksumAddress = exports.getAddressFromInjectiveAddress = exports.getSubaccountId = exports.getDefaultSubaccountId = exports.getInjectiveAddressFromSubaccountId = exports.getEthereumAddress = exports.getInjectiveAddress = void 0;
7
- const bech32_1 = require("bech32");
7
+ const base_1 = require("@scure/base");
8
8
  const ethereumjs_util_1 = require("ethereumjs-util");
9
9
  const keccak256_1 = __importDefault(require("keccak256"));
10
10
  /**
@@ -15,7 +15,7 @@ const keccak256_1 = __importDefault(require("keccak256"));
15
15
  */
16
16
  const getInjectiveAddress = (ethAddress) => {
17
17
  const addressBuffer = ethereumjs_util_1.Address.fromString(ethAddress.toString()).toBuffer();
18
- return bech32_1.bech32.encode('inj', bech32_1.bech32.toWords(addressBuffer));
18
+ return base_1.bech32.encode('inj', base_1.bech32.toWords(addressBuffer));
19
19
  };
20
20
  exports.getInjectiveAddress = getInjectiveAddress;
21
21
  /**
@@ -28,7 +28,7 @@ const getEthereumAddress = (injectiveAddress) => {
28
28
  if (injectiveAddress.startsWith('0x')) {
29
29
  return injectiveAddress;
30
30
  }
31
- return `0x${Buffer.from(bech32_1.bech32.fromWords(bech32_1.bech32.decode(injectiveAddress).words)).toString('hex')}`;
31
+ return `0x${Buffer.from(base_1.bech32.fromWords(base_1.bech32.decode(injectiveAddress).words)).toString('hex')}`;
32
32
  };
33
33
  exports.getEthereumAddress = getEthereumAddress;
34
34
  /**
@@ -49,7 +49,7 @@ exports.getInjectiveAddressFromSubaccountId = getInjectiveAddressFromSubaccountI
49
49
  * @returns string
50
50
  */
51
51
  const getDefaultSubaccountId = (injectiveAddress) => {
52
- return `0x${Buffer.from(bech32_1.bech32.fromWords(bech32_1.bech32.decode(injectiveAddress).words)).toString('hex')}${'0'.repeat(24)}`;
52
+ return `0x${Buffer.from(base_1.bech32.fromWords(base_1.bech32.decode(injectiveAddress).words)).toString('hex')}${'0'.repeat(24)}`;
53
53
  };
54
54
  exports.getDefaultSubaccountId = getDefaultSubaccountId;
55
55
  /**
@@ -59,7 +59,7 @@ exports.getDefaultSubaccountId = getDefaultSubaccountId;
59
59
  * @returns string
60
60
  */
61
61
  const getSubaccountId = (injectiveAddress, nonce = 0) => {
62
- return `0x${Buffer.from(bech32_1.bech32.fromWords(bech32_1.bech32.decode(injectiveAddress).words)).toString('hex')}${'0'.repeat(23)}${nonce}`;
62
+ return `0x${Buffer.from(base_1.bech32.fromWords(base_1.bech32.decode(injectiveAddress).words)).toString('hex')}${'0'.repeat(23)}${nonce}`;
63
63
  };
64
64
  exports.getSubaccountId = getSubaccountId;
65
65
  /** @deprecated - use getEthereumAddress */
@@ -67,7 +67,7 @@ const getAddressFromInjectiveAddress = (address) => {
67
67
  if (address.startsWith('0x')) {
68
68
  return address;
69
69
  }
70
- return `0x${Buffer.from(bech32_1.bech32.fromWords(bech32_1.bech32.decode(address).words)).toString('hex')}`;
70
+ return `0x${Buffer.from(base_1.bech32.fromWords(base_1.bech32.decode(address).words)).toString('hex')}`;
71
71
  };
72
72
  exports.getAddressFromInjectiveAddress = getAddressFromInjectiveAddress;
73
73
  const getChecksumAddress = (ethAddress) => {
@@ -3,7 +3,7 @@ import { GrpcOrderType } from '../../chain/types/exchange.js';
3
3
  import { PriceLevel } from './exchange.js';
4
4
  import { TokenMeta } from './../../../types/token.js';
5
5
  import { InjectiveSpotExchangeRpc } from '@injectivelabs/indexer-proto-ts';
6
- import { Coin } from '@injectivelabs//ts-types';
6
+ import { Coin } from '@injectivelabs/ts-types';
7
7
  export interface SpotMarket {
8
8
  marketId: string;
9
9
  marketStatus: string;
@@ -1,4 +1,4 @@
1
- import { bech32 } from 'bech32';
1
+ import { bech32 } from '@scure/base';
2
2
  import { Address as EthereumUtilsAddress } from 'ethereumjs-util';
3
3
  import { ErrorType, GeneralException } from '@injectivelabs/exceptions';
4
4
  import { BECH32_ADDR_ACC_PREFIX, BECH32_ADDR_CONS_PREFIX, BECH32_ADDR_VAL_PREFIX, } from '../../utils/constants.js';
@@ -1,10 +1,9 @@
1
1
  import { generateMnemonic } from 'bip39';
2
- import { Wallet, HDNodeWallet } from 'ethers';
2
+ import { Wallet, HDNodeWallet, Signature, getBytes, concat } from 'ethers';
3
3
  import secp256k1 from 'secp256k1';
4
4
  import keccak256 from 'keccak256';
5
5
  import { PublicKey } from './PublicKey.js';
6
6
  import { Address } from './Address.js';
7
- import * as BytesUtils from '@ethersproject/bytes';
8
7
  import { signTypedData, SignTypedDataVersion } from '@metamask/eth-sig-util';
9
8
  import { DEFAULT_DERIVATION_PATH, recoverTypedSignaturePubKey, } from '../../utils/index.js';
10
9
  import { InjectiveTypesV1Beta1TxExt, } from '@injectivelabs/core-proto-ts';
@@ -118,8 +117,8 @@ export class PrivateKey {
118
117
  const { wallet } = this;
119
118
  const msgHash = keccak256(messageBytes);
120
119
  const signature = wallet.signingKey.sign(msgHash);
121
- const splitSignature = BytesUtils.splitSignature(signature);
122
- return BytesUtils.arrayify(BytesUtils.concat([splitSignature.r, splitSignature.s]));
120
+ const splittedSignature = Signature.from(signature);
121
+ return getBytes(concat([splittedSignature.r, splittedSignature.s]));
123
122
  }
124
123
  /**
125
124
  * Sign the given message using the edcsa sign_deterministic function.
@@ -144,8 +143,8 @@ export class PrivateKey {
144
143
  signHashed(messageHashedBytes) {
145
144
  const { wallet } = this;
146
145
  const signature = wallet.signingKey.sign(messageHashedBytes);
147
- const splitSignature = BytesUtils.splitSignature(signature);
148
- return BytesUtils.arrayify(BytesUtils.concat([splitSignature.r, splitSignature.s]));
146
+ const splittedSignature = Signature.from(signature);
147
+ return getBytes(concat([splittedSignature.r, splittedSignature.s]));
149
148
  }
150
149
  /**
151
150
  * Sign the given message using the edcsa sign_deterministic function.
@@ -1,5 +1,5 @@
1
1
  import { BECH32_PUBKEY_ACC_PREFIX, decompressPubKey } from '../../utils/index.js';
2
- import { bech32 } from 'bech32';
2
+ import { bech32 } from '@scure/base';
3
3
  import { toBuffer } from 'ethereumjs-util';
4
4
  import secp256k1 from 'secp256k1';
5
5
  import { Address } from './Address.js';
@@ -1,4 +1,4 @@
1
- import { bech32 } from 'bech32';
1
+ import { bech32 } from '@scure/base';
2
2
  import { Address } from 'ethereumjs-util';
3
3
  import keccak256 from 'keccak256';
4
4
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@injectivelabs/sdk-ts",
3
3
  "description": "SDK in TypeScript for building Injective applications in a browser, node, and react native environment.",
4
- "version": "1.15.23",
4
+ "version": "1.15.25-beta.0",
5
5
  "sideEffects": false,
6
6
  "license": "Apache-2.0",
7
7
  "author": {
@@ -121,24 +121,23 @@
121
121
  "@cosmjs/amino": "^0.33.0",
122
122
  "@cosmjs/proto-signing": "^0.33.0",
123
123
  "@cosmjs/stargate": "^0.33.0",
124
- "@ethersproject/bytes": "^5.8.0",
125
124
  "@injectivelabs/abacus-proto-ts": "1.14.0",
126
125
  "@injectivelabs/core-proto-ts": "1.14.3",
127
- "@injectivelabs/exceptions": "^1.15.20",
126
+ "@injectivelabs/exceptions": "^1.15.22-beta.0",
128
127
  "@injectivelabs/grpc-web": "^0.0.1",
129
128
  "@injectivelabs/grpc-web-node-http-transport": "^0.0.2",
130
129
  "@injectivelabs/grpc-web-react-native-transport": "^0.0.2",
131
130
  "@injectivelabs/indexer-proto-ts": "1.13.12",
132
131
  "@injectivelabs/mito-proto-ts": "1.13.2",
133
- "@injectivelabs/networks": "^1.15.21",
132
+ "@injectivelabs/networks": "^1.15.23-beta.0",
134
133
  "@injectivelabs/olp-proto-ts": "1.13.4",
135
- "@injectivelabs/ts-types": "^1.15.21",
136
- "@injectivelabs/utils": "^1.15.21",
134
+ "@injectivelabs/ts-types": "^1.15.23-beta.0",
135
+ "@injectivelabs/utils": "^1.15.23-beta.0",
137
136
  "@metamask/eth-sig-util": "^8.2.0",
138
137
  "@noble/curves": "^1.8.1",
139
138
  "@noble/hashes": "^1.7.1",
139
+ "@scure/base": "^1.2.6",
140
140
  "axios": "^1.8.1",
141
- "bech32": "^2.0.0",
142
141
  "bip39": "^3.1.0",
143
142
  "cosmjs-types": "^0.9.0",
144
143
  "crypto-js": "^4.2.0",
@@ -152,7 +151,7 @@
152
151
  "shx": "^0.3.4",
153
152
  "snakecase-keys": "^5.4.1"
154
153
  },
155
- "gitHead": "fe69f860c669483a0d1de3419952de88b5e157b0",
154
+ "gitHead": "309bbc355de329bc7c94eb3db212f8d7164d94f0",
156
155
  "typedoc": {
157
156
  "entryPoint": "./src/index.ts",
158
157
  "readmeFile": "./README.md",