Collection of components build on top of the UIGC Framework providing view & interaction layer with HydraDX & Basilisk chains.
Component | Name (import) | Custom element |
---|---|---|
Notification Center | NotificationCenter | gc-notification-center |
Transaction Center | TransactionCenter | gc-transaction-center |
Trade App | TradeApp | gc-trade-app |
Trade Spa | TradeSpa | gc-trade-spa |
Xcm App | XcmApp | gc-xcm-app |
Display app notifications (toast) and related history (drawer) based on slotted component event.
this.dispatchEvent(new CustomEvent() < Notification > ('gc:notification:new', message));
Attribute | Description |
---|---|
id | unique notification id |
timestamp | unix timestamp |
message | string or html template |
type | notification type |
toast | whether to display toast |
type Notification = {
id: string,
timestamp: number,
message: string | TemplateResult,
type: NotificationType,
toast: boolean,
};
enum NotificationType {
success = 'success',
error = 'error',
progress = 'progress',
default = '',
}
Process transaction & display status based on slotted component event. Dispatch result to Notification center.
this.dispatchEvent(new CustomEvent() < TxInfo > ('gc:tx:new', message)); // on chain tx
this.dispatchEvent(new CustomEvent() < TxInfo > ('gc:tx:newXcm', message)); // cross chain tx
Attribute | Description |
---|---|
account | User account (wallet) |
transaction | Transaction info (extrinsic, hex) |
notification | Notification center metadata |
meta | Transaction metadata |
type TxNotification = {
processing: string | TemplateResult,
success: string | TemplateResult,
failure: string | TemplateResult,
};
type TxInfo = {
account: Account,
transaction: Transaction,
notification: TxNotification,
meta?: Record<string, string>,
};
Bare trade app without tx & notification center.
<gc-trade-app
apiAddress="wss://rococo-basilisk-rpc.hydration.dev"
accountAddress="your_account_address"
accountProvider="polkadot-js"
accountName="your_account_name"
pools="XYK,LBP"
></gc-trade-app>
Property | Description | Required |
---|---|---|
apiAddress | chain ws address | true |
stableCoinAssetId | stablecoin id | true |
accountAddress | account address | false |
accountProvider | account provider | false |
accountName | account name | false |
pools | list of pools | false |
assetIn | asset in id | false |
assetOut | asset out id | false |
Standalone trade app with tx & notification center.
<gc-trade-spa
apiAddress="wss://rococo-basilisk-rpc.hydration.dev"
accountAddress="your_account_address"
accountProvider="polkadot-js"
accountName="your_account_name"
pools="XYK"
></gc-trade-spa>
Property | Description | Required |
---|---|---|
apiAddress | chain ws address | true |
stableCoinAssetId | stablecoin id | true |
accountAddress | account address | false |
accountProvider | account provider | false |
accountName | account name | false |
pools | list of pools | false |
assetIn | asset in id | false |
assetOut | asset out id | false |
Bare cross chain transaction app without tx & notification center.
<gc-xcm-app
srcChain="polkadot"
dstChain="hydradx"
chains="polkadot,hydradx,acala"
accountAddress="your_account_address"
accountProvider="polkadot-js"
accountName="your_account_name"
></gc-xcm-app>
Property | Description | Required |
---|---|---|
accountAddress | account address | false |
accountProvider | account provider | false |
accountName | account name | false |
chains | listed chains | true |
srcChain | default src chain | true |
dstChain | default dst chain | true |
Visit https://galactic-apps.netlify.app/
- Node.js (version 18 or higher)
npm install # to install all dependencies
npm run dev # to build & serve the apps
npm run cleanup # to cleanup the namespace
npm run package:prod # to build library & web bundle
Please create well-written issue here. It makes it easier to find & fix the problem accordingly.