@exodus/solana-plugin 1.0.10 → 1.1.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 +2 -2
- package/src/index.js +13 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/solana-plugin",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Exodus internal Solana asset plugin",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@exodus/assets-testing": "^1.0.0"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "583bd3e0d923d342a1e615dd4fb2a1a0ac15dae9"
|
|
34
34
|
}
|
package/src/index.js
CHANGED
|
@@ -22,20 +22,29 @@ import serverApi, {
|
|
|
22
22
|
createAndBroadcastTXFactory,
|
|
23
23
|
} from '@exodus/solana-api'
|
|
24
24
|
|
|
25
|
+
const DEFAULT_ACCOUNT_RESERVE = 0.01
|
|
26
|
+
const DEFAULT_LOW_BALANCE = 0.01
|
|
27
|
+
const DEFAULT_MIN_STAKING_AMOUNT = 0.01
|
|
28
|
+
|
|
25
29
|
const createAsset = ({
|
|
26
30
|
config: {
|
|
27
31
|
stakingFeatureAvailable = true,
|
|
28
32
|
includeUnparsed = false,
|
|
29
33
|
monitorInterval = ms('300s'),
|
|
34
|
+
defaultAccountReserve = DEFAULT_ACCOUNT_RESERVE,
|
|
35
|
+
defaultLowBalance = DEFAULT_LOW_BALANCE,
|
|
36
|
+
defaultMinStakingAmount = DEFAULT_MIN_STAKING_AMOUNT,
|
|
30
37
|
} = {},
|
|
31
38
|
overrideCallback = ({ asset }) => asset,
|
|
32
39
|
} = {}) => {
|
|
33
40
|
const assets = connectAssetsList(assetList)
|
|
34
41
|
const base = assets.solana
|
|
35
42
|
|
|
36
|
-
const accountReserve = base.currency.SOL(
|
|
37
|
-
const lowBalance = base.currency.SOL(
|
|
38
|
-
const MIN_STAKING_AMOUNT = base.currency.SOL(
|
|
43
|
+
const accountReserve = base.currency.SOL(defaultAccountReserve ?? DEFAULT_ACCOUNT_RESERVE)
|
|
44
|
+
const lowBalance = base.currency.SOL(defaultLowBalance ?? DEFAULT_LOW_BALANCE)
|
|
45
|
+
const MIN_STAKING_AMOUNT = base.currency.SOL(
|
|
46
|
+
defaultMinStakingAmount ?? DEFAULT_MIN_STAKING_AMOUNT
|
|
47
|
+
)
|
|
39
48
|
|
|
40
49
|
const address = {
|
|
41
50
|
validate: isValidAddress,
|
|
@@ -86,7 +95,7 @@ const createAsset = ({
|
|
|
86
95
|
}
|
|
87
96
|
|
|
88
97
|
const assetStakingApi = {
|
|
89
|
-
isStaking: ({ accountState }) => accountState.
|
|
98
|
+
isStaking: ({ accountState }) => accountState.mem.isDelegating,
|
|
90
99
|
}
|
|
91
100
|
|
|
92
101
|
const api = {
|