@exodus/solana-plugin 1.5.0 → 1.6.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/create-asset.js +11 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Exodus internal Solana asset plugin",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@exodus/assets": "^9.0.1",
|
|
23
23
|
"@exodus/bip44-constants": "^195.0.0",
|
|
24
24
|
"@exodus/solana-api": "^3.0.0",
|
|
25
|
-
"@exodus/solana-lib": "^2.
|
|
25
|
+
"@exodus/solana-lib": "^2.2.0",
|
|
26
26
|
"@exodus/solana-meta": "^1.0.7",
|
|
27
27
|
"minimalistic-assert": "^1.0.1",
|
|
28
28
|
"ms": "^2.1.3"
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@exodus/assets-testing": "^1.0.0"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "85fd61e1f2f77aff4c32b5684eb5f4845f06794a"
|
|
34
34
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
isValidAddress,
|
|
8
8
|
parseUnsignedTx,
|
|
9
9
|
signUnsignedTx,
|
|
10
|
+
signUnsignedTxWithSigner,
|
|
10
11
|
signHardware,
|
|
11
12
|
createFeeData,
|
|
12
13
|
} from '@exodus/solana-lib'
|
|
@@ -39,6 +40,7 @@ export const createSolanaAssetFactory =
|
|
|
39
40
|
ticksBetweenHistoryFetches,
|
|
40
41
|
ticksBetweenStakeFetches,
|
|
41
42
|
txsLimit,
|
|
43
|
+
signWithSigner = true,
|
|
42
44
|
} = {},
|
|
43
45
|
overrideCallback = ({ asset }) => asset,
|
|
44
46
|
} = {}) => {
|
|
@@ -106,6 +108,7 @@ export const createSolanaAssetFactory =
|
|
|
106
108
|
nfts: true,
|
|
107
109
|
staking: {},
|
|
108
110
|
isTestnet,
|
|
111
|
+
signWithSigner,
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
const assetStakingApi = {
|
|
@@ -114,6 +117,8 @@ export const createSolanaAssetFactory =
|
|
|
114
117
|
|
|
115
118
|
const SolanaAccountState = createAccountState({ assetList })
|
|
116
119
|
|
|
120
|
+
const defaultAddressPath = 'm/0/0'
|
|
121
|
+
|
|
117
122
|
const api = {
|
|
118
123
|
getActivityTxs,
|
|
119
124
|
addressHasHistory: (...args) => serverApi.getAccountInfo(...args).then((acc) => !!acc),
|
|
@@ -132,9 +137,10 @@ export const createSolanaAssetFactory =
|
|
|
132
137
|
}),
|
|
133
138
|
createToken: (tokenDef) =>
|
|
134
139
|
tokenDef.isBuiltIn ? createToken(tokenDef) : createCustomToken(tokenDef),
|
|
135
|
-
defaultAddressPath
|
|
140
|
+
defaultAddressPath,
|
|
136
141
|
features,
|
|
137
142
|
getBalances,
|
|
143
|
+
getDefaultAddressPath: () => defaultAddressPath,
|
|
138
144
|
getFee: ({ feeData }) => feeData.fee,
|
|
139
145
|
getFeeAsync: async ({ feeData }) => feeData.fee,
|
|
140
146
|
getFeeData: () => feeData,
|
|
@@ -149,7 +155,10 @@ export const createSolanaAssetFactory =
|
|
|
149
155
|
parseUnsignedTx: (unsignedTx) => parseUnsignedTx({ asset: base, unsignedTx }),
|
|
150
156
|
parseTx: ({ unsignedTx }) => parseUnsignedTx({ asset: base, unsignedTx }),
|
|
151
157
|
sendTx,
|
|
152
|
-
signTx: ({ unsignedTx, privateKey }) =>
|
|
158
|
+
signTx: ({ unsignedTx, privateKey, signer }) =>
|
|
159
|
+
signer
|
|
160
|
+
? signUnsignedTxWithSigner(unsignedTx, signer)
|
|
161
|
+
: signUnsignedTx(unsignedTx, privateKey),
|
|
153
162
|
signUnsignedTx,
|
|
154
163
|
signHardware,
|
|
155
164
|
staking: assetStakingApi,
|