@injectivelabs/wallet-core 1.16.12 → 1.16.13-alpha.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.
- package/dist/cjs/broadcaster/MsgBroadcaster.d.ts +9 -8
- package/dist/cjs/broadcaster/MsgBroadcaster.js +12 -9
- package/dist/cjs/broadcaster/Web3Broadcaster.d.ts +3 -3
- package/dist/cjs/broadcaster/types.d.ts +16 -15
- package/dist/cjs/broadcaster/types.js +10 -11
- package/dist/cjs/strategy/BaseWalletStrategy.d.ts +8 -6
- package/dist/cjs/strategy/BaseWalletStrategy.js +1 -1
- package/dist/esm/broadcaster/MsgBroadcaster.d.ts +9 -8
- package/dist/esm/broadcaster/MsgBroadcaster.js +12 -9
- package/dist/esm/broadcaster/Web3Broadcaster.d.ts +3 -3
- package/dist/esm/broadcaster/types.d.ts +16 -15
- package/dist/esm/broadcaster/types.js +10 -11
- package/dist/esm/strategy/BaseWalletStrategy.d.ts +8 -6
- package/dist/esm/strategy/BaseWalletStrategy.js +1 -1
- package/package.json +8 -8
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NetworkEndpoints } from '@injectivelabs/networks';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import { EvmChainId } from '@injectivelabs/ts-types';
|
|
2
|
+
import type { NetworkEndpoints } from '@injectivelabs/networks';
|
|
3
|
+
import type BaseWalletStrategy from '../strategy/BaseWalletStrategy.js';
|
|
4
|
+
import type { ChainId as ChainIdType, EvmChainId as EvmChainIdType } from '@injectivelabs/ts-types';
|
|
5
|
+
import type { MsgBroadcasterOptions, MsgBroadcasterTxOptions } from './types.js';
|
|
6
|
+
import type { TxResponse } from '@injectivelabs/sdk-ts';
|
|
6
7
|
/**
|
|
7
8
|
* This class is used to broadcast transactions
|
|
8
9
|
* using the WalletStrategy as a handler
|
|
@@ -14,14 +15,14 @@ export declare class MsgBroadcaster {
|
|
|
14
15
|
options: MsgBroadcasterOptions;
|
|
15
16
|
walletStrategy: BaseWalletStrategy;
|
|
16
17
|
endpoints: NetworkEndpoints;
|
|
17
|
-
chainId:
|
|
18
|
+
chainId: ChainIdType;
|
|
18
19
|
txTimeout: number;
|
|
19
20
|
simulateTx: boolean;
|
|
20
21
|
txTimeoutOnFeeDelegation: boolean;
|
|
21
|
-
evmChainId?:
|
|
22
|
+
evmChainId?: EvmChainIdType;
|
|
22
23
|
gasBufferCoefficient: number;
|
|
23
24
|
retriesOnError: {
|
|
24
|
-
|
|
25
|
+
[x: string]: {
|
|
25
26
|
retries: number;
|
|
26
27
|
maxRetries: number;
|
|
27
28
|
timeout: number;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MsgBroadcaster = void 0;
|
|
4
|
-
const
|
|
4
|
+
const ts_types_1 = require("@injectivelabs/ts-types");
|
|
5
|
+
const networks_1 = require("@injectivelabs/networks");
|
|
5
6
|
const utils_1 = require("@injectivelabs/utils");
|
|
6
7
|
const exceptions_1 = require("@injectivelabs/exceptions");
|
|
7
|
-
const networks_1 = require("@injectivelabs/networks");
|
|
8
|
-
const ts_types_1 = require("@injectivelabs/ts-types");
|
|
9
|
-
const types_js_1 = require("./types.js");
|
|
10
|
-
const index_js_1 = require("../utils/index.js");
|
|
11
8
|
const wallet_base_1 = require("@injectivelabs/wallet-base");
|
|
12
|
-
const
|
|
9
|
+
const sdk_ts_1 = require("@injectivelabs/sdk-ts");
|
|
10
|
+
const index_js_1 = require("../utils/index.js");
|
|
11
|
+
const types_js_1 = require("./types.js");
|
|
12
|
+
const getEthereumWalletPubKey = async ({ pubKey, eip712TypedData, signature, }) => {
|
|
13
13
|
if (pubKey) {
|
|
14
14
|
return pubKey;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
const recoveredPubKey = await (0, sdk_ts_1.recoverTypedSignaturePubKey)(
|
|
17
|
+
// TODO: fix type
|
|
18
|
+
eip712TypedData, signature);
|
|
19
|
+
return (0, sdk_ts_1.hexToBase64)(recoveredPubKey);
|
|
17
20
|
};
|
|
18
21
|
const defaultRetriesConfig = () => ({
|
|
19
22
|
[`${exceptions_1.TransactionChainErrorModule.CosmosSdk}-${exceptions_1.ChainCosmosErrorCode.ErrMempoolIsFull}`]: {
|
|
@@ -252,7 +255,7 @@ class MsgBroadcaster {
|
|
|
252
255
|
});
|
|
253
256
|
/** Signing on Ethereum */
|
|
254
257
|
const signature = await walletStrategy.signEip712TypedData(JSON.stringify(eip712TypedData), tx.ethereumAddress);
|
|
255
|
-
const pubKeyOrSignatureDerivedPubKey = getEthereumWalletPubKey({
|
|
258
|
+
const pubKeyOrSignatureDerivedPubKey = await getEthereumWalletPubKey({
|
|
256
259
|
pubKey: baseAccount.pubKey?.key,
|
|
257
260
|
eip712TypedData,
|
|
258
261
|
signature,
|
|
@@ -346,7 +349,7 @@ class MsgBroadcaster {
|
|
|
346
349
|
walletStrategy.emit(types_js_1.WalletStrategyEmitterEventType.TransactionPreparationEnd);
|
|
347
350
|
/** Signing on Ethereum */
|
|
348
351
|
const signature = await walletStrategy.signEip712TypedData(JSON.stringify(eip712TypedData), tx.ethereumAddress);
|
|
349
|
-
const pubKeyOrSignatureDerivedPubKey = getEthereumWalletPubKey({
|
|
352
|
+
const pubKeyOrSignatureDerivedPubKey = await getEthereumWalletPubKey({
|
|
350
353
|
pubKey: baseAccount.pubKey?.key,
|
|
351
354
|
eip712TypedData,
|
|
352
355
|
signature,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Network } from '@injectivelabs/networks';
|
|
2
|
-
import { EvmChainId } from '@injectivelabs/ts-types';
|
|
3
|
-
import BaseWalletStrategy from '../strategy/BaseWalletStrategy.js';
|
|
1
|
+
import type { Network } from '@injectivelabs/networks';
|
|
2
|
+
import type { EvmChainId } from '@injectivelabs/ts-types';
|
|
3
|
+
import type BaseWalletStrategy from '../strategy/BaseWalletStrategy.js';
|
|
4
4
|
interface SendTransactionOptions {
|
|
5
5
|
tx: {
|
|
6
6
|
from: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EventEmitter } from 'eventemitter3';
|
|
2
|
-
import { Msgs } from '@injectivelabs/sdk-ts';
|
|
3
|
-
import { ChainId, EvmChainId } from '@injectivelabs/ts-types';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import type { EventEmitter } from 'eventemitter3';
|
|
2
|
+
import type { Msgs } from '@injectivelabs/sdk-ts';
|
|
3
|
+
import type { ChainId, EvmChainId } from '@injectivelabs/ts-types';
|
|
4
|
+
import type BaseWalletStrategy from '../strategy/BaseWalletStrategy.js';
|
|
5
|
+
import type { Network, NetworkEndpoints } from '@injectivelabs/networks';
|
|
6
6
|
export interface MsgBroadcasterTxOptions {
|
|
7
7
|
memo?: string;
|
|
8
8
|
ethereumAddress?: string;
|
|
@@ -32,16 +32,17 @@ export interface MsgBroadcasterOptions {
|
|
|
32
32
|
gasBufferCoefficient?: number;
|
|
33
33
|
httpHeaders?: Record<string, string>;
|
|
34
34
|
}
|
|
35
|
-
export declare
|
|
36
|
-
TransactionFail
|
|
37
|
-
TransactionSigned
|
|
38
|
-
TransactionSignStart
|
|
39
|
-
TransactionBroadcastEnd
|
|
40
|
-
WalletStrategyDisconnect
|
|
41
|
-
TransactionBroadcastStart
|
|
42
|
-
TransactionPreparationEnd
|
|
43
|
-
TransactionPreparationStart
|
|
44
|
-
}
|
|
35
|
+
export declare const WalletStrategyEmitterEventType: {
|
|
36
|
+
readonly TransactionFail: "transaction-fail";
|
|
37
|
+
readonly TransactionSigned: "transaction-signed";
|
|
38
|
+
readonly TransactionSignStart: "transaction-sign-start";
|
|
39
|
+
readonly TransactionBroadcastEnd: "transaction-broadcast-end";
|
|
40
|
+
readonly WalletStrategyDisconnect: "wallet-strategy-disconnect";
|
|
41
|
+
readonly TransactionBroadcastStart: "transaction-broadcast-start";
|
|
42
|
+
readonly TransactionPreparationEnd: "transaction-preparation-end";
|
|
43
|
+
readonly TransactionPreparationStart: "transaction-preparation-start";
|
|
44
|
+
};
|
|
45
|
+
export type WalletStrategyEmitterEventType = typeof WalletStrategyEmitterEventType[keyof typeof WalletStrategyEmitterEventType];
|
|
45
46
|
export type WalletStrategyEmitterEvents = {
|
|
46
47
|
[WalletStrategyEmitterEventType.TransactionFail]: Record<string, any>;
|
|
47
48
|
[WalletStrategyEmitterEventType.TransactionSigned]: Record<string, any>;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WalletStrategyEmitterEventType = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})(WalletStrategyEmitterEventType || (exports.WalletStrategyEmitterEventType = WalletStrategyEmitterEventType = {}));
|
|
4
|
+
exports.WalletStrategyEmitterEventType = {
|
|
5
|
+
TransactionFail: 'transaction-fail',
|
|
6
|
+
TransactionSigned: 'transaction-signed',
|
|
7
|
+
TransactionSignStart: 'transaction-sign-start',
|
|
8
|
+
TransactionBroadcastEnd: 'transaction-broadcast-end',
|
|
9
|
+
WalletStrategyDisconnect: 'wallet-strategy-disconnect',
|
|
10
|
+
TransactionBroadcastStart: 'transaction-broadcast-start',
|
|
11
|
+
TransactionPreparationEnd: 'transaction-preparation-end',
|
|
12
|
+
TransactionPreparationStart: 'transaction-preparation-start',
|
|
13
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { Wallet, type WalletMetadata } from '@injectivelabs/wallet-base';
|
|
2
|
+
import type { StdSignDoc } from '@keplr-wallet/types';
|
|
3
|
+
import type { OfflineSigner } from '@cosmjs/proto-signing';
|
|
4
|
+
import type { AccountAddress } from '@injectivelabs/ts-types';
|
|
5
|
+
import type { ChainId, EvmChainId } from '@injectivelabs/ts-types';
|
|
6
|
+
import type { WalletStrategyEmitter } from '../broadcaster/types.js';
|
|
7
|
+
import type { TxRaw, TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
|
|
8
|
+
import type { Eip1193Provider, WalletDeviceType, ConcreteStrategiesArg, SendTransactionOptions, ConcreteWalletStrategy, onAccountChangeCallback, onChainIdChangeCallback, WalletStrategyArguments, CosmosWalletAbstraction, WalletStrategy as WalletStrategyInterface } from '@injectivelabs/wallet-base';
|
|
7
9
|
export default class BaseWalletStrategy implements WalletStrategyInterface {
|
|
8
10
|
strategies: ConcreteStrategiesArg;
|
|
9
11
|
wallet: Wallet;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const eventemitter3_1 = require("eventemitter3");
|
|
4
|
-
const wallet_base_1 = require("@injectivelabs/wallet-base");
|
|
5
4
|
const exceptions_1 = require("@injectivelabs/exceptions");
|
|
5
|
+
const wallet_base_1 = require("@injectivelabs/wallet-base");
|
|
6
6
|
const types_js_1 = require("../broadcaster/types.js");
|
|
7
7
|
const getInitialWallet = (args) => {
|
|
8
8
|
if (args.wallet) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NetworkEndpoints } from '@injectivelabs/networks';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import { EvmChainId } from '@injectivelabs/ts-types';
|
|
2
|
+
import type { NetworkEndpoints } from '@injectivelabs/networks';
|
|
3
|
+
import type BaseWalletStrategy from '../strategy/BaseWalletStrategy.js';
|
|
4
|
+
import type { ChainId as ChainIdType, EvmChainId as EvmChainIdType } from '@injectivelabs/ts-types';
|
|
5
|
+
import type { MsgBroadcasterOptions, MsgBroadcasterTxOptions } from './types.js';
|
|
6
|
+
import type { TxResponse } from '@injectivelabs/sdk-ts';
|
|
6
7
|
/**
|
|
7
8
|
* This class is used to broadcast transactions
|
|
8
9
|
* using the WalletStrategy as a handler
|
|
@@ -14,14 +15,14 @@ export declare class MsgBroadcaster {
|
|
|
14
15
|
options: MsgBroadcasterOptions;
|
|
15
16
|
walletStrategy: BaseWalletStrategy;
|
|
16
17
|
endpoints: NetworkEndpoints;
|
|
17
|
-
chainId:
|
|
18
|
+
chainId: ChainIdType;
|
|
18
19
|
txTimeout: number;
|
|
19
20
|
simulateTx: boolean;
|
|
20
21
|
txTimeoutOnFeeDelegation: boolean;
|
|
21
|
-
evmChainId?:
|
|
22
|
+
evmChainId?: EvmChainIdType;
|
|
22
23
|
gasBufferCoefficient: number;
|
|
23
24
|
retriesOnError: {
|
|
24
|
-
|
|
25
|
+
[x: string]: {
|
|
25
26
|
retries: number;
|
|
26
27
|
maxRetries: number;
|
|
27
28
|
timeout: number;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EvmChainId } from '@injectivelabs/ts-types';
|
|
2
|
+
import { isTestnet, isMainnet, getNetworkInfo, getNetworkEndpoints, } from '@injectivelabs/networks';
|
|
2
3
|
import { sleep, getStdFee, BigNumberInBase, DEFAULT_GAS_PRICE, DEFAULT_BLOCK_TIMEOUT_HEIGHT, } from '@injectivelabs/utils';
|
|
3
4
|
import { WalletException, GeneralException, isThrownException, UnspecifiedErrorCode, ChainCosmosErrorCode, TransactionException, TransactionChainErrorModule, } from '@injectivelabs/exceptions';
|
|
4
|
-
import { isTestnet, isMainnet, getNetworkInfo, getNetworkEndpoints, } from '@injectivelabs/networks';
|
|
5
|
-
import { EvmChainId } from '@injectivelabs/ts-types';
|
|
6
|
-
import { WalletStrategyEmitterEventType, } from './types.js';
|
|
7
|
-
import { checkIfTxRunOutOfGas } from '../utils/index.js';
|
|
8
5
|
import { Wallet, isCosmosWallet, WalletDeviceType, isEvmBrowserWallet, isEip712V2OnlyWallet, createEip712StdSignDoc, isCosmosAminoOnlyWallet, getEthereumSignerAddress, getInjectiveSignerAddress, } from '@injectivelabs/wallet-base';
|
|
9
|
-
|
|
6
|
+
import { TxGrpcApi, hexToBuff, PublicKey, SIGN_DIRECT, hexToBase64, ofacWallets, SIGN_EIP712, SIGN_EIP712_V2, ChainGrpcAuthApi, createTxRawEIP712, createTransaction, ChainGrpcTxFeesApi, getAminoStdSignDoc, getEip712TypedData, createWeb3Extension, getEip712TypedDataV2, IndexerGrpcWeb3GwApi, ChainGrpcTendermintApi, getGasPriceBasedOnMessage, createTxRawFromSigResponse, recoverTypedSignaturePubKey, createTransactionWithSigners } from '@injectivelabs/sdk-ts';
|
|
7
|
+
import { checkIfTxRunOutOfGas } from '../utils/index.js';
|
|
8
|
+
import { WalletStrategyEmitterEventType } from './types.js';
|
|
9
|
+
const getEthereumWalletPubKey = async ({ pubKey, eip712TypedData, signature, }) => {
|
|
10
10
|
if (pubKey) {
|
|
11
11
|
return pubKey;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
const recoveredPubKey = await recoverTypedSignaturePubKey(
|
|
14
|
+
// TODO: fix type
|
|
15
|
+
eip712TypedData, signature);
|
|
16
|
+
return hexToBase64(recoveredPubKey);
|
|
14
17
|
};
|
|
15
18
|
const defaultRetriesConfig = () => ({
|
|
16
19
|
[`${TransactionChainErrorModule.CosmosSdk}-${ChainCosmosErrorCode.ErrMempoolIsFull}`]: {
|
|
@@ -249,7 +252,7 @@ export class MsgBroadcaster {
|
|
|
249
252
|
});
|
|
250
253
|
/** Signing on Ethereum */
|
|
251
254
|
const signature = await walletStrategy.signEip712TypedData(JSON.stringify(eip712TypedData), tx.ethereumAddress);
|
|
252
|
-
const pubKeyOrSignatureDerivedPubKey = getEthereumWalletPubKey({
|
|
255
|
+
const pubKeyOrSignatureDerivedPubKey = await getEthereumWalletPubKey({
|
|
253
256
|
pubKey: baseAccount.pubKey?.key,
|
|
254
257
|
eip712TypedData,
|
|
255
258
|
signature,
|
|
@@ -343,7 +346,7 @@ export class MsgBroadcaster {
|
|
|
343
346
|
walletStrategy.emit(WalletStrategyEmitterEventType.TransactionPreparationEnd);
|
|
344
347
|
/** Signing on Ethereum */
|
|
345
348
|
const signature = await walletStrategy.signEip712TypedData(JSON.stringify(eip712TypedData), tx.ethereumAddress);
|
|
346
|
-
const pubKeyOrSignatureDerivedPubKey = getEthereumWalletPubKey({
|
|
349
|
+
const pubKeyOrSignatureDerivedPubKey = await getEthereumWalletPubKey({
|
|
347
350
|
pubKey: baseAccount.pubKey?.key,
|
|
348
351
|
eip712TypedData,
|
|
349
352
|
signature,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Network } from '@injectivelabs/networks';
|
|
2
|
-
import { EvmChainId } from '@injectivelabs/ts-types';
|
|
3
|
-
import BaseWalletStrategy from '../strategy/BaseWalletStrategy.js';
|
|
1
|
+
import type { Network } from '@injectivelabs/networks';
|
|
2
|
+
import type { EvmChainId } from '@injectivelabs/ts-types';
|
|
3
|
+
import type BaseWalletStrategy from '../strategy/BaseWalletStrategy.js';
|
|
4
4
|
interface SendTransactionOptions {
|
|
5
5
|
tx: {
|
|
6
6
|
from: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EventEmitter } from 'eventemitter3';
|
|
2
|
-
import { Msgs } from '@injectivelabs/sdk-ts';
|
|
3
|
-
import { ChainId, EvmChainId } from '@injectivelabs/ts-types';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import type { EventEmitter } from 'eventemitter3';
|
|
2
|
+
import type { Msgs } from '@injectivelabs/sdk-ts';
|
|
3
|
+
import type { ChainId, EvmChainId } from '@injectivelabs/ts-types';
|
|
4
|
+
import type BaseWalletStrategy from '../strategy/BaseWalletStrategy.js';
|
|
5
|
+
import type { Network, NetworkEndpoints } from '@injectivelabs/networks';
|
|
6
6
|
export interface MsgBroadcasterTxOptions {
|
|
7
7
|
memo?: string;
|
|
8
8
|
ethereumAddress?: string;
|
|
@@ -32,16 +32,17 @@ export interface MsgBroadcasterOptions {
|
|
|
32
32
|
gasBufferCoefficient?: number;
|
|
33
33
|
httpHeaders?: Record<string, string>;
|
|
34
34
|
}
|
|
35
|
-
export declare
|
|
36
|
-
TransactionFail
|
|
37
|
-
TransactionSigned
|
|
38
|
-
TransactionSignStart
|
|
39
|
-
TransactionBroadcastEnd
|
|
40
|
-
WalletStrategyDisconnect
|
|
41
|
-
TransactionBroadcastStart
|
|
42
|
-
TransactionPreparationEnd
|
|
43
|
-
TransactionPreparationStart
|
|
44
|
-
}
|
|
35
|
+
export declare const WalletStrategyEmitterEventType: {
|
|
36
|
+
readonly TransactionFail: "transaction-fail";
|
|
37
|
+
readonly TransactionSigned: "transaction-signed";
|
|
38
|
+
readonly TransactionSignStart: "transaction-sign-start";
|
|
39
|
+
readonly TransactionBroadcastEnd: "transaction-broadcast-end";
|
|
40
|
+
readonly WalletStrategyDisconnect: "wallet-strategy-disconnect";
|
|
41
|
+
readonly TransactionBroadcastStart: "transaction-broadcast-start";
|
|
42
|
+
readonly TransactionPreparationEnd: "transaction-preparation-end";
|
|
43
|
+
readonly TransactionPreparationStart: "transaction-preparation-start";
|
|
44
|
+
};
|
|
45
|
+
export type WalletStrategyEmitterEventType = typeof WalletStrategyEmitterEventType[keyof typeof WalletStrategyEmitterEventType];
|
|
45
46
|
export type WalletStrategyEmitterEvents = {
|
|
46
47
|
[WalletStrategyEmitterEventType.TransactionFail]: Record<string, any>;
|
|
47
48
|
[WalletStrategyEmitterEventType.TransactionSigned]: Record<string, any>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})(WalletStrategyEmitterEventType || (WalletStrategyEmitterEventType = {}));
|
|
1
|
+
export const WalletStrategyEmitterEventType = {
|
|
2
|
+
TransactionFail: 'transaction-fail',
|
|
3
|
+
TransactionSigned: 'transaction-signed',
|
|
4
|
+
TransactionSignStart: 'transaction-sign-start',
|
|
5
|
+
TransactionBroadcastEnd: 'transaction-broadcast-end',
|
|
6
|
+
WalletStrategyDisconnect: 'wallet-strategy-disconnect',
|
|
7
|
+
TransactionBroadcastStart: 'transaction-broadcast-start',
|
|
8
|
+
TransactionPreparationEnd: 'transaction-preparation-end',
|
|
9
|
+
TransactionPreparationStart: 'transaction-preparation-start',
|
|
10
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { Wallet, type WalletMetadata } from '@injectivelabs/wallet-base';
|
|
2
|
+
import type { StdSignDoc } from '@keplr-wallet/types';
|
|
3
|
+
import type { OfflineSigner } from '@cosmjs/proto-signing';
|
|
4
|
+
import type { AccountAddress } from '@injectivelabs/ts-types';
|
|
5
|
+
import type { ChainId, EvmChainId } from '@injectivelabs/ts-types';
|
|
6
|
+
import type { WalletStrategyEmitter } from '../broadcaster/types.js';
|
|
7
|
+
import type { TxRaw, TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
|
|
8
|
+
import type { Eip1193Provider, WalletDeviceType, ConcreteStrategiesArg, SendTransactionOptions, ConcreteWalletStrategy, onAccountChangeCallback, onChainIdChangeCallback, WalletStrategyArguments, CosmosWalletAbstraction, WalletStrategy as WalletStrategyInterface } from '@injectivelabs/wallet-base';
|
|
7
9
|
export default class BaseWalletStrategy implements WalletStrategyInterface {
|
|
8
10
|
strategies: ConcreteStrategiesArg;
|
|
9
11
|
wallet: Wallet;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'eventemitter3';
|
|
2
|
-
import { Wallet, isEvmWallet, isCosmosWallet, } from '@injectivelabs/wallet-base';
|
|
3
2
|
import { GeneralException, WalletException } from '@injectivelabs/exceptions';
|
|
3
|
+
import { Wallet, isEvmWallet, isCosmosWallet } from '@injectivelabs/wallet-base';
|
|
4
4
|
import { WalletStrategyEmitterEventType, } from '../broadcaster/types.js';
|
|
5
5
|
const getInitialWallet = (args) => {
|
|
6
6
|
if (args.wallet) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-core",
|
|
3
3
|
"description": "Core wallet strategy",
|
|
4
|
-
"version": "1.16.
|
|
4
|
+
"version": "1.16.13-alpha.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": {
|
|
@@ -56,17 +56,17 @@
|
|
|
56
56
|
"start": "node dist/index.js"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@injectivelabs/exceptions": "1.16.
|
|
60
|
-
"@injectivelabs/networks": "1.16.
|
|
61
|
-
"@injectivelabs/sdk-ts": "1.16.
|
|
62
|
-
"@injectivelabs/ts-types": "1.16.
|
|
63
|
-
"@injectivelabs/utils": "1.16.
|
|
64
|
-
"@injectivelabs/wallet-base": "1.16.
|
|
59
|
+
"@injectivelabs/exceptions": "1.16.13-alpha.0",
|
|
60
|
+
"@injectivelabs/networks": "1.16.13-alpha.0",
|
|
61
|
+
"@injectivelabs/sdk-ts": "1.16.13-alpha.0",
|
|
62
|
+
"@injectivelabs/ts-types": "1.16.13-alpha.0",
|
|
63
|
+
"@injectivelabs/utils": "1.16.13-alpha.0",
|
|
64
|
+
"@injectivelabs/wallet-base": "1.16.13-alpha.0",
|
|
65
65
|
"@keplr-wallet/types": "^0.12.159",
|
|
66
66
|
"eventemitter3": "^5.0.1"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"shx": "^0.3.3"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "bb71ac9147c0a2f0946ea0c316caf094fbbe2f2c"
|
|
72
72
|
}
|