@injectivelabs/wallet-core 1.16.38-alpha.3 → 1.16.38-alpha.5
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/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.d.cts +5 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +7 -5
- package/package.json +8 -8
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
|
|
2
2
|
let eventemitter3 = require("eventemitter3");
|
|
3
3
|
let __injectivelabs_wallet_base = require("@injectivelabs/wallet-base");
|
|
4
|
-
let __injectivelabs_sdk_ts = require("@injectivelabs/sdk-ts");
|
|
5
4
|
let __injectivelabs_ts_types = require("@injectivelabs/ts-types");
|
|
5
|
+
let __injectivelabs_sdk_ts_utils = require("@injectivelabs/sdk-ts/utils");
|
|
6
6
|
let __injectivelabs_sdk_ts_core_accounts = require("@injectivelabs/sdk-ts/core/accounts");
|
|
7
7
|
let __injectivelabs_sdk_ts_client_indexer = require("@injectivelabs/sdk-ts/client/indexer");
|
|
8
8
|
let __injectivelabs_networks = require("@injectivelabs/networks");
|
|
9
9
|
let __injectivelabs_sdk_ts_client_chain = require("@injectivelabs/sdk-ts/client/chain");
|
|
10
10
|
let __injectivelabs_utils = require("@injectivelabs/utils");
|
|
11
|
-
let __injectivelabs_sdk_ts_utils = require("@injectivelabs/sdk-ts/utils");
|
|
12
11
|
let __injectivelabs_sdk_ts_core_tx = require("@injectivelabs/sdk-ts/core/tx");
|
|
13
12
|
|
|
14
13
|
//#region src/utils/tx.ts
|
|
@@ -121,6 +120,9 @@ var BaseWalletStrategy = class {
|
|
|
121
120
|
getAddresses(args) {
|
|
122
121
|
return this.getStrategy().getAddresses(args);
|
|
123
122
|
}
|
|
123
|
+
getAddressesInfo(args) {
|
|
124
|
+
return this.getStrategy().getAddressesInfo(args);
|
|
125
|
+
}
|
|
124
126
|
getWalletDeviceType() {
|
|
125
127
|
return this.getStrategy().getWalletDeviceType();
|
|
126
128
|
}
|
|
@@ -300,7 +302,7 @@ var MsgBroadcaster = class {
|
|
|
300
302
|
ethereumAddress: (0, __injectivelabs_wallet_base.getEthereumSignerAddress)(tx.injectiveAddress),
|
|
301
303
|
injectiveAddress: (0, __injectivelabs_wallet_base.getInjectiveSignerAddress)(tx.injectiveAddress)
|
|
302
304
|
};
|
|
303
|
-
if (
|
|
305
|
+
if (__injectivelabs_sdk_ts_utils.ofacList.includes(txWithAddresses.ethereumAddress)) throw new __injectivelabs_exceptions.GeneralException(/* @__PURE__ */ new Error("You cannot execute this transaction"));
|
|
304
306
|
try {
|
|
305
307
|
return (0, __injectivelabs_wallet_base.isCosmosWallet)(walletStrategy.wallet) ? await this.broadcastDirectSign(txWithAddresses) : (0, __injectivelabs_wallet_base.isEip712V2OnlyWallet)(walletStrategy.wallet) ? await this.broadcastEip712V2(txWithAddresses) : await this.broadcastEip712(txWithAddresses);
|
|
306
308
|
} catch (e) {
|
|
@@ -325,7 +327,7 @@ var MsgBroadcaster = class {
|
|
|
325
327
|
ethereumAddress: (0, __injectivelabs_wallet_base.getEthereumSignerAddress)(tx.injectiveAddress),
|
|
326
328
|
injectiveAddress: (0, __injectivelabs_wallet_base.getInjectiveSignerAddress)(tx.injectiveAddress)
|
|
327
329
|
};
|
|
328
|
-
if (
|
|
330
|
+
if (__injectivelabs_sdk_ts_utils.ofacList.includes(txWithAddresses.ethereumAddress)) throw new __injectivelabs_exceptions.GeneralException(/* @__PURE__ */ new Error("You cannot execute this transaction"));
|
|
329
331
|
try {
|
|
330
332
|
return (0, __injectivelabs_wallet_base.isCosmosWallet)(walletStrategy.wallet) ? await this.broadcastDirectSign(txWithAddresses) : await this.broadcastEip712V2(txWithAddresses);
|
|
331
333
|
} catch (e) {
|
|
@@ -349,7 +351,7 @@ var MsgBroadcaster = class {
|
|
|
349
351
|
ethereumAddress: (0, __injectivelabs_wallet_base.getEthereumSignerAddress)(tx.injectiveAddress),
|
|
350
352
|
injectiveAddress: (0, __injectivelabs_wallet_base.getInjectiveSignerAddress)(tx.injectiveAddress)
|
|
351
353
|
};
|
|
352
|
-
if (
|
|
354
|
+
if (__injectivelabs_sdk_ts_utils.ofacList.includes(txWithAddresses.ethereumAddress)) throw new __injectivelabs_exceptions.GeneralException(/* @__PURE__ */ new Error("You cannot execute this transaction"));
|
|
353
355
|
try {
|
|
354
356
|
return (0, __injectivelabs_wallet_base.isCosmosWallet)(walletStrategy.wallet) ? await this.broadcastDirectSignWithFeeDelegation(txWithAddresses) : await this.broadcastEip712WithFeeDelegation(txWithAddresses);
|
|
355
357
|
} catch (e) {
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -81,6 +81,11 @@ declare class BaseWalletStrategy implements WalletStrategy {
|
|
|
81
81
|
setMetadata(metadata?: WalletMetadata): void;
|
|
82
82
|
getStrategy(): ConcreteWalletStrategy;
|
|
83
83
|
getAddresses(args?: unknown): Promise<AccountAddress[]>;
|
|
84
|
+
getAddressesInfo(args?: unknown): Promise<{
|
|
85
|
+
address: string;
|
|
86
|
+
derivationPath: string;
|
|
87
|
+
baseDerivationPath: string;
|
|
88
|
+
}[]>;
|
|
84
89
|
getWalletDeviceType(): Promise<WalletDeviceType>;
|
|
85
90
|
getPubKey(address?: string): Promise<string>;
|
|
86
91
|
enable(args?: unknown): Promise<boolean>;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -81,6 +81,11 @@ declare class BaseWalletStrategy implements WalletStrategy {
|
|
|
81
81
|
setMetadata(metadata?: WalletMetadata): void;
|
|
82
82
|
getStrategy(): ConcreteWalletStrategy;
|
|
83
83
|
getAddresses(args?: unknown): Promise<AccountAddress[]>;
|
|
84
|
+
getAddressesInfo(args?: unknown): Promise<{
|
|
85
|
+
address: string;
|
|
86
|
+
derivationPath: string;
|
|
87
|
+
baseDerivationPath: string;
|
|
88
|
+
}[]>;
|
|
84
89
|
getWalletDeviceType(): Promise<WalletDeviceType>;
|
|
85
90
|
getPubKey(address?: string): Promise<string>;
|
|
86
91
|
enable(args?: unknown): Promise<boolean>;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ChainCosmosErrorCode, GeneralException, TransactionChainErrorModule, TransactionException, UnspecifiedErrorCode, WalletException, Web3Exception, isThrownException } from "@injectivelabs/exceptions";
|
|
2
2
|
import { EventEmitter } from "eventemitter3";
|
|
3
3
|
import { Wallet, WalletDeviceType, createEip712StdSignDoc, getEthereumSignerAddress, getInjectiveSignerAddress, isCosmosAminoOnlyWallet, isCosmosWallet, isEip712V2OnlyWallet, isEvmBrowserWallet, isEvmWallet } from "@injectivelabs/wallet-base";
|
|
4
|
-
import { ofacWallets } from "@injectivelabs/sdk-ts";
|
|
5
4
|
import { EvmChainId } from "@injectivelabs/ts-types";
|
|
5
|
+
import { base64ToUint8Array, getGasPriceBasedOnMessage, hexToBase64, hexToBuff, hexToUint8Array, ofacList, recoverTypedSignaturePubKey, uint8ArrayToBase64 } from "@injectivelabs/sdk-ts/utils";
|
|
6
6
|
import { PublicKey } from "@injectivelabs/sdk-ts/core/accounts";
|
|
7
7
|
import { IndexerGrpcWeb3GwApi } from "@injectivelabs/sdk-ts/client/indexer";
|
|
8
8
|
import { getNetworkEndpoints, getNetworkInfo, isMainnet, isTestnet } from "@injectivelabs/networks";
|
|
9
9
|
import { ChainGrpcAuthApi, ChainGrpcTendermintApi, ChainGrpcTxFeesApi } from "@injectivelabs/sdk-ts/client/chain";
|
|
10
10
|
import { DEFAULT_BLOCK_TIMEOUT_HEIGHT, DEFAULT_BLOCK_TIME_IN_SECONDS, DEFAULT_GAS_PRICE, getStdFee, sleep, toBigNumber } from "@injectivelabs/utils";
|
|
11
|
-
import { base64ToUint8Array, getGasPriceBasedOnMessage, hexToBase64, hexToBuff, hexToUint8Array, recoverTypedSignaturePubKey, uint8ArrayToBase64 } from "@injectivelabs/sdk-ts/utils";
|
|
12
11
|
import { SIGN_DIRECT, SIGN_EIP712, SIGN_EIP712_V2, TxGrpcApi, createTransaction, createTransactionWithSigners, createTxRawEIP712, createTxRawFromSigResponse, createWeb3Extension, getAminoStdSignDoc, getEip712TypedData, getEip712TypedDataV2 } from "@injectivelabs/sdk-ts/core/tx";
|
|
13
12
|
|
|
14
13
|
//#region src/utils/tx.ts
|
|
@@ -121,6 +120,9 @@ var BaseWalletStrategy = class {
|
|
|
121
120
|
getAddresses(args) {
|
|
122
121
|
return this.getStrategy().getAddresses(args);
|
|
123
122
|
}
|
|
123
|
+
getAddressesInfo(args) {
|
|
124
|
+
return this.getStrategy().getAddressesInfo(args);
|
|
125
|
+
}
|
|
124
126
|
getWalletDeviceType() {
|
|
125
127
|
return this.getStrategy().getWalletDeviceType();
|
|
126
128
|
}
|
|
@@ -300,7 +302,7 @@ var MsgBroadcaster = class {
|
|
|
300
302
|
ethereumAddress: getEthereumSignerAddress(tx.injectiveAddress),
|
|
301
303
|
injectiveAddress: getInjectiveSignerAddress(tx.injectiveAddress)
|
|
302
304
|
};
|
|
303
|
-
if (
|
|
305
|
+
if (ofacList.includes(txWithAddresses.ethereumAddress)) throw new GeneralException(/* @__PURE__ */ new Error("You cannot execute this transaction"));
|
|
304
306
|
try {
|
|
305
307
|
return isCosmosWallet(walletStrategy.wallet) ? await this.broadcastDirectSign(txWithAddresses) : isEip712V2OnlyWallet(walletStrategy.wallet) ? await this.broadcastEip712V2(txWithAddresses) : await this.broadcastEip712(txWithAddresses);
|
|
306
308
|
} catch (e) {
|
|
@@ -325,7 +327,7 @@ var MsgBroadcaster = class {
|
|
|
325
327
|
ethereumAddress: getEthereumSignerAddress(tx.injectiveAddress),
|
|
326
328
|
injectiveAddress: getInjectiveSignerAddress(tx.injectiveAddress)
|
|
327
329
|
};
|
|
328
|
-
if (
|
|
330
|
+
if (ofacList.includes(txWithAddresses.ethereumAddress)) throw new GeneralException(/* @__PURE__ */ new Error("You cannot execute this transaction"));
|
|
329
331
|
try {
|
|
330
332
|
return isCosmosWallet(walletStrategy.wallet) ? await this.broadcastDirectSign(txWithAddresses) : await this.broadcastEip712V2(txWithAddresses);
|
|
331
333
|
} catch (e) {
|
|
@@ -349,7 +351,7 @@ var MsgBroadcaster = class {
|
|
|
349
351
|
ethereumAddress: getEthereumSignerAddress(tx.injectiveAddress),
|
|
350
352
|
injectiveAddress: getInjectiveSignerAddress(tx.injectiveAddress)
|
|
351
353
|
};
|
|
352
|
-
if (
|
|
354
|
+
if (ofacList.includes(txWithAddresses.ethereumAddress)) throw new GeneralException(/* @__PURE__ */ new Error("You cannot execute this transaction"));
|
|
353
355
|
try {
|
|
354
356
|
return isCosmosWallet(walletStrategy.wallet) ? await this.broadcastDirectSignWithFeeDelegation(txWithAddresses) : await this.broadcastEip712WithFeeDelegation(txWithAddresses);
|
|
355
357
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-core",
|
|
3
|
-
"version": "1.16.38-alpha.
|
|
3
|
+
"version": "1.16.38-alpha.5",
|
|
4
4
|
"description": "Core wallet strategy",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"dist"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@keplr-wallet/types": "^0.12.
|
|
41
|
+
"@keplr-wallet/types": "^0.12.296",
|
|
42
42
|
"eventemitter3": "^5.0.1",
|
|
43
|
-
"@injectivelabs/
|
|
44
|
-
"@injectivelabs/
|
|
45
|
-
"@injectivelabs/ts-types": "1.16.38-alpha.
|
|
46
|
-
"@injectivelabs/sdk-ts": "1.16.38-alpha.
|
|
47
|
-
"@injectivelabs/utils": "1.16.38-alpha.
|
|
48
|
-
"@injectivelabs/wallet-base": "1.16.38-alpha.
|
|
43
|
+
"@injectivelabs/exceptions": "1.16.38-alpha.3",
|
|
44
|
+
"@injectivelabs/networks": "1.16.38-alpha.2",
|
|
45
|
+
"@injectivelabs/ts-types": "1.16.38-alpha.2",
|
|
46
|
+
"@injectivelabs/sdk-ts": "1.16.38-alpha.5",
|
|
47
|
+
"@injectivelabs/utils": "1.16.38-alpha.4",
|
|
48
|
+
"@injectivelabs/wallet-base": "1.16.38-alpha.5"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|