Skip to content

Commit

Permalink
Liiquidity proxy 1.6 (#923)
Browse files Browse the repository at this point in the history
* update wallet with liqudity proxy

* update swap view
  • Loading branch information
Nikita-Polyakov authored Jan 20, 2023
1 parent fd52bb4 commit 6bfc131
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 48 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"dependencies": {
"@metamask/detect-provider": "^2.0.0",
"@soramitsu/soraneo-wallet-web": "1.13.1",
"@soramitsu/soraneo-wallet-web": "1.13.3",
"@walletconnect/web3-provider": "^1.8.0",
"base-64": "^1.0.0",
"core-js": "^3.26.0",
Expand Down
5 changes: 4 additions & 1 deletion src/store/swap/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ const actions = defineActions({

async switchTokens(context): Promise<void> {
const { commit, state } = swapActionContext(context);
const { tokenFromAddress: from, tokenToAddress: to } = state;
const { tokenFromAddress: from, tokenToAddress: to, fromValue, toValue, isExchangeB } = state;
if (from && to) {
commit.setTokenFromAddress(to);
commit.setTokenToAddress(from);
commit.setFromValue(toValue);
commit.setToValue(fromValue);
commit.setExchangeB(!isExchangeB);
updateTokenSubscription(context, Direction.From);
updateTokenSubscription(context, Direction.To);
}
Expand Down
12 changes: 2 additions & 10 deletions src/views/Swap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ export default class Swap extends Mixins(
this.setAmountWithoutImpact(amountWithoutImpact as string);
this.setLiquidityProviderFee(fee);
this.setRewards(rewards);
this.setPath(path);
this.setPath(path as string[]);
this.selectDexId(bestDexId);
} catch (error: any) {
console.error(error);
Expand Down Expand Up @@ -538,18 +538,10 @@ export default class Swap extends Mixins(
}
async handleSwitchTokens(): Promise<void> {
if (!(this.tokenFrom && this.tokenTo)) return;
if (!this.areTokensSelected) return;
await this.switchTokens();
if (this.isExchangeB) {
this.setExchangeB(false);
this.handleInputFieldFrom(this.toValue);
} else {
this.setExchangeB(true);
this.handleInputFieldTo(this.fromValue);
}
this.subscribeOnSwapReserves();
}
Expand Down
72 changes: 36 additions & 36 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2521,60 +2521,60 @@
resolved "https://registry.yarnpkg.com/@soda/get-current-script/-/get-current-script-1.0.2.tgz#a53515db25d8038374381b73af20bb4f2e508d87"
integrity sha512-T7VNNlYVM1SgQ+VsMYhnDkcGmWhQdL0bDyGm5TlQ3GBXnJscEClUUOKduWTmm2zCnvNLC1hc3JpuXjs/nFOc5w==

"@sora-substrate/api@1.13.4":
version "1.13.4"
resolved "https://registry.yarnpkg.com/@sora-substrate/api/-/api-1.13.4.tgz#91006cc68c7657e08621e2846be921cb8a88aaaf"
integrity sha512-AGUpROkbpc5Ns4RlUTViJl63fRJMcJmFQ+BBkp/4BYcHQn2STnv78z3MET+uOb7JciGThCL7Vt+0HCdtPCSniQ==
"@sora-substrate/api@1.13.8":
version "1.13.8"
resolved "https://registry.yarnpkg.com/@sora-substrate/api/-/api-1.13.8.tgz#842dc5d8287c3119722e213a514b4bfaf422ea6f"
integrity sha512-rhWISPHvUB6HCdO5MKyxf+xTqA892G//DIVn3i8+T+ucTUHnfw7kise1pv6hhJbDJbg/8TO7fTRy1NtO/KvuAA==
dependencies:
"@open-web3/orml-api-derive" "0.9.4-26"
"@polkadot/api" "9.6.2"
"@sora-substrate/types" "1.13.4"
"@sora-substrate/types" "1.13.8"

"@sora-substrate/liquidity-proxy@1.13.4":
version "1.13.4"
resolved "https://registry.yarnpkg.com/@sora-substrate/liquidity-proxy/-/liquidity-proxy-1.13.4.tgz#f210627a33b2e5468dc93e1b9d1e25d78b7eee22"
integrity sha512-XVEZxiwv2BVdKFI9SRvzQEmANsaP3mjhkUcZp4Is/ItqzocDtDzSjSzBssbvVyK0/yyNXLQwRAxG3o1X30Spdw==
"@sora-substrate/liquidity-proxy@1.13.8":
version "1.13.8"
resolved "https://registry.yarnpkg.com/@sora-substrate/liquidity-proxy/-/liquidity-proxy-1.13.8.tgz#a0110c4bcf8b7548a1382fa1ec12cce38ba569e6"
integrity sha512-zPQukF73O+SPORRmopm87+DHAGBNQxACen9KqtmV9bFBYosOnjpUTNmKlCxpD+6qMt10djNrw4/Qb/iq81unNg==
dependencies:
"@sora-substrate/math" "1.13.4"
"@sora-substrate/math" "1.13.8"

"@sora-substrate/math@1.13.4":
version "1.13.4"
resolved "https://registry.yarnpkg.com/@sora-substrate/math/-/math-1.13.4.tgz#8b2ed2f76a62dfe46d8e1e09fa87f154a770d0cd"
integrity sha512-Uf8eNUe4QDPDojtS0xEz3mVWVhFeNVTJsaZlenwL/iEyknUKZB1eid1JRaZaeRLl0h6RsEmllN7JC3g8zMRm6A==
"@sora-substrate/math@1.13.8":
version "1.13.8"
resolved "https://registry.yarnpkg.com/@sora-substrate/math/-/math-1.13.8.tgz#5bf8a9078212ef44f486fa2716ee84a87af9522e"
integrity sha512-ZZ5nsYqqmEZSCySXYSGhoRbExZ8z+eZlBiXL7gUiW9BRIuPJ5stRq5uPuWFlaFxnUQXSE2qOM6Tyv8RXNOPWfA==
dependencies:
"@polkadot/types" "9.6.2"
bignumber.js "^9.0.1"
lodash "^4.17.15"

"@sora-substrate/type-definitions@1.13.4":
version "1.13.4"
resolved "https://registry.yarnpkg.com/@sora-substrate/type-definitions/-/type-definitions-1.13.4.tgz#60d544f6588786144305a7dfd3397e618296c9ac"
integrity sha512-9TOdFEaJxAjGcsRhD/30Efpt3rdc9kOrnlhJGQNru9QwUOWvuZ0RVi2XXZgVU7l0XVQQW3Jd4Qix9MNO1Gb4kQ==
"@sora-substrate/type-definitions@1.13.8":
version "1.13.8"
resolved "https://registry.yarnpkg.com/@sora-substrate/type-definitions/-/type-definitions-1.13.8.tgz#3470a1cfa6538d30eec12a7c671bac2ac1544653"
integrity sha512-z58/gR90b79w6vCiDCcMykx3n/G5OlFFI/a7ZhnYLv8fnFHjRE1mRE0XbCbYwWLf1n8muM+sgroi5Hqdr0cZXg==
dependencies:
"@open-web3/orml-type-definitions" "0.9.4-26"

"@sora-substrate/types@1.13.4":
version "1.13.4"
resolved "https://registry.yarnpkg.com/@sora-substrate/types/-/types-1.13.4.tgz#ce7347b7078275f4cb88262f66c88ddc30859892"
integrity sha512-V1uGIlfIaM25lU/hcqGz0R0LJROQgLWmw6tulQIX5/bijH8lzr0GBtj42l4mNTBwRcjRluPy8opuxBo4eX0QyQ==
"@sora-substrate/types@1.13.8":
version "1.13.8"
resolved "https://registry.yarnpkg.com/@sora-substrate/types/-/types-1.13.8.tgz#851936742bcf36f9b357f91090071d2166cff101"
integrity sha512-Hx06P2bTuP/KPJGz8fBgNVO6JDSeHvNFPgwXgACSa28T69HNgUaFr/5WMleCeM13iEZrMVlnofBMHX5cDi703Q==
dependencies:
"@open-web3/api-mobx" "0.9.4-26"
"@open-web3/orml-types" "0.9.4-26"
"@polkadot/api" "9.6.2"
"@polkadot/typegen" "9.6.2"
"@polkadot/types" "9.6.2"
"@sora-substrate/type-definitions" "1.13.4"
"@sora-substrate/type-definitions" "1.13.8"

"@sora-substrate/util@1.13.4":
version "1.13.4"
resolved "https://registry.yarnpkg.com/@sora-substrate/util/-/util-1.13.4.tgz#d24c52d3046dd45a03ca1263b9852a863b909827"
integrity sha512-xM0KRUY5AyVfx7JOymUSE4zNWqwLW71QKJ1rXlpzk0haBbzj8vFLyvxHYvFjklSxpC3sM8cCHQkBva4epg1vRQ==
"@sora-substrate/util@1.13.8":
version "1.13.8"
resolved "https://registry.yarnpkg.com/@sora-substrate/util/-/util-1.13.8.tgz#635b9361b6d1178b3b24624011e0a13d1b442e7d"
integrity sha512-Knd2pRyfFwAokRQF0mNifPi9q1IUDRAUeH4LjX4Q/712VvlG7I8K2S4qBXbn1PNt/g7O0mJjY1No9QT8TRTzVA==
dependencies:
"@polkadot/ui-keyring" "2.9.14"
"@sora-substrate/api" "1.13.4"
"@sora-substrate/liquidity-proxy" "1.13.4"
"@sora-substrate/math" "1.13.4"
"@sora-substrate/types" "1.13.4"
"@sora-substrate/api" "1.13.8"
"@sora-substrate/liquidity-proxy" "1.13.8"
"@sora-substrate/math" "1.13.8"
"@sora-substrate/types" "1.13.8"
axios "^0.21.1"
bignumber.js "^9.0.1"
crypto-js "^4.0.0"
Expand All @@ -2597,13 +2597,13 @@
vue-property-decorator "^9.1.2"
vuex "^3.6.2"

"@soramitsu/soraneo-wallet-web@1.13.1":
version "1.13.1"
resolved "https://nexus.iroha.tech/repository/npm-group/@soramitsu/soraneo-wallet-web/-/soraneo-wallet-web-1.13.1.tgz#326986d846c7e3fcb7671b652e0f82dcb6e05935"
integrity sha512-Y6TF/drUA3C1C9T85gDIKI1+xj194HVlUt2Ivce01IYA6thZGwkRCyzew4wAW3DTLCjRWIMgeUms7RVZ1tpd/g==
"@soramitsu/soraneo-wallet-web@1.13.3":
version "1.13.3"
resolved "https://nexus.iroha.tech/repository/npm-group/@soramitsu/soraneo-wallet-web/-/soraneo-wallet-web-1.13.3.tgz#cefdbe65a11575a0708c511f1bb482fcd036c471"
integrity sha512-e4gMcovB+d8KdfpdDjRN8r0kEP1iZ2+UB4GOPeihon5i9LyEgg6a2fzbCTKfSt7xyR6dIa0D+PQaDI0slWDTUA==
dependencies:
"@polkadot/vue-identicon" "2.9.14"
"@sora-substrate/util" "1.13.4"
"@sora-substrate/util" "1.13.8"
"@soramitsu/soramitsu-js-ui" "^1.0.42"
"@subwallet/wallet-connect" "^0.2.3"
"@urql/core" "^3.0.5"
Expand Down

0 comments on commit 6bfc131

Please sign in to comment.