import type from @darwinia/types (#4701)

This commit is contained in:
WoeOm 2021-02-20 16:00:15 +08:00 committed by GitHub
parent ca00af9e0e
commit bdec80b4c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 547 deletions

View File

@ -11,6 +11,7 @@
"dependencies": {
"@acala-network/type-definitions": "^0.6.2-12",
"@babel/runtime": "^7.12.5",
"@darwinia/types": "^1.1.0-alpha.1",
"@edgeware/node-types": "^3.3.1",
"@interlay/polkabtc-types": "^0.3.4",
"@laminar/type-definitions": "^0.2.0-beta.143",

View File

@ -3,284 +3,6 @@
import type { OverrideBundleDefinition } from '@polkadot/types/types';
// structs need to be in order
/* eslint-disable sort-keys */
import { typesBundleForPolkadot } from '@darwinia/types/mix';
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId',
BalanceInfo: 'Null',
BalanceLock: {
id: 'LockIdentifier',
lockFor: 'LockFor',
LockReasons: 'Reasons',
amount: 'Balance',
reasons: 'Reasons'
},
LockFor: {
_enum: {
Common: 'Common',
Staking: 'StakingLock'
}
},
Common: {
amount: 'Balance'
},
StakingLock: {
stakingAmount: 'Balance',
unbondings: 'Vec<Unbonding>'
},
Reasons: {
_enum: ['Fee', 'Misc', 'All']
},
Unbonding: {
amount: 'Balance',
moment: 'BlockNumber'
},
AccountData: {
free: 'Balance',
reserved: 'Balance',
freeKton: 'Balance',
reservedKton: 'Balance',
miscFrozen: 'Balance',
feeFrozen: 'Balance'
},
RingBalance: 'Balance',
KtonBalance: 'Balance',
TsInMs: 'u64',
Power: 'u32',
DepositId: 'U256',
StakingBalanceT: {
_enum: {
RingBalance: 'Balance',
KtonBalance: 'Balance'
}
},
StakingLedgerT: {
stash: 'AccountId',
activeRing: 'Compact<Balance>',
activeDepositRing: 'Compact<Balance>',
activeKton: 'Compact<Balance>',
depositItems: 'Vec<TimeDepositItem>',
ringStakingLock: 'StakingLock',
ktonStakingLock: 'StakingLock',
claimedRewards: 'Vec<EraIndex>',
total: 'Compact<Balance>',
active: 'Compact<Balance>',
unlocking: 'Vec<UnlockChunk>'
},
TimeDepositItem: {
value: 'Compact<Balance>',
startTime: 'Compact<TsInMs>',
expireTime: 'Compact<TsInMs>'
},
ExposureT: {
ownRingBalance: 'Compact<Balance>',
ownKtonBalance: 'Compact<Balance>',
ownPower: 'Power',
totalPower: 'Power',
others: 'Vec<IndividualExposure>'
},
Exposure: 'ExposureT',
IndividualExposure: {
who: 'AccountId',
ringBalance: 'Compact<Balance>',
ktonBalance: 'Compact<Balance>',
power: 'Power',
value: 'Compact<Balance>'
},
ElectionResultT: {
electedStashes: 'Vec<AccountId>',
exposures: 'Vec<(AccountId, ExposureT)>',
compute: 'ElectionCompute'
},
RKT: {
r: 'Balance',
k: 'Balance'
},
SpanRecord: {
slashed: 'RKT',
paidOut: 'RKT'
},
UnappliedSlash: {
validator: 'AccountId',
own: 'RKT',
others: 'Vec<(AccountId, RKT)>',
reporters: 'Vec<AccountId>',
payout: 'RKT'
},
TreasuryProposal: {
proposer: 'AccountId',
beneficiary: 'AccountId',
ringValue: 'Balance',
ktonValue: 'Balance',
ringBond: 'Balance',
ktonBond: 'Balance'
},
MappedRing: 'u128',
EthereumTransactionIndex: '(H256, u64)',
EthereumBlockNumber: 'u64',
EthereumHeader: {
parent_hash: 'H256',
timestamp: 'u64',
number: 'EthereumBlockNumber',
author: 'EthereumAddress',
transactions_root: 'H256',
uncles_hash: 'H256',
extra_data: 'Bytes',
state_root: 'H256',
receipts_root: 'H256',
log_bloom: 'Bloom',
gas_used: 'U256',
gas_limit: 'U256',
difficulty: 'U256',
seal: 'Vec<Bytes>',
hash: 'Option<H256>'
},
EthereumAddress: 'H160',
Bloom: '[u8; 256; Bloom]',
H128: '[u8; 16; H128]',
EthashProof: {
dagNodes: '(H512, H512)',
proof: 'Vec<H128>'
},
EthereumReceipt: {
gasUsed: 'U256',
logBloom: 'Bloom',
logs: 'Vec<LogEntry>',
outcome: 'TransactionOutcome'
},
LogEntry: {},
TransactionOutcome: {},
EthereumNetworkType: {
_enum: {
Mainnet: null,
Ropsten: null
}
},
RedeemFor: {
_enum: {
Token: null,
Deposit: null
}
},
EthereumReceiptProof: {
index: 'u64',
proof: 'Bytes',
headerHash: 'H256'
},
EthereumReceiptProofThing: '(EthereumHeader, EthereumReceiptProof, MMRProof)',
MMRProof: {
memberLeafIndex: 'u64',
lastLeafIndex: 'u64',
proof: 'Vec<H256>'
},
EthereumRelayHeaderParcel: {
header: 'EthereumHeader',
mmrRoot: 'H256'
},
EthereumRelayProofs: {
ethashProof: 'Vec<EthashProof>',
mmrProof: 'Vec<H256>'
},
OtherSignature: {
_enum: {
Eth: 'EcdsaSignature',
Tron: 'EcdsaSignature'
}
},
EcdsaSignature: '[u8; 65; EcdsaSignature]',
TronAddress: 'EthereumAddress',
OtherAddress: {
_enum: {
Eth: 'EthereumAddress',
Tron: 'TronAddress'
}
},
AddressT: '[u8; 20; AddressT]',
MerkleMountainRangeRootLog: {
prefix: '[u8; 4; Prefix]',
ParentMmrRoot: 'Hash'
},
AccountInfo: {
nonce: 'Index',
refcount: 'RefCount',
data: 'AccountData'
},
ProxyDefinition: {
delegate: 'AccountId',
proxyType: 'ProxyType',
delay: 'BlockNumber'
},
ProxyType: {
_enum: {
Any: null,
NonTransfer: null,
Governance: null,
Staking: null,
IdentityJudgement: null,
EthereumBridge: null
}
},
ProxyAnnouncement: {
real: 'AccountId',
callHash: 'Hash',
height: 'BlockNumber'
},
Announcement: 'ProxyAnnouncement',
RelayHeaderId: 'EthereumBlockNumber',
RelayHeaderParcel: 'EthereumRelayHeaderParcel',
RelayProofs: 'EthereumRelayProofs',
RelayAffirmationId: {
relayHeaderId: 'EthereumBlockNumber',
round: 'u32',
index: 'u32'
},
RelayAffirmationT: {
relayer: 'AccountId',
relayHeaderParcels: 'EthereumRelayHeaderParcel',
bond: 'Balance',
maybeExtendedRelayAffirmationId: 'Option<RelayAffirmationId>',
verified: 'bool'
},
RelayVotingState: {
ayes: 'Vec<AccountId>',
nays: 'Vec<AccountId>'
},
PowerOf: {
power: 'Power'
},
Signer: 'EthereumAddress',
RelayAuthorityT: {
accountId: 'AccountId',
signer: 'Signer',
stake: 'Balance',
term: 'BlockNumber'
},
MMRRoot: 'Hash',
EcdsaAddress: 'EthereumAddress',
EcdsaMessage: 'H256',
RelayAuthoritySigner: 'EcdsaAddress',
RelayAuthorityMessage: 'EcdsaMessage',
RelayAuthoritySignature: 'EcdsaSignature',
Term: 'u32'
}
}
]
};
export default definitions;
export default typesBundleForPolkadot.spec.crab as unknown as OverrideBundleDefinition;

View File

@ -3,270 +3,6 @@
import type { OverrideBundleDefinition } from '@polkadot/types/types';
// structs need to be in order
/* eslint-disable sort-keys */
import { typesBundleForPolkadot } from '@darwinia/types/mix';
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId',
BalanceInfo: 'Null',
BalanceLock: {
id: 'LockIdentifier',
lockFor: 'LockFor',
LockReasons: 'Reasons',
amount: 'Balance',
reasons: 'Reasons'
},
LockFor: {
_enum: {
Common: 'Common',
Staking: 'StakingLock'
}
},
Common: {
amount: 'Balance'
},
StakingLock: {
stakingAmount: 'Balance',
unbondings: 'Vec<Unbonding>'
},
Reasons: {
_enum: ['Fee', 'Misc', 'All']
},
Unbonding: {
amount: 'Balance',
moment: 'BlockNumber'
},
AccountData: {
free: 'Balance',
reserved: 'Balance',
freeKton: 'Balance',
reservedKton: 'Balance',
miscFrozen: 'Balance',
feeFrozen: 'Balance'
},
RingBalance: 'Balance',
KtonBalance: 'Balance',
TsInMs: 'u64',
Power: 'u32',
DepositId: 'U256',
StakingBalanceT: {
_enum: {
RingBalance: 'Balance',
KtonBalance: 'Balance'
}
},
StakingLedgerT: {
stash: 'AccountId',
activeRing: 'Compact<Balance>',
activeDepositRing: 'Compact<Balance>',
activeKton: 'Compact<Balance>',
depositItems: 'Vec<TimeDepositItem>',
ringStakingLock: 'StakingLock',
ktonStakingLock: 'StakingLock',
claimedRewards: 'Vec<EraIndex>',
total: 'Compact<Balance>',
active: 'Compact<Balance>',
unlocking: 'Vec<UnlockChunk>'
},
TimeDepositItem: {
value: 'Compact<Balance>',
startTime: 'Compact<TsInMs>',
expireTime: 'Compact<TsInMs>'
},
ExposureT: {
ownRingBalance: 'Compact<Balance>',
ownKtonBalance: 'Compact<Balance>',
ownPower: 'Power',
totalPower: 'Power',
others: 'Vec<IndividualExposure>'
},
Exposure: 'ExposureT',
IndividualExposure: {
who: 'AccountId',
ringBalance: 'Compact<Balance>',
ktonBalance: 'Compact<Balance>',
power: 'Power',
value: 'Compact<Balance>'
},
ElectionResultT: {
electedStashes: 'Vec<AccountId>',
exposures: 'Vec<(AccountId, ExposureT)>',
compute: 'ElectionCompute'
},
RKT: {
r: 'Balance',
k: 'Balance'
},
SpanRecord: {
slashed: 'RKT',
paidOut: 'RKT'
},
UnappliedSlash: {
validator: 'AccountId',
own: 'RKT',
others: 'Vec<(AccountId, RKT)>',
reporters: 'Vec<AccountId>',
payout: 'RKT'
},
TreasuryProposal: {
proposer: 'AccountId',
beneficiary: 'AccountId',
ringValue: 'Balance',
ktonValue: 'Balance',
ringBond: 'Balance',
ktonBond: 'Balance'
},
MappedRing: 'u128',
EthereumTransactionIndex: '(H256, u64)',
EthereumBlockNumber: 'u64',
EthereumHeader: {
parent_hash: 'H256',
timestamp: 'u64',
number: 'EthereumBlockNumber',
author: 'EthereumAddress',
transactions_root: 'H256',
uncles_hash: 'H256',
extra_data: 'Bytes',
state_root: 'H256',
receipts_root: 'H256',
log_bloom: 'Bloom',
gas_used: 'U256',
gas_limit: 'U256',
difficulty: 'U256',
seal: 'Vec<Bytes>',
hash: 'Option<H256>'
},
EthereumAddress: 'H160',
Bloom: '[u8; 256; Bloom]',
H128: '[u8; 16; H128]',
EthashProof: {
dagNodes: '(H512, H512)',
proof: 'Vec<H128>'
},
EthereumReceipt: {
gasUsed: 'U256',
logBloom: 'Bloom',
logs: 'Vec<LogEntry>',
outcome: 'TransactionOutcome'
},
LogEntry: {},
TransactionOutcome: {},
EthereumNetworkType: {
_enum: {
Mainnet: null,
Ropsten: null
}
},
RedeemFor: {
_enum: {
Token: null,
Deposit: null
}
},
EthereumReceiptProof: {
index: 'u64',
proof: 'Bytes',
headerHash: 'H256'
},
EthereumReceiptProofThing: '(EthereumHeader, EthereumReceiptProof, MMRProof)',
MMRProof: {
memberLeafIndex: 'u64',
lastLeafIndex: 'u64',
proof: 'Vec<H256>'
},
EthereumRelayHeaderParcel: {
header: 'EthereumHeader',
mmrRoot: 'H256'
},
EthereumRelayProofs: {
ethashProof: 'Vec<EthashProof>',
mmrProof: 'Vec<H256>'
},
OtherSignature: {
_enum: {
Eth: 'EcdsaSignature',
Tron: 'EcdsaSignature'
}
},
EcdsaSignature: '[u8; 65; EcdsaSignature]',
TronAddress: 'EthereumAddress',
OtherAddress: {
_enum: {
Eth: 'EthereumAddress',
Tron: 'TronAddress'
}
},
AddressT: '[u8; 20; AddressT]',
MerkleMountainRangeRootLog: {
prefix: '[u8; 4; Prefix]',
mmrRoot: 'Hash'
},
AccountInfo: {
nonce: 'Index',
refcount: 'RefCount',
data: 'AccountData'
},
ProxyDefinition: {
delegate: 'AccountId',
proxyType: 'ProxyType',
delay: 'BlockNumber'
},
ProxyType: {
_enum: {
Any: null,
NonTransfer: null,
Governance: null,
Staking: null,
IdentityJudgement: null,
EthereumBridge: null
}
},
ProxyAnnouncement: {
real: 'AccountId',
callHash: 'Hash',
height: 'BlockNumber'
},
Announcement: 'ProxyAnnouncement',
RelayHeaderId: 'EthereumBlockNumber',
RelayHeaderParcel: 'EthereumRelayHeaderParcel',
RelayProofs: 'EthereumRelayProofs',
RelayAffirmationId: {
relayHeaderId: 'EthereumBlockNumber',
round: 'u32',
index: 'u32'
},
RelayAffirmationT: {
relayer: 'AccountId',
relayHeaderParcels: 'EthereumRelayHeaderParcel',
bond: 'Balance',
maybeExtendedRelayAffirmationId: 'Option<RelayAffirmationId>',
verified: 'bool'
},
RelayVotingState: {
ayes: 'Vec<AccountId>',
nays: 'Vec<AccountId>'
},
PowerOf: {
power: 'Power'
}
}
}
]
};
export default definitions;
export default typesBundleForPolkadot.spec.darwinia as unknown as OverrideBundleDefinition;

View File

@ -1304,6 +1304,15 @@ __metadata:
languageName: node
linkType: hard
"@babel/runtime@npm:^7.9.6":
version: 7.12.18
resolution: "@babel/runtime@npm:7.12.18"
dependencies:
regenerator-runtime: ^0.13.4
checksum: cb9e0c51b8e6e294ed5f52992d3fac13eb33b346760ef8eb0b3cb7542bb7c88c0297e2d878082255f91677e81e9cfcb00c38b3e55771a1ad9451647c6dd6a974
languageName: node
linkType: hard
"@babel/template@npm:^7.12.13, @babel/template@npm:^7.3.3":
version: 7.12.13
resolution: "@babel/template@npm:7.12.13"
@ -1362,6 +1371,27 @@ __metadata:
languageName: node
linkType: hard
"@darwinia/types-known@npm:^1.1.0-alpha.1":
version: 1.1.0-alpha.1
resolution: "@darwinia/types-known@npm:1.1.0-alpha.1"
dependencies:
"@babel/runtime": ^7.9.6
"@polkadot/types": 3.6.4
"@polkadot/util": ^3.0.1
bn.js: ^5.1.2
checksum: 501067fe1ebece4505eb6b0fa8ea08773e757ade51a8f55bd37a5a72476e24f653f34c444b50b63f1fd793f9dbfc15664841ff5eedb67c8bb4a9fc5be91a32fb
languageName: node
linkType: hard
"@darwinia/types@npm:^1.1.0-alpha.1":
version: 1.1.0-alpha.1
resolution: "@darwinia/types@npm:1.1.0-alpha.1"
dependencies:
"@darwinia/types-known": ^1.1.0-alpha.1
checksum: df8ac2ffbc7eba7c39995d8b71b4d2ef4762f2e844411f5950b370b4aa83a047a494c2e10f9f1188bcca17be180822096e2db550616dee63c8f3e1c2d3fc31e8
languageName: node
linkType: hard
"@develar/schema-utils@npm:~2.6.5":
version: 2.6.5
resolution: "@develar/schema-utils@npm:2.6.5"
@ -2326,6 +2356,7 @@ __metadata:
dependencies:
"@acala-network/type-definitions": ^0.6.2-12
"@babel/runtime": ^7.12.5
"@darwinia/types": ^1.1.0-alpha.1
"@edgeware/node-types": ^3.3.1
"@interlay/polkabtc-types": ^0.3.4
"@laminar/type-definitions": ^0.2.0-beta.143
@ -5246,7 +5277,7 @@ __metadata:
languageName: node
linkType: hard
"bn.js@npm:^5.0.0, bn.js@npm:^5.1.1":
"bn.js@npm:^5.0.0, bn.js@npm:^5.1.1, bn.js@npm:^5.1.2":
version: 5.1.3
resolution: "bn.js@npm:5.1.3"
checksum: 991c1fefb03bd69315297d454b379d5a5dd4834ab97db3ec985714f00ff7d3cc19642e1ac6bdf0d9f04946cc9f1ad26a5b497b7f4e7fa1230caf68af46fbefe6