Statemint v14 types (#4045)

* Statemint v14 types

* CHANGELOG

* v4 & v5

* Adjust
This commit is contained in:
Jaco
2021-10-10 13:59:58 +03:00
committed by GitHub
parent 5495501e0c
commit 7c6b64c6c8
2 changed files with 35 additions and 19 deletions
+1
View File
@@ -4,6 +4,7 @@
Changes:
- Adjust Statemint known types for version 4+
- Add Kusama & Polkadot upgrade blocks for 9100/9110
- Adjust contracts `InstantiateReturnValue` type (no rent projection after 267)
+34 -19
View File
@@ -5,29 +5,44 @@
import type { OverrideVersionedType } from '@polkadot/types/types';
import { mapXcm } from '@polkadot/types/interfaces/xcm/definitions';
const sharedTypes = {
TAssetBalance: 'u128',
ProxyType: {
_enum: [
'Any',
'NonTransfer',
'CancelProxy',
'Assets',
'AssetOwner',
'AssetManager',
'Staking'
]
}
};
// these are override types for Statemine, Statemint, Westmint
const versioned: OverrideVersionedType[] = [
{
minmax: [0, undefined],
minmax: [0, 3],
types: {
TAssetBalance: 'u128',
ProxyType: {
_enum: [
'Any',
'NonTransfer',
'CancelProxy',
'Assets',
'AssetOwner',
'AssetManager',
'Staking'
]
},
AssetInstance: 'AssetInstanceV0',
MultiAsset: 'MultiAssetV0',
MultiLocation: 'MultiLocationV0',
Response: 'ResponseV0',
Xcm: 'XcmV0',
XcmOrder: 'XcmOrderV0'
...sharedTypes,
...mapXcm('V0')
}
},
{
minmax: [4, 4],
types: {
...sharedTypes,
...mapXcm('V1')
}
},
{
// metadata V14
minmax: [5, undefined],
types: {
...sharedTypes
}
}
];