Skip to content

Commit

Permalink
Acala support (#1382)
Browse files Browse the repository at this point in the history
* add Alphanet to consts

* save stage config

* transfer subBridgeConnector to store

* add moonbase alpha icon

* address format research

* refactoring

* revert some changes

* add Acala icon & sub config

* fetch acala assets metadata

* acala balance fetching

* add acala min deposit for token

* add acala extrinsic

* incoming tx history restoration

* refactoring outgoing process

* refactoring outgoing

* update reducer

* refactoring

* remove lib from resolutions

* add moonbase xcm fee & util resolution

* fixes & improvements for acala

* update prod env.json to enable acala

* update wallet 1.33.1

* update sub networks config in const

* remove store dependency in reducer

* only ACA as supported bridge token

* history restoration updates

* change liberland nodes order
  • Loading branch information
Nikita-Polyakov authored Apr 25, 2024
1 parent 11c1dd2 commit 8c697f4
Show file tree
Hide file tree
Showing 35 changed files with 1,014 additions and 398 deletions.
3 changes: 2 additions & 1 deletion env.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"KusamaSora": true,
"Polkadot": true,
"PolkadotSora": true,
"Liberland": false
"PolkadotAcala": true,
"Liberland": true
},
"EVM_NETWORKS_IDS": [56, 8217],
"ETH_BRIDGE": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polkaswap-exchange-web",
"version": "1.32.0",
"version": "1.33.0",
"repository": {
"type": "git",
"url": "https://github.com/sora-xor/polkaswap-exchange-web.git"
Expand All @@ -27,7 +27,7 @@
},
"dependencies": {
"@metamask/detect-provider": "^2.0.0",
"@soramitsu/soraneo-wallet-web": "1.33.0",
"@soramitsu/soraneo-wallet-web": "1.33.1",
"@walletconnect/ethereum-provider": "^2.11.2",
"@walletconnect/modal": "^2.6.2",
"core-js": "^3.36.0",
Expand Down
34 changes: 34 additions & 0 deletions src/assets/img/networks/acala.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
136 changes: 136 additions & 0 deletions src/assets/img/networks/moonbase.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions src/components/mixins/BridgeTransactionMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class BridgeTransactionMixin extends Mixins(NetworkFormatterMixin
return this.tx?.blockId ?? '';
}

get txEventIndex(): number | undefined {
get txInternalEventIndex(): number | undefined {
return this.tx?.payload?.eventIndex;
}

Expand All @@ -65,6 +65,10 @@ export default class BridgeTransactionMixin extends Mixins(NetworkFormatterMixin
return this.tx?.externalBlockId ?? '';
}

get txExternalEventIndex(): number | undefined {
return this.tx && 'externalEventIndex' in this.tx ? this.tx.externalEventIndex : undefined;
}

get externalNetworkType(): Nullable<BridgeNetworkType> {
return this.tx?.externalNetworkType;
}
Expand All @@ -78,7 +82,7 @@ export default class BridgeTransactionMixin extends Mixins(NetworkFormatterMixin
this.soraNetwork,
this.txSoraId,
this.txInternalBlockNumber ?? this.txInternalBlockId,
this.txEventIndex
this.txInternalEventIndex
);
}

Expand All @@ -90,7 +94,7 @@ export default class BridgeTransactionMixin extends Mixins(NetworkFormatterMixin
this.externalNetworkId,
this.txExternalHash,
this.txExternalBlockNumber ?? this.txExternalBlockId,
this.txEventIndex
this.txExternalEventIndex
);
}

Expand Down
4 changes: 4 additions & 0 deletions src/components/mixins/NetworkFormatterMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ export default class NetworkFormatterMixin extends Mixins(TranslationMixin) {
return 'polkadot';
case SubNetworkId.PolkadotSora:
return 'sora-polkadot';
case SubNetworkId.PolkadotAcala:
return 'acala';
case SubNetworkId.Kusama:
return 'kusama';
case SubNetworkId.Rococo:
Expand All @@ -151,6 +153,8 @@ export default class NetworkFormatterMixin extends Mixins(TranslationMixin) {
return 'sora-kusama';
case SubNetworkId.Liberland:
return 'liberland';
case SubNetworkId.AlphanetMoonbase:
return 'moonbase';
default:
return 'ethereum';
}
Expand Down
Loading

0 comments on commit 8c697f4

Please sign in to comment.