@subwallet/extension-base 1.1.31-beta.0 → 1.1.33-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.
Files changed (319) hide show
  1. package/background/KoniTypes.d.ts +71 -111
  2. package/background/KoniTypes.js +14 -19
  3. package/background/errors/TransactionError.js +0 -9
  4. package/cjs/background/KoniTypes.js +17 -20
  5. package/cjs/background/errors/TransactionError.js +0 -9
  6. package/cjs/constants/index.js +4 -19
  7. package/cjs/koni/api/nft/config.js +23 -33
  8. package/cjs/koni/api/nft/index.js +0 -14
  9. package/cjs/koni/api/nft/nft.js +22 -1
  10. package/cjs/koni/api/staking/bonding/amplitude.js +108 -76
  11. package/cjs/koni/api/staking/bonding/astar.js +10 -11
  12. package/cjs/koni/api/staking/bonding/index.js +3 -4
  13. package/cjs/koni/api/staking/bonding/paraChain.js +29 -28
  14. package/cjs/koni/api/staking/bonding/relayChain.js +45 -48
  15. package/cjs/koni/api/staking/bonding/utils.js +86 -104
  16. package/cjs/koni/api/staking/index.js +5 -6
  17. package/cjs/koni/api/staking/paraChain.js +36 -11
  18. package/cjs/koni/api/staking/relayChain.js +2 -3
  19. package/cjs/koni/api/xcm/xTokens.js +1 -1
  20. package/cjs/koni/background/cron.js +1 -11
  21. package/cjs/koni/background/handlers/Extension.js +69 -362
  22. package/cjs/koni/background/handlers/State.js +3 -51
  23. package/cjs/koni/background/handlers/Tabs.js +19 -2
  24. package/cjs/koni/background/handlers/index.js +2 -4
  25. package/cjs/koni/background/subscription.js +37 -95
  26. package/cjs/packageInfo.js +1 -1
  27. package/cjs/services/campaign-service/index.js +25 -9
  28. package/cjs/services/chain-service/constants.js +21 -4
  29. package/cjs/services/chain-service/index.js +2 -3
  30. package/cjs/services/chain-service/utils.js +1 -7
  31. package/cjs/services/event-service/index.js +0 -4
  32. package/cjs/services/history-service/index.js +12 -8
  33. package/cjs/services/keyring-service/index.js +2 -14
  34. package/cjs/services/migration-service/scripts/MigrateLedgerAccount.js +1 -1
  35. package/cjs/services/migration-service/scripts/MigrateTransactionHistory.js +1 -1
  36. package/cjs/services/migration-service/scripts/index.js +1 -7
  37. package/cjs/services/notification-service/NotificationService.js +1 -1
  38. package/cjs/services/storage-service/DatabaseService.js +3 -51
  39. package/cjs/services/storage-service/databases/index.js +0 -4
  40. package/cjs/services/storage-service/db-stores/Campaign.js +9 -3
  41. package/cjs/services/storage-service/db-stores/NominatorMetadata.js +3 -3
  42. package/cjs/services/subscan-service/index.js +0 -16
  43. package/cjs/services/transaction-service/event-parser/index.js +0 -58
  44. package/cjs/services/transaction-service/helpers/index.js +1 -3
  45. package/cjs/services/transaction-service/index.js +131 -242
  46. package/cjs/services/transaction-service/utils.js +0 -1
  47. package/cjs/types/index.js +0 -44
  48. package/cjs/utils/fetchEvmChainInfo.js +20 -0
  49. package/cjs/utils/fetchStaticData.js +1 -2
  50. package/cjs/utils/index.js +17 -81
  51. package/cjs/utils/number.js +1 -3
  52. package/constants/index.d.ts +1 -6
  53. package/constants/index.js +1 -6
  54. package/koni/api/nft/config.js +23 -33
  55. package/koni/api/nft/index.js +1 -15
  56. package/koni/api/nft/nft.js +23 -2
  57. package/koni/api/staking/bonding/amplitude.d.ts +1 -1
  58. package/koni/api/staking/bonding/amplitude.js +105 -73
  59. package/koni/api/staking/bonding/astar.js +8 -9
  60. package/koni/api/staking/bonding/index.d.ts +2 -1
  61. package/koni/api/staking/bonding/index.js +3 -5
  62. package/koni/api/staking/bonding/paraChain.js +16 -15
  63. package/koni/api/staking/bonding/relayChain.d.ts +2 -2
  64. package/koni/api/staking/bonding/relayChain.js +30 -33
  65. package/koni/api/staking/bonding/utils.d.ts +42 -15
  66. package/koni/api/staking/bonding/utils.js +69 -85
  67. package/koni/api/staking/index.js +1 -2
  68. package/koni/api/staking/paraChain.js +37 -12
  69. package/koni/api/staking/relayChain.js +3 -4
  70. package/koni/api/xcm/xTokens.js +1 -1
  71. package/koni/background/cron.d.ts +0 -1
  72. package/koni/background/cron.js +2 -12
  73. package/koni/background/handlers/Extension.d.ts +1 -17
  74. package/koni/background/handlers/Extension.js +30 -321
  75. package/koni/background/handlers/State.d.ts +2 -18
  76. package/koni/background/handlers/State.js +3 -50
  77. package/koni/background/handlers/Tabs.js +20 -3
  78. package/koni/background/handlers/index.js +2 -4
  79. package/koni/background/subscription.d.ts +1 -6
  80. package/koni/background/subscription.js +38 -97
  81. package/package.json +13 -321
  82. package/packageInfo.js +1 -1
  83. package/services/campaign-service/index.js +25 -9
  84. package/services/chain-service/constants.d.ts +12 -0
  85. package/services/chain-service/constants.js +19 -3
  86. package/services/chain-service/index.js +2 -3
  87. package/services/chain-service/utils.d.ts +0 -1
  88. package/services/chain-service/utils.js +1 -5
  89. package/services/event-service/index.d.ts +0 -1
  90. package/services/event-service/index.js +0 -4
  91. package/services/event-service/types.d.ts +1 -8
  92. package/services/history-service/index.js +12 -8
  93. package/services/keyring-service/index.d.ts +1 -2
  94. package/services/keyring-service/index.js +2 -14
  95. package/services/migration-service/scripts/MigrateLedgerAccount.js +1 -1
  96. package/services/migration-service/scripts/MigrateTransactionHistory.js +1 -1
  97. package/services/migration-service/scripts/index.js +1 -7
  98. package/services/notification-service/NotificationService.js +1 -1
  99. package/services/storage-service/DatabaseService.d.ts +2 -18
  100. package/services/storage-service/DatabaseService.js +3 -51
  101. package/services/storage-service/databases/index.d.ts +1 -3
  102. package/services/storage-service/databases/index.js +0 -4
  103. package/services/storage-service/db-stores/Campaign.js +9 -3
  104. package/services/storage-service/db-stores/NominatorMetadata.js +3 -3
  105. package/services/subscan-service/index.d.ts +2 -3
  106. package/services/subscan-service/index.js +0 -15
  107. package/services/subscan-service/types.d.ts +0 -20
  108. package/services/transaction-service/event-parser/index.d.ts +1 -3
  109. package/services/transaction-service/event-parser/index.js +1 -57
  110. package/services/transaction-service/helpers/index.js +1 -3
  111. package/services/transaction-service/index.d.ts +16 -4
  112. package/services/transaction-service/index.js +118 -230
  113. package/services/transaction-service/types.d.ts +1 -2
  114. package/services/transaction-service/utils.js +0 -1
  115. package/types/index.d.ts +0 -5
  116. package/types/index.js +1 -5
  117. package/utils/fetchEvmChainInfo.d.ts +17 -0
  118. package/utils/fetchEvmChainInfo.js +14 -0
  119. package/utils/fetchStaticData.js +1 -2
  120. package/utils/index.d.ts +2 -5
  121. package/utils/index.js +2 -52
  122. package/utils/number.d.ts +1 -1
  123. package/utils/number.js +1 -1
  124. package/cjs/koni/api/dotsama/balance.js +0 -464
  125. package/cjs/koni/api/nft/ordinal_nft/constants.js +0 -21
  126. package/cjs/koni/api/nft/ordinal_nft/index.js +0 -121
  127. package/cjs/koni/api/nft/ordinal_nft/utils.js +0 -41
  128. package/cjs/koni/api/yield/helper/utils.js +0 -46
  129. package/cjs/services/earning-service/constants/chains.js +0 -29
  130. package/cjs/services/earning-service/constants/index.js +0 -27
  131. package/cjs/services/earning-service/constants/step.js +0 -18
  132. package/cjs/services/earning-service/handlers/base.js +0 -259
  133. package/cjs/services/earning-service/handlers/index.js +0 -60
  134. package/cjs/services/earning-service/handlers/lending/base.js +0 -20
  135. package/cjs/services/earning-service/handlers/lending/index.js +0 -13
  136. package/cjs/services/earning-service/handlers/lending/interlay.js +0 -191
  137. package/cjs/services/earning-service/handlers/liquid-staking/acala.js +0 -239
  138. package/cjs/services/earning-service/handlers/liquid-staking/base.js +0 -43
  139. package/cjs/services/earning-service/handlers/liquid-staking/bifrost.js +0 -297
  140. package/cjs/services/earning-service/handlers/liquid-staking/index.js +0 -34
  141. package/cjs/services/earning-service/handlers/liquid-staking/parallel.js +0 -226
  142. package/cjs/services/earning-service/handlers/liquid-staking/stella-swap.js +0 -395
  143. package/cjs/services/earning-service/handlers/native-staking/amplitude.js +0 -384
  144. package/cjs/services/earning-service/handlers/native-staking/astar.js +0 -461
  145. package/cjs/services/earning-service/handlers/native-staking/base-para.js +0 -146
  146. package/cjs/services/earning-service/handlers/native-staking/base.js +0 -159
  147. package/cjs/services/earning-service/handlers/native-staking/index.js +0 -34
  148. package/cjs/services/earning-service/handlers/native-staking/para-chain.js +0 -385
  149. package/cjs/services/earning-service/handlers/native-staking/relay-chain.js +0 -558
  150. package/cjs/services/earning-service/handlers/nomination-pool/index.js +0 -560
  151. package/cjs/services/earning-service/handlers/special.js +0 -503
  152. package/cjs/services/earning-service/service.js +0 -387
  153. package/cjs/services/earning-service/utils/index.js +0 -128
  154. package/cjs/services/migration-service/scripts/DeleteEarningData.js +0 -21
  155. package/cjs/services/migration-service/scripts/EnableEarningChains.js +0 -21
  156. package/cjs/services/migration-service/scripts/MigrateEthProvider.js +0 -17
  157. package/cjs/services/migration-service/scripts/MigratePioneerProvider.js +0 -17
  158. package/cjs/services/migration-service/scripts/MigrateProvider.js +0 -29
  159. package/cjs/services/migration-service/scripts/databases/MigrateEarningHistory.js +0 -21
  160. package/cjs/services/migration-service/scripts/databases/MigrateEarningVersion.js +0 -21
  161. package/cjs/services/mint-campaign-service/campaigns/UnlockDotCampaign.js +0 -149
  162. package/cjs/services/mint-campaign-service/campaigns/index.js +0 -13
  163. package/cjs/services/mint-campaign-service/constants.js +0 -11
  164. package/cjs/services/mint-campaign-service/index.js +0 -18
  165. package/cjs/services/storage-service/db-stores/YieldPoolStore.js +0 -36
  166. package/cjs/services/storage-service/db-stores/YieldPositionStore.js +0 -65
  167. package/cjs/services/storage-service/index.js +0 -241
  168. package/cjs/types/campaigns/index.js +0 -16
  169. package/cjs/types/campaigns/unlock-dot.js +0 -1
  170. package/cjs/types/ordinal.js +0 -1
  171. package/cjs/types/transaction.js +0 -1
  172. package/cjs/types/yield/actions/index.js +0 -27
  173. package/cjs/types/yield/actions/join/index.js +0 -38
  174. package/cjs/types/yield/actions/join/step.js +0 -47
  175. package/cjs/types/yield/actions/join/submit.js +0 -1
  176. package/cjs/types/yield/actions/join/validate.js +0 -16
  177. package/cjs/types/yield/actions/others.js +0 -1
  178. package/cjs/types/yield/index.js +0 -27
  179. package/cjs/types/yield/info/account/index.js +0 -49
  180. package/cjs/types/yield/info/account/info.js +0 -1
  181. package/cjs/types/yield/info/account/reward.js +0 -1
  182. package/cjs/types/yield/info/account/target.js +0 -32
  183. package/cjs/types/yield/info/account/unstake.js +0 -27
  184. package/cjs/types/yield/info/base.js +0 -41
  185. package/cjs/types/yield/info/chain/index.js +0 -27
  186. package/cjs/types/yield/info/chain/info.js +0 -1
  187. package/cjs/types/yield/info/chain/target.js +0 -1
  188. package/cjs/types/yield/info/index.js +0 -49
  189. package/cjs/types/yield/info/pallet.js +0 -15
  190. package/cjs/types.js +0 -1
  191. package/cjs/utils/address.js +0 -34
  192. package/cjs/utils/keyring.js +0 -57
  193. package/cjs/utils/object.js +0 -12
  194. package/koni/api/nft/ordinal_nft/constants.d.ts +0 -9
  195. package/koni/api/nft/ordinal_nft/constants.js +0 -12
  196. package/koni/api/nft/ordinal_nft/index.d.ts +0 -8
  197. package/koni/api/nft/ordinal_nft/index.js +0 -114
  198. package/koni/api/nft/ordinal_nft/utils.d.ts +0 -2
  199. package/koni/api/nft/ordinal_nft/utils.js +0 -33
  200. package/koni/api/yield/helper/utils.d.ts +0 -10
  201. package/koni/api/yield/helper/utils.js +0 -32
  202. package/services/earning-service/constants/abis/compound_finance_v2_abi.json +0 -1235
  203. package/services/earning-service/constants/abis/st_liquid_token_abi.json +0 -1355
  204. package/services/earning-service/constants/chains.d.ts +0 -14
  205. package/services/earning-service/constants/chains.js +0 -21
  206. package/services/earning-service/constants/index.d.ts +0 -2
  207. package/services/earning-service/constants/index.js +0 -5
  208. package/services/earning-service/constants/step.d.ts +0 -3
  209. package/services/earning-service/constants/step.js +0 -10
  210. package/services/earning-service/handlers/base.d.ts +0 -112
  211. package/services/earning-service/handlers/base.js +0 -253
  212. package/services/earning-service/handlers/index.d.ts +0 -5
  213. package/services/earning-service/handlers/index.js +0 -8
  214. package/services/earning-service/handlers/lending/base.d.ts +0 -6
  215. package/services/earning-service/handlers/lending/base.js +0 -12
  216. package/services/earning-service/handlers/lending/index.d.ts +0 -1
  217. package/services/earning-service/handlers/lending/index.js +0 -4
  218. package/services/earning-service/handlers/lending/interlay.d.ts +0 -24
  219. package/services/earning-service/handlers/lending/interlay.js +0 -183
  220. package/services/earning-service/handlers/liquid-staking/acala.d.ts +0 -27
  221. package/services/earning-service/handlers/liquid-staking/acala.js +0 -231
  222. package/services/earning-service/handlers/liquid-staking/base.d.ts +0 -9
  223. package/services/earning-service/handlers/liquid-staking/base.js +0 -35
  224. package/services/earning-service/handlers/liquid-staking/bifrost.d.ts +0 -46
  225. package/services/earning-service/handlers/liquid-staking/bifrost.js +0 -286
  226. package/services/earning-service/handlers/liquid-staking/index.d.ts +0 -4
  227. package/services/earning-service/handlers/liquid-staking/index.js +0 -7
  228. package/services/earning-service/handlers/liquid-staking/parallel.d.ts +0 -26
  229. package/services/earning-service/handlers/liquid-staking/parallel.js +0 -218
  230. package/services/earning-service/handlers/liquid-staking/stella-swap.d.ts +0 -34
  231. package/services/earning-service/handlers/liquid-staking/stella-swap.js +0 -385
  232. package/services/earning-service/handlers/native-staking/amplitude.d.ts +0 -22
  233. package/services/earning-service/handlers/native-staking/amplitude.js +0 -375
  234. package/services/earning-service/handlers/native-staking/astar.d.ts +0 -19
  235. package/services/earning-service/handlers/native-staking/astar.js +0 -451
  236. package/services/earning-service/handlers/native-staking/base-para.d.ts +0 -11
  237. package/services/earning-service/handlers/native-staking/base-para.js +0 -138
  238. package/services/earning-service/handlers/native-staking/base.d.ts +0 -21
  239. package/services/earning-service/handlers/native-staking/base.js +0 -150
  240. package/services/earning-service/handlers/native-staking/index.d.ts +0 -4
  241. package/services/earning-service/handlers/native-staking/index.js +0 -7
  242. package/services/earning-service/handlers/native-staking/para-chain.d.ts +0 -15
  243. package/services/earning-service/handlers/native-staking/para-chain.js +0 -377
  244. package/services/earning-service/handlers/native-staking/relay-chain.d.ts +0 -21
  245. package/services/earning-service/handlers/native-staking/relay-chain.js +0 -549
  246. package/services/earning-service/handlers/nomination-pool/index.d.ts +0 -36
  247. package/services/earning-service/handlers/nomination-pool/index.js +0 -550
  248. package/services/earning-service/handlers/special.d.ts +0 -65
  249. package/services/earning-service/handlers/special.js +0 -495
  250. package/services/earning-service/service.d.ts +0 -45
  251. package/services/earning-service/service.js +0 -379
  252. package/services/earning-service/utils/index.d.ts +0 -18
  253. package/services/earning-service/utils/index.js +0 -112
  254. package/services/migration-service/scripts/DeleteEarningData.d.ts +0 -4
  255. package/services/migration-service/scripts/DeleteEarningData.js +0 -13
  256. package/services/migration-service/scripts/EnableEarningChains.d.ts +0 -4
  257. package/services/migration-service/scripts/EnableEarningChains.js +0 -13
  258. package/services/migration-service/scripts/databases/MigrateEarningHistory.d.ts +0 -4
  259. package/services/migration-service/scripts/databases/MigrateEarningHistory.js +0 -13
  260. package/services/migration-service/scripts/databases/MigrateEarningVersion.d.ts +0 -4
  261. package/services/migration-service/scripts/databases/MigrateEarningVersion.js +0 -13
  262. package/services/mint-campaign-service/campaigns/UnlockDotCampaign.d.ts +0 -13
  263. package/services/mint-campaign-service/campaigns/UnlockDotCampaign.js +0 -139
  264. package/services/mint-campaign-service/campaigns/index.d.ts +0 -1
  265. package/services/mint-campaign-service/campaigns/index.js +0 -4
  266. package/services/mint-campaign-service/constants.d.ts +0 -1
  267. package/services/mint-campaign-service/constants.js +0 -4
  268. package/services/mint-campaign-service/index.d.ts +0 -7
  269. package/services/mint-campaign-service/index.js +0 -11
  270. package/services/storage-service/db-stores/YieldPoolStore.d.ts +0 -10
  271. package/services/storage-service/db-stores/YieldPoolStore.js +0 -28
  272. package/services/storage-service/db-stores/YieldPositionStore.d.ts +0 -9
  273. package/services/storage-service/db-stores/YieldPositionStore.js +0 -57
  274. package/types/campaigns/index.d.ts +0 -1
  275. package/types/campaigns/index.js +0 -4
  276. package/types/campaigns/unlock-dot.d.ts +0 -71
  277. package/types/campaigns/unlock-dot.js +0 -1
  278. package/types/ordinal.d.ts +0 -69
  279. package/types/ordinal.js +0 -1
  280. package/types/transaction.d.ts +0 -3
  281. package/types/transaction.js +0 -1
  282. package/types/yield/actions/index.d.ts +0 -2
  283. package/types/yield/actions/index.js +0 -5
  284. package/types/yield/actions/join/index.d.ts +0 -3
  285. package/types/yield/actions/join/index.js +0 -6
  286. package/types/yield/actions/join/step.d.ts +0 -95
  287. package/types/yield/actions/join/step.js +0 -46
  288. package/types/yield/actions/join/submit.d.ts +0 -57
  289. package/types/yield/actions/join/submit.js +0 -1
  290. package/types/yield/actions/join/validate.d.ts +0 -18
  291. package/types/yield/actions/join/validate.js +0 -10
  292. package/types/yield/actions/others.d.ts +0 -85
  293. package/types/yield/actions/others.js +0 -1
  294. package/types/yield/index.d.ts +0 -2
  295. package/types/yield/index.js +0 -5
  296. package/types/yield/info/account/index.d.ts +0 -4
  297. package/types/yield/info/account/index.js +0 -7
  298. package/types/yield/info/account/info.d.ts +0 -92
  299. package/types/yield/info/account/info.js +0 -1
  300. package/types/yield/info/account/reward.d.ts +0 -45
  301. package/types/yield/info/account/reward.js +0 -1
  302. package/types/yield/info/account/target.d.ts +0 -43
  303. package/types/yield/info/account/target.js +0 -27
  304. package/types/yield/info/account/unstake.d.ts +0 -31
  305. package/types/yield/info/account/unstake.js +0 -22
  306. package/types/yield/info/base.d.ts +0 -45
  307. package/types/yield/info/base.js +0 -36
  308. package/types/yield/info/chain/index.d.ts +0 -2
  309. package/types/yield/info/chain/index.js +0 -5
  310. package/types/yield/info/chain/info.d.ts +0 -251
  311. package/types/yield/info/chain/info.js +0 -1
  312. package/types/yield/info/chain/target.d.ts +0 -37
  313. package/types/yield/info/chain/target.js +0 -1
  314. package/types/yield/info/index.d.ts +0 -4
  315. package/types/yield/info/index.js +0 -7
  316. package/types/yield/info/pallet.d.ts +0 -143
  317. package/types/yield/info/pallet.js +0 -9
  318. package/utils/object.d.ts +0 -1
  319. package/utils/object.js +0 -6
@@ -1,18 +0,0 @@
1
- import { OptimalYieldPath, YieldStepDetail } from './step';
2
- import { SubmitYieldJoinData } from './submit';
3
- export declare enum YieldValidationStatus {
4
- NOT_ENOUGH_FEE = "NOT_ENOUGH_FEE",
5
- NOT_ENOUGH_BALANCE = "NOT_ENOUGH_BALANCE",
6
- NOT_ENOUGH_MIN_JOIN_POOL = "NOT_ENOUGH_MIN_JOIN_POOL",
7
- OK = "OK"
8
- }
9
- export interface YieldProcessValidation {
10
- ok: boolean;
11
- status: YieldValidationStatus;
12
- failedStep?: YieldStepDetail;
13
- message?: string;
14
- }
15
- export interface ValidateYieldProcessParams {
16
- path: OptimalYieldPath;
17
- data: SubmitYieldJoinData;
18
- }
@@ -1,10 +0,0 @@
1
- // Copyright 2019-2022 @subwallet/extension-base
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- export let YieldValidationStatus;
5
- (function (YieldValidationStatus) {
6
- YieldValidationStatus["NOT_ENOUGH_FEE"] = "NOT_ENOUGH_FEE";
7
- YieldValidationStatus["NOT_ENOUGH_BALANCE"] = "NOT_ENOUGH_BALANCE";
8
- YieldValidationStatus["NOT_ENOUGH_MIN_JOIN_POOL"] = "NOT_ENOUGH_MIN_JOIN_POOL";
9
- YieldValidationStatus["OK"] = "OK";
10
- })(YieldValidationStatus || (YieldValidationStatus = {}));
@@ -1,85 +0,0 @@
1
- import { BaseRequestSign, InternalRequestSign } from '@subwallet/extension-base/background/KoniTypes';
2
- import { BasePoolInfo, UnstakingInfo, YieldPoolInfo } from '../info';
3
- /**
4
- * @interface YieldLeaveParams
5
- * @description Request params to leave pool
6
- * @prop {string} address - Request account
7
- * @prop {string} amount - Amount token want to leave
8
- * @prop {string} slug - Pool's slug
9
- * @prop {string} [selectedTarget] - Pool target want to leave (nomination pool and native staking need)
10
- * @prop {boolean} fastLeave - Fast leave pool (swap token)
11
- * @prop {YieldPoolInfo} poolInfo - Pool's info - use for create history
12
- * */
13
- export interface YieldLeaveParams extends BaseRequestSign {
14
- /** Request account */
15
- address: string;
16
- /** Amount token want to leave */
17
- amount: string;
18
- /** Pool's slug */
19
- slug: string;
20
- /** Pool target want to leave (nomination pool and native staking need) */
21
- selectedTarget?: string;
22
- /** Fast leave pool (swap token) */
23
- fastLeave: boolean;
24
- /** Pool's info - use for create history */
25
- poolInfo: YieldPoolInfo;
26
- }
27
- export declare type RequestYieldLeave = InternalRequestSign<YieldLeaveParams>;
28
- /**
29
- * @interface RequestYieldWithdrawal
30
- * @description Request params to withdraw
31
- * @prop {string} address - Request account
32
- * @prop {string} slug - Pool's slug
33
- * @prop {UnstakingInfo} unstakingInfo - Info of unstaking request wants to withdraw
34
- * */
35
- export interface YieldWithdrawalParams extends BaseRequestSign {
36
- /** Request account */
37
- address: string;
38
- /** Pool's slug */
39
- slug: string;
40
- /**
41
- * <p>
42
- * Info of unstaking request wants to withdraw
43
- * </p>
44
- * <p>
45
- * Need to create amount on history
46
- * </p>
47
- * */
48
- unstakingInfo: UnstakingInfo;
49
- }
50
- /**
51
- * @interface LeavePoolAdditionalData
52
- * @extends BasePoolInfo
53
- * @description Additional data for history for unstake from liquid staking pool
54
- * @prop {number} minAmountPercent - The rate will be min received from estimated
55
- * @prop {number} exchangeRate - Rate convert amount to estimate received token
56
- * @prop {string} symbol - Receiver token's symbol
57
- * @prop {number} decimals - Receiver token's decimals
58
- * @prop {boolean} isFast - Is fast unstake
59
- * */
60
- export interface LeavePoolAdditionalData extends BasePoolInfo {
61
- /** The rate will be min received from estimated */
62
- minAmountPercent: number;
63
- /** Rate convert amount to estimate received token */
64
- exchangeRate: number;
65
- /** Receiver token's symbol */
66
- symbol: string;
67
- /** Receiver token's decimals */
68
- decimals: number;
69
- /** Is fast unstake */
70
- isFast: boolean;
71
- }
72
- export declare type RequestYieldWithdrawal = InternalRequestSign<YieldWithdrawalParams>;
73
- export interface StakeCancelWithdrawalParams extends BaseRequestSign {
74
- address: string;
75
- slug: string;
76
- selectedUnstaking: UnstakingInfo;
77
- }
78
- export declare type RequestStakeCancelWithdrawal = InternalRequestSign<StakeCancelWithdrawalParams>;
79
- export interface StakeClaimRewardParams extends BaseRequestSign {
80
- address: string;
81
- slug: string;
82
- unclaimedReward?: string;
83
- bondReward?: boolean;
84
- }
85
- export declare type RequestStakeClaimReward = InternalRequestSign<StakeClaimRewardParams>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- export * from './info';
2
- export * from './actions';
@@ -1,5 +0,0 @@
1
- // Copyright 2019-2022 @subwallet/extension-base
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- export * from "./info/index.js";
5
- export * from "./actions/index.js";
@@ -1,4 +0,0 @@
1
- export * from './info';
2
- export * from './reward';
3
- export * from './target';
4
- export * from './unstake';
@@ -1,7 +0,0 @@
1
- // Copyright 2019-2022 @subwallet/extension-base
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- export * from "./info.js";
5
- export * from "./reward.js";
6
- export * from "./target.js";
7
- export * from "./unstake.js";
@@ -1,92 +0,0 @@
1
- import { BasePoolInfo, YieldPoolType } from '../base';
2
- import { EarningStatus, NominationInfo } from './target';
3
- import { UnstakingInfo } from './unstake';
4
- export interface YieldAssetBalance {
5
- slug: string;
6
- activeBalance: string;
7
- exchangeRate?: number;
8
- }
9
- /**
10
- * @interface BaseYieldPositionInfo
11
- * @extends BasePoolInfo
12
- * @prop {string} address - Account address
13
- * */
14
- export interface BaseYieldPositionInfo extends BasePoolInfo {
15
- /** Account address */
16
- address: string;
17
- }
18
- /**
19
- * @interface AbstractYieldPositionInfo
20
- * @prop {string} totalStake - Total stake of the account
21
- * @prop {string} activeStake - Active stake of the account
22
- * @prop {string} unstakeBalance - Unstaking balance of the account
23
- * @prop {YieldAssetBalance[]} balance - List balance related with stake
24
- * @prop {boolean} isBondedBefore - Is the account bonded in pool before?
25
- * @prop {NominationInfo[]} nominations - List nominations account joined - use for nomination pool and native staking
26
- * @prop {EarningStatus} status - Earning status of the account
27
- * @prop {UnstakingInfo[]} unstakings - List unstake request of the account - use for nomination pool and native staking
28
- * */
29
- export interface AbstractYieldPositionInfo extends BaseYieldPositionInfo {
30
- /** Token to show */
31
- balanceToken: string;
32
- /** Total stake of the account - input asset */
33
- totalStake: string;
34
- /** Active stake of the account - derivation/input asset */
35
- activeStake: string;
36
- /** Unstaking balance of the account - input asset */
37
- unstakeBalance: string;
38
- /** Is the account bonded in pool before? */
39
- isBondedBefore: boolean;
40
- /** List nominations account joined - use for nomination pool and native staking */
41
- nominations: NominationInfo[];
42
- /** Earning status of the account */
43
- status: EarningStatus;
44
- /** List unstake request of the account - use for nomination pool and native staking */
45
- unstakings: UnstakingInfo[];
46
- }
47
- /**
48
- * @interface SpecialYieldPositionInfo
49
- * @extends AbstractYieldPositionInfo
50
- * @prop {string} derivativeToken - Derivative token (slug)
51
- * */
52
- export interface SpecialYieldPositionInfo extends AbstractYieldPositionInfo {
53
- type: YieldPoolType.LIQUID_STAKING | YieldPoolType.LENDING;
54
- /** Derivative token (slug) */
55
- derivativeToken: string;
56
- }
57
- /**
58
- * @interface LiquidYieldPositionInfo
59
- * @extends SpecialYieldPositionInfo
60
- * @prop {YieldPoolType.LIQUID_STAKING} type - Pool's type
61
- * */
62
- export interface LiquidYieldPositionInfo extends SpecialYieldPositionInfo {
63
- type: YieldPoolType.LIQUID_STAKING;
64
- }
65
- /**
66
- * @interface LendingYieldPositionInfo
67
- * @extends SpecialYieldPositionInfo
68
- * @prop {YieldPoolType.LENDING} type - Pool's type
69
- * */
70
- export interface LendingYieldPositionInfo extends SpecialYieldPositionInfo {
71
- type: YieldPoolType.LENDING;
72
- }
73
- /**
74
- * @interface NominationYieldPositionInfo
75
- * @extends AbstractYieldPositionInfo
76
- * @prop {YieldPoolType.NOMINATION_POOL} type - Pool's type
77
- * */
78
- export interface NominationYieldPositionInfo extends AbstractYieldPositionInfo {
79
- type: YieldPoolType.NOMINATION_POOL;
80
- }
81
- /**
82
- * @interface NativeYieldPositionInfo
83
- * @extends AbstractYieldPositionInfo
84
- * @prop {YieldPoolType.NATIVE_STAKING} type - Pool's type
85
- * */
86
- export interface NativeYieldPositionInfo extends AbstractYieldPositionInfo {
87
- type: YieldPoolType.NATIVE_STAKING;
88
- }
89
- /**
90
- * Info of yield pool
91
- * */
92
- export declare type YieldPositionInfo = NativeYieldPositionInfo | NominationYieldPositionInfo | LiquidYieldPositionInfo | LendingYieldPositionInfo;
@@ -1 +0,0 @@
1
- export {};
@@ -1,45 +0,0 @@
1
- import { APIItemState } from '@subwallet/extension-base/background/KoniTypes';
2
- import { BasePoolInfo } from '../base';
3
- /**
4
- * @interface EarningRewardItem
5
- * @extends BasePoolInfo
6
- * @prop {string} address - Account address
7
- * @prop {APIItemState} state - State of item
8
- * @prop {string} [latestReward] - Latest rewarded claimed
9
- * @prop {string} [totalReward] - Total rewarded claimed
10
- * @prop {string} [totalSlash] - Total token slashed
11
- * @prop {string} [unclaimedReward] - Un-claim reward
12
- * */
13
- export interface EarningRewardItem extends BasePoolInfo {
14
- /** Account address */
15
- address: string;
16
- /** State of item */
17
- state: APIItemState;
18
- /** Latest rewarded claimed */
19
- latestReward?: string;
20
- /** Total rewarded claimed */
21
- totalReward?: string;
22
- /** Total token slashed */
23
- totalSlash?: string;
24
- /** Un-claim reward */
25
- unclaimedReward?: string;
26
- }
27
- export interface EarningRewardJson {
28
- ready: boolean;
29
- data: Record<string, EarningRewardItem>;
30
- }
31
- /**
32
- * @interface EarningRewardHistoryItem
33
- * @extends BasePoolInfo
34
- * @prop {string} address - Account address
35
- * @prop {number} blockTimestamp - Reward history's block timestamp
36
- * @prop {string} amount - Reward history's amount
37
- * */
38
- export interface EarningRewardHistoryItem extends BasePoolInfo {
39
- /** Account address */
40
- address: string;
41
- /** Reward history's block timestamp */
42
- blockTimestamp: number;
43
- /** Reward history's amount */
44
- amount: string;
45
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,43 +0,0 @@
1
- /**
2
- * @enum {string}
3
- * @description The earning status of an account in a pool.
4
- * */
5
- export declare enum EarningStatus {
6
- /** Earning reward */
7
- EARNING_REWARD = "EARNING_REWARD",
8
- /** Partially earning */
9
- PARTIALLY_EARNING = "PARTIALLY_EARNING",
10
- /** Not earning */
11
- NOT_EARNING = "NOT_EARNING",
12
- /** Waiting (Pool selected not in the reward list) */
13
- WAITING = "WAITING",
14
- /** Account not staking */
15
- NOT_STAKING = "NOT_STAKING"
16
- }
17
- /**
18
- * @interface NominationInfo
19
- * @description Info of the validator account joined
20
- * @prop {string} chain - Slug of chain
21
- * @prop {string} validatorAddress - Validator's address or nomination pool's id
22
- * @prop {string} [validatorIdentity] - Validator's identity
23
- * @prop {string} activeStake - Active staked value
24
- * @prop {boolean} [hasUnstaking] - Does the account have unstake request with validator?
25
- * @prop {string} [validatorMinStake] - Min amount to join with validator
26
- * @prop {EarningStatus} status - The staking status of the account
27
- * */
28
- export interface NominationInfo {
29
- /** Slug of chain */
30
- chain: string;
31
- /** Validator's address or nomination pool's id */
32
- validatorAddress: string;
33
- /** Validator's identity */
34
- validatorIdentity?: string;
35
- /** Active staked value */
36
- activeStake: string;
37
- /** Does the account have unstake request with validator? */
38
- hasUnstaking?: boolean;
39
- /** Min amount to join with validator */
40
- validatorMinStake?: string;
41
- /** The staking status of the account */
42
- status: EarningStatus;
43
- }
@@ -1,27 +0,0 @@
1
- // Copyright 2019-2022 @subwallet/extension-base
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- /**
5
- * @enum {string}
6
- * @description The earning status of an account in a pool.
7
- * */
8
- export let EarningStatus;
9
-
10
- /**
11
- * @interface NominationInfo
12
- * @description Info of the validator account joined
13
- * @prop {string} chain - Slug of chain
14
- * @prop {string} validatorAddress - Validator's address or nomination pool's id
15
- * @prop {string} [validatorIdentity] - Validator's identity
16
- * @prop {string} activeStake - Active staked value
17
- * @prop {boolean} [hasUnstaking] - Does the account have unstake request with validator?
18
- * @prop {string} [validatorMinStake] - Min amount to join with validator
19
- * @prop {EarningStatus} status - The staking status of the account
20
- * */
21
- (function (EarningStatus) {
22
- EarningStatus["EARNING_REWARD"] = "EARNING_REWARD";
23
- EarningStatus["PARTIALLY_EARNING"] = "PARTIALLY_EARNING";
24
- EarningStatus["NOT_EARNING"] = "NOT_EARNING";
25
- EarningStatus["WAITING"] = "WAITING";
26
- EarningStatus["NOT_STAKING"] = "NOT_STAKING";
27
- })(EarningStatus || (EarningStatus = {}));
@@ -1,31 +0,0 @@
1
- /**
2
- * @enum {string}
3
- * @description The status of un-staked request.
4
- * */
5
- export declare enum UnstakingStatus {
6
- /** Can withdraw unstaked value */
7
- CLAIMABLE = "CLAIMABLE",
8
- /** Waiting to unlock unstake value */
9
- UNLOCKING = "UNLOCKING"
10
- }
11
- /**
12
- * @interface UnstakingInfo
13
- * @description Info of un-stake request
14
- * @prop {string} chain - Slug of chain
15
- * @prop {UnstakingStatus} status - Status of request
16
- * @prop {string} claimable - Amount to be withdrawn
17
- * @prop {number} [waitingTime] - Time remains to wait (in hours)
18
- * @prop {string} [validatorAddress] - Address of validator
19
- * */
20
- export interface UnstakingInfo {
21
- /** Slug of chain */
22
- chain: string;
23
- /** Status of request */
24
- status: UnstakingStatus;
25
- /** Amount to be withdrawn */
26
- claimable: string;
27
- /** Time remains to wait (in hours) */
28
- waitingTime?: number;
29
- /** Address of validator */
30
- validatorAddress?: string;
31
- }
@@ -1,22 +0,0 @@
1
- // Copyright 2019-2022 @subwallet/extension-base
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- /**
5
- * @enum {string}
6
- * @description The status of un-staked request.
7
- * */
8
- export let UnstakingStatus;
9
-
10
- /**
11
- * @interface UnstakingInfo
12
- * @description Info of un-stake request
13
- * @prop {string} chain - Slug of chain
14
- * @prop {UnstakingStatus} status - Status of request
15
- * @prop {string} claimable - Amount to be withdrawn
16
- * @prop {number} [waitingTime] - Time remains to wait (in hours)
17
- * @prop {string} [validatorAddress] - Address of validator
18
- * */
19
- (function (UnstakingStatus) {
20
- UnstakingStatus["CLAIMABLE"] = "CLAIMABLE";
21
- UnstakingStatus["UNLOCKING"] = "UNLOCKING";
22
- })(UnstakingStatus || (UnstakingStatus = {}));
@@ -1,45 +0,0 @@
1
- /**
2
- * @enum {string}
3
- * @description The types of yield pool.
4
- * */
5
- export declare enum YieldPoolType {
6
- /** Liquid staking */
7
- LIQUID_STAKING = "LIQUID_STAKING",
8
- /** Lending */
9
- LENDING = "LENDING",
10
- /** Single farming */
11
- SINGLE_FARMING = "SINGLE_FARMING",
12
- /** Pool staking */
13
- NOMINATION_POOL = "NOMINATION_POOL",
14
- /** Native staking */
15
- NATIVE_STAKING = "NATIVE_STAKING",
16
- /** Parachain staking */
17
- PARACHAIN_STAKING = "PARACHAIN_STAKING"
18
- }
19
- /**
20
- * @enum {number}
21
- * @description Time to calculate profit
22
- * */
23
- export declare enum YieldCompoundingPeriod {
24
- DAILY = 1,
25
- WEEKLY = 7,
26
- MONTHLY = 30,
27
- YEARLY = 365
28
- }
29
- /**
30
- * @interface BasePoolInfo
31
- * @prop {string} slug - Pool's slug
32
- * @prop {string} chain - Pool's chain
33
- * @prop {string} type - Pool's type
34
- * @prop {string} group - Pool's group (by token)
35
- * */
36
- export interface BasePoolInfo {
37
- /** Pool's slug */
38
- slug: string;
39
- /** Pool's chain */
40
- chain: string;
41
- /** Pool's type */
42
- type: YieldPoolType;
43
- /** Pool's group (by token) */
44
- group: string;
45
- }
@@ -1,36 +0,0 @@
1
- // Copyright 2019-2022 @subwallet/extension-base
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- /**
5
- * @enum {string}
6
- * @description The types of yield pool.
7
- * */
8
- export let YieldPoolType;
9
-
10
- /**
11
- * @enum {number}
12
- * @description Time to calculate profit
13
- * */
14
- (function (YieldPoolType) {
15
- YieldPoolType["LIQUID_STAKING"] = "LIQUID_STAKING";
16
- YieldPoolType["LENDING"] = "LENDING";
17
- YieldPoolType["SINGLE_FARMING"] = "SINGLE_FARMING";
18
- YieldPoolType["NOMINATION_POOL"] = "NOMINATION_POOL";
19
- YieldPoolType["NATIVE_STAKING"] = "NATIVE_STAKING";
20
- YieldPoolType["PARACHAIN_STAKING"] = "PARACHAIN_STAKING";
21
- })(YieldPoolType || (YieldPoolType = {}));
22
- export let YieldCompoundingPeriod;
23
-
24
- /**
25
- * @interface BasePoolInfo
26
- * @prop {string} slug - Pool's slug
27
- * @prop {string} chain - Pool's chain
28
- * @prop {string} type - Pool's type
29
- * @prop {string} group - Pool's group (by token)
30
- * */
31
- (function (YieldCompoundingPeriod) {
32
- YieldCompoundingPeriod[YieldCompoundingPeriod["DAILY"] = 1] = "DAILY";
33
- YieldCompoundingPeriod[YieldCompoundingPeriod["WEEKLY"] = 7] = "WEEKLY";
34
- YieldCompoundingPeriod[YieldCompoundingPeriod["MONTHLY"] = 30] = "MONTHLY";
35
- YieldCompoundingPeriod[YieldCompoundingPeriod["YEARLY"] = 365] = "YEARLY";
36
- })(YieldCompoundingPeriod || (YieldCompoundingPeriod = {}));
@@ -1,2 +0,0 @@
1
- export * from './info';
2
- export * from './target';
@@ -1,5 +0,0 @@
1
- // Copyright 2019-2022 @subwallet/extension-base
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- export * from "./info.js";
5
- export * from "./target.js";