@injectivelabs/wallet-cosmostation 1.16.38-alpha.2 → 1.16.38-alpha.3
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 +3 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +3 -1
- package/package.json +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -5,6 +5,8 @@ let __injectivelabs_ts_types = require("@injectivelabs/ts-types");
|
|
|
5
5
|
let __injectivelabs_sdk_ts = require("@injectivelabs/sdk-ts");
|
|
6
6
|
let __cosmostation_cosmos_client = require("@cosmostation/cosmos-client");
|
|
7
7
|
let __cosmostation_extension_client_cosmos_js = require("@cosmostation/extension-client/cosmos.js");
|
|
8
|
+
let __injectivelabs_sdk_ts_core_tx = require("@injectivelabs/sdk-ts/core/tx");
|
|
9
|
+
let __injectivelabs_sdk_ts_utils = require("@injectivelabs/sdk-ts/utils");
|
|
8
10
|
let __injectivelabs_wallet_base = require("@injectivelabs/wallet-base");
|
|
9
11
|
|
|
10
12
|
//#region src/utils/index.ts
|
|
@@ -127,7 +129,7 @@ var Cosmostation = class extends __injectivelabs_wallet_base.BaseConcreteStrateg
|
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
131
|
async getSessionOrConfirm(address) {
|
|
130
|
-
return Promise.resolve(`0x${(0,
|
|
132
|
+
return Promise.resolve(`0x${(0, __injectivelabs_sdk_ts_utils.uint8ArrayToHex)((0, __injectivelabs_sdk_ts_utils.stringToUint8Array)(`Confirmation for ${address} at time: ${Date.now()}`))}`);
|
|
131
133
|
}
|
|
132
134
|
async sendEvmTransaction(_transaction, _options) {
|
|
133
135
|
throw new __injectivelabs_exceptions.CosmosWalletException(/* @__PURE__ */ new Error("sendEvmTransaction is not supported. Cosmostation only supports sending cosmos transactions"), {
|
|
@@ -137,7 +139,7 @@ var Cosmostation = class extends __injectivelabs_wallet_base.BaseConcreteStrateg
|
|
|
137
139
|
}
|
|
138
140
|
async sendTransaction(transaction, _options) {
|
|
139
141
|
const cosmostationWallet = await this.getCosmostationWallet();
|
|
140
|
-
const txRaw = (0,
|
|
142
|
+
const txRaw = (0, __injectivelabs_sdk_ts_core_tx.createTxRawFromSigResponse)(transaction);
|
|
141
143
|
try {
|
|
142
144
|
const response = await cosmostationWallet.sendTransaction(this.chainName, __injectivelabs_sdk_ts.CosmosTxV1Beta1TxPb.TxRaw.toBinary(txRaw), __cosmostation_extension_client_cosmos_js.SEND_TRANSACTION_MODE.SYNC);
|
|
143
145
|
return {
|
|
@@ -165,7 +167,7 @@ var Cosmostation = class extends __injectivelabs_wallet_base.BaseConcreteStrateg
|
|
|
165
167
|
async signCosmosTransaction(transaction) {
|
|
166
168
|
const { chainId } = this;
|
|
167
169
|
const cosmostationWallet = await this.getCosmostationWallet();
|
|
168
|
-
const signDoc = (0,
|
|
170
|
+
const signDoc = (0, __injectivelabs_sdk_ts_core_tx.createSignDocFromTransaction)(transaction);
|
|
169
171
|
try {
|
|
170
172
|
const signDirectResponse = await cosmostationWallet.signDirect(this.chainName, {
|
|
171
173
|
chain_id: chainId,
|
|
@@ -190,7 +192,7 @@ var Cosmostation = class extends __injectivelabs_wallet_base.BaseConcreteStrateg
|
|
|
190
192
|
async getPubKey() {
|
|
191
193
|
const cosmostationWallet = await this.getCosmostationWallet();
|
|
192
194
|
try {
|
|
193
|
-
return (0,
|
|
195
|
+
return (0, __injectivelabs_sdk_ts_utils.uint8ArrayToBase64)((await cosmostationWallet.requestAccount(this.chainName)).publicKey);
|
|
194
196
|
} catch (e) {
|
|
195
197
|
if (e.code === 4001) throw new __injectivelabs_exceptions.CosmosWalletException(/* @__PURE__ */ new Error("The user rejected the request"), {
|
|
196
198
|
code: __injectivelabs_exceptions.UnspecifiedErrorCode,
|
|
@@ -210,7 +212,7 @@ var Cosmostation = class extends __injectivelabs_wallet_base.BaseConcreteStrateg
|
|
|
210
212
|
}
|
|
211
213
|
async signArbitrary(signer, data) {
|
|
212
214
|
try {
|
|
213
|
-
return (await (await this.getCosmostationWallet()).signMessage(this.chainName, signer, (0,
|
|
215
|
+
return (await (await this.getCosmostationWallet()).signMessage(this.chainName, signer, (0, __injectivelabs_sdk_ts_utils.toUtf8)(data))).signature;
|
|
214
216
|
} catch (e) {
|
|
215
217
|
throw new __injectivelabs_exceptions.CosmosWalletException(new Error(e.message), {
|
|
216
218
|
code: __injectivelabs_exceptions.UnspecifiedErrorCode,
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as _cosmostation_extension_client_cosmos0 from "@cosmostation/extension-client/cosmos";
|
|
2
2
|
import { AccountAddress, ChainId, CosmosChainId, EvmChainId, TestnetCosmosChainId } from "@injectivelabs/ts-types";
|
|
3
|
-
import {
|
|
3
|
+
import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts";
|
|
4
4
|
import { BaseConcreteStrategy, ConcreteWalletStrategy, StdSignDoc, WalletDeviceType } from "@injectivelabs/wallet-base";
|
|
5
5
|
import { OfflineSigner } from "@cosmjs/proto-signing";
|
|
6
|
+
import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
|
|
7
|
+
import { AminoSignResponse, DirectSignResponse } from "@injectivelabs/sdk-ts/types";
|
|
6
8
|
|
|
7
9
|
//#region src/utils/index.d.ts
|
|
8
10
|
declare const isCosmosStationWalletInstalled: () => boolean;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { OfflineSigner } from "@cosmjs/proto-signing";
|
|
2
2
|
import { AccountAddress, ChainId, CosmosChainId, EvmChainId, TestnetCosmosChainId } from "@injectivelabs/ts-types";
|
|
3
|
-
import {
|
|
3
|
+
import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts";
|
|
4
|
+
import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
|
|
4
5
|
import { BaseConcreteStrategy, ConcreteWalletStrategy, StdSignDoc, WalletDeviceType } from "@injectivelabs/wallet-base";
|
|
5
6
|
import * as _cosmostation_extension_client_cosmos0 from "@cosmostation/extension-client/cosmos";
|
|
7
|
+
import { AminoSignResponse, DirectSignResponse } from "@injectivelabs/sdk-ts/types";
|
|
6
8
|
|
|
7
9
|
//#region src/utils/index.d.ts
|
|
8
10
|
declare const isCosmosStationWalletInstalled: () => boolean;
|
package/dist/esm/index.js
CHANGED
|
@@ -2,9 +2,11 @@ import { InstallError, cosmos } from "@cosmostation/extension-client";
|
|
|
2
2
|
import { CosmosWalletException, ErrorType, TransactionException, UnspecifiedErrorCode } from "@injectivelabs/exceptions";
|
|
3
3
|
import { makeSignDoc } from "@cosmjs/proto-signing";
|
|
4
4
|
import { CosmosChainId } from "@injectivelabs/ts-types";
|
|
5
|
-
import { CosmosTxV1Beta1TxPb
|
|
5
|
+
import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts";
|
|
6
6
|
import { getOfflineSigner } from "@cosmostation/cosmos-client";
|
|
7
7
|
import { SEND_TRANSACTION_MODE } from "@cosmostation/extension-client/cosmos.js";
|
|
8
|
+
import { createSignDocFromTransaction, createTxRawFromSigResponse } from "@injectivelabs/sdk-ts/core/tx";
|
|
9
|
+
import { stringToUint8Array, toUtf8, uint8ArrayToBase64, uint8ArrayToHex } from "@injectivelabs/sdk-ts/utils";
|
|
8
10
|
import { BaseConcreteStrategy, WalletAction, WalletDeviceType } from "@injectivelabs/wallet-base";
|
|
9
11
|
|
|
10
12
|
//#region src/utils/index.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-cosmostation",
|
|
3
|
-
"version": "1.16.38-alpha.
|
|
3
|
+
"version": "1.16.38-alpha.3",
|
|
4
4
|
"description": "Cosmostation strategy for use with @injectivelabs/wallet-core.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"@cosmostation/cosmos-client": "^0.0.5",
|
|
43
43
|
"@cosmostation/extension-client": "^0.1.15",
|
|
44
44
|
"@walletconnect/ethereum-provider": "2.18.1",
|
|
45
|
-
"@injectivelabs/exceptions": "1.16.38-alpha.1",
|
|
46
45
|
"@injectivelabs/ts-types": "1.16.38-alpha.1",
|
|
47
|
-
"@injectivelabs/
|
|
48
|
-
"@injectivelabs/
|
|
49
|
-
"@injectivelabs/
|
|
46
|
+
"@injectivelabs/utils": "1.16.38-alpha.2",
|
|
47
|
+
"@injectivelabs/sdk-ts": "1.16.38-alpha.3",
|
|
48
|
+
"@injectivelabs/exceptions": "1.16.38-alpha.2",
|
|
49
|
+
"@injectivelabs/wallet-base": "1.16.38-alpha.3"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|