Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix chart volume update for XOR #1348

Merged
merged 5 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"dependencies": {
"@metamask/detect-provider": "^2.0.0",
"@soramitsu/soraneo-wallet-web": "1.32.0",
"@soramitsu/soraneo-wallet-web": "1.32.3",
"@walletconnect/ethereum-provider": "^2.11.2",
"@walletconnect/modal": "^2.6.2",
"core-js": "^3.36.0",
Expand Down
13 changes: 5 additions & 8 deletions src/components/pages/Swap/Chart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -839,14 +839,11 @@ export default class SwapChart extends Mixins(
console.error
);
} else {
return this.$watch(
() => this.fiatPriceObject,
(updated, prev) => {
if (updated && (!prev || entities.some((addr) => updated[addr] !== prev[addr]))) {
this.fetchAndHandleUpdate(entities);
}
}
);
const interval = setInterval(() => {
this.fetchAndHandleUpdate(entities);
}, SYNC_INTERVAL * 5);

return () => clearInterval(interval);
}
}

Expand Down
12 changes: 9 additions & 3 deletions src/utils/bridge/eth/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ export const updateTransaction = async (id: string, params = {}) => {
};

export const waitForApprovedRequest = async (tx: EthHistory): Promise<EthApprovedRequest> => {
if (!tx.hash) throw new Error(`[Bridge]: Tx hash cannot be empty`);
const hash = tx.hash;

if (!hash) throw new Error(`[Bridge]: Tx hash cannot be empty`);
if (!Number.isFinite(tx.externalNetwork))
throw new Error(`[Bridge]: Tx externalNetwork should be a number, ${tx.externalNetwork} received`);

let subscription!: Subscription;

await new Promise<void>((resolve, reject) => {
subscription = ethBridgeApi.subscribeOnRequestStatus(tx.hash as string).subscribe((status) => {
subscription = ethBridgeApi.subscribeOnRequestStatus(hash).subscribe((status) => {
switch (status) {
case BridgeTxStatus.Failed:
case BridgeTxStatus.Frozen:
Expand All @@ -80,7 +82,11 @@ export const waitForApprovedRequest = async (tx: EthHistory): Promise<EthApprove

subscription.unsubscribe();

return ethBridgeApi.getApprovedRequest(tx.hash as string);
const request = await ethBridgeApi.getApprovedRequest(hash);

if (!request) throw new Error(`[Bridge]: getApprovedRequest is empty, hash="${hash}"`);

return request;
};

export const waitForIncomingRequest = async (tx: EthHistory): Promise<{ hash: string; blockId: string }> => {
Expand Down
134 changes: 68 additions & 66 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2349,71 +2349,71 @@
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.31.0":
version "1.31.0"
resolved "https://registry.yarnpkg.com/@sora-substrate/api/-/api-1.31.0.tgz#cb023783e61b522a1409d0c05f4870e109e49040"
integrity sha512-ztn9nhl5TB0uoPZ34sNMainPB55bJs8ZWoKd+liZfWyfMfxRws9DZF0AYehXVczH/I0bUam6Xf0lJOn0AfOi/Q==
"@sora-substrate/api@1.32.5":
version "1.32.5"
resolved "https://registry.yarnpkg.com/@sora-substrate/api/-/api-1.32.5.tgz#81074faa013d045937bc6a8edbfcd363c023b994"
integrity sha512-XayduSUyPMk8/IKToGTV/W3u7URlkSVWLr3gCPatnG4Fw7zZN1n+26tPRsc46NUilMV51mpSjh0dnUXbEwhNKw==
dependencies:
"@open-web3/orml-api-derive" "1.1.4"
"@polkadot/api" "9.14.2"
"@sora-substrate/types" "1.31.0"
"@sora-substrate/types" "1.32.5"

"@sora-substrate/connection@1.31.0":
version "1.31.0"
resolved "https://registry.yarnpkg.com/@sora-substrate/connection/-/connection-1.31.0.tgz#55a32348a87d8a4cfe935a99d06616e5b5bf9c2b"
integrity sha512-vDBkRrn/+0xFQ3ZYczNEXyZ1MIwg8t4jOfCxes+xs+HLvLF46vSm1OEJ78XIngFOVh19H9ofi4kSlWjeaRmx5w==
"@sora-substrate/connection@1.32.5":
version "1.32.5"
resolved "https://registry.yarnpkg.com/@sora-substrate/connection/-/connection-1.32.5.tgz#4b7753bfdb419cd3f94ac3533b00a2a3b7aa4665"
integrity sha512-+p19wSnIUr0srGyfuDW9s2aTOLWwZxOxlJQBFVkQmLC4R7uU3ziZQMQkIxMJ0IdBJQrPXfA6ZySi0G/6hiKlwA==
dependencies:
"@sora-substrate/api" "1.31.0"
"@sora-substrate/api" "1.32.5"

"@sora-substrate/liquidity-proxy@1.31.0":
version "1.31.0"
resolved "https://registry.yarnpkg.com/@sora-substrate/liquidity-proxy/-/liquidity-proxy-1.31.0.tgz#57c1dcb1b6d392bc6a8d24f99746cdfd83f24adf"
integrity sha512-LFg0dONnHx0ONGLm5x1hjhfQ+J50+MnHbyoebsQXFaoeWfHtmtvDF9PFD5qdqm6aQJ/QEz60BUIafiL/9oUzSw==
"@sora-substrate/liquidity-proxy@1.32.5":
version "1.32.5"
resolved "https://registry.yarnpkg.com/@sora-substrate/liquidity-proxy/-/liquidity-proxy-1.32.5.tgz#3694852306be4ef9c369e7e8abe2b523dc1f0707"
integrity sha512-CXxR1SXnzslZScnnG+fLa7TpM1JSyjaARl7Oi4iFzLPrue1tY35rvK4Diy19Wt2NovmnXYb/nSHj1Dk2xi2ckw==
dependencies:
"@sora-substrate/math" "1.31.0"
"@sora-substrate/math" "1.32.5"

"@sora-substrate/math@1.31.0":
version "1.31.0"
resolved "https://registry.yarnpkg.com/@sora-substrate/math/-/math-1.31.0.tgz#a34cc35fa251a407b78e4c22a6234cfc4b9ade4c"
integrity sha512-OcZ2ZLsP7+OjJHzuieM95lXvNGwNTm/HSgQTOhc4P3RQgyTtxwIyaW5yP55t7SSOzOygA4Rz47tI4K2KyWRs4g==
"@sora-substrate/math@1.32.5":
version "1.32.5"
resolved "https://registry.yarnpkg.com/@sora-substrate/math/-/math-1.32.5.tgz#868950210d271f30f71fb8799be08b56443824d5"
integrity sha512-oWsZgKkffT8718SexmF+SFNg1f6NsXlMaGGQH5x0dZNbzKkaheixtamWZsiIqT5avPto6e/ENPydUXO8NsuijQ==
dependencies:
"@polkadot/types" "9.14.2"
bignumber.js "^9.0.1"
lodash "^4.17.15"
bignumber.js "^9.1.2"
lodash "^4.17.21"

"@sora-substrate/type-definitions@1.31.0":
version "1.31.0"
resolved "https://registry.yarnpkg.com/@sora-substrate/type-definitions/-/type-definitions-1.31.0.tgz#75ab66b95ae5235a3aa879a938ab18ff484c86f4"
integrity sha512-3p03vVSRcbAGwemflfmHULLfV8Tihqc1Khs48snUy4Ez4COtKtmRlH2g6iapUYoWAhZrP1+9miuQ8nRFHCTlkA==
"@sora-substrate/type-definitions@1.32.5":
version "1.32.5"
resolved "https://registry.yarnpkg.com/@sora-substrate/type-definitions/-/type-definitions-1.32.5.tgz#2a7ee8fbd0a158b166482f5cc15c067983095d90"
integrity sha512-f14xlEYBb9e6GJtlyfCL3j2h6K+Bd/ZFKeAa+b7A2wQte66HSqy5pye3PPNbB5B2dYsdYLV3UFlrkkrv0QB+4A==
dependencies:
"@open-web3/orml-type-definitions" "1.1.4"

"@sora-substrate/types@1.31.0":
version "1.31.0"
resolved "https://registry.yarnpkg.com/@sora-substrate/types/-/types-1.31.0.tgz#a12f15438d850eb6fe22004a75458e4645ff4212"
integrity sha512-c8zqOc5T87kLmmlwtxVh/65u1Dy0Nz0meftGdJ7YcDCWoJXqIAaG/rMAZlvajO10bWd43jpAUcLERzemncLpgQ==
"@sora-substrate/types@1.32.5":
version "1.32.5"
resolved "https://registry.yarnpkg.com/@sora-substrate/types/-/types-1.32.5.tgz#dc78f4f9426256f4f8d1b7a77c5a847f6fa2790b"
integrity sha512-f9SbtWlRz+Zo6wFUM27iBLXUWd/rQV950fJicTbXQMLJ9nTmPwv/7z16CyJ6atzTVuiODz/OdGrCG4+Tf0qJ2Q==
dependencies:
"@open-web3/api-mobx" "0.9.4-26"
"@open-web3/orml-types" "1.1.4"
"@polkadot/api" "9.14.2"
"@polkadot/typegen" "9.14.2"
"@polkadot/types" "9.14.2"
"@sora-substrate/type-definitions" "1.31.0"
"@sora-substrate/type-definitions" "1.32.5"

"@sora-substrate/util@1.31.0":
version "1.31.0"
resolved "https://registry.yarnpkg.com/@sora-substrate/util/-/util-1.31.0.tgz#89c77add9ddd66980187bae9462a5f2f66d24bd6"
integrity sha512-wn++Jllgr7/40P+ykmQz1WBTFgMK12GvgDEqY+Ufqz35jxLfn/5Mu3U6xQyhFcpODyRkoYor1tewCaCXLkBIrg==
"@sora-substrate/util@1.32.5":
version "1.32.5"
resolved "https://registry.yarnpkg.com/@sora-substrate/util/-/util-1.32.5.tgz#c113db68b169189a2dda047253444087410249db"
integrity sha512-WmC5oLj9EkHRR0/gGSdGFGPBebtM+CsErVHZ3/k3b9MrjsOXdOyDYG1Bz4DzOeWbkxPxltrfPNWBmOmVP0s8QQ==
dependencies:
"@polkadot/ui-keyring" "2.12.1"
"@sora-substrate/api" "1.31.0"
"@sora-substrate/connection" "1.31.0"
"@sora-substrate/liquidity-proxy" "1.31.0"
"@sora-substrate/math" "1.31.0"
"@sora-substrate/types" "1.31.0"
axios "^0.21.1"
crypto-js "^4.0.0"
lodash "^4.17.15"
"@sora-substrate/api" "1.32.5"
"@sora-substrate/connection" "1.32.5"
"@sora-substrate/liquidity-proxy" "1.32.5"
"@sora-substrate/math" "1.32.5"
"@sora-substrate/types" "1.32.5"
axios "^1.6.7"
crypto-js "^4.2.0"
lodash "^4.17.21"

"@sora-test/wallet-connect@^0.0.9":
version "0.0.9"
Expand Down Expand Up @@ -2443,13 +2443,13 @@
vue-property-decorator "^9.1.2"
vuex "^3.6.2"

"@soramitsu/[email protected].0":
version "1.32.0"
resolved "https://nexus.iroha.tech/repository/npm-group/@soramitsu/soraneo-wallet-web/-/soraneo-wallet-web-1.32.0.tgz#bb1dfe4995736c4f28ea868e4ea7e90514cf434d"
integrity sha512-iGPmVXam/Q9GvkFx/8Zs9gftdk+O/UBBI+Y4E7vwRBJF8FdhkmtL1/Je4OFzeVQCuQqWHntexgre1MeL+d3bZw==
"@soramitsu/[email protected].3":
version "1.32.3"
resolved "https://nexus.iroha.tech/repository/npm-group/@soramitsu/soraneo-wallet-web/-/soraneo-wallet-web-1.32.3.tgz#ab8730471c0d22e84c4c6b09669a576fb984808c"
integrity sha512-ZqK2rJ9PFBwgmkKMD03s1UznmiSSzbsfEtEMmWjlHHJ3fWO3gl5drjGkxH99Ph507dk0kJATveP0MoWF6BpKUg==
dependencies:
"@polkadot/vue-identicon" "2.12.1"
"@sora-substrate/util" "1.31.0"
"@sora-substrate/util" "1.32.5"
"@sora-test/wallet-connect" "^0.0.9"
"@soramitsu-ui/ui-vue2" "^1.1.1"
"@urql/core" "^4.1.2"
Expand Down Expand Up @@ -4520,12 +4520,14 @@ available-typed-arrays@^1.0.5:
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7"
integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==

axios@^0.21.1:
version "0.21.4"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==
axios@^1.6.7:
version "1.6.7"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7"
integrity sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==
dependencies:
follow-redirects "^1.14.0"
follow-redirects "^1.15.4"
form-data "^4.0.0"
proxy-from-env "^1.1.0"

babel-helper-vue-jsx-merge-props@^2.0.0:
version "2.0.3"
Expand Down Expand Up @@ -4682,7 +4684,7 @@ big.js@^5.2.2:
resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328"
integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==

bignumber.js@^9.0.1:
bignumber.js@^9.1.2:
version "9.1.2"
resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c"
integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==
Expand Down Expand Up @@ -5808,10 +5810,10 @@ crypto-browserify@^3.12.0:
randombytes "^2.0.0"
randomfill "^1.0.3"

crypto-js@^4.0.0, crypto-js@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf"
integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==
crypto-js@^4.1.1, crypto-js@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.2.0.tgz#4d931639ecdfd12ff80e8186dba6af2c2e856631"
integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==

crypto-random-string@^2.0.0:
version "2.0.0"
Expand Down Expand Up @@ -7519,10 +7521,10 @@ flatted@^3.2.7:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==

follow-redirects@^1.0.0, follow-redirects@^1.14.0:
version "1.15.3"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a"
integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==
follow-redirects@^1.0.0, follow-redirects@^1.15.4:
version "1.15.6"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b"
integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==

for-each@^0.3.3:
version "0.3.3"
Expand Down Expand Up @@ -11967,6 +11969,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/proxy-compare/-/proxy-compare-2.5.1.tgz#17818e33d1653fbac8c2ec31406bce8a2966f600"
integrity sha512-oyfc0Tx87Cpwva5ZXezSp5V9vht1c7dZBhvuV/y3ctkgMVUmiAGDVeeB0dKhGSyT0v1ZTEQYpe/RXlBVBNuCLA==

proxy-from-env@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==

pseudomap@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
Expand Down Expand Up @@ -13805,11 +13812,6 @@ uncrypto@^0.1.3:
resolved "https://registry.yarnpkg.com/uncrypto/-/uncrypto-0.1.3.tgz#e1288d609226f2d02d8d69ee861fa20d8348ef2b"
integrity sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==

undici-types@~5.25.1:
version "5.25.3"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.25.3.tgz#e044115914c85f0bcbb229f346ab739f064998c3"
integrity sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==

undici-types@~5.26.4:
version "5.26.5"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
Expand Down