@injectivelabs/wallet-magic 1.16.5-alpha.2 → 1.16.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/README.md +21 -20
- package/dist/cjs/strategy/strategy.d.ts +2 -2
- package/dist/esm/strategy/strategy.d.ts +2 -2
- package/package.json +12 -15
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
|
+
yarn add @injectivelabs/wallet-magic
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
---
|
|
@@ -30,9 +30,10 @@ 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 { MagicStrategy } from '@injectivelabs/wallet-magic'
|
|
33
|
+
import { Wallet } from '@injectivelabs/wallet-base';
|
|
34
|
+
import { BaseWalletStrategy, MsgBroadcaster } from '@injectivelabs/wallet-core';
|
|
35
|
+
import { MagicStrategy } from '@injectivelabs/wallet-magic';
|
|
36
|
+
|
|
36
37
|
|
|
37
38
|
const strategyArgs: WalletStrategyArguments = {
|
|
38
39
|
chainId: ChainId.Mainnet,
|
|
@@ -41,8 +42,8 @@ const strategyArgs: WalletStrategyArguments = {
|
|
|
41
42
|
[Wallet.Magic]: new MagicStrategy({
|
|
42
43
|
chainId: ChainId.Mainnet,
|
|
43
44
|
metadata: {
|
|
44
|
-
apiKey: 'YOUR_MAGIC_API_KEY'
|
|
45
|
-
}
|
|
45
|
+
apiKey: 'YOUR_MAGIC_API_KEY'
|
|
46
|
+
}
|
|
46
47
|
}),
|
|
47
48
|
},
|
|
48
49
|
}
|
|
@@ -55,21 +56,21 @@ const msgBroadcaster = new MsgBroadcaster({
|
|
|
55
56
|
})
|
|
56
57
|
|
|
57
58
|
const sendTX = async () => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
59
|
+
const injectiveAddress = 'someInjectiveAddress'
|
|
60
|
+
|
|
61
|
+
const message = MsgSend.fromJSON({
|
|
62
|
+
srcInjectiveAddress: injectiveAddress,
|
|
63
|
+
dstInjectiveAddress: injectiveAddress,
|
|
64
|
+
amount: {
|
|
65
|
+
amount: '1',
|
|
66
|
+
denom: 'inj',
|
|
67
|
+
},
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
return await msgBroadcaster.broadcast({ msgs: message })
|
|
71
|
+
}
|
|
71
72
|
|
|
72
|
-
const result = await sendTX()
|
|
73
|
+
const result = await sendTX()
|
|
73
74
|
```
|
|
74
75
|
|
|
75
76
|
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 { TxRaw, DirectSignResponse, AminoSignResponse } from '@injectivelabs/sdk-ts';
|
|
2
|
-
import { AccountAddress,
|
|
2
|
+
import { AccountAddress, EthereumChainId } from '@injectivelabs/ts-types';
|
|
3
3
|
import { StdSignDoc, MagicProvider, WalletDeviceType, BaseConcreteStrategy, BrowserEip1993Provider, ConcreteWalletStrategy, SendTransactionOptions } from '@injectivelabs/wallet-base';
|
|
4
4
|
export declare class Magic extends BaseConcreteStrategy implements ConcreteWalletStrategy {
|
|
5
5
|
provider: BrowserEip1993Provider | undefined;
|
|
@@ -18,7 +18,7 @@ export declare class Magic extends BaseConcreteStrategy implements ConcreteWalle
|
|
|
18
18
|
getSessionOrConfirm(address: AccountAddress): Promise<string>;
|
|
19
19
|
sendEvmTransaction(_transaction: unknown, _options: {
|
|
20
20
|
address: AccountAddress;
|
|
21
|
-
|
|
21
|
+
ethereumChainId: EthereumChainId;
|
|
22
22
|
}): Promise<string>;
|
|
23
23
|
sendTransaction(transaction: TxRaw, options: SendTransactionOptions): Promise<any>;
|
|
24
24
|
signEip712TypedData(eip712json: string, _address: AccountAddress): Promise<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TxRaw, DirectSignResponse, AminoSignResponse } from '@injectivelabs/sdk-ts';
|
|
2
|
-
import { AccountAddress,
|
|
2
|
+
import { AccountAddress, EthereumChainId } from '@injectivelabs/ts-types';
|
|
3
3
|
import { StdSignDoc, MagicProvider, WalletDeviceType, BaseConcreteStrategy, BrowserEip1993Provider, ConcreteWalletStrategy, SendTransactionOptions } from '@injectivelabs/wallet-base';
|
|
4
4
|
export declare class Magic extends BaseConcreteStrategy implements ConcreteWalletStrategy {
|
|
5
5
|
provider: BrowserEip1993Provider | undefined;
|
|
@@ -18,7 +18,7 @@ export declare class Magic extends BaseConcreteStrategy implements ConcreteWalle
|
|
|
18
18
|
getSessionOrConfirm(address: AccountAddress): Promise<string>;
|
|
19
19
|
sendEvmTransaction(_transaction: unknown, _options: {
|
|
20
20
|
address: AccountAddress;
|
|
21
|
-
|
|
21
|
+
ethereumChainId: EthereumChainId;
|
|
22
22
|
}): Promise<string>;
|
|
23
23
|
sendTransaction(transaction: TxRaw, options: SendTransactionOptions): Promise<any>;
|
|
24
24
|
signEip712TypedData(eip712json: string, _address: AccountAddress): Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-magic",
|
|
3
3
|
"description": "Magic wallet strategy for use with @injectivelabs/wallet-core.",
|
|
4
|
-
"version": "1.16.5
|
|
4
|
+
"version": "1.16.5",
|
|
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": "yarn build:cjs && yarn build:esm && yarn 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 && yarn 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",
|
|
@@ -56,19 +56,16 @@
|
|
|
56
56
|
"start": "node dist/index.js"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@injectivelabs/exceptions": "1.16.5
|
|
60
|
-
"@injectivelabs/sdk-ts": "1.16.5
|
|
61
|
-
"@injectivelabs/ts-types": "1.16.5
|
|
62
|
-
"@injectivelabs/utils": "1.16.5
|
|
63
|
-
"@injectivelabs/wallet-base": "1.16.5
|
|
64
|
-
"@magic-ext/cosmos": "
|
|
65
|
-
"@magic-ext/oauth2": "
|
|
66
|
-
"magic-sdk": "29.
|
|
59
|
+
"@injectivelabs/exceptions": "^1.16.5",
|
|
60
|
+
"@injectivelabs/sdk-ts": "^1.16.5",
|
|
61
|
+
"@injectivelabs/ts-types": "^1.16.5",
|
|
62
|
+
"@injectivelabs/utils": "^1.16.5",
|
|
63
|
+
"@injectivelabs/wallet-base": "^1.16.5",
|
|
64
|
+
"@magic-ext/cosmos": "24.4.0",
|
|
65
|
+
"@magic-ext/oauth2": "11.4.0",
|
|
66
|
+
"magic-sdk": "29.4.0"
|
|
67
67
|
},
|
|
68
|
-
"
|
|
69
|
-
"shx": "^0.3.4"
|
|
70
|
-
},
|
|
71
|
-
"gitHead": "7b737bd3053f73f633837f686d31b59ee98c7f67",
|
|
68
|
+
"gitHead": "59378cbaf7f09e97bd0c8c157fd03abdd0ea35d5",
|
|
72
69
|
"typedoc": {
|
|
73
70
|
"entryPoint": "./src/index.ts",
|
|
74
71
|
"readmeFile": "./README.md",
|