-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create demeter store * add PoolStatusBadge component * wip pool card * show/hide badge in title * update translations & info lines * add dialog templates * stake dialog content * fix percent css * fix ts error * subscriptions examples * update store * claim dialog wip * add AccountPoolMixin * buttons texts * add claim rewards action * fix claim handler * add staking route * wip Staking page * connect wallet on card * add PageMixin * refactoring common methods * add staking actions * add DemeterDataContainer * new folder structure * remove liqudity calculations * add APR for staking * fix apr formula * add liquidty apr * update calc * refactoring params * hide removed inactive pools * fix calculations after * add float input for stake * add fiat amounts to stake dialog * refactoring balance * fix pool share after * update translation keys * fix some translations, max button visibility * update removeLiquidity * update messages * update translations * revert env.json * staking empty card * fix status-badge css * update icon & balance text * update badges * fix click on stopped pool badge * fix bugs * fixes after review
- Loading branch information
1 parent
d05aa79
commit 7f1d5ea
Showing
39 changed files
with
2,298 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,86 @@ | ||
{ | ||
"BASE_API_URL": "", | ||
"API_KEYS": { | ||
"moonpay": "pk_test_4ASGxHKGpLPE6sdQq1V3QjtpUFSpWLk", | ||
"nftStorage": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDBmMzgwOTMyQTNDODM3ZDNiN2JEYzBBNTc0NmNkMDlBRGIyNUZGMzQiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTY0MjU4OTQ2ODA4MSwibmFtZSI6Im5mdC1zdG9yYWdlLWRldiJ9.hkvzea9ltcriXXHKoYd3F2Iu1Y8X5H-zunAQboC_3vw", | ||
"etherscan": "YBR7IWEBEXFICT8M7GRV77NBX4AXJ9T53H" | ||
}, | ||
"FEATURE_FLAGS": { | ||
"moonpay": true, | ||
"charts": false | ||
}, | ||
"FAUCET_URL": "https://faucet.dev.sora2.tachi.soramitsu.co.jp/", | ||
"SUBQUERY_ENDPOINT": "https://api.subquery.network/sq/sora-xor/sora-dev", | ||
"DEFAULT_NETWORKS": [ | ||
{ | ||
"chain": "SORA-dev Testnet", | ||
"name": "SORA", | ||
"address": "wss://ws.framenode-1.s1.dev.sora2.soramitsu.co.jp" | ||
}, | ||
{ | ||
"chain": "SORA-dev Testnet", | ||
"name": "SORA", | ||
"address": "wss://ws.framenode-2.s2.dev.sora2.soramitsu.co.jp" | ||
}, | ||
{ | ||
"chain": "SORA-dev Testnet", | ||
"name": "SORA", | ||
"address": "wss://ws.framenode-3.s3.dev.sora2.soramitsu.co.jp" | ||
}, | ||
{ | ||
"chain": "SORA-dev Testnet", | ||
"name": "SORA", | ||
"address": "wss://ws.framenode-4.s3.dev.sora2.soramitsu.co.jp" | ||
}, | ||
{ | ||
"chain": "SORA-dev Testnet", | ||
"name": "SORA", | ||
"address": "wss://ws.framenode-5.s4.dev.sora2.soramitsu.co.jp" | ||
}, | ||
{ | ||
"chain": "SORA-dev Testnet", | ||
"name": "SORA", | ||
"address": "wss://ws.framenode-6.s4.dev.sora2.soramitsu.co.jp" | ||
} | ||
], | ||
"NETWORK_TYPE": "Dev", | ||
"CHAIN_GENESIS_HASH": "", | ||
"SUB_NETWORKS": [ | ||
{ | ||
"name": "ethereum", | ||
"id": 0, | ||
"symbol": "ETH", | ||
"currency": "ETH", | ||
"defaultType": "rinkeby", | ||
"CONTRACTS": { | ||
"XOR": { | ||
"MASTER": "0x12c6a709925783f49fcca0b398d13b0d597e6e1c" | ||
}, | ||
"VAL": { | ||
"MASTER": "0x47e229aa491763038f6a505b4f85d8eb463f0962" | ||
}, | ||
"OTHER": { | ||
"MASTER": "0x24390c8f6cbd5d152c30226f809f4e3f153b88d4" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "energy", | ||
"id": 1, | ||
"symbol": "VT", | ||
"currency": "VT", | ||
"defaultType": "private", | ||
"CONTRACTS": { | ||
"XOR": { | ||
"MASTER": "" | ||
}, | ||
"VAL": { | ||
"MASTER": "" | ||
}, | ||
"OTHER": { | ||
"MASTER": "0x1891b81AE0C5A81Ec84BC4f69322C6a01A3B3095" | ||
} | ||
} | ||
} | ||
] | ||
"BASE_API_URL": "", | ||
"API_KEYS": { | ||
"moonpay": "pk_test_4ASGxHKGpLPE6sdQq1V3QjtpUFSpWLk", | ||
"nftStorage": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDBmMzgwOTMyQTNDODM3ZDNiN2JEYzBBNTc0NmNkMDlBRGIyNUZGMzQiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTY0MjU4OTQ2ODA4MSwibmFtZSI6Im5mdC1zdG9yYWdlLWRldiJ9.hkvzea9ltcriXXHKoYd3F2Iu1Y8X5H-zunAQboC_3vw", | ||
"etherscan": "YBR7IWEBEXFICT8M7GRV77NBX4AXJ9T53H" | ||
}, | ||
"FEATURE_FLAGS": { | ||
"moonpay": true, | ||
"charts": false | ||
}, | ||
"FAUCET_URL": "https://faucet.dev.sora2.tachi.soramitsu.co.jp/", | ||
"SUBQUERY_ENDPOINT": "https://api.subquery.network/sq/sora-xor/sora-dev", | ||
"DEFAULT_NETWORKS": [ | ||
{ | ||
"chain": "SORA-dev Testnet", | ||
"name": "SORA", | ||
"address": "wss://ws.framenode-1.s1.dev.sora2.soramitsu.co.jp" | ||
}, | ||
{ | ||
"chain": "SORA-dev Testnet", | ||
"name": "SORA", | ||
"address": "wss://ws.framenode-2.s2.dev.sora2.soramitsu.co.jp" | ||
}, | ||
{ | ||
"chain": "SORA-dev Testnet", | ||
"name": "SORA", | ||
"address": "wss://ws.framenode-3.s3.dev.sora2.soramitsu.co.jp" | ||
}, | ||
{ | ||
"chain": "SORA-dev Testnet", | ||
"name": "SORA", | ||
"address": "wss://ws.framenode-4.s3.dev.sora2.soramitsu.co.jp" | ||
}, | ||
{ | ||
"chain": "SORA-dev Testnet", | ||
"name": "SORA", | ||
"address": "wss://ws.framenode-5.s4.dev.sora2.soramitsu.co.jp" | ||
}, | ||
{ | ||
"chain": "SORA-dev Testnet", | ||
"name": "SORA", | ||
"address": "wss://ws.framenode-6.s4.dev.sora2.soramitsu.co.jp" | ||
} | ||
], | ||
"NETWORK_TYPE": "Dev", | ||
"CHAIN_GENESIS_HASH": "", | ||
"SUB_NETWORKS": [ | ||
{ | ||
"name": "ethereum", | ||
"id": 0, | ||
"symbol": "ETH", | ||
"currency": "ETH", | ||
"defaultType": "rinkeby", | ||
"CONTRACTS": { | ||
"XOR": { | ||
"MASTER": "0x12c6a709925783f49fcca0b398d13b0d597e6e1c" | ||
}, | ||
"VAL": { | ||
"MASTER": "0x47e229aa491763038f6a505b4f85d8eb463f0962" | ||
}, | ||
"OTHER": { | ||
"MASTER": "0x24390c8f6cbd5d152c30226f809f4e3f153b88d4" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "energy", | ||
"id": 1, | ||
"symbol": "VT", | ||
"currency": "VT", | ||
"defaultType": "private", | ||
"CONTRACTS": { | ||
"XOR": { | ||
"MASTER": "" | ||
}, | ||
"VAL": { | ||
"MASTER": "" | ||
}, | ||
"OTHER": { | ||
"MASTER": "0x1891b81AE0C5A81Ec84BC4f69322C6a01A3B3095" | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<template> | ||
<div class="pool-info"> | ||
<slot name="prepend" /> | ||
|
||
<div class="pool-info-content"> | ||
<slot /> | ||
</div> | ||
|
||
<div class="pool-info-buttons" v-if="$slots.buttons"> | ||
<slot name="buttons" /> | ||
</div> | ||
|
||
<slot name="append" /> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Vue } from 'vue-property-decorator'; | ||
@Component | ||
export default class PoolInfo extends Vue {} | ||
</script> | ||
|
||
<style lang="scss"> | ||
.pool-info { | ||
& > *:not(:last-child) { | ||
margin-bottom: $inner-spacing-medium; | ||
} | ||
&-buttons { | ||
display: flex; | ||
justify-content: center; | ||
> * { | ||
width: 100%; | ||
&:not(:first-child), | ||
&:not(:last-child) { | ||
width: 50%; | ||
} | ||
} | ||
.el-button + .el-button { | ||
margin-left: $inner-spacing-small; | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { Component, Watch, Mixins } from 'vue-property-decorator'; | ||
import { mixins } from '@soramitsu/soraneo-wallet-web'; | ||
|
||
import { getter } from '@/store/decorators'; | ||
|
||
@Component | ||
export default class SubscriptionsMixin extends Mixins(mixins.LoadingMixin) { | ||
@getter.wallet.account.isLoggedIn isLoggedIn!: boolean; | ||
@getter.settings.nodeIsConnected nodeIsConnected!: boolean; | ||
|
||
startSubscriptionsList: AsyncVoidFn[] = []; | ||
resetSubscriptionsList: AsyncVoidFn[] = []; | ||
|
||
@Watch('isLoggedIn') | ||
@Watch('nodeIsConnected') | ||
private async restartSubscriptions(value: boolean) { | ||
if (value) { | ||
await this.updateSubscriptions(); | ||
} else { | ||
await this.resetSubscriptions(); | ||
} | ||
} | ||
|
||
get subscriptionsDataLoading(): boolean { | ||
return this.parentLoading || this.loading; | ||
} | ||
|
||
async mounted(): Promise<void> { | ||
await this.updateSubscriptions(); | ||
} | ||
|
||
async beforeDestroy(): Promise<void> { | ||
await this.resetSubscriptions(); | ||
} | ||
|
||
public setStartSubscriptions(list: AsyncVoidFn[]) { | ||
this.startSubscriptionsList = list; | ||
} | ||
|
||
public setResetSubscriptions(list: AsyncVoidFn[]) { | ||
this.resetSubscriptionsList = list; | ||
} | ||
|
||
/** | ||
* Update subscriptions | ||
* If this page is loaded first time by url, "watch" & "mounted" call this method | ||
*/ | ||
private async updateSubscriptions(): Promise<void> { | ||
// return if updateSubscription is already called by "watch" or "mounted" | ||
if (this.loading) return; | ||
|
||
await this.withLoading(async () => { | ||
// wait for node connection & wallet init (App.vue) | ||
await this.withParentLoading(async () => { | ||
await Promise.all(this.startSubscriptionsList.map((fn) => fn?.())); | ||
}); | ||
}); | ||
} | ||
|
||
private async resetSubscriptions(): Promise<void> { | ||
await Promise.all(this.resetSubscriptionsList.map((fn) => fn?.())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.