@exodus/solana-plugin 1.5.0 → 1.7.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/solana-plugin",
3
- "version": "1.5.0",
3
+ "version": "1.7.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.0.0",
25
+ "@exodus/solana-lib": "^2.4.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": "a3d4e16dc0b19901cd976cd699814c7070fa116a"
33
+ "gitHead": "02a052ff417b0c4d0379edf866b6a984ca6a4830"
34
34
  }
@@ -7,7 +7,9 @@ import {
7
7
  isValidAddress,
8
8
  parseUnsignedTx,
9
9
  signUnsignedTx,
10
+ signUnsignedTxWithSigner,
10
11
  signHardware,
12
+ signMessageNew,
11
13
  createFeeData,
12
14
  } from '@exodus/solana-lib'
13
15
  import ms from 'ms'
@@ -39,6 +41,7 @@ export const createSolanaAssetFactory =
39
41
  ticksBetweenHistoryFetches,
40
42
  ticksBetweenStakeFetches,
41
43
  txsLimit,
44
+ signWithSigner = true,
42
45
  } = {},
43
46
  overrideCallback = ({ asset }) => asset,
44
47
  } = {}) => {
@@ -106,6 +109,7 @@ export const createSolanaAssetFactory =
106
109
  nfts: true,
107
110
  staking: {},
108
111
  isTestnet,
112
+ signWithSigner,
109
113
  }
110
114
 
111
115
  const assetStakingApi = {
@@ -114,6 +118,8 @@ export const createSolanaAssetFactory =
114
118
 
115
119
  const SolanaAccountState = createAccountState({ assetList })
116
120
 
121
+ const defaultAddressPath = 'm/0/0'
122
+
117
123
  const api = {
118
124
  getActivityTxs,
119
125
  addressHasHistory: (...args) => serverApi.getAccountInfo(...args).then((acc) => !!acc),
@@ -132,9 +138,10 @@ export const createSolanaAssetFactory =
132
138
  }),
133
139
  createToken: (tokenDef) =>
134
140
  tokenDef.isBuiltIn ? createToken(tokenDef) : createCustomToken(tokenDef),
135
- defaultAddressPath: 'm/0/0',
141
+ defaultAddressPath,
136
142
  features,
137
143
  getBalances,
144
+ getDefaultAddressPath: () => defaultAddressPath,
138
145
  getFee: ({ feeData }) => feeData.fee,
139
146
  getFeeAsync: async ({ feeData }) => feeData.fee,
140
147
  getFeeData: () => feeData,
@@ -149,9 +156,13 @@ export const createSolanaAssetFactory =
149
156
  parseUnsignedTx: (unsignedTx) => parseUnsignedTx({ asset: base, unsignedTx }),
150
157
  parseTx: ({ unsignedTx }) => parseUnsignedTx({ asset: base, unsignedTx }),
151
158
  sendTx,
152
- signTx: ({ unsignedTx, privateKey }) => signUnsignedTx(unsignedTx, privateKey),
159
+ signTx: ({ unsignedTx, privateKey, signer }) =>
160
+ signer
161
+ ? signUnsignedTxWithSigner(unsignedTx, signer)
162
+ : signUnsignedTx(unsignedTx, privateKey),
153
163
  signUnsignedTx,
154
164
  signHardware,
165
+ signMessage: signMessageNew,
155
166
  staking: assetStakingApi,
156
167
  validateAssetId: isValidAddress,
157
168
  }