Type definition

BFChainCore.TransactionJSON

interface TransactionJSON<AssetJSON extends object = object> {
    /**Event version number */
    version: number;
    /**Event type */
    type: string;
    /**The address of the account that initiated the event, base58-encoded hexadecimal string */
    senderId: string;
    /**The public key of the account that initiated the event, a 128-byte hexadecimal string */
    senderPublicKey: string;
    /**The security public key of the account that initiated the event, a 128-byte hexadecimal string */
    senderSecondPublicKey?: string;
    /**The receiving account address of the event, base58-encoded hexadecimal string */
    recipientId?: string;
    /**Event receiving range type */
    rangeType: BFChainCore.RANGE_TYPE;
    /**Event reception range */
    range: string[];
    /**Event handling fee */
    fee: string;
    /**Time stamp of the event */
    timestamp: number;
    /**The dappid to which the event belongs */
    dappid?: string;
    /**The name of the place to which the event belongs */
    lns?: string;
    /**The source IP of the event, IPv4 or IPv6, does not include the header and the end (for example: 127.0.0.1), the default is empty */
    sourceIP?: string;
    /**The source chain network identifier of the event */
    fromMagic: string;
    /**The to-chain network identifier of the event */
    toMagic: string;
    /**Initiation height of the event */
    applyBlockHeight: number;
    /**The effective height of the event */
    effectiveBlockHeight: number;
    /**Signature of the event */
    signature: string;
    /**Security signature of the event */
    signSignature?: string;
    /**Remarks of the event */
    remark: {
        [key: string]: string;
    };
    /**The actual event part */
    asset: AssetJSON;
    /**The index object of the event */
    storage?: TransactionStorageJSON;
    /**The index key of the event, provide the field name used for additional queries */
    storageKey?: TransactionStorageJSON["key"];
    /**The index value of the event, which provides the field value used by additional queries */
    storageValue?: TransactionStorageJSON["value"];
    /**Event pow noise */
    nonce: number;
}

BFChainCore.RANGE_TYPE

enum RANGE_TYPE {
  /**Unlimited range */
  EMPTY = 0,
  /**Multiple address */
  MULTI_ADDRESS = 1,
  /**DAppid range */
  MULTI_DAPPID = 2,
  /**Chain domain name range */
  MULTI_LOCATION_NAME = 4,
}

BFChainCore.TransactionStorageJSON

interface TransactionStorageJSON {
    /**The index key of the event, which provides the field name for additional queries */
    key: string;
    /**The index value of the event, which provides the field value used by additional queries */
    value: string;
}

BFChainPC.MemInfoModel.AccountInfoAndAsset

type AccountInfoAndAsset = {
    /**Account basic information, JSON object */
    accountInfo: AccountInfoModel;
    /**Account equity information, JSON object */
    accountAssets: AccountAssetsModel;
};

BFChainPC.MemInfoModel.AccountInfoModel

type AccountInfoModel = {
    /**Account address */
    address: string;
    /**Account public key */
    publicKey?: string;
    /**Account security public key */
    secondPublicKey?: string;
    /**Account alias */
    username?: string;
    /**Account status: 0 is normal and 1 is frozen */
    accountStatus: number;
    /**Whether it is a trustee: false is a normal account true is a trustee */
    isDelegate: boolean;
    /**Whether to receive votes: false to not receive true to receive votes */
    isAcceptVote: boolean;
    /**Number of forged blocks */
    producedblocks: number;
    /**The number of dropped blocks, the number of times that the corresponding block was not forged due to various reasons after being selected as the trustee and reaching the forging block */
    missedblocks: number;
    /**Accumulated event volume */
    numberOfTransactions: number;
    /** Obtained rights and interests information */
    voteInfo: VoteInfoModel;
    /**Information on rights and interests involved in governance voting */
    equityInfo: EquityInfoModel;
    /**The amount of equity and event information at the end of the previous round, and the round information of the penultimate round. If the current is 600, the current is the 11th round, and this value refers to the 10th round */
    lastRoundInfo: RoundInfoModel;
    /**Account change block height */
    height: number;
    /**Account online rate */
    productivity?: number;
};

BFChainPC.MemInfoModel.VoteInfoModel

type VoteInfoModel = {
    /**The round of equity */
    round: number;
    /**Amount of equity obtained */
    vote: bigint;
};

BFChainPC.MemInfoModel.EquityInfoModel

type EquityInfoModel = {
    /**The round of equity */
    round: number;
    /**Remaining value of equity */
    equity: bigint;
    /**Initial value of equity */
    fixedEquity: bigint;
};

BFChainPC.MemInfoModel.RoundInfoModel

type RoundInfoModel = {
    /**The round */
    round: number;
    /**The amount of equity held at the end of the round */
    assetNumber: bigint;
    /**The amount of events at the end of the round */
    txCount: number;
};

BFChainPC.MemInfoModel.AccountAssetsModel

type AccountAssetsModel = {
    /**Account address */
    address: string;
    /**Account public key */
    publicKey?: string;
    /**Account equity */
    assets: AssetsModel;
    /**Accumulated processing fee */
    paidFee: bigint;
    /**Cumulative voting income */
    votingRewards: bigint;
    /**Cumulative block gain */
    forgingRewards: bigint;
    /**Account change block height */
    height: number;
};

BFChainPC.MemInfoModel.AssetsModel

type AssetsModel = {
    /**The equity information of a certain chain */
    [sourceChainMagic: string]: {
        /**Some kind of rights information */
        [assetType: string]: AccountAssetSubModel;
    };
};

BFChainPC.MemInfoModel.AccountAssetSubModel

type AccountAssetSubModel = {
    /**The network identifier of the chain to which the equity belongs */
    sourceChainMagic: string;
    /**Equity name */
    assetType: string;
    /**The name of the main chain to which the equity belongs */
    sourceChainName?: string;
    /**Amount of equity */
    assetNumber: bigint;
    /**The amount of equity and event volume at the end of the last round */
    penultimateRoundInfo?: RoundInfoModel;
    /**The amount of equity and event volume at the end of the previous round */
    lastRoundInfo?: RoundInfoModel;
};

BFChainPC.ApiRequest.TRANSACTION.TrCommonParam

interface TrCommonParam {
    /**Public key of the initiating account */
    publicKey: string;
    /**The security public key of the initiating account */
    secondPublicKey?: string;
    /**The receiving account address of the event, base58-encoded hexadecimal string */
    recipientId?: string;
    /**The receiving range type of the event can only be one of 0, 1, 2, 4, 0 means that the operating range is not limited, 1 means that only the specified account address can operate on this event, 2 means that only specified The dappid can operate on this event, 4 means that only the specified bit name can operate on this event, the default is 0 */
    rangeType?: number;
    /**Event receiving range. When rangeType is 0, no data can be filled in. When rangeType is 1, only account address can be filled in. When rangeType is 2, only dappid can be filled in. When rangeType is 4, only dappid can be filled in. Fill in the name, the default is empty*/
    range?: string[];
    /**Event handling fee */
    fee: string;
    /**The launch height of the event, composed of 0-9 and no dots, optional, the latest height of the current blockchain is used by default */
    applyBlockHeight: number;
    /**Event remarks information, as a json object */
    remark?: {
        [key: string]: string;
    };
    /**The dappid to which the event belongs, uppercase letters or numbers, 8 characters, the default is empty */
    dappid?: string;
    /**The bit name to which the event belongs, 2-1024 characters, the maximum length of each level name is 128 characters, the first level bit name can only be composed of lowercase letters, and the beginning and end of the second level and above can only be composed of lowercase letters or It is composed of numbers, which can contain an underscore. The root name must be the chain name of the chain. It is optional. The default is empty*/
    lns?: string;
    /**The source IP of the event, IPv4 or IPv6, does not include the header and the end (for example: 127.0.0.1), the default is empty */
    sourceIP?: string;
    /**The network identifier of the source chain of the event, composed of uppercase letters or numbers, 5 characters, and the magic of the genesis block is used by default */
    fromMagic?: string;
    /**The destination chain network identifier of the event, composed of uppercase letters or numbers, 5 characters, the magic of the genesis block is used by default */
    toMagic?: string;
    /**The expiration block interval of the event, the maximum expiration time parameter of the genesis block is used by default, which is composed of 0-9 and does not contain a decimal point */
    numberOfEffectiveBlocks?: number;
}

BFChainCore.TransferAssetAssetJSON

interface TransferAssetAssetJSON {
    /** Information attached to the equity transfer event */
    transferAsset: TransferAssetJSON;
}

BFChainCore.TransferAssetJSON

interface TransferAssetJSON {
    /**The chain name of the transferred equity, composed of lowercase letters, 3-8 digits */
    sourceChainName: string;
    /**The network identifier of the chain to which the transferred equity belongs, composed of uppercase letters or numbers, 5 characters, and the last digit is the check digit */
    sourceChainMagic: string;
    /**Name of the transferred equity, composed of uppercase letters, 3-5 characters */
    assetType: string;
    /**The amount of transferred equity, composed of 0-9 and excluding the decimal point, must be greater than 0 */
    amount: string;
}

BFChainCore.SignatureAssetJSON

interface SignatureAssetJSON {
    /**Set the security password event with information */
    signature: SignatureJSON;
}

BFChainCore.SignatureJSON

interface SignatureJSON {
    /**The public key generated by the security key, a 128-byte hexadecimal string */
    publicKey: string;
}

BFChainCore.UsernameAssetJSON

interface UsernameAssetJSON {
    /**Information attached to the address name event */
    username: UsernameJSON;
}

BFChainCore.UsernameJSON

interface UsernameJSON {
    /**User name string, composed of uppercase and lowercase letters, numbers, and underscores, 1-20 characters, cannot contain this chain name */
    alias: string;
}

BFChainCore.DelegateAssetJSON

interface DelegateAssetJSON {

BFChainCore.AcceptVoteAssetJSON

interface AcceptVoteAssetJSON {

BFChainCore.RejectVoteAssetJSON

interface RejectVoteAssetJSON {

BFChainCore.VoteAssetJSON

interface VoteAssetJSON {
    /** Information attached to the voting event */
    vote: VoteJSON;
}

BFChainCore.VoteJSON

interface VoteJSON {
    /**The number of equity voted, composed of 0-9 and excluding the decimal point, allowed to be 0 */
    equity: string;
}

BFChainCore.DAppAssetJSON

interface DAppAssetJSON {
    /**Information attached to dapp release event */
    dapp: DAppJSON;
}

BFChainCore.DAppJSON

interface DAppJSON {
    /**The chain name that dappid belongs to, composed of lowercase letters, 3-8 digits */
    sourceChainName: string;
    /**The chain network identifier that dappid belongs to, composed of uppercase letters or numbers, 5 characters, and the last digit is the check digit */
    sourceChainMagic: string;
    /**dappid, composed of uppercase letters or numbers, 8 characters, the last digit is the check digit */
    dappid: string;
    /**The type of dappid can only be 0 or 1; 0 means this dappid is paid for use, 1 means this dappid is free to use */
    type: BFChainCore.DAPP_TYPE;
    /**Purchase the rights and interests used by dappid */
    purchaseAsset?: DAppPurchaseAssetJSON;
}

BFChainCore.DAPP_TYPE

enum DAPP_TYPE {
  /**Paid apps */
  PAID_APP = 0, // "PAID_APP",
  /**Free app */
  FREE_APP = 1, // "FREE_APP",
}

BFChainCore.DAppPurchaseAssetJSON

interface DAppPurchaseAssetJSON {
    /**The name of the chain to which the right to use dappid belongs, composed of lowercase letters, 3-8 digits */
    sourceChainName: string;
    /**The DAPPID payment chain network identifier of the purchase dappid usage right, composed of uppercase letters or numbers, 5 characters, the last digit is the check digit */
    sourceChainMagic: string;
    /**The name of the right to purchase the right to use dappid, composed of uppercase letters, 3-5 characters */
    assetType: string;
    /**The number of rights and interests required to purchase the right to use dappid (if dappid is a paid application, it must be carried, if it is a free application, it does not need to be carried), composed of 0-9 and excluding decimal points, must be greater than 0 */
    amount: string;
}

BFChainCore.DAppPurchasingAssetJSON

interface DAppPurchasingAssetJSON {
    /**Information attached to dapp purchase event */
    dappPurchasing: DAppPurchasingJSON;
}

BFChainCore.DAppPurchasingJSON

interface DAppPurchasingJSON {
    /**Purchased dapp information */
    dappAsset: DAppJSON;
}

BFChainCore.MarkAssetJSON

interface MarkAssetJSON {
    /**Information attached to the deposit event */
    mark: MarkJSON;
}

BFChainCore.MarkJSON

interface MarkJSON { 
    /**Certificate content, any string */
    content: string;
    /**Certificate type, which is an arbitrary string, used to distinguish the certificate of deposit */
    action: string;
    /**Dapp information used by the deposit event */
    dapp: DAppJSON;
}

BFChainCore.IssueAssetAssetJSON

interface IssueAssetAssetJSON {
    /** Information attached to the issue of equity event */
    issueAsset: IssueAssetJSON;
}

BFChainCore.IssueAssetJSON

interface IssueAssetJSON {
    /**The name of the chain to which the equity belongs, composed of lowercase letters, 3-8 digits */
    sourceChainName: string;
    /**The network identifier of the chain to which the equity belongs, composed of uppercase letters or numbers, 5 characters, and the last digit is the check digit */
    sourceChainMagic: string;
    /**Name of equity, composed of uppercase letters, 3-5 characters */
    assetType: string;
    /**Total number of new equity issued. The number of equity consists of ten numbers from 0-9. The number of equity does not include a decimal point and must be greater than 0 */
    expectedIssuedAssets: string;
}

BFChainCore.DestoryAssetAssetJSON

interface DestoryAssetAssetJSON {
    /**Information attached to the event of equity destruction */
    destoryAsset: DestoryAssetJSON;
}

BFChainCore.DestoryAssetJSON

interface DestoryAssetJSON {
    /**Chain name of the destroyed equity, composed of lowercase letters, 3-8 digits */
    sourceChainName: string;
    /**The network identifier of the chain to which the destroyed equity belongs, composed of uppercase letters or numbers, 5 characters, and the last digit is the check digit */
    sourceChainMagic: string;
    /**Destroyed equity name, composed of uppercase letters, 3-5 characters */
    assetType: string;
    /**The amount of equity to be destroyed, composed of 0-9 and excluding the decimal point, must be greater than 0 */
    amount: string;
}

BFChainCore.ToExchangeAssetAssetJSON

interface ToExchangeAssetAssetJSON {
    /**Initiation of the rights exchange event with information */
    toExchangeAsset: ToExchangeAssetJSON;
}

BFChainCore.ToExchangeAssetJSON

interface ToExchangeAssetJSON {
    /**The public key array generated by the encryption key */
    cipherPublicKeys: string[];
    /**The network identifier of the equity source chain used for exchange, composed of uppercase letters or numbers, 5 characters, and the last digit is the check digit */
    toExchangeSource: string;
    /**The network identifier of the equity source chain to be exchanged, consisting of uppercase letters or numbers, 5 characters, and the last digit is the check digit */
    beExchangeSource: string;
    /**The name of the equity source chain used for exchange, composed of lowercase letters, 3-8 digits */
    toExchangeChainName: string;
    /**The name of the equity source chain to be exchanged, composed of lowercase letters, 3-8 digits */
    beExchangeChainName: string;
    /**The equity name used for exchange, composed of uppercase letters, 3-5 characters */
    toExchangeAsset: string;
    /**The name of the equity to be exchanged, composed of uppercase letters, 3-5 characters */
    beExchangeAsset: string;
    /**The amount of equity used for exchange, composed of 0-9 and excluding the decimal point, must be greater than 0 */
    toExchangeNumber: string;
    /**The exchange ratio of equity */
    exchangeRate: BFChainCore.RateJSON<string>;
}

BFChainCore.RateJSON

interface RateJSON<T extends number | bigint | string = number> {
    /**Front weight */
    prevWeight: T;
    /**Back weight */
    nextWeight: T;
}

BFChainCore.BeExchangeAssetAssetJSON

interface BeExchangeAssetAssetJSON {
    /**Receive information attached to the rights exchange event */
    beExchangeAsset: BeExchangeAssetJSON;
}

BFChainCore.BeExchangeAssetJSON

interface BeExchangeAssetJSON {
    /**The event signature that initiated the equity exchange, a 128-byte hexadecimal string */
    transactionSignature: string;
    /**Signature array generated by encryption key */
    ciphertextSignature?: AccountSignatureJSON;
    /**The amount of equity used for exchange. The amount of equity consists of ten numbers from 0-9. The amount of equity does not include a decimal point and must be greater than 0 */
    toExchangeNumber: string;
    /**The amount of equity obtained by the exchange, the amount of equity is composed of a total of ten numbers from 0-9, the amount of equity does not include the decimal point and must be greater than 0 */
    beExchangeNumber: string;
    /**Equity Exchange Information */
    exchangeAsset: ToExchangeAssetJSON;
}

BFChainCore.AccountSignatureJSON

interface AccountSignatureJSON {
    /**Public key generated by account key */
    publicKey: string;
    /**Signature generated by account public key */
    signature: string;
    /**Public key generated by account security key */
    secondPublicKey?: string;
    /**Signature generated by account security public key */
    signSignature?: string;
}

BFChainCore.ToExchangeSpecialAssetAssetJSON

interface ToExchangeSpecialAssetAssetJSON {
    /**Initiation of asset exchange event with information */
    toExchangeSpecialAsset: ToExchangeSpecialAssetJSON;
}

BFChainCore.ToExchangeSpecialAssetJSON

interface ToExchangeSpecialAssetJSON {
    /**The public key array generated by the encryption key */
    cipherPublicKeys: string[];
    /**The network identifier of the equity/asset source chain used for exchange, composed of uppercase letters or numbers, 5 characters, and the last digit is the check digit */
    toExchangeSource: string;
    /**The network identifier of the asset/equity source chain to be exchanged, consisting of uppercase letters or numbers, 5 characters, and the last digit is the check digit */
    beExchangeSource: string;
    /**The name of the equity/asset source chain used for exchange, composed of lowercase letters, 3-8 digits */
    toExchangeChainName: string;
    /**The name of the asset/equity source chain to be exchanged, composed of lowercase letters, 3-8 digits */
    beExchangeChainName: string;
    /**The equity/asset name used for exchange, composed of uppercase letters, 3-5 characters */
    toExchangeAsset: string;
    /**The name of the asset/equity being exchanged, composed of uppercase letters, 3-5 characters */
    beExchangeAsset: string;
    /**The amount of equity used for exchange or exchange. The amount of equity consists of ten numbers from 0-9. The amount of equity does not include a decimal point and must be greater than 0 */
    exchangeNumber: string;
    /**The type of asset, it can only be 0 or 1, 0 is dappid, 1 is bit name */
    exchangeAssetType: BFChainCore.SPECIAL_ASSET_TYPE;
    /**The source of the asset can only be 0 or 1, 0 is for sale, 1 is for purchase */
    exchangeDirection: BFChainCore.EXCHANGE_DIRECTION;
}

BFChainCore.SPECIAL_ASSET_TYPE

enum SPECIAL_ASSET_TYPE {
  /**Special asset type: dapp */
  DAPP_ID,
  /**Special asset type: chain domain name */
  LOCATION_NAME,
}

BFChainCore.EXCHANGE_DIRECTION

enum EXCHANGE_DIRECTION {
  /**Special assets come from the originating account of the to transaction, that is, sold */
  ASSET_FROM_SENDER = 0,
  /**The special asset comes from the initiating account of the be transaction, that is, the purchase */
  ASSET_FROM_RECIPIENT = 1,
}

BFChainCore.BeExchangeSpecialAssetAssetJSON

interface BeExchangeSpecialAssetAssetJSON {
    /** Receive information accompanying asset exchange events */
    beExchangeSpecialAsset: BeExchangeSpecialAssetJSON;
}

BFChainCore.BeExchangeSpecialAssetJSON

interface BeExchangeSpecialAssetJSON { 
    /** Event signature for initiating asset exchange, 128-byte hexadecimal string */
    transactionSignature: string;
    /**Signature array generated by encryption key */
    ciphertextSignature?: AccountSignatureJSON;
    /**Asset Exchange Information */
    exchangeSpecialAsset: ToExchangeSpecialAssetJSON;
}

BFChainCore.GiftAssetAssetJSON

interface GiftAssetAssetJSON {
    /** Information attached to the gift event */
    giftAsset: GiftAssetJSON;
}

BFChainCore.GiftAssetJSON

interface GiftAssetJSON {
    /**The public key array generated by the encryption key */
    cipherPublicKeys: string[];
    /**The name of the chain to which the donated rights belong, composed of lowercase letters, 3-8 digits */
    sourceChainName: string;
    /**The network identifier of the chain to which the gift belongs, composed of uppercase letters or numbers, 5 characters, and the last digit is the check digit */
    sourceChainMagic: string;
    /**The gift name, composed of uppercase letters, 3-5 characters */
    assetType: string;
    /**The amount of gifted rights, composed of 0-9 and excluding the decimal point, must be greater than 0 */
    amount: string;
    /**The number of times that can be received, composed of 0-9 and excluding the decimal point, must be greater than 0 */
    totalGrabableTimes: number;
    /**The height of the block to be signed at the beginning, composed of 0-9 and excluding the decimal point */
    beginUnfrozenBlockHeight?: number;
    /**Receiving rules can only be 0, 1 or 2, 0 means even distribution, 1 means random distribution according to the address of any account, 2 means random distribution according to the account address in the recipient list */
    giftDistributionRule: BFChainCore.GIFT_DISTRIBUTION_RULE;
}

BFChainCore.GIFT_DISTRIBUTION_RULE

enum GIFT_DISTRIBUTION_RULE {
  /**equally distributed */
  AVERAGE,
  /**According to the random allocation method of the address of any account */
  RANDOM,
  /**According to the random allocation method of the account address in the recipient list
   * This rule will ensure that the donated assets are distributed as much as possible, and ensure that each receiving account has the amount that can be received
   */
  RECIPIENT_RANDOM,
};

BFChainCore.GrabAssetAssetJSON

interface GrabAssetAssetJSON {
    /**Receive the information attached to the gift event */
    grabAsset: GrabAssetJSON;
}

BFChainCore.GrabAssetJSON

interface GrabAssetJSON {
    /**The signature of the block where the event is presented, a 128-byte hexadecimal string */
    blockSignature: string;
    /**The signature of the gift event, a 128-byte hexadecimal string */
    transactionSignature: string;
    /**Calculated according to the consensus rules: the amount grabbed */
    amount: string;
    /**Cryptographic signature used to verify identity, if needed */
    ciphertextSignature?: AccountSignatureJSON;
    /**The following are redundant fields
     * All can be queried from `transactionSignature`, but this is still stored, to ensure that it can still be rendered in an independent situation
     */
    /**Gift configuration */
    giftAsset: GiftAssetJSON;
}

BFChainCore.TrustAssetAssetJSON

interface TrustAssetAssetJSON {
    /**Information attached to the witness event */
    trustAsset: TrustAssetJSON;
}

BFChainCore.TrustAssetJSON

interface TrustAssetJSON {
    /** Witness account address array, base58-encoded hexadecimal string array */
    trustees: string[];
    /**The number of witness signatures required when signing for receipt, consisting of 0-9, must be greater than 0, and the maximum value is the number of designated trustees + 2 */
    numberOfSignFor: number;
    /**The chain name of the witnessed equity, composed of lowercase letters, 3-8 digits */
    sourceChainName: string;
    /**The network identifier of the chain to which the witnessed equity belongs, composed of uppercase letters or numbers, 5 characters, and the last digit is the check digit */
    sourceChainMagic: string;
    /**The witness's equity name, composed of uppercase letters, 3-5 characters */
    assetType: string;
    /**The number of witnessed equity, composed of 0-9 and excluding the decimal point, must be greater than 0 */
    amount: string;
}

BFChainCore.SignForAssetAssetJSON

interface SignForAssetAssetJSON {
    /**Sign for the incidental information of the witness event */
    signForAsset: SignForAssetJSON;
}

BFChainCore.SignForAssetJSON

interface SignForAssetJSON {
    /**Signature to witness the transaction,*/
    transactionSignature: string;
    /**The address of the initiating account of the witness transaction, a base58-encoded hexadecimal string */
    trustSenderId: string;
    /**The receiving account address of the witness transaction, base58-encoded hexadecimal string */
    trustRecipientId: string;
    /** Witness information */
    trustAsset: TrustAssetJSON;
}

BFChainCore.EmigrateAssetAssetJSON

interface EmigrateAssetAssetJSON {
    /**Information attached to the right to move out event */
    emigrateAsset: EmigrateAssetJSON;
}

BFChainCore.EmigrateAssetJSON

interface EmigrateAssetJSON {
    /**Generation Trustee Signature */
    genesisDelegateSignature: AccountSignatureJSON;
    /**Chain name of the rights and interests to be moved out, composed of lowercase letters, 3-8 digits */
    sourceChainName: string;
    /**The chain network identifier of the rights and interests to be moved out, composed of uppercase letters or numbers, 5 characters, and the last digit is the check digit */
    sourceChainMagic: string;
    /**The name of the right to move out, composed of uppercase letters, 3-5 characters */
    assetType: string;
    /**The number of rights to move out, composed of 0-9 and excluding the decimal point, must be greater than 0 */
    amount: string;
}

BFChainCore.ImmigrateAssetAssetJSON

interface ImmigrateAssetAssetJSON {
    /**Information attached to the transfer of rights and interests */
    immigrateAsset: ImmigrateAssetJSON;
}

BFChainCore.ImmigrateAssetJSON

interface ImmigrateAssetJSON {
    /**Generation Trustee Signature */
    genesisDelegateSignature: AccountSignatureJSON;
    /**Complete main rights relocation event */
    emigrateAssetTransaction: EmigrateAssetTransactionJSON;
}

BFChainCore.EmigrateAssetTransactionJSON

type EmigrateAssetTransactionJSON = TransactionMixJSON<EmigrateAssetAssetJSON, {
    hasRecipientId: false;
}>;

BFChainCore.LocationNameAssetJSON

interface LocationNameAssetJSON {
    /**Information attached to the name event of registration/deregistration */
    locationName: LocationNameJSON;
}

BFChainCore.LocationNameJSON

interface LocationNameJSON {
    /**The name of the registration/deregistration, 2-1024 characters, the maximum length of each level domain name is 128 characters, the first level domain name can only be composed of lowercase letters, and the beginning and end of the second level and above can only be lowercase letters or numbers It can contain an underscore in the middle, and the root domain name must be the chain name of this chain*/
    name: string;
    /**Registered/Unregistered Bit Name Source Chain Name, composed of lowercase letters, 3-8 digits */
    sourceChainName: string;
    /**Registered/Unregistered bit name source chain network identifier, composed of uppercase letters or numbers, 5 characters, the last digit is the check digit */
    sourceChainMagic: string;
    /**Operation type, it can only be 0 or 1, 0 means registration position name, 1 means deregistration position name */
    operationType: BFChainCore.LOCATION_NAME_OPERATION_TYPE;
}

BFChainCore.LOCATION_NAME_OPERATION_TYPE

enum LOCATION_NAME_OPERATION_TYPE {
  /**Register lns */
  REGISTRATION,
  /**Logout */
  CANCELLATION,
};

BFChainCore.SetLnsManagerAssetJSON

interface SetLnsManagerAssetJSON {
    /**Set additional information for the name manager event */
    lnsManager: SetLnsManagerJSON;
}

BFChainCore.SetLnsManagerJSON

interface SetLnsManagerJSON {
    /**Bit name, 2-1024 characters, the maximum length of each level domain name is 128 characters, the first level domain name can only be composed of lowercase letters, the beginning and end of the second level and above can only be composed of lowercase letters or numbers, and the middle can be Contains an underscore, the root domain name must be the chain name of this chain*/
    name: string;
    /**Bit name source chain name, composed of lowercase letters, 3-8 digits */
    sourceChainName: string;
    /**Bit name source chain network identifier, composed of uppercase letters or numbers, 5 characters, the last digit is the check digit */
    sourceChainMagic: string;
}

BFChainCore.SetLnsRecordValueAssetJSON

interface SetLnsRecordValueAssetJSON {
    /**Set additional information for bit name resolution value event */
    lnsRecordValue: SetLnsRecordValueJSON;
}

BFChainCore.SetLnsRecordValueJSON

interface SetLnsRecordValueJSON {
    /**Bit name, 2-1024 characters, the maximum length of each level domain name is 128 characters, the first level domain name can only be composed of lowercase letters, the beginning and end of the second level and above can only be composed of lowercase letters or numbers, and the middle can be Contains an underscore, the root domain name must be the chain name of this chain*/
    name: string;
    /**Bit name source chain name, composed of lowercase letters, 3-8 digits */
    sourceChainName: string;
    /**Bit name source chain network identifier, composed of uppercase letters or numbers, 5 characters, the last digit is the check digit */
    sourceChainMagic: string;
    /**Operation type, can only be 0 or 1 or 2, 0 means add, 1 means delete, 2 means update */
    operationType: BFChainCore.RECORD_OPERATION_TYPE;
    /**Added analytical value, the analytical value type can only be A or AAAA or LNG_LAT or BLOCK_CHAIN_ACCOUNT_ADDRESS, A means ipV4, AAAA means ipV6, LNG_LAT means latitude and longitude, BLOCK_CHAIN_ACCOUNT_ADDRESS means the address of the chain account, the underscore is the analytic value type, underscore The following is the analytical value, optional, required when the operation type is 0 or 2*/
    addRecord?: LocationNameRecordJSON;
    /**Deleted analytical value, the analytical value type can only be A or AAAA or LNG_LAT or BLOCK_CHAIN_ACCOUNT_ADDRESS, A means ipV4, AAAA means ipV6, LNG_LAT means latitude and longitude, BLOCK_CHAIN_ACCOUNT_ADDRESS means the address of the chain account, the underscore is the analytic value type, underscore The following is the analytical value, optional, required when the operation type is 1 or 2*/
    deleteRecord?: LocationNameRecordJSON;
}

BFChainCore.RECORD_OPERATION_TYPE

enum RECORD_OPERATION_TYPE {
  /**Add analytic value */
  ADD,
  /**Delete parsed value */
  DELETE,
  /**Update parsed value */
  UPDATE,
};

BFChainCore.LocationNameRecordJSON

interface LocationNameRecordJSON {
    /**Analysis value type */
    recordType: BFChainCore.RECORD_TYPE;
    /**Analytical value */
    recordValue: string;
}

BFChainCore.RECORD_TYPE

enum RECORD_TYPE {
  /**IPV4 resolution */
  IPV4 = "A",
  /**IPV6 resolution */
  IPV6 = "AAAA",
  /**Longitude and latitude resolution */
  LNG_LAT = "LNG_LAT",
  /**Account address resolution */
  ADDRESSV1 = "BLOCK_CHAIN_ACCOUNT_ADDRESS",
};

BFChainCore.RegisterChainAssetJSON

interface RegisterChainAssetJSON {
    registerChain: RegisterChainJSON;
}

BFChainCore.RegisterChainJSON

interface RegisterChainJSON {
    genesisBlock: BlockJSON<GenesisBlockAssetJSON>;
}

BFChainCore.BlockJSON

interface BlockJSON<AssetJSON extends object = object> extends BlockWithoutTransactionJSON<AssetJSON> {
    /**Event */
    transactions: TransactionInBlockJSON[];
}

BFChainCore.BlockWithoutTransactionJSON

interface BlockWithoutTransactionJSON<AssetJSON extends object = object> {
    /**Block version number */
    version: number;
    /**Block height */
    height: number;
    /**Block size */
    blockSize: number;
    /**Block timestamp */
    timestamp: number;
    /**Block signature */
    signature: string;
    /**Block security signature */
    signSignature?: string;
    /**Blacksmith gong'yao */
    generatorPublicKey: string;
    /**Forger's security public key */
    generatorSecondPublicKey?: string;
    /**Forger's rights */
    generatorEquity: string;
    /**Number of block events */
    numberOfTransactions: number;
    /**Block event summary */
    payloadHash: string;
    /**Block event summary length */
    payloadLength: number;
    /**Previous block signature */
    previousBlockSignature: string;
    /**Total amount of assets incurred */
    totalAmount: string;
    /**Total handling fees incurred */
    totalFee: string;
    /**Block reward value */
    reward: string;
    /**Chain identifier of the block */
    magic: string;
    /**Block participation */
    blockParticipation: string;
    /**Block remarks information */
    remark: {
        [key: string]: string;
    };
    /**Block additional information */
    asset: AssetJSON;
    /**Block statistics */
    statisticInfo: StatisticInfoJSON;
    /**List of Forgers dropped */
    roundOfflineGeneratersHashMap: RoundOfflineGeneratersHashMap;
}

BFChainCore.GenesisBlockAssetJSON

interface GenesisBlockAssetJSON {
    /**Information attached to the genesis block */
    genesisAsset: GenesisAssetJSON;
}

BFChainCore.GenesisAssetJSON

interface GenesisAssetJSON extends RoundDelegateJSON { 
    /**Chain name */
    chainName: string;
    /**Chain owner equity name */
    assetType: string;
    /**Chain network identifier */
    magic: string;
    /**Chain network type, can only be'b' or'c', b is the official network, and c is the test network */
    bnid: string;
    /**Chain creation time */
    beginEpochTime: number;
    /**Chain creation name */
    genesisLocationName: string;
    /**The amount of main equity initially held by the chain creation account */
    genesisAmount: string;
    /**Minimum fee for each byte of chain event */
    minTransactionFeePerByte: FractionJSON;
    /**Maximum bytes of event body on chain */
    maxTransactionSize: number;
    /**The maximum number of bytes of the block body on the chain */
    maxBlockSize: number;
    /**The largest event processed by the block on the chain tps */
    maxTPSPerBlock: number;
    /**The minimum height required to lag behind when deleting a fork */
    consessusBeforeSyncBlockDiff: number;
    /**Number of registered trustees that can be processed in each round */
    maxDelegateTxsPerRound: number;
    /**Maximum number of times that can be grabbed for rights gift event */
    maxGrabTimesOfGiftAsset: number;
    /**The minimum amount of chain owner's equity held by the account issuing equity */
    issueAssetMinChainAsset: string;
    /**The minimum amount of main equity held by the account registered for the genesis block */
    registerChainMinChainAsset: string;
    /**Maximum number of expiration block intervals */
    maxApplyAndConfirmedBlockHeightDiff: number;
    /**Number of blocks per round */
    blockPerRound: number;
    /**Number of Genesis Trustees */
    delegates: number;
    /**Whether the trustee is allowed to continuously participate in the election */
    whetherToAllowDelegateContinusElections: boolean;
    /**Block interval */
    forgeInterval: number;
    /**Reward distribution ratio, JSON object */
    rewardPercent: RewardPercentJSON;
    /**Blockchain port number, JSON object */
    ports: PortsJSON;
    /**Block reward, JSON object */
    rewardPerBlock: RewardPerBlockJSON;
    /**Account participation weight ratio, JSON object */
    accountParticipationWeightRatio: AccountParticipationWeightRatioJSON;
    /**Block participation weight ratio, JSON object */
    blockParticipationWeightRatio: BlockParticipationWeightRatioJSON;
    /**The difficulty of constructing tpow */
    averageComputingPower: number;
    /**Block height for tpow exemption */
    tpowOfWorkExemptionBlocks: number;
    /**tpow configuration, JSON object */
    transactionPowOfWorkConfig: TransactionPowOfWorkConfigJSON;
}

BFChainCore.RoundDelegateJSON

interface RoundDelegateJSON {
    /**The next round of block-blocking account list */
    nextRoundDelegates: NextRoundDelegateJSON[];
    /**Newly registered trustee */
    newDelegates: string[];
    /**The maximum amount of main equity at the end of the previous round of voting in the account */
    maxBeginBalance: string;
    /**The largest amount of events in the last round of voting accounts */
    maxTxCount: number;
    /**The ratio of the maximum amount of main equity at the end of the previous round of voting accounts to the maximum event of the previous round of voting accounts */
    rate: string;
}

BFChainCore.NextRoundDelegateJSON

interface NextRoundDelegateJSON {
    /**Account address of the trustee */
    address: string;
    /**The rights and interests obtained by the trustee in the previous round */
    equity: string;
}

BFChainCore.FractionJSON

interface FractionJSON<T extends number | bigint | string = number> {
    /**Molecule */
    numerator: T;
    /** Denominator */
    denominator: T;
}

BFChainCore.RewardPercentJSON

interface RewardPercentJSON {
    /**Vote as a percentage of the total block reward */
    votePercent: FractionJSON;
    /**Blocking as a percentage of the total block reward */
    forgePercent: FractionJSON;
}

BFChainCore.PortsJSON

interface PortsJSON {
    /**Consensus port number */
    port: number;
    /**Node scan port number */
    scan_peer_port: number;
}

BFChainCore.RewardPerBlockJSON

interface RewardPerBlockJSON {
    /**Block mileage for reward changes */
    readonly heights: number[];
    /**The number of assets rewarded by each block mileage */
    readonly rewards: string[];
}

BFChainCore.AccountParticipationWeightRatioJSON

interface AccountParticipationWeightRatioJSON {
    /**The weight of the main equity amount held by the account at the end of the previous round */
    balanceWeight: number;
    /**The weight of the last round of events on the account */
    numberOfTransactionsWeight: number;
}

BFChainCore.BlockParticipationWeightRatioJSON

interface BlockParticipationWeightRatioJSON {
    /**The weight of the main equity amount packaged in the block */
    balanceWeight: number;
    /**The weight of the amount of events packaged by the block */
    numberOfTransactionsWeight: number;
}

BFChainCore.TransactionPowOfWorkConfigJSON

interface TransactionPowOfWorkConfigJSON {
    /**Chain's pow difficulty growth coefficient */
    growthFactor: FractionJSON<string>;
    /**The pow of the chain calculates the participation rate */
    participationRatio: FractionJSON;
}

BFChainCore.StatisticInfoJSON

interface StatisticInfoJSON {
    /**Total handling fee for events packaged by the block */
    totalFee: string;
    /**The total equity value of the event packaged by the block (without distinguishing the equity type) */
    totalAsset: string;
    /**The total main equity value of the event packaged by the block */
    totalChainAsset: string;
    /**The total number of accounts involved in the event packaged by the block */
    totalAccount: number;
    /**Statistic details of event equity type packaged by block, JSON object */
    assetStatisticHashMap: {
        [index: number]: AssetStatisticJSON;
    };
}

BFChainCore.AssetStatisticJSON

interface AssetStatisticJSON extends AssetInfoJSON {
    /** Index of equity in the block */
    index: number;
    /**Statistics of event types of block packaging, JSON object */
    typeStatisticHashMap: {
        [baseType: number]: CountAndAmountStatisticJSON;
    };
    /**Statistics of event equity type packaged by block, JSON object */
    total: CountAndAmountStatisticJSON;
}

BFChainCore.AssetInfoJSON

type AssetInfoJSON = {
    /**The chain network identification to which the equity belongs, composed of uppercase letters or numbers, 5 characters, and the last digit is the check digit */
    magic: string;
    /**Name of equity, composed of uppercase letters, 3-5 characters */
    assetType: string;
};

BFChainCore.CountAndAmountStatisticJSON

interface CountAndAmountStatisticJSON {
    /**The total value of the change, the increase or decrease of an account will have an impact */
    changeAmount: string;
    /**The total number of changes, the increase or decrease of an account will have an impact */
    changeCount: number;
    /**Total asset migration */
    moveAmount: string;
    /**Unified number of transactions */
    transactionCount: number;
}

BFChainCore.RoundOfflineGeneratersHashMap

interface RoundOfflineGeneratersHashMap {
    /**
     * Use comma separated addresses
     * address,address */
    [roundOffset: string]: string;
}

BFChainCore.TransactionInBlockJSON

interface TransactionInBlockJSON<T extends TransactionJSON = TransactionJSON> extends SomeTransactionJSON<T> {
    /**The index of the event in the block */
    index: number;
    /**Block height */
    height: number;
    /**The amount of events in the event originating account */
    numberOfSenderTransactions: number;
    /**Information on changes in account equity involved in the event */
    transactionAssetChanges: TransactionAssetChangeJSON[];
    /**The latest information about the rights and interests before the rights and interests are destroyed */
    assetPrealnum?: AssetPrealnumJSON;
    /** Signature of the block forger */
    signature: string;
    /**Security signature of the block forger */
    signSignature?: string;
}

BFChainCore.SomeTransactionJSON

interface SomeTransactionJSON<T extends TransactionJSON> {
    transaction: T;
}

BFChainCore.TransactionAssetChangeJSON

interface TransactionAssetChangeJSON {
    /**account type */
    accountType: number;
    /** Index of equity in the block */
    assetTypes: number;
    /**The latest equity holdings of the account */
    assetBalance: string;
}

BFChainCore.AssetPrealnumJSON

type AssetPrealnumJSON = {
    /**The number of remaining equity */
    remainAssetPrealnum: string;
    /**Number of frozen main equity */
    frozenMainAssetPrealnum: string;
};

BFChainPC.Config.ConfigRevisable

interface ConfigRevisable {
    /**Process parameter configuration */
    coreForProcess: {
        /**Whether to use the configured number of cores */
        forceUseConfig: boolean;
        /**Number of processes processing transactions */
        coreNumForDealTransaction: number;
        /**Number of processes processing the account */
        coreNumForMemInfo: number;
        /**Number of processes processing outstanding transactions */
        coreNumForUntreatedTrs: number;
    };
    /**Event parameters */
    transactionConfig: {
        /**Whether to receive votes */
        receiveVoteEnable: boolean;
        /**Maximum number of voting transactions that can be processed in each round */
        maxTransactionLimitForVote: number;
        /**Transaction limit of each block */
        transactionsLimitPerBlock: number;
        /**Minimum handling fee for miners */
        minFeePerByte: {
            /**Molecule */
            numerator: number;
            /** Denominator */
            denominator: number;
        };
        /**Maximum handling fee for the event, unit: B */
        maxFee: string;
        /**Automatic voting configuration */
        autoVote: AutoVoteModel;
    };
    /**File log configuration */
    logConfig: {
        /** Console output level: "error" | "warn" | "info" */
        consoleLogLevel: string;
        /**Log level: "error" | "warn" | "info" */
        fileLogLevel: string;
        /**Log file size limit (mb) */
        fileLogLimit: number;
        /**Number of copies divided when backing up the log */
        fileLogBackup: number;
        /**Whether to split by date */
        fileLogDateExpire: boolean;
        /**Log save days */
        fileLogDaysToKeep: number;
    };
    /**Startup parameter */
    startConfig: {
        /**Enable whether to block, true: start to block, false: stop to block */
        generateBlockEnable: boolean;
        /**Block mark */
        remark: string;
        /**Start with critical checkpoint */
        useCheckPoint: boolean;
        /**Key checkpoint retention rounds */
        numberOfReservedCheckPoint: number;
        /**Node initial connection ip */
        peers: string[];
        /**Maximum number of connections */
        maxChannelNumber: number;
    };
    /**Network Configuration */
    networkConfig: {
        /**Whether to enable grpc */
        grpcEnable: boolean;
    };
    /**Flow control configuration */
    flowControlConfig: {
        /**flow control */
        requestLimit: {
            /** Whether to open */
            enable: boolean;
            /**Total limit of visits */
            count: number;
            /**Maximum number of api visits */
            apiRequestInterface: {
                [apiName: string]: number;
            };
            /**Reset interval */
            time: number;
        };
        /**Total flow limit */
        flowRequestLimit: {
            enable: boolean;
            /**Total traffic limit */
            count: number;
            time: number;
        };
    };
    /**Disk Monitoring */
    diskMonitorConfig: {
        enable: boolean;
        /**Monitor disk path and configuration */
        clearPath: string[];
        /**Clean up when the disk space is insufficient x */
        clearWhenFreeSpaceLowerThan: number;
        /**Check interval */
        checkInterval: number;
        /**Clean up files with suffix xxx */
        clearWithSuffix?: string[];
        /**Files with suffix xxx will not be cleaned up */
        noClearWithSuffix?: string[];
        /**Files whose last modification time is greater than n milliseconds will not be cleaned up */
        noClearWithLastModifyTimeGreaterThen?: number;
    };
    /**Notification configuration */
    noticeConfig: {
        enable: boolean;
        /**Email sending conditions */
        sendCondition: {
            usageCPU: number;
            usageDisk: number;
            usageMemory: number;
            missedBlocks: number;
        };
        /** Email sending interval */
        sendIntervalTime: number;
    };
    /**Service market configuration */
    serviceConfig: {
        /**Whether to open the service market */
        serverMarketEnable: boolean;
        userMaxUploadNumber: number;
        uploadTokenExpireTime: number;
        remainTimeToClearUserSessoin: number;
    };
}

BFChainPC.Config.AutoVoteModel

type AutoVoteModel = {
    /**Whether to turn on automatic voting */
    enable: boolean;
    /**Whether to use configuration fee */
    useConfigFee: boolean;
    /**Automatic voting fee */
    fee: string;
    /**Whether to give priority to guarantee the number of recommenders */
    priorRecommendedNumber: boolean;
    /**Maximum number of referrals selected */
    maxNumberOfRecommended: number;
    /**Selected block range, the most recent 100 rounds */
    numberOfRounds: number;
    /**Online rate percentage */
    productivityPercent: number;
    /**The proportion of the number of blocks */
    forgedBlocksPercent: number;
    /**The proportion of packaged transactions */
    applyTxPercent: number;
    /**The percentage of votes in the previous round */
    votePercent: number;
    /**Proportion of new trustees */
    newDelegatePercent: number;
    /**Minimum account online rate that can be recommended */
    minBeSelectProductivity: number;
};

BFChainPC.Config.ConfigReadable

interface ConfigReadable extends ConfigRevisable {
     /**Chain port number */
    chainPort: ConfigPort;
}

BFChainPC.Config.ConfigPort

interface ConfigPort {
    /**Turnsever server port */
    turnserver: number;
    /**Port used by the database */
    mongodb: number;
    /**Node management use port */
    system_websocket_port: number;
    /**Process lock use port */
    clusterLock: number;
    /** Port used by grpc */
    grpc: number;
    /**Upgrade service port */
    update_service_port: number;
    /**Comlink use port */
    comlink_port: number;
}

BFChainCore.TransactionMixJSON

type TransactionMixJSON<AssetJSON extends object = object, Opts extends TransactionOptions = {}> = Opts["hasRecipientId"] extends true ? Omit<TransactionJSON<AssetJSON>, "recipientId"> & {
    recipientId: string;
} : Opts["hasRecipientId"] extends false ? Omit<TransactionJSON<AssetJSON>, "recipientId"> & {
    recipientId: undefined;
} : TransactionJSON<AssetJSON>;