@subwallet/extension-base 1.3.46-0 → 1.3.48-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/background/KoniTypes.d.ts +7 -1
- package/background/KoniTypes.js +1 -0
- package/background/errors/TransactionError.js +4 -0
- package/cjs/background/KoniTypes.js +1 -0
- package/cjs/background/errors/TransactionError.js +4 -0
- package/cjs/core/logic-validation/transfer.js +7 -0
- package/cjs/koni/api/nft/config.js +1 -1
- package/cjs/koni/api/nft/ordinal_nft/index.js +3 -2
- package/cjs/koni/background/handlers/Extension.js +21 -1
- package/cjs/koni/background/handlers/State.js +3 -0
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/balance-service/helpers/subscribe/substrate/index.js +8 -14
- package/cjs/services/buy-service/index.js +2 -0
- package/cjs/services/chain-service/index.js +7 -2
- package/cjs/services/chain-service/utils/index.js +3 -0
- package/cjs/services/chain-service/utils/patch.js +1 -1
- package/cjs/services/earning-service/constants/chains.js +4 -2
- package/cjs/services/earning-service/handlers/lending/interlay.js +2 -1
- package/cjs/services/earning-service/handlers/liquid-staking/acala.js +2 -1
- package/cjs/services/earning-service/handlers/liquid-staking/bifrost.js +2 -1
- package/cjs/services/earning-service/handlers/liquid-staking/parallel.js +2 -1
- package/cjs/services/earning-service/handlers/liquid-staking/stella-swap.js +2 -1
- package/cjs/services/earning-service/handlers/native-staking/amplitude.js +32 -0
- package/cjs/services/earning-service/handlers/native-staking/astar.js +20 -1
- package/cjs/services/earning-service/handlers/native-staking/base.js +42 -30
- package/cjs/services/earning-service/handlers/native-staking/dtao.js +79 -21
- package/cjs/services/earning-service/handlers/native-staking/mythos.js +30 -1
- package/cjs/services/earning-service/handlers/native-staking/para-chain.js +17 -0
- package/cjs/services/earning-service/handlers/native-staking/relay-chain.js +49 -6
- package/cjs/services/earning-service/handlers/native-staking/tao.js +98 -32
- package/cjs/services/earning-service/handlers/nomination-pool/index.js +5 -2
- package/cjs/services/earning-service/handlers/special.js +3 -1
- package/cjs/services/earning-service/service.js +52 -7
- package/cjs/services/history-service/index.js +12 -7
- package/cjs/services/subscan-service/index.js +35 -104
- package/cjs/services/transaction-service/helpers/index.js +2 -0
- package/cjs/services/transaction-service/index.js +15 -0
- package/cjs/services/transaction-service/utils.js +10 -1
- package/cjs/strategy/api-request-strategy/index.js +1 -0
- package/cjs/strategy/api-request-strategy/utils/index.js +2 -2
- package/cjs/strategy/api-request-strategy-v2/index.js +138 -0
- package/cjs/strategy/api-request-strategy-v2/types.js +1 -0
- package/cjs/types/transaction/error.js +1 -0
- package/cjs/utils/account/transform.js +3 -2
- package/cjs/utils/gear/combine.js +4 -3
- package/cjs/utils/gear/vft.js +104 -135
- package/core/logic-validation/transfer.js +7 -0
- package/koni/api/nft/config.d.ts +1 -1
- package/koni/api/nft/config.js +1 -1
- package/koni/api/nft/ordinal_nft/index.js +3 -2
- package/koni/background/handlers/Extension.d.ts +1 -0
- package/koni/background/handlers/Extension.js +21 -1
- package/koni/background/handlers/State.js +4 -1
- package/package.json +20 -9
- package/packageInfo.js +1 -1
- package/services/balance-service/helpers/subscribe/substrate/index.js +8 -14
- package/services/buy-service/index.js +2 -0
- package/services/chain-service/index.js +7 -2
- package/services/chain-service/utils/index.js +3 -0
- package/services/chain-service/utils/patch.js +1 -1
- package/services/earning-service/constants/chains.d.ts +1 -0
- package/services/earning-service/constants/chains.js +2 -1
- package/services/earning-service/handlers/base.d.ts +5 -3
- package/services/earning-service/handlers/lending/interlay.d.ts +1 -1
- package/services/earning-service/handlers/lending/interlay.js +2 -1
- package/services/earning-service/handlers/liquid-staking/acala.d.ts +1 -1
- package/services/earning-service/handlers/liquid-staking/acala.js +2 -1
- package/services/earning-service/handlers/liquid-staking/bifrost.d.ts +1 -1
- package/services/earning-service/handlers/liquid-staking/bifrost.js +2 -1
- package/services/earning-service/handlers/liquid-staking/parallel.d.ts +1 -1
- package/services/earning-service/handlers/liquid-staking/parallel.js +2 -1
- package/services/earning-service/handlers/liquid-staking/stella-swap.d.ts +1 -1
- package/services/earning-service/handlers/liquid-staking/stella-swap.js +2 -1
- package/services/earning-service/handlers/native-staking/amplitude.d.ts +1 -0
- package/services/earning-service/handlers/native-staking/amplitude.js +32 -0
- package/services/earning-service/handlers/native-staking/astar.d.ts +2 -1
- package/services/earning-service/handlers/native-staking/astar.js +20 -1
- package/services/earning-service/handlers/native-staking/base.d.ts +4 -2
- package/services/earning-service/handlers/native-staking/base.js +42 -30
- package/services/earning-service/handlers/native-staking/dtao.d.ts +5 -3
- package/services/earning-service/handlers/native-staking/dtao.js +80 -22
- package/services/earning-service/handlers/native-staking/mythos.d.ts +2 -1
- package/services/earning-service/handlers/native-staking/mythos.js +30 -1
- package/services/earning-service/handlers/native-staking/para-chain.d.ts +1 -0
- package/services/earning-service/handlers/native-staking/para-chain.js +17 -0
- package/services/earning-service/handlers/native-staking/relay-chain.d.ts +6 -1
- package/services/earning-service/handlers/native-staking/relay-chain.js +50 -7
- package/services/earning-service/handlers/native-staking/tao.d.ts +23 -4
- package/services/earning-service/handlers/native-staking/tao.js +99 -33
- package/services/earning-service/handlers/nomination-pool/index.d.ts +3 -2
- package/services/earning-service/handlers/nomination-pool/index.js +5 -2
- package/services/earning-service/handlers/special.d.ts +2 -1
- package/services/earning-service/handlers/special.js +3 -1
- package/services/earning-service/service.d.ts +3 -1
- package/services/earning-service/service.js +52 -7
- package/services/history-service/index.js +12 -7
- package/services/subscan-service/index.d.ts +13 -27
- package/services/subscan-service/index.js +26 -95
- package/services/transaction-service/helpers/index.js +2 -0
- package/services/transaction-service/index.js +15 -0
- package/services/transaction-service/utils.js +11 -2
- package/strategy/api-request-strategy/context/base.d.ts +2 -6
- package/strategy/api-request-strategy/index.js +1 -0
- package/strategy/api-request-strategy/types.d.ts +4 -2
- package/strategy/api-request-strategy/utils/index.js +2 -2
- package/strategy/api-request-strategy-v2/index.d.ts +22 -0
- package/strategy/api-request-strategy-v2/index.js +128 -0
- package/strategy/api-request-strategy-v2/types.d.ts +11 -0
- package/strategy/api-request-strategy-v2/types.js +1 -0
- package/types/buy.d.ts +1 -1
- package/types/transaction/error.d.ts +2 -1
- package/types/transaction/error.js +1 -0
- package/types/yield/actions/join/submit.d.ts +10 -1
- package/types/yield/info/chain/info.d.ts +2 -0
- package/utils/account/transform.js +3 -2
- package/utils/gear/combine.d.ts +2 -1
- package/utils/gear/combine.js +4 -4
- package/utils/gear/vft.d.ts +20 -9
- package/utils/gear/vft.js +104 -135
|
@@ -22,7 +22,8 @@ function getGRC20ContractPromise(apiPromise, contractAddress) {
|
|
|
22
22
|
const gearApi = apiPromise;
|
|
23
23
|
return new _grc.GRC20(gearApi, contractAddress);
|
|
24
24
|
}
|
|
25
|
-
function getVFTContractPromise(
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
function getVFTContractPromise(api) {
|
|
26
|
+
let contractAddress = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0x';
|
|
27
|
+
const sails = _vft.sailsCache.get();
|
|
28
|
+
return new _vft.VFT(api, contractAddress, sails);
|
|
28
29
|
}
|
package/cjs/utils/gear/vft.js
CHANGED
|
@@ -3,33 +3,32 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.VftService = exports.VFT = void 0;
|
|
7
|
-
var _api = require("@gear-js/api");
|
|
6
|
+
exports.sailsCache = exports.VftService = exports.VFT = void 0;
|
|
8
7
|
var _sailsJs = require("sails-js");
|
|
9
|
-
var
|
|
8
|
+
var _sailsJsParser = require("sails-js-parser");
|
|
10
9
|
// Copyright 2019-2022 @subwallet/extension-base authors & contributors
|
|
11
10
|
// SPDX-License-Identifier: Apache-2.0
|
|
12
11
|
|
|
13
12
|
class VFT {
|
|
14
13
|
constructor(api) {
|
|
15
14
|
let programId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0x';
|
|
15
|
+
let sails = arguments.length > 2 ? arguments[2] : undefined;
|
|
16
16
|
this.api = api;
|
|
17
17
|
this.programId = programId;
|
|
18
|
-
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
types
|
|
22
|
-
});
|
|
23
|
-
this.registry.register(types);
|
|
18
|
+
this.sails = sails;
|
|
19
|
+
this.sails.setApi(api);
|
|
20
|
+
this.sails.setProgramId(programId);
|
|
24
21
|
this.service = new VftService(this);
|
|
25
22
|
}
|
|
26
23
|
newCtorFromCode(code, name, symbol, decimals) {
|
|
27
|
-
const
|
|
24
|
+
const ctor = this.sails.ctors.New;
|
|
25
|
+
const builder = ctor.fromCode(code, name, symbol, decimals);
|
|
28
26
|
this.programId = builder.programId;
|
|
29
27
|
return builder;
|
|
30
28
|
}
|
|
31
29
|
newCtorFromCodeId(codeId, name, symbol, decimals) {
|
|
32
|
-
const
|
|
30
|
+
const ctor = this.sails.ctors.New;
|
|
31
|
+
const builder = ctor.fromCodeId(codeId, name, symbol, decimals);
|
|
33
32
|
this.programId = builder.programId;
|
|
34
33
|
return builder;
|
|
35
34
|
}
|
|
@@ -39,135 +38,105 @@ class VftService {
|
|
|
39
38
|
constructor(_program) {
|
|
40
39
|
this._program = _program;
|
|
41
40
|
}
|
|
41
|
+
get functions() {
|
|
42
|
+
return this._program.sails.services.Vft.functions;
|
|
43
|
+
}
|
|
44
|
+
get queries() {
|
|
45
|
+
return this._program.sails.services.Vft.queries;
|
|
46
|
+
}
|
|
42
47
|
approve(spender, value) {
|
|
43
|
-
|
|
44
|
-
throw new Error('Program ID is not set');
|
|
45
|
-
}
|
|
46
|
-
return new _sailsJs.TransactionBuilder(this._program.api, this._program.registry, 'send_message', ['Vft', 'Approve', spender, value], '(String, String, [u8;32], U256)', 'bool', this._program.programId);
|
|
48
|
+
return this.functions.Approve(spender, value);
|
|
47
49
|
}
|
|
48
50
|
transfer(to, value) {
|
|
49
|
-
|
|
50
|
-
throw new Error('Program ID is not set');
|
|
51
|
-
}
|
|
52
|
-
return new _sailsJs.TransactionBuilder(this._program.api, this._program.registry, 'send_message', ['Vft', 'Transfer', to, value], '(String, String, [u8;32], U256)', 'bool', this._program.programId);
|
|
51
|
+
return this.functions.Transfer(to, value);
|
|
53
52
|
}
|
|
54
53
|
transferFrom(from, to, value) {
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
return this.functions.TransferFrom(from, to, value);
|
|
55
|
+
}
|
|
56
|
+
allowance(owner, spender, originAddress, value, atBlock) {
|
|
57
|
+
return this.queries.Allowance(originAddress, BigInt(value || 0), atBlock, owner, spender);
|
|
58
|
+
}
|
|
59
|
+
balanceOf(account, originAddress, value, atBlock) {
|
|
60
|
+
return this.queries.BalanceOf(originAddress, BigInt(value || 0), atBlock, account);
|
|
61
|
+
}
|
|
62
|
+
decimals(originAddress, value, atBlock) {
|
|
63
|
+
return this.queries.Decimals(originAddress, BigInt(value || 0), atBlock);
|
|
64
|
+
}
|
|
65
|
+
name(originAddress, value, atBlock) {
|
|
66
|
+
return this.queries.Name(originAddress, BigInt(value || 0), atBlock);
|
|
67
|
+
}
|
|
68
|
+
symbol(originAddress, value, atBlock) {
|
|
69
|
+
return this.queries.Symbol(originAddress, BigInt(value || 0), atBlock);
|
|
70
|
+
}
|
|
71
|
+
totalSupply(originAddress, value, atBlock) {
|
|
72
|
+
return this.queries.TotalSupply(originAddress, BigInt(value || 0), atBlock);
|
|
73
|
+
}
|
|
74
|
+
async subscribeToApprovalEvent(callback) {
|
|
75
|
+
return this._program.sails.services.Vft.events.Approval.subscribe(callback);
|
|
76
|
+
}
|
|
77
|
+
async subscribeToTransferEvent(callback) {
|
|
78
|
+
return this._program.sails.services.Vft.events.Transfer.subscribe(callback);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Cache sai
|
|
83
|
+
exports.VftService = VftService;
|
|
84
|
+
const vftIdl = `
|
|
85
|
+
constructor {
|
|
86
|
+
New : (name: str, symbol: str, decimals: u8);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
service Vft {
|
|
90
|
+
Approve : (spender: actor_id, value: u256) -> bool;
|
|
91
|
+
Transfer : (to: actor_id, value: u256) -> bool;
|
|
92
|
+
TransferFrom : (from: actor_id, to: actor_id, value: u256) -> bool;
|
|
93
|
+
|
|
94
|
+
query Allowance : (owner: actor_id, spender: actor_id) -> u256;
|
|
95
|
+
query BalanceOf : (account: actor_id) -> u256;
|
|
96
|
+
query Decimals : () -> u8;
|
|
97
|
+
query Name : () -> str;
|
|
98
|
+
query Symbol : () -> str;
|
|
99
|
+
query TotalSupply : () -> u256;
|
|
100
|
+
|
|
101
|
+
events {
|
|
102
|
+
Approval: struct {
|
|
103
|
+
owner: actor_id,
|
|
104
|
+
spender: actor_id,
|
|
105
|
+
value: u256,
|
|
106
|
+
};
|
|
107
|
+
Transfer: struct {
|
|
108
|
+
from: actor_id,
|
|
109
|
+
to: actor_id,
|
|
110
|
+
value: u256,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
`;
|
|
115
|
+
class SailsCache {
|
|
116
|
+
static instance = null;
|
|
117
|
+
sail = null;
|
|
118
|
+
|
|
119
|
+
// eslint-disable-next-line no-useless-constructor, @typescript-eslint/no-empty-function
|
|
120
|
+
constructor() {}
|
|
121
|
+
static getInstance() {
|
|
122
|
+
if (!SailsCache.instance) {
|
|
123
|
+
SailsCache.instance = new SailsCache();
|
|
124
|
+
}
|
|
125
|
+
return SailsCache.instance;
|
|
126
|
+
}
|
|
127
|
+
async init() {
|
|
128
|
+
if (!this.sail) {
|
|
129
|
+
const parser = await _sailsJsParser.SailsIdlParser.new();
|
|
130
|
+
const sails = new _sailsJs.Sails(parser);
|
|
131
|
+
this.sail = sails.parseIdl(vftIdl);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
get() {
|
|
135
|
+
if (!this.sail) {
|
|
136
|
+
throw new Error('Sails is not init yet');
|
|
57
137
|
}
|
|
58
|
-
return
|
|
59
|
-
}
|
|
60
|
-
async allowance(owner, spender, originAddress, value, atBlock) {
|
|
61
|
-
const payload = this._program.registry.createType('(String, String, [u8;32], [u8;32])', ['Vft', 'Allowance', owner, spender]).toHex();
|
|
62
|
-
const reply = await this._program.api.message.calculateReply({
|
|
63
|
-
destination: this._program.programId,
|
|
64
|
-
origin: (0, _api.decodeAddress)(originAddress),
|
|
65
|
-
payload,
|
|
66
|
-
value: value || 0,
|
|
67
|
-
gasLimit: this._program.api.blockGasLimit.toBigInt(),
|
|
68
|
-
at: atBlock
|
|
69
|
-
});
|
|
70
|
-
const result = this._program.registry.createType('(String, String, U256)', reply.payload);
|
|
71
|
-
return result[2].toBigInt();
|
|
72
|
-
}
|
|
73
|
-
async balanceOf(account, originAddress, value, atBlock) {
|
|
74
|
-
const payload = this._program.registry.createType('(String, String, [u8;32])', ['Vft', 'BalanceOf', account]).toHex();
|
|
75
|
-
const reply = await this._program.api.message.calculateReply({
|
|
76
|
-
destination: this._program.programId,
|
|
77
|
-
origin: (0, _api.decodeAddress)(originAddress),
|
|
78
|
-
payload,
|
|
79
|
-
value: value || 0,
|
|
80
|
-
gasLimit: this._program.api.blockGasLimit.toBigInt(),
|
|
81
|
-
at: atBlock
|
|
82
|
-
});
|
|
83
|
-
const result = this._program.registry.createType('(String, String, U256)', reply.payload);
|
|
84
|
-
return result[2].toBigInt();
|
|
85
|
-
}
|
|
86
|
-
async decimals(originAddress, value, atBlock) {
|
|
87
|
-
const payload = this._program.registry.createType('(String, String)', ['Vft', 'Decimals']).toHex();
|
|
88
|
-
const reply = await this._program.api.message.calculateReply({
|
|
89
|
-
destination: this._program.programId,
|
|
90
|
-
origin: (0, _api.decodeAddress)(originAddress),
|
|
91
|
-
payload,
|
|
92
|
-
value: value || 0,
|
|
93
|
-
gasLimit: this._program.api.blockGasLimit.toBigInt(),
|
|
94
|
-
at: atBlock
|
|
95
|
-
});
|
|
96
|
-
const result = this._program.registry.createType('(String, String, u8)', reply.payload);
|
|
97
|
-
return result[2].toNumber();
|
|
98
|
-
}
|
|
99
|
-
async name(originAddress, value, atBlock) {
|
|
100
|
-
const payload = this._program.registry.createType('(String, String)', ['Vft', 'Name']).toHex();
|
|
101
|
-
const reply = await this._program.api.message.calculateReply({
|
|
102
|
-
destination: this._program.programId,
|
|
103
|
-
origin: (0, _api.decodeAddress)(originAddress),
|
|
104
|
-
payload,
|
|
105
|
-
value: value || 0,
|
|
106
|
-
gasLimit: this._program.api.blockGasLimit.toBigInt(),
|
|
107
|
-
at: atBlock
|
|
108
|
-
});
|
|
109
|
-
const result = this._program.registry.createType('(String, String, String)', reply.payload);
|
|
110
|
-
return result[2].toString();
|
|
111
|
-
}
|
|
112
|
-
async symbol(originAddress, value, atBlock) {
|
|
113
|
-
const payload = this._program.registry.createType('(String, String)', ['Vft', 'Symbol']).toHex();
|
|
114
|
-
const reply = await this._program.api.message.calculateReply({
|
|
115
|
-
destination: this._program.programId,
|
|
116
|
-
origin: (0, _api.decodeAddress)(originAddress),
|
|
117
|
-
payload,
|
|
118
|
-
value: value || 0,
|
|
119
|
-
gasLimit: this._program.api.blockGasLimit.toBigInt(),
|
|
120
|
-
at: atBlock
|
|
121
|
-
});
|
|
122
|
-
const result = this._program.registry.createType('(String, String, String)', reply.payload);
|
|
123
|
-
return result[2].toString();
|
|
124
|
-
}
|
|
125
|
-
async totalSupply(originAddress, value, atBlock) {
|
|
126
|
-
const payload = this._program.registry.createType('(String, String)', ['Vft', 'TotalSupply']).toHex();
|
|
127
|
-
const reply = await this._program.api.message.calculateReply({
|
|
128
|
-
destination: this._program.programId,
|
|
129
|
-
origin: (0, _api.decodeAddress)(originAddress),
|
|
130
|
-
payload,
|
|
131
|
-
value: value || 0,
|
|
132
|
-
gasLimit: this._program.api.blockGasLimit.toBigInt(),
|
|
133
|
-
at: atBlock
|
|
134
|
-
});
|
|
135
|
-
const result = this._program.registry.createType('(String, String, U256)', reply.payload);
|
|
136
|
-
return result[2].toBigInt();
|
|
137
|
-
}
|
|
138
|
-
subscribeToApprovalEvent(callback) {
|
|
139
|
-
return this._program.api.gearEvents.subscribeToGearEvent('UserMessageSent', _ref => {
|
|
140
|
-
let {
|
|
141
|
-
data: {
|
|
142
|
-
message
|
|
143
|
-
}
|
|
144
|
-
} = _ref;
|
|
145
|
-
if (!message.source.eq(this._program.programId) || !message.destination.eq(_sailsJs.ZERO_ADDRESS)) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
const payload = message.payload.toHex();
|
|
149
|
-
if ((0, _sailsJs.getServiceNamePrefix)(payload) === 'Vft' && (0, _sailsJs.getFnNamePrefix)(payload) === 'Approval') {
|
|
150
|
-
// eslint-disable-next-line node/no-callback-literal,@typescript-eslint/no-floating-promises
|
|
151
|
-
callback(this._program.registry.createType('(String, String, {"owner":"[u8;32]","spender":"[u8;32]","value":"U256"})', message.payload)[2].toJSON());
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
subscribeToTransferEvent(callback) {
|
|
156
|
-
return this._program.api.gearEvents.subscribeToGearEvent('UserMessageSent', _ref2 => {
|
|
157
|
-
let {
|
|
158
|
-
data: {
|
|
159
|
-
message
|
|
160
|
-
}
|
|
161
|
-
} = _ref2;
|
|
162
|
-
if (!message.source.eq(this._program.programId) || !message.destination.eq(_sailsJs.ZERO_ADDRESS)) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
const payload = message.payload.toHex();
|
|
166
|
-
if ((0, _sailsJs.getServiceNamePrefix)(payload) === 'Service' && (0, _sailsJs.getFnNamePrefix)(payload) === 'Transfer') {
|
|
167
|
-
// eslint-disable-next-line node/no-callback-literal,@typescript-eslint/no-floating-promises
|
|
168
|
-
callback(this._program.registry.createType('(String, String, {"from":"[u8;32]","to":"[u8;32]","value":"U256"})', message.payload)[2].toJSON());
|
|
169
|
-
}
|
|
170
|
-
});
|
|
138
|
+
return this.sail;
|
|
171
139
|
}
|
|
172
140
|
}
|
|
173
|
-
|
|
141
|
+
const sailsCache = SailsCache.getInstance();
|
|
142
|
+
exports.sailsCache = sailsCache;
|
|
@@ -188,6 +188,13 @@ export function checkSupportForAction(validationResponse, blockedActionsMap) {
|
|
|
188
188
|
currentAction = `${extrinsicType}___${chain}`;
|
|
189
189
|
break;
|
|
190
190
|
}
|
|
191
|
+
case ExtrinsicType.CHANGE_EARNING_VALIDATOR:
|
|
192
|
+
{
|
|
193
|
+
const data = validationResponse.data;
|
|
194
|
+
const slug = data.slug;
|
|
195
|
+
currentAction = `${extrinsicType}___${slug}`;
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
191
198
|
case ExtrinsicType.STAKING_CLAIM_REWARD:
|
|
192
199
|
{
|
|
193
200
|
const data = validationResponse.data;
|
package/koni/api/nft/config.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare const IPFS_FLEEK = "https://ipfs.fleek.co/ipfs/";
|
|
|
32
32
|
export declare const W3S_IPFS = "https://w3s.link/ipfs/";
|
|
33
33
|
export declare const IPFS2_RMRK = "https://ipfs2.rmrk.link/ipfs/";
|
|
34
34
|
export declare const IPFS_ETH_ARAGON = "https://ipfs.eth.aragon.network/ipfs/";
|
|
35
|
-
export declare const SUBWALLET_IPFS = "https://ipfs.subwallet.app/ipfs/";
|
|
35
|
+
export declare const SUBWALLET_IPFS = "https://ipfs-files.subwallet.app/ipfs/";
|
|
36
36
|
export declare enum SUPPORTED_NFT_NETWORKS {
|
|
37
37
|
karura = "karura",
|
|
38
38
|
acala = "acala",
|
package/koni/api/nft/config.js
CHANGED
|
@@ -62,7 +62,7 @@ export const IPFS_FLEEK = 'https://ipfs.fleek.co/ipfs/';
|
|
|
62
62
|
export const W3S_IPFS = 'https://w3s.link/ipfs/'; // 400
|
|
63
63
|
export const IPFS2_RMRK = 'https://ipfs2.rmrk.link/ipfs/'; // ????
|
|
64
64
|
export const IPFS_ETH_ARAGON = 'https://ipfs.eth.aragon.network/ipfs/'; // 400
|
|
65
|
-
export const SUBWALLET_IPFS = 'https://ipfs.subwallet.app/ipfs/'; // ???
|
|
65
|
+
export const SUBWALLET_IPFS = 'https://ipfs-files.subwallet.app/ipfs/'; // ???
|
|
66
66
|
|
|
67
67
|
export let SUPPORTED_NFT_NETWORKS;
|
|
68
68
|
(function (SUPPORTED_NFT_NETWORKS) {
|
|
@@ -46,10 +46,11 @@ export default class OrdinalNftApi extends BaseNftApi {
|
|
|
46
46
|
this.subscanService = SubscanService.getInstance();
|
|
47
47
|
}
|
|
48
48
|
async handleNft(address, handleNftParams) {
|
|
49
|
-
const
|
|
49
|
+
const groupId = this.subscanService.getGroupId();
|
|
50
|
+
const events = await this.subscanService.getAccountRemarkEvents(groupId, this.subscanChain, address);
|
|
50
51
|
if (events && events.length) {
|
|
51
52
|
const extrinsicIds = events.map(data => data.extrinsic_index);
|
|
52
|
-
const extrinsicParams = await this.subscanService.getExtrinsicParams(this.subscanChain, extrinsicIds);
|
|
53
|
+
const extrinsicParams = await this.subscanService.getExtrinsicParams(groupId, this.subscanChain, extrinsicIds);
|
|
53
54
|
const items = [];
|
|
54
55
|
for (const data of extrinsicParams) {
|
|
55
56
|
const {
|
|
@@ -253,6 +253,7 @@ export default class KoniExtension {
|
|
|
253
253
|
private yieldSubmitCancelWithdrawal;
|
|
254
254
|
private yieldSubmitClaimReward;
|
|
255
255
|
private yieldGetEarningSlippage;
|
|
256
|
+
private handleYieldChangeValidator;
|
|
256
257
|
private unlockDotCheckCanMint;
|
|
257
258
|
private unlockDotSubscribeMintedData;
|
|
258
259
|
private subscribeProcessingBanner;
|
|
@@ -3970,6 +3970,25 @@ export default class KoniExtension {
|
|
|
3970
3970
|
const slippage = await this.#koniState.earningService.yieldGetEarningSlippage(params);
|
|
3971
3971
|
return slippage;
|
|
3972
3972
|
}
|
|
3973
|
+
async handleYieldChangeValidator(params) {
|
|
3974
|
+
const {
|
|
3975
|
+
address,
|
|
3976
|
+
slug
|
|
3977
|
+
} = params;
|
|
3978
|
+
const poolHandler = this.#koniState.earningService.getPoolHandler(slug);
|
|
3979
|
+
if (!poolHandler) {
|
|
3980
|
+
return this.#koniState.transactionService.generateBeforeHandleResponseErrors([new TransactionError(BasicTxErrorType.INVALID_PARAMS)]);
|
|
3981
|
+
}
|
|
3982
|
+
const extrinsic = await this.#koniState.earningService.handleYieldChangeValidator(params);
|
|
3983
|
+
return await this.#koniState.transactionService.handleTransaction({
|
|
3984
|
+
address,
|
|
3985
|
+
chain: poolHandler.chain,
|
|
3986
|
+
transaction: extrinsic,
|
|
3987
|
+
data: params,
|
|
3988
|
+
extrinsicType: ExtrinsicType.CHANGE_EARNING_VALIDATOR,
|
|
3989
|
+
chainType: ChainType.SUBSTRATE
|
|
3990
|
+
});
|
|
3991
|
+
}
|
|
3973
3992
|
|
|
3974
3993
|
/* Campaign */
|
|
3975
3994
|
|
|
@@ -4839,7 +4858,8 @@ export default class KoniExtension {
|
|
|
4839
4858
|
return await this.yieldSubmitClaimReward(request);
|
|
4840
4859
|
case 'pri(yield.getEarningSlippage)':
|
|
4841
4860
|
return await this.yieldGetEarningSlippage(request);
|
|
4842
|
-
|
|
4861
|
+
case 'pri(yield.changeValidator.submit)':
|
|
4862
|
+
return await this.handleYieldChangeValidator(request);
|
|
4843
4863
|
/* Others */
|
|
4844
4864
|
|
|
4845
4865
|
/* Actions */
|
|
@@ -41,7 +41,7 @@ import TransactionService from '@subwallet/extension-base/services/transaction-s
|
|
|
41
41
|
import WalletConnectService from '@subwallet/extension-base/services/wallet-connect-service';
|
|
42
42
|
import { SWStorage } from '@subwallet/extension-base/storage';
|
|
43
43
|
import { BasicTxErrorType } from '@subwallet/extension-base/types';
|
|
44
|
-
import { addLazy, isManifestV3, isSameAddress, reformatAddress, stripUrl, targetIsWeb } from '@subwallet/extension-base/utils';
|
|
44
|
+
import { addLazy, isManifestV3, isSameAddress, reformatAddress, sailsCache, stripUrl, targetIsWeb } from '@subwallet/extension-base/utils';
|
|
45
45
|
import { convertCardanoHexToBech32, validateAddressNetwork } from '@subwallet/extension-base/utils/cardano';
|
|
46
46
|
import { createPromiseHandler } from '@subwallet/extension-base/utils/promise';
|
|
47
47
|
import subwalletApiSdk from '@subwallet/subwallet-api-sdk';
|
|
@@ -238,6 +238,9 @@ export default class KoniState {
|
|
|
238
238
|
this.afterChainServiceInit();
|
|
239
239
|
});
|
|
240
240
|
|
|
241
|
+
// init sails
|
|
242
|
+
await sailsCache.init();
|
|
243
|
+
|
|
241
244
|
// Mark app is ready
|
|
242
245
|
this.eventService.emit('general.init', true);
|
|
243
246
|
}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"./cjs/detectPackage.js"
|
|
18
18
|
],
|
|
19
19
|
"type": "module",
|
|
20
|
-
"version": "1.3.
|
|
20
|
+
"version": "1.3.48-0",
|
|
21
21
|
"main": "./cjs/index.js",
|
|
22
22
|
"module": "./index.js",
|
|
23
23
|
"types": "./index.d.ts",
|
|
@@ -2201,6 +2201,16 @@
|
|
|
2201
2201
|
"require": "./cjs/strategy/api-request-strategy/index.js",
|
|
2202
2202
|
"default": "./strategy/api-request-strategy/index.js"
|
|
2203
2203
|
},
|
|
2204
|
+
"./strategy/api-request-strategy-v2": {
|
|
2205
|
+
"types": "./strategy/api-request-strategy-v2/index.d.ts",
|
|
2206
|
+
"require": "./cjs/strategy/api-request-strategy-v2/index.js",
|
|
2207
|
+
"default": "./strategy/api-request-strategy-v2/index.js"
|
|
2208
|
+
},
|
|
2209
|
+
"./strategy/api-request-strategy-v2/types": {
|
|
2210
|
+
"types": "./strategy/api-request-strategy-v2/types.d.ts",
|
|
2211
|
+
"require": "./cjs/strategy/api-request-strategy-v2/types.js",
|
|
2212
|
+
"default": "./strategy/api-request-strategy-v2/types.js"
|
|
2213
|
+
},
|
|
2204
2214
|
"./strategy/api-request-strategy/context/base": {
|
|
2205
2215
|
"types": "./strategy/api-request-strategy/context/base.d.ts",
|
|
2206
2216
|
"require": "./cjs/strategy/api-request-strategy/context/base.js",
|
|
@@ -2829,7 +2839,7 @@
|
|
|
2829
2839
|
"@ethereumjs/common": "^4.1.0",
|
|
2830
2840
|
"@ethereumjs/tx": "^5.1.0",
|
|
2831
2841
|
"@ethersproject/abi": "^5.7.0",
|
|
2832
|
-
"@gear-js/api": "^0.
|
|
2842
|
+
"@gear-js/api": "^0.42.0",
|
|
2833
2843
|
"@json-rpc-tools/utils": "^1.7.6",
|
|
2834
2844
|
"@metamask/eth-sig-util": "^7.0.3",
|
|
2835
2845
|
"@metamask/safe-event-emitter": "^2.0.0",
|
|
@@ -2855,13 +2865,13 @@
|
|
|
2855
2865
|
"@reduxjs/toolkit": "^1.9.1",
|
|
2856
2866
|
"@sora-substrate/type-definitions": "^1.17.7",
|
|
2857
2867
|
"@substrate/connect": "^0.8.9",
|
|
2858
|
-
"@subwallet/chain-list": "0.2.
|
|
2859
|
-
"@subwallet/extension-base": "^1.3.
|
|
2860
|
-
"@subwallet/extension-chains": "^1.3.
|
|
2861
|
-
"@subwallet/extension-dapp": "^1.3.
|
|
2862
|
-
"@subwallet/extension-inject": "^1.3.
|
|
2868
|
+
"@subwallet/chain-list": "0.2.108-beta.15",
|
|
2869
|
+
"@subwallet/extension-base": "^1.3.48-0",
|
|
2870
|
+
"@subwallet/extension-chains": "^1.3.48-0",
|
|
2871
|
+
"@subwallet/extension-dapp": "^1.3.48-0",
|
|
2872
|
+
"@subwallet/extension-inject": "^1.3.48-0",
|
|
2863
2873
|
"@subwallet/keyring": "^0.1.12",
|
|
2864
|
-
"@subwallet/subwallet-api-sdk": "^1.3.
|
|
2874
|
+
"@subwallet/subwallet-api-sdk": "^1.3.48-0",
|
|
2865
2875
|
"@subwallet/ui-keyring": "^0.1.12",
|
|
2866
2876
|
"@ton/core": "^0.56.3",
|
|
2867
2877
|
"@ton/crypto": "^3.2.0",
|
|
@@ -2894,7 +2904,8 @@
|
|
|
2894
2904
|
"moment": "^2.29.4",
|
|
2895
2905
|
"protobufjs": "^7.2.4",
|
|
2896
2906
|
"rxjs": "^7.8.1",
|
|
2897
|
-
"sails-js": "^0.
|
|
2907
|
+
"sails-js": "^0.4.2",
|
|
2908
|
+
"sails-js-parser": "^0.4.2",
|
|
2898
2909
|
"ts-md5": "^1.3.1",
|
|
2899
2910
|
"tweetnacl": "^1.0.3",
|
|
2900
2911
|
"uuid": "^9.0.0",
|
package/packageInfo.js
CHANGED
|
@@ -7,5 +7,5 @@ export const packageInfo = {
|
|
|
7
7
|
name: '@subwallet/extension-base',
|
|
8
8
|
path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
|
|
9
9
|
type: 'esm',
|
|
10
|
-
version: '1.3.
|
|
10
|
+
version: '1.3.48-0'
|
|
11
11
|
};
|
|
@@ -324,17 +324,15 @@ const subscribeTokensAccountsPallet = async ({
|
|
|
324
324
|
const tokensAccountsKey = 'query_tokens_accounts';
|
|
325
325
|
const tokenTypes = includeNativeToken ? [_AssetType.NATIVE, _AssetType.LOCAL] : [_AssetType.LOCAL];
|
|
326
326
|
const tokenMap = filterAssetsByChainAndType(assetMap, chainInfo.slug, tokenTypes);
|
|
327
|
-
|
|
328
|
-
// Hotfix balance for gdot
|
|
329
|
-
const getGdotBalance = async () => {
|
|
330
|
-
const gdotBalances = await queryGdotBalance(substrateApi, addresses, assetMap[gdotSlug], extrinsicType);
|
|
331
|
-
callback(gdotBalances);
|
|
332
|
-
};
|
|
333
327
|
const unsubList = await Promise.all(Object.values(tokenMap).map(tokenInfo => {
|
|
334
|
-
|
|
335
|
-
if (tokenInfo.
|
|
328
|
+
var _tokenInfo$metadata;
|
|
329
|
+
if ((_tokenInfo$metadata = tokenInfo.metadata) !== null && _tokenInfo$metadata !== void 0 && _tokenInfo$metadata.isGigaToken) {
|
|
336
330
|
return timer(0, CRON_REFRESH_PRICE_INTERVAL).subscribe(() => {
|
|
337
|
-
|
|
331
|
+
const getGigaTokenBalance = async () => {
|
|
332
|
+
const gigaTokenBalances = await queryGigaTokenBalance(substrateApi, addresses, assetMap[tokenInfo.slug], extrinsicType);
|
|
333
|
+
callback(gigaTokenBalances);
|
|
334
|
+
};
|
|
335
|
+
getGigaTokenBalance().catch(console.error);
|
|
338
336
|
});
|
|
339
337
|
}
|
|
340
338
|
try {
|
|
@@ -543,11 +541,7 @@ const subscribeSubnetAlphaPallet = async ({
|
|
|
543
541
|
clearInterval(interval);
|
|
544
542
|
};
|
|
545
543
|
};
|
|
546
|
-
|
|
547
|
-
// Hot fix for gdot balance
|
|
548
|
-
|
|
549
|
-
const gdotSlug = 'hydradx_main-LOCAL-GDOT';
|
|
550
|
-
async function queryGdotBalance(substrateApi, addresses, tokenInfo, extrinsicType) {
|
|
544
|
+
async function queryGigaTokenBalance(substrateApi, addresses, tokenInfo, extrinsicType) {
|
|
551
545
|
return await Promise.all(addresses.map(async address => {
|
|
552
546
|
const _balanceInfo = await substrateApi.api.call.currenciesApi.account(_getTokenOnChainAssetId(tokenInfo), address);
|
|
553
547
|
const balanceInfo = _balanceInfo.toPrimitive();
|
|
@@ -667,15 +667,20 @@ export class ChainService {
|
|
|
667
667
|
const priorityTokensMap = this.priorityTokensSubject.value || {};
|
|
668
668
|
const priorityTokensList = priorityTokensMap.token && typeof priorityTokensMap.token === 'object' ? Object.keys(priorityTokensMap.token) : [];
|
|
669
669
|
for (const assetSlug of priorityTokensList) {
|
|
670
|
-
const assetState = assetSettings[assetSlug];
|
|
671
670
|
const assetInfo = this.getAssetBySlug(assetSlug);
|
|
671
|
+
|
|
672
|
+
// This can occur if the assetSlug is not present in the current chainlist version
|
|
673
|
+
if (!assetInfo) {
|
|
674
|
+
continue;
|
|
675
|
+
}
|
|
676
|
+
const assetState = assetSettings[assetSlug];
|
|
672
677
|
const chainState = chainStateMap[assetInfo.originChain];
|
|
673
678
|
if (!assetState) {
|
|
674
679
|
// If this asset not has asset setting, this token is not enabled before (not turned off before)
|
|
675
680
|
if (!chainState || !chainState.manualTurnOff) {
|
|
676
681
|
await this.updateAssetSetting(assetSlug, {
|
|
677
682
|
visible: true
|
|
678
|
-
},
|
|
683
|
+
}, false);
|
|
679
684
|
}
|
|
680
685
|
}
|
|
681
686
|
}
|
|
@@ -432,6 +432,9 @@ export function _getBlockExplorerFromChain(chainInfo) {
|
|
|
432
432
|
} else if (_isPureBitcoinChain(chainInfo)) {
|
|
433
433
|
var _chainInfo$bitcoinInf;
|
|
434
434
|
blockExplorer = chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$bitcoinInf = chainInfo.bitcoinInfo) === null || _chainInfo$bitcoinInf === void 0 ? void 0 : _chainInfo$bitcoinInf.blockExplorer;
|
|
435
|
+
} else if (_isPureTonChain(chainInfo)) {
|
|
436
|
+
var _chainInfo$tonInfo;
|
|
437
|
+
blockExplorer = chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$tonInfo = chainInfo.tonInfo) === null || _chainInfo$tonInfo === void 0 ? void 0 : _chainInfo$tonInfo.blockExplorer;
|
|
435
438
|
} else {
|
|
436
439
|
var _chainInfo$substrateI18;
|
|
437
440
|
blockExplorer = chainInfo === null || chainInfo === void 0 ? void 0 : (_chainInfo$substrateI18 = chainInfo.substrateInfo) === null || _chainInfo$substrateI18 === void 0 ? void 0 : _chainInfo$substrateI18.blockExplorer;
|
|
@@ -5,7 +5,7 @@ const PRODUCTION_BRANCHES = ['master', 'webapp', 'webapp-dev'];
|
|
|
5
5
|
const branchName = process.env.BRANCH_NAME || 'subwallet-dev';
|
|
6
6
|
const fetchDomain = PRODUCTION_BRANCHES.indexOf(branchName) > -1 ? 'https://chain-list-assets.subwallet.app' : 'https://dev.sw-chain-list-assets.pages.dev';
|
|
7
7
|
const fetchFile = PRODUCTION_BRANCHES.indexOf(branchName) > -1 ? 'list.json' : 'preview.json';
|
|
8
|
-
const ChainListVersion = '0.2.
|
|
8
|
+
const ChainListVersion = '0.2.109'; // update this when build chainlist
|
|
9
9
|
|
|
10
10
|
// todo: move this interface to chainlist
|
|
11
11
|
|
|
@@ -22,3 +22,4 @@ export declare const ST_LIQUID_TOKEN_ABI: Record<string, any>;
|
|
|
22
22
|
export declare const MANTA_VALIDATOR_POINTS_PER_BLOCK = 20;
|
|
23
23
|
export declare const MANTA_MIN_DELEGATION = 500;
|
|
24
24
|
export declare const CHANNEL_ID = 7;
|
|
25
|
+
export declare const _SUPPORT_CHANGE_VALIDATOR_CHAIN: string[];
|
|
@@ -28,4 +28,5 @@ export const MaxEraRewardPointsEras = 14;
|
|
|
28
28
|
export const ST_LIQUID_TOKEN_ABI = require("./abis/st_liquid_token_abi.json");
|
|
29
29
|
export const MANTA_VALIDATOR_POINTS_PER_BLOCK = 20;
|
|
30
30
|
export const MANTA_MIN_DELEGATION = 500;
|
|
31
|
-
export const CHANNEL_ID = 7;
|
|
31
|
+
export const CHANNEL_ID = 7;
|
|
32
|
+
export const _SUPPORT_CHANGE_VALIDATOR_CHAIN = ['polkadot', 'kusama'];
|
|
@@ -3,7 +3,7 @@ import { TransactionError } from '@subwallet/extension-base/background/errors/Tr
|
|
|
3
3
|
import { ChainType, ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
|
|
4
4
|
import KoniState from '@subwallet/extension-base/koni/background/handlers/State';
|
|
5
5
|
import { _EvmApi, _SubstrateApi } from '@subwallet/extension-base/services/chain-service/types';
|
|
6
|
-
import { BasePoolInfo, BaseYieldPoolMetadata, EarningRewardHistoryItem, EarningRewardItem, HandleYieldStepData, OptimalYieldPath, OptimalYieldPathParams, RequestEarlyValidateYield, RequestEarningSlippage, ResponseEarlyValidateYield, StakeCancelWithdrawalParams, SubmitYieldJoinData, TransactionData, UnstakingInfo, YieldPoolInfo, YieldPoolMethodInfo, YieldPoolTarget, YieldPoolType, YieldPositionInfo, YieldStepBaseInfo, YieldTokenBaseInfo } from '@subwallet/extension-base/types';
|
|
6
|
+
import { BasePoolInfo, BaseYieldPoolMetadata, EarningRewardHistoryItem, EarningRewardItem, HandleYieldStepData, OptimalYieldPath, OptimalYieldPathParams, RequestEarlyValidateYield, RequestEarningSlippage, ResponseEarlyValidateYield, StakeCancelWithdrawalParams, SubmitChangeValidatorStaking, SubmitYieldJoinData, TransactionData, UnstakingInfo, YieldPoolInfo, YieldPoolMethodInfo, YieldPoolTarget, YieldPoolType, YieldPositionInfo, YieldStepBaseInfo, YieldTokenBaseInfo } from '@subwallet/extension-base/types';
|
|
7
7
|
import { EarningSlippageResult } from './native-staking/dtao';
|
|
8
8
|
/**
|
|
9
9
|
* @class BasePoolHandler
|
|
@@ -27,7 +27,7 @@ export default abstract class BasePoolHandler {
|
|
|
27
27
|
/** Pool's transaction type */
|
|
28
28
|
readonly transactionChainType: ChainType;
|
|
29
29
|
/** Pool's available method */
|
|
30
|
-
|
|
30
|
+
abstract readonly availableMethod: YieldPoolMethodInfo;
|
|
31
31
|
/**
|
|
32
32
|
* @constructor
|
|
33
33
|
* @param {KoniState} state - Koni state
|
|
@@ -61,7 +61,7 @@ export default abstract class BasePoolHandler {
|
|
|
61
61
|
/** Get pool reward history */
|
|
62
62
|
abstract getPoolRewardHistory(useAddresses: string[], callback: (rs: EarningRewardHistoryItem) => void): Promise<VoidFunction>;
|
|
63
63
|
/** Get pool target */
|
|
64
|
-
abstract getPoolTargets(): Promise<YieldPoolTarget[]>;
|
|
64
|
+
abstract getPoolTargets(netuid?: number): Promise<YieldPoolTarget[]>;
|
|
65
65
|
earlyValidate(request: RequestEarlyValidateYield): Promise<ResponseEarlyValidateYield>;
|
|
66
66
|
/**
|
|
67
67
|
* @function firstStepFee
|
|
@@ -113,6 +113,8 @@ export default abstract class BasePoolHandler {
|
|
|
113
113
|
abstract handleYieldCancelUnstake(params: StakeCancelWithdrawalParams): Promise<TransactionData>;
|
|
114
114
|
/** Create `transaction` to claim reward */
|
|
115
115
|
abstract handleYieldClaimReward(address: string, bondReward?: boolean): Promise<TransactionData>;
|
|
116
|
+
/** Change earning validator */
|
|
117
|
+
abstract handleChangeEarningValidator(data: SubmitChangeValidatorStaking): Promise<TransactionData>;
|
|
116
118
|
/** Check handler can handle slug */
|
|
117
119
|
canHandleSlug(slug: string): boolean;
|
|
118
120
|
getEarningSlippage(params: RequestEarningSlippage): Promise<EarningSlippageResult>;
|
|
@@ -11,7 +11,7 @@ export default class InterlayLendingPoolHandler extends BaseLendingPoolHandler {
|
|
|
11
11
|
protected readonly inputAsset: string;
|
|
12
12
|
protected readonly rewardAssets: string[];
|
|
13
13
|
protected readonly feeAssets: string[];
|
|
14
|
-
|
|
14
|
+
readonly availableMethod: YieldPoolMethodInfo;
|
|
15
15
|
protected readonly rateDecimals = 18;
|
|
16
16
|
constructor(state: KoniState, chain: string);
|
|
17
17
|
protected getDescription(): string;
|
|
@@ -20,7 +20,8 @@ export default class InterlayLendingPoolHandler extends BaseLendingPoolHandler {
|
|
|
20
20
|
fastUnstake: true,
|
|
21
21
|
cancelUnstake: false,
|
|
22
22
|
withdraw: false,
|
|
23
|
-
claimReward: false
|
|
23
|
+
claimReward: false,
|
|
24
|
+
changeValidator: false
|
|
24
25
|
};
|
|
25
26
|
rateDecimals = 18;
|
|
26
27
|
constructor(state, chain) {
|
|
@@ -12,7 +12,7 @@ export default class AcalaLiquidStakingPoolHandler extends BaseLiquidStakingPool
|
|
|
12
12
|
protected readonly feeAssets: string[];
|
|
13
13
|
readonly minAmountPercent = 0.98;
|
|
14
14
|
protected readonly rateDecimals = 10;
|
|
15
|
-
|
|
15
|
+
readonly availableMethod: YieldPoolMethodInfo;
|
|
16
16
|
slug: string;
|
|
17
17
|
constructor(state: KoniState, chain: string);
|
|
18
18
|
protected getDescription(): string;
|