@injectivelabs/wallet-cosmostation 1.16.7 → 1.16.8
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/README.md
CHANGED
|
@@ -13,7 +13,7 @@ _Package to use Magic Wallets on Injective via the wallet strategy._
|
|
|
13
13
|
## 📚 Installation
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
|
|
16
|
+
pnpm add @injectivelabs/wallet-cosmostation
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
---
|
|
@@ -30,10 +30,9 @@ dependencies and implementations for their specific wallets.
|
|
|
30
30
|
Here's a brief example of how to use this package to send 1 INJ.:
|
|
31
31
|
|
|
32
32
|
```typescript
|
|
33
|
-
import { Wallet } from '@injectivelabs/wallet-base'
|
|
34
|
-
import { BaseWalletStrategy, MsgBroadcaster } from '@injectivelabs/wallet-core'
|
|
35
|
-
import { CosmostationWalletStrategy } from '@injectivelabs/wallet-cosmostation'
|
|
36
|
-
|
|
33
|
+
import { Wallet } from '@injectivelabs/wallet-base'
|
|
34
|
+
import { BaseWalletStrategy, MsgBroadcaster } from '@injectivelabs/wallet-core'
|
|
35
|
+
import { CosmostationWalletStrategy } from '@injectivelabs/wallet-cosmostation'
|
|
37
36
|
|
|
38
37
|
const strategyArgs: WalletStrategyArguments = {
|
|
39
38
|
chainId: ChainId.Mainnet,
|
|
@@ -53,21 +52,21 @@ const msgBroadcaster = new MsgBroadcaster({
|
|
|
53
52
|
})
|
|
54
53
|
|
|
55
54
|
const sendTX = async () => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
const injectiveAddress = 'someInjectiveAddress'
|
|
56
|
+
|
|
57
|
+
const message = MsgSend.fromJSON({
|
|
58
|
+
srcInjectiveAddress: injectiveAddress,
|
|
59
|
+
dstInjectiveAddress: injectiveAddress,
|
|
60
|
+
amount: {
|
|
61
|
+
amount: '1',
|
|
62
|
+
denom: 'inj',
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
return await msgBroadcaster.broadcast({ msgs: message })
|
|
67
|
+
}
|
|
69
68
|
|
|
70
|
-
|
|
69
|
+
const result = await sendTX()
|
|
71
70
|
```
|
|
72
71
|
|
|
73
72
|
Read more and find example usages on our [WalletStrategy Docs](https://docs.ts.injective.network/wallet/wallet-wallet-strategy)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
|
|
2
|
-
import { ChainId, CosmosChainId, AccountAddress
|
|
2
|
+
import { ChainId, EvmChainId, CosmosChainId, AccountAddress } from '@injectivelabs/ts-types';
|
|
3
3
|
import { StdSignDoc, WalletDeviceType, BaseConcreteStrategy, ConcreteWalletStrategy } from '@injectivelabs/wallet-base';
|
|
4
4
|
import { CosmosTxV1Beta1Tx } from '@injectivelabs/sdk-ts';
|
|
5
5
|
export declare class Cosmostation extends BaseConcreteStrategy implements ConcreteWalletStrategy {
|
|
@@ -14,7 +14,7 @@ export declare class Cosmostation extends BaseConcreteStrategy implements Concre
|
|
|
14
14
|
getSessionOrConfirm(address?: AccountAddress): Promise<string>;
|
|
15
15
|
sendEvmTransaction(_transaction: unknown, _options: {
|
|
16
16
|
address: AccountAddress;
|
|
17
|
-
|
|
17
|
+
evmChainId: EvmChainId;
|
|
18
18
|
}): Promise<string>;
|
|
19
19
|
sendTransaction(transaction: DirectSignResponse | CosmosTxV1Beta1Tx.TxRaw, _options: {
|
|
20
20
|
address: AccountAddress;
|
|
@@ -146,7 +146,7 @@ class Cosmostation extends wallet_base_1.BaseConcreteStrategy {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
async signEip712TypedData(_eip712TypedData, _address) {
|
|
149
|
-
throw new exceptions_1.CosmosWalletException(new Error('This wallet does not support signing
|
|
149
|
+
throw new exceptions_1.CosmosWalletException(new Error('This wallet does not support signing Evm transactions'), {
|
|
150
150
|
code: exceptions_1.UnspecifiedErrorCode,
|
|
151
151
|
context: wallet_base_1.WalletAction.SendTransaction,
|
|
152
152
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
|
|
2
|
-
import { ChainId, CosmosChainId, AccountAddress
|
|
2
|
+
import { ChainId, EvmChainId, CosmosChainId, AccountAddress } from '@injectivelabs/ts-types';
|
|
3
3
|
import { StdSignDoc, WalletDeviceType, BaseConcreteStrategy, ConcreteWalletStrategy } from '@injectivelabs/wallet-base';
|
|
4
4
|
import { CosmosTxV1Beta1Tx } from '@injectivelabs/sdk-ts';
|
|
5
5
|
export declare class Cosmostation extends BaseConcreteStrategy implements ConcreteWalletStrategy {
|
|
@@ -14,7 +14,7 @@ export declare class Cosmostation extends BaseConcreteStrategy implements Concre
|
|
|
14
14
|
getSessionOrConfirm(address?: AccountAddress): Promise<string>;
|
|
15
15
|
sendEvmTransaction(_transaction: unknown, _options: {
|
|
16
16
|
address: AccountAddress;
|
|
17
|
-
|
|
17
|
+
evmChainId: EvmChainId;
|
|
18
18
|
}): Promise<string>;
|
|
19
19
|
sendTransaction(transaction: DirectSignResponse | CosmosTxV1Beta1Tx.TxRaw, _options: {
|
|
20
20
|
address: AccountAddress;
|
|
@@ -143,7 +143,7 @@ export class Cosmostation extends BaseConcreteStrategy {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
async signEip712TypedData(_eip712TypedData, _address) {
|
|
146
|
-
throw new CosmosWalletException(new Error('This wallet does not support signing
|
|
146
|
+
throw new CosmosWalletException(new Error('This wallet does not support signing Evm transactions'), {
|
|
147
147
|
code: UnspecifiedErrorCode,
|
|
148
148
|
context: WalletAction.SendTransaction,
|
|
149
149
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-cosmostation",
|
|
3
3
|
"description": "Cosmostation strategy for use with @injectivelabs/wallet-core.",
|
|
4
|
-
"version": "1.16.
|
|
4
|
+
"version": "1.16.8",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": {
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
|
-
"build": "
|
|
44
|
+
"build": "pnpm build:cjs && pnpm build:esm && pnpm build:post",
|
|
45
45
|
"build:cjs": "tsc --build --force tsconfig.build.json",
|
|
46
46
|
"build:esm": "tsc --build --force tsconfig.build.esm.json",
|
|
47
|
-
"build:watch": "tsc --build -w tsconfig.build.json && tsc -w --build tsconfig.build.esm.json &&
|
|
47
|
+
"build:watch": "tsc --build -w tsconfig.build.json && tsc -w --build tsconfig.build.esm.json && pnpm build:post",
|
|
48
48
|
"build:post": "shx cp ../../../etc/stub/package.json.stub dist/cjs/package.json && shx cp ../../../etc/stub/package.esm.json.stub dist/esm/package.json",
|
|
49
49
|
"clean": "tsc --build tsconfig.build.json --clean && tsc --build tsconfig.build.esm.json --clean && shx rm -rf coverage *.log junit.xml dist && jest --clearCache && shx mkdir -p dist",
|
|
50
50
|
"test": "jest",
|
|
@@ -58,14 +58,17 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@cosmjs/proto-signing": "^0.32.3",
|
|
60
60
|
"@cosmostation/extension-client": "^0.1.15",
|
|
61
|
-
"@injectivelabs/exceptions": "
|
|
62
|
-
"@injectivelabs/sdk-ts": "
|
|
63
|
-
"@injectivelabs/ts-types": "
|
|
64
|
-
"@injectivelabs/utils": "
|
|
65
|
-
"@injectivelabs/wallet-base": "
|
|
61
|
+
"@injectivelabs/exceptions": "1.16.6",
|
|
62
|
+
"@injectivelabs/sdk-ts": "1.16.8",
|
|
63
|
+
"@injectivelabs/ts-types": "1.16.8",
|
|
64
|
+
"@injectivelabs/utils": "1.16.8",
|
|
65
|
+
"@injectivelabs/wallet-base": "1.16.8",
|
|
66
66
|
"@walletconnect/ethereum-provider": "2.18.1"
|
|
67
67
|
},
|
|
68
|
-
"
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"shx": "^0.3.4"
|
|
70
|
+
},
|
|
71
|
+
"gitHead": "8bdbbfff8a07053ec2cd91a7103bfe99975672b4",
|
|
69
72
|
"typedoc": {
|
|
70
73
|
"entryPoint": "./src/index.ts",
|
|
71
74
|
"readmeFile": "./README.md",
|