@exodus/solana-plugin 1.0.8 → 1.0.10-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/package.json +3 -3
- package/src/index.js +19 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10-alpha.0",
|
|
4
4
|
"description": "Exodus internal Solana asset plugin",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@exodus/assets": "^9.0.1",
|
|
24
24
|
"@exodus/bip44-constants": "^195.0.0",
|
|
25
|
-
"@exodus/solana-api": "^2.5.
|
|
25
|
+
"@exodus/solana-api": "^2.5.31-alpha.0",
|
|
26
26
|
"@exodus/solana-lib": "^1.7.5",
|
|
27
27
|
"@exodus/solana-meta": "^1.0.7",
|
|
28
28
|
"minimalistic-assert": "^1.0.1"
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@exodus/assets-testing": "file:../../../__testing__"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "659340c999fa86c132293643a7fb96f33963e6cd"
|
|
34
34
|
}
|
package/src/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
isValidAddress,
|
|
8
8
|
parseUnsignedTx,
|
|
9
9
|
signUnsignedTx,
|
|
10
|
+
signHardware,
|
|
10
11
|
} from '@exodus/solana-lib'
|
|
11
12
|
import { solana as feeData } from '@exodus/solana-lib/src/fee-data'
|
|
12
13
|
import assetList from '@exodus/solana-meta'
|
|
@@ -26,6 +27,8 @@ const createAsset = ({
|
|
|
26
27
|
stakingFeatureAvailable = true,
|
|
27
28
|
includeUnparsed = false,
|
|
28
29
|
monitorInterval = ms('30s'),
|
|
30
|
+
ticksBetweenHistoryFetches,
|
|
31
|
+
ticksBetweenStakeFetches,
|
|
29
32
|
} = {},
|
|
30
33
|
overrideCallback = ({ asset }) => asset,
|
|
31
34
|
} = {}) => {
|
|
@@ -81,6 +84,11 @@ const createAsset = ({
|
|
|
81
84
|
feeMonitor: true,
|
|
82
85
|
feesApi: true,
|
|
83
86
|
nfts: true,
|
|
87
|
+
staking: {},
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const assetStakingApi = {
|
|
91
|
+
isStaking: ({ accountState }) => accountState.staking.isDelegating,
|
|
84
92
|
}
|
|
85
93
|
|
|
86
94
|
const api = {
|
|
@@ -90,7 +98,14 @@ const createAsset = ({
|
|
|
90
98
|
createAccountState: () => SolanaAccountState,
|
|
91
99
|
createFeeMonitor: (args) => new SolanaFeeMonitor({ ...args, api: serverApi }),
|
|
92
100
|
createHistoryMonitor: (args) =>
|
|
93
|
-
new SolanaMonitor({
|
|
101
|
+
new SolanaMonitor({
|
|
102
|
+
interval: monitorInterval,
|
|
103
|
+
ticksBetweenHistoryFetches,
|
|
104
|
+
ticksBetweenStakeFetches,
|
|
105
|
+
includeUnparsed,
|
|
106
|
+
api: serverApi,
|
|
107
|
+
...args,
|
|
108
|
+
}),
|
|
94
109
|
createToken: (tokenDef) =>
|
|
95
110
|
tokenDef.isBuiltIn ? createToken(tokenDef) : createCustomToken(tokenDef),
|
|
96
111
|
defaultAddressPath: 'm/0/0',
|
|
@@ -99,11 +114,7 @@ const createAsset = ({
|
|
|
99
114
|
getFee: () => feeData.fee,
|
|
100
115
|
getFeeAsync: async () => feeData.fee,
|
|
101
116
|
getFeeData: () => feeData,
|
|
102
|
-
getKeyIdentifier: createGetKeyIdentifier({
|
|
103
|
-
bip44,
|
|
104
|
-
assetName: base.name,
|
|
105
|
-
keyType: 'nacl',
|
|
106
|
-
}),
|
|
117
|
+
getKeyIdentifier: createGetKeyIdentifier({ bip44 }),
|
|
107
118
|
getTokens: () =>
|
|
108
119
|
Object.values(assets)
|
|
109
120
|
.filter((asset) => asset.name !== base.name)
|
|
@@ -115,6 +126,8 @@ const createAsset = ({
|
|
|
115
126
|
sendTx,
|
|
116
127
|
signTx: ({ unsignedTx, privateKey }) => signUnsignedTx(unsignedTx, privateKey),
|
|
117
128
|
signUnsignedTx,
|
|
129
|
+
signHardware,
|
|
130
|
+
staking: assetStakingApi,
|
|
118
131
|
validateAssetId: isValidAddress,
|
|
119
132
|
}
|
|
120
133
|
|