Skip to content

Commit

Permalink
fix: bsx types (#2942)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuul-wq authored Jan 10, 2025
1 parent a242b6f commit 4488ea2
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/renderer/shared/config/extensions/basilisk/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { types } from './types';

export const BASILISK_PROVIDER = {
types,
};

export const BASILISK_TXWRAPPER = {
additionalTypes: types,
};
114 changes: 114 additions & 0 deletions src/renderer/shared/config/extensions/basilisk/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import { type RegistryTypes } from '@polkadot/types/types';

export const types: RegistryTypes = {
Address: 'AccountId',
Amount: 'i128',
AmountOf: 'Amount',
AssetDetails: {
name: 'Vec<u8>',
asset_type: 'AssetType',
existential_deposit: 'Balance',
locked: 'bool',
},
AssetDetailsT: 'AssetDetails',
AssetInstance: 'AssetInstanceV1',
AssetMetadata: {
symbol: 'Vec<u8>',
decimals: 'u8',
},
AssetPair: {
asset_in: 'AssetId',
asset_out: 'AssetId',
},
AssetType: {
_enum: {
Token: 'Null',
PoolShare: '(AssetId,AssetId)',
},
},
BalanceInfo: {
amount: 'Balance',
assetId: 'AssetId',
},
BalanceOf: 'Balance',
Chain: {
genesisHash: 'Vec<u8>',
lastBlockHash: 'Vec<u8>',
},
ClassData: {
is_pool: 'bool',
},
ClassId: 'u64',
ClassIdOf: 'ClassId',
ClassInfo: {
metadata: 'Vec<u8>',
total_issuance: 'TokenId',
owner: 'AccountId',
data: 'ClassData',
},
ClassInfoOf: 'ClassInfo',
Currency: 'AssetId',
CurrencyId: 'AssetId',
CurrencyIdOf: 'AssetId',
Fee: { numerator: 'u32', denominator: 'u32' },
Intention: {
who: 'AccountId',
asset_sell: 'AssetId',
asset_buy: 'AssetId',
amount: 'Balance',
discount: 'bool',
sell_or_buy: 'IntentionType',
},
IntentionId: 'Hash',
IntentionType: {
_enum: ['SELL', 'BUY'],
},
LBPWeight: 'u32',
LookupSource: 'AccountId',
MultiAsset: 'MultiAssetV1',
MultiLocation: 'MultiLocationV1',
OrderedSet: 'Vec<AssetId>',
OrmlAccountData: {
free: 'Balance',
frozen: 'Balance',
reserved: 'Balance',
},
Pool: {
owner: 'AccountId',
start: 'BlockNumber',
end: 'BlockNumber',
assets: 'AssetPair',
initial_weights: 'LBPWeight',
final_weights: 'LBPWeight',
weight_curve: 'WeightCurveType',
pausable: 'bool',
paused: 'bool',
fee: 'Fee',
fee_receiver: 'AccountId',
},
PoolId: 'AccountId',
Price: 'Balance',
TokenData: {
locked: 'bool',
},
TokenId: 'u64',
TokenIdOf: 'TokenId',
TokenInfo: {
metadata: 'Vec<u8>',
owner: 'AccountId',
data: 'TokenData',
},
TokenInfoOf: 'TokenInfo',
VestingSchedule: {
start: 'BlockNumber',
period: 'BlockNumber',
period_count: 'u32',
per_period: 'Compact<Balance>',
},
VestingScheduleOf: 'VestingSchedule',
WeightCurveType: {
_enum: ['Linear'],
},
Xcm: 'XcmV1',
XcmOrder: 'XcmOrderV1',
};
5 changes: 5 additions & 0 deletions src/renderer/shared/config/extensions/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { type ChainId } from '@/shared/core';

import { AVAIL_PROVIDER, AVAIL_TXWRAPPER } from './avail';
import { BASILISK_PROVIDER, BASILISK_TXWRAPPER } from './basilisk';
import { MYTHOS_PROVIDER, MYTHOS_TXWRAPPER } from './mythos';
import { type Extension, type TxWrapper } from './types';

Expand All @@ -15,4 +16,8 @@ export const EXTENSIONS: {
provider: MYTHOS_PROVIDER,
txwrapper: MYTHOS_TXWRAPPER,
},
'0xa85cfb9b9fd4d622a5b28289a02347af987d8f73fa3108450e2b4a11c1ce5755': {
provider: BASILISK_PROVIDER,
txwrapper: BASILISK_TXWRAPPER,
},
};

0 comments on commit 4488ea2

Please sign in to comment.