import { u128 } from "as-bignum" ; import { ByteArray , CompactInt , Hash , UInt128 , UInt32 , UInt64 } from "as-scale-codec" ; import { AccountData , AccountId , AccountInfo , Block , DigestItem , ExtrinsicData , GenericExtrinsic , Header , RuntimeVersion , Signature , SignedTransaction , SupportedAPIs } from "subsembly-core" ; export type HashType = Hash ; export type Moment = UInt64 ; export type NonceType = UInt32 ; export type ExtrinsicIndexType = UInt32 ; export type AmountType = Balance ; export type SignedTransactionType = SignedTransaction < HashType , AmountType , NonceType , SignatureType > ; export type BlockNumber = CompactInt ; export type AccountIdType = AccountId ; export type SignatureType = Signature ; export type DigestItemType = DigestItem ; export type Balance = UInt128 ; export type HeaderType = Header < BlockNumber , HashType > ; export type BlockType = Block < HeaderType , UncheckedExtrinsic > ; export type Inherent = UncheckedExtrinsic ; export type ExtrinsicDataType = ExtrinsicData < ExtrinsicIndexType , ByteArray > ; export type Multiplier = UInt64 ; export type Weight = UInt64 ; export type UncheckedExtrinsic = GenericExtrinsic < AccountIdType , Balance , NonceType , SignatureType > ; export type AccountDataType = AccountData < Balance > ; export type RefCount = UInt32 ; export type AccountInfoType = AccountInfo < NonceType , RefCount , AccountDataType > ; /**
 * Note: Originally Events are stored as a vector of RawEvents,
 * since we don't have support for vector of Codec types (i.e Codec[]),
 * we are using opaque bytes to store events
 */ export type VecEvent = ByteArray ; description export class RuntimeConfig { description static runtimeVersion ( ) { const SPEC_NAME = "node-template" ; const IMPL_NAME = "AssemblyScript" ; const AUTHORING_VERSION = 1 ; const SPEC_VERSION = 1 ; const IMPL_VERSION = 1 ; const APIS_VEC = new SupportedAPIs ( ) ; APIS_VEC . addAPI ( [ 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ] , 10 ) ; const TRANSACTION_VERSION = 1 ; return new RuntimeVersion ( SPEC_NAME , IMPL_NAME , AUTHORING_VERSION , SPEC_VERSION , IMPL_VERSION , APIS_VEC , TRANSACTION_VERSION ) ; } ; } /**
 * System config
 */ export class SystemConfig { static readonly WEIGHT_PER_SECOND : u64 = 1000000000000 ; static readonly WEIGHT_PER_MILLIS : u64 = SystemConfig . WEIGHT_PER_SECOND / 1000 ; static readonly WEIGHT_PER_MICROS : u64 = SystemConfig . WEIGHT_PER_MILLIS / 1000 ; description static BlockHashCount ( ) { return instantiate < BlockNumber > ( 1000 ) ; } description static MaximumBlockLength ( ) { return new UInt32 ( 5000 ) ; } description static MaximumBlockWeight ( ) { return instantiate < Weight > ( 2 * this . WEIGHT_PER_SECOND ) ; } description static ExtrinsicBaseWeight ( ) { return instantiate < Weight > ( 125 * this . WEIGHT_PER_MICROS ) ; } description static BlockExecutionWeight ( ) { return instantiate < Weight > ( 5 * this . WEIGHT_PER_MILLIS ) ; } } description export class TimestampConfig { description static minimumPeriod ( ) { return instantiate < Moment > ( 5000 ) ; } } description export class BalancesConfig { description static existentialDeposit ( ) { return instantiate < Balance > ( u128 . fromU32 ( 1000 ) ) ; } }