@injectivelabs/wallet-private-key 1.20.65-alpha.0 → 1.20.66
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 +4 -29
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +5 -30
- package/package.json +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
let __injectivelabs_ts_types = require("@injectivelabs/ts-types");
|
|
2
|
-
let __injectivelabs_sdk_ts_core_accounts = require("@injectivelabs/sdk-ts/core/accounts");
|
|
3
2
|
let __injectivelabs_sdk_ts_core_tx = require("@injectivelabs/sdk-ts/core/tx");
|
|
4
|
-
let
|
|
3
|
+
let __injectivelabs_sdk_ts_core_accounts = require("@injectivelabs/sdk-ts/core/accounts");
|
|
5
4
|
let __injectivelabs_sdk_ts_utils = require("@injectivelabs/sdk-ts/utils");
|
|
6
5
|
let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
|
|
6
|
+
let __injectivelabs_wallet_base = require("@injectivelabs/wallet-base");
|
|
7
7
|
|
|
8
8
|
//#region \0@oxc-project+runtime@0.99.0/helpers/typeof.js
|
|
9
9
|
function _typeof(o) {
|
|
@@ -92,19 +92,7 @@ var PrivateKeyWallet = class extends __injectivelabs_wallet_base.BaseConcreteStr
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
async sendTransaction(transaction, options) {
|
|
95
|
-
|
|
96
|
-
if (!endpoints) throw new __injectivelabs_exceptions.WalletException(/* @__PURE__ */ new Error("You have to pass endpoints within the options for using Ethereum native wallets"));
|
|
97
|
-
const response = await new __injectivelabs_sdk_ts_core_tx.TxGrpcApi(endpoints.grpc).broadcast(transaction, {
|
|
98
|
-
txTimeout,
|
|
99
|
-
...txInclusion,
|
|
100
|
-
onBroadcast
|
|
101
|
-
});
|
|
102
|
-
if (response.code !== 0) throw new __injectivelabs_exceptions.TransactionException(new Error(response.rawLog), {
|
|
103
|
-
code: __injectivelabs_exceptions.UnspecifiedErrorCode,
|
|
104
|
-
contextCode: response.code,
|
|
105
|
-
contextModule: response.codespace
|
|
106
|
-
});
|
|
107
|
-
return response;
|
|
95
|
+
return (0, __injectivelabs_wallet_base.broadcastTxRaw)(transaction, options);
|
|
108
96
|
}
|
|
109
97
|
async signEip712TypedData(eip712json, address) {
|
|
110
98
|
const pk = this.getPrivateKey();
|
|
@@ -191,20 +179,7 @@ var PrivateKeyWallet = class extends __injectivelabs_wallet_base.BaseConcreteStr
|
|
|
191
179
|
//#region src/strategy/strategy-cosmos.ts
|
|
192
180
|
var PrivateKeyCosmosWallet = class extends PrivateKeyWallet {
|
|
193
181
|
async sendTransaction(transaction, options) {
|
|
194
|
-
|
|
195
|
-
if (!endpoints) throw new __injectivelabs_exceptions.WalletException(/* @__PURE__ */ new Error("You have to pass endpoints within the options for using Ethereum native wallets"));
|
|
196
|
-
const txRaw = (0, __injectivelabs_sdk_ts_core_tx.createTxRawFromSigResponse)(transaction);
|
|
197
|
-
const response = await new __injectivelabs_sdk_ts_core_tx.TxGrpcApi(endpoints.grpc).broadcast(txRaw, {
|
|
198
|
-
txTimeout,
|
|
199
|
-
...txInclusion,
|
|
200
|
-
onBroadcast
|
|
201
|
-
});
|
|
202
|
-
if (response.code !== 0) throw new __injectivelabs_exceptions.TransactionException(new Error(response.rawLog), {
|
|
203
|
-
code: __injectivelabs_exceptions.UnspecifiedErrorCode,
|
|
204
|
-
contextCode: response.code,
|
|
205
|
-
contextModule: response.codespace
|
|
206
|
-
});
|
|
207
|
-
return response;
|
|
182
|
+
return (0, __injectivelabs_wallet_base.broadcastTxRaw)((0, __injectivelabs_sdk_ts_core_tx.createTxRawFromSigResponse)(transaction), options);
|
|
208
183
|
}
|
|
209
184
|
async signCosmosTransaction(transaction) {
|
|
210
185
|
const privateKey = this.getPrivateKey();
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AccountAddress, ChainId, EvmChainId } from "@injectivelabs/ts-types";
|
|
2
|
-
import { PrivateKey } from "@injectivelabs/sdk-ts/core/accounts";
|
|
3
2
|
import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
|
|
3
|
+
import { PrivateKey } from "@injectivelabs/sdk-ts/core/accounts";
|
|
4
4
|
import { BaseConcreteStrategy, ConcreteWalletStrategy, CosmosWalletAbstraction, SendTransactionOptions, StdSignDoc, WalletDeviceType } from "@injectivelabs/wallet-base";
|
|
5
5
|
import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts/types";
|
|
6
6
|
|
package/dist/esm/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ChainId, EvmChainId } from "@injectivelabs/ts-types";
|
|
2
|
+
import { CosmosTxV1Beta1TxPb, createSignDocFromTransaction, createTxRawFromSigResponse, getInjectiveSignerAddress } from "@injectivelabs/sdk-ts/core/tx";
|
|
2
3
|
import { PrivateKey } from "@injectivelabs/sdk-ts/core/accounts";
|
|
3
|
-
import { CosmosTxV1Beta1TxPb, TxGrpcApi, createSignDocFromTransaction, createTxRawFromSigResponse, getInjectiveSignerAddress } from "@injectivelabs/sdk-ts/core/tx";
|
|
4
|
-
import { BaseConcreteStrategy, WalletAction, WalletDeviceType } from "@injectivelabs/wallet-base";
|
|
5
4
|
import { stringToUint8Array, toUtf8, uint8ArrayToBase64, uint8ArrayToHex } from "@injectivelabs/sdk-ts/utils";
|
|
6
|
-
import { ErrorType, MetamaskException,
|
|
5
|
+
import { ErrorType, MetamaskException, UnspecifiedErrorCode, WalletException } from "@injectivelabs/exceptions";
|
|
6
|
+
import { BaseConcreteStrategy, WalletAction, WalletDeviceType, broadcastTxRaw } from "@injectivelabs/wallet-base";
|
|
7
7
|
|
|
8
8
|
//#region \0@oxc-project+runtime@0.99.0/helpers/typeof.js
|
|
9
9
|
function _typeof(o) {
|
|
@@ -92,19 +92,7 @@ var PrivateKeyWallet = class extends BaseConcreteStrategy {
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
async sendTransaction(transaction, options) {
|
|
95
|
-
|
|
96
|
-
if (!endpoints) throw new WalletException(/* @__PURE__ */ new Error("You have to pass endpoints within the options for using Ethereum native wallets"));
|
|
97
|
-
const response = await new TxGrpcApi(endpoints.grpc).broadcast(transaction, {
|
|
98
|
-
txTimeout,
|
|
99
|
-
...txInclusion,
|
|
100
|
-
onBroadcast
|
|
101
|
-
});
|
|
102
|
-
if (response.code !== 0) throw new TransactionException(new Error(response.rawLog), {
|
|
103
|
-
code: UnspecifiedErrorCode,
|
|
104
|
-
contextCode: response.code,
|
|
105
|
-
contextModule: response.codespace
|
|
106
|
-
});
|
|
107
|
-
return response;
|
|
95
|
+
return broadcastTxRaw(transaction, options);
|
|
108
96
|
}
|
|
109
97
|
async signEip712TypedData(eip712json, address) {
|
|
110
98
|
const pk = this.getPrivateKey();
|
|
@@ -191,20 +179,7 @@ var PrivateKeyWallet = class extends BaseConcreteStrategy {
|
|
|
191
179
|
//#region src/strategy/strategy-cosmos.ts
|
|
192
180
|
var PrivateKeyCosmosWallet = class extends PrivateKeyWallet {
|
|
193
181
|
async sendTransaction(transaction, options) {
|
|
194
|
-
|
|
195
|
-
if (!endpoints) throw new WalletException(/* @__PURE__ */ new Error("You have to pass endpoints within the options for using Ethereum native wallets"));
|
|
196
|
-
const txRaw = createTxRawFromSigResponse(transaction);
|
|
197
|
-
const response = await new TxGrpcApi(endpoints.grpc).broadcast(txRaw, {
|
|
198
|
-
txTimeout,
|
|
199
|
-
...txInclusion,
|
|
200
|
-
onBroadcast
|
|
201
|
-
});
|
|
202
|
-
if (response.code !== 0) throw new TransactionException(new Error(response.rawLog), {
|
|
203
|
-
code: UnspecifiedErrorCode,
|
|
204
|
-
contextCode: response.code,
|
|
205
|
-
contextModule: response.codespace
|
|
206
|
-
});
|
|
207
|
-
return response;
|
|
182
|
+
return broadcastTxRaw(createTxRawFromSigResponse(transaction), options);
|
|
208
183
|
}
|
|
209
184
|
async signCosmosTransaction(transaction) {
|
|
210
185
|
const privateKey = this.getPrivateKey();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-private-key",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.66",
|
|
4
4
|
"description": "Private key wallet strategy for use with @injectivelabs/wallet-core.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"dist"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@injectivelabs/sdk-ts": "1.20.
|
|
46
|
-
"@injectivelabs/
|
|
47
|
-
"@injectivelabs/
|
|
48
|
-
"@injectivelabs/
|
|
45
|
+
"@injectivelabs/sdk-ts": "1.20.66",
|
|
46
|
+
"@injectivelabs/ts-types": "1.20.66",
|
|
47
|
+
"@injectivelabs/wallet-base": "1.20.66",
|
|
48
|
+
"@injectivelabs/exceptions": "1.20.66"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|