Options
All
  • Public
  • Public/Protected
  • All
Menu

Module muta-client-raw

Index

Type aliases

Block

Block: { hash: Scalars["Hash"]; header: BlockHeader; orderedTxHashes: Array<Scalars["Hash"]> }

Block is a single digital record created within a blockchain. Each block contains a record of the previous Block, and when linked together these become the “chain”.A block is always composed of header and body.

Type declaration

  • hash: Scalars["Hash"]

    Hash of the block

  • header: BlockHeader

    The header section of a block

  • orderedTxHashes: Array<Scalars["Hash"]>

    The body section of a block

BlockHeader

BlockHeader: { chainId: Scalars["Hash"]; confirmRoot: Array<Scalars["Hash"]>; cyclesUsed: Array<Scalars["Uint64"]>; execHeight: Scalars["Uint64"]; height: Scalars["Uint64"]; orderRoot: Scalars["Hash"]; orderSignedTransactionsHash: Scalars["Hash"]; prevHash: Scalars["Hash"]; proof: Proof; proposer: Scalars["Address"]; receiptRoot: Array<Scalars["Hash"]>; stateRoot: Scalars["Hash"]; timestamp: Scalars["Uint64"]; validatorVersion: Scalars["Uint64"]; validators: Array<Validator> }

A block header is like the metadata of a block.

Type declaration

  • chainId: Scalars["Hash"]

    Identifier of a chain in order to prevent replay attacks across channels

  • confirmRoot: Array<Scalars["Hash"]>

    The merkle roots of all the confirms

  • cyclesUsed: Array<Scalars["Uint64"]>

    The sum of all transactions costs

  • execHeight: Scalars["Uint64"]

    The height to which the block has been executed

  • height: Scalars["Uint64"]

    block height

  • orderRoot: Scalars["Hash"]

    The merkle root of ordered transactions

  • orderSignedTransactionsHash: Scalars["Hash"]

    The hash of ordered signed transactions

  • prevHash: Scalars["Hash"]

    The hash of the serialized previous block

  • proof: Proof
  • proposer: Scalars["Address"]

    The address descirbed who packed the block

  • receiptRoot: Array<Scalars["Hash"]>

    The merkle roots of receipts

  • stateRoot: Scalars["Hash"]

    The merkle root of state root

  • timestamp: Scalars["Uint64"]

    A timestamp that records when the block was created

  • validatorVersion: Scalars["Uint64"]

    The version of validator is designed for cross chain

  • validators: Array<Validator>

Event

Event: { data: Scalars["String"]; name: Scalars["String"]; service: Scalars["String"] }

Type declaration

  • data: Scalars["String"]
  • name: Scalars["String"]
  • service: Scalars["String"]

Exact

Exact<T>: {}

Type parameters

  • T: {}

Type declaration

GetBlockQuery

GetBlockQuery: { getBlock?: Maybe<{} & { header: {} & { proof: Pick<Proof, "bitmap" | "blockHash" | "height" | "round" | "signature">; validators: Array<Pick<Validator, "pubkey" | "proposeWeight" | "voteWeight">> } }> }

Type declaration

  • Optional getBlock?: Maybe<{} & { header: {} & { proof: Pick<Proof, "bitmap" | "blockHash" | "height" | "round" | "signature">; validators: Array<Pick<Validator, "pubkey" | "proposeWeight" | "voteWeight">> } }>

GetBlockQueryVariables

GetBlockQueryVariables: Exact<{ height?: Maybe<Scalars["Uint64"]> }>

GetReceiptQuery

GetReceiptQuery: { getReceipt?: Maybe<{} & { events: Array<Pick<Event, "data" | "name" | "service">>; response: {} & { response: Pick<ServiceResponse, "code" | "errorMessage" | "succeedData"> } }> }

Type declaration

  • Optional getReceipt?: Maybe<{} & { events: Array<Pick<Event, "data" | "name" | "service">>; response: {} & { response: Pick<ServiceResponse, "code" | "errorMessage" | "succeedData"> } }>

GetReceiptQueryVariables

GetReceiptQueryVariables: Exact<{ txHash: Scalars["Hash"] }>

GetTransactionQuery

GetTransactionQuery: { getTransaction?: Maybe<{} & {}> }

Type declaration

  • Optional getTransaction?: Maybe<{} & {}>

GetTransactionQueryVariables

GetTransactionQueryVariables: Exact<{ txHash: Scalars["Hash"] }>

InputRawTransaction

InputRawTransaction: { chainId: Scalars["Hash"]; cyclesLimit: Scalars["Uint64"]; cyclesPrice: Scalars["Uint64"]; method: Scalars["String"]; nonce: Scalars["Hash"]; payload: Scalars["String"]; sender: Scalars["Address"]; serviceName: Scalars["String"]; timeout: Scalars["Uint64"] }

There was many types of transaction in Muta, A transaction often require computing resources or write data to chain,these resources are valuable so we need to pay some token for them.InputRawTransaction describes information above

Type declaration

  • chainId: Scalars["Hash"]

    Identifier of the chain.

  • cyclesLimit: Scalars["Uint64"]

    Mostly like the gas limit in Ethereum, describes the fee that you are willing to pay the highest price for the transaction

  • cyclesPrice: Scalars["Uint64"]
  • method: Scalars["String"]
  • nonce: Scalars["Hash"]

    Every transaction has its own id, unlike Ethereum's nonce,the nonce in Muta is an hash

  • payload: Scalars["String"]
  • sender: Scalars["Address"]
  • serviceName: Scalars["String"]
  • timeout: Scalars["Uint64"]

    For security and performance reasons, Muta will only deal with trade request over a period of time,the timeout should be timeout > current_block_height and timeout < current_block_height + timeout_gap,the timeout_gap generally equal to 20.

InputTransactionEncryption

InputTransactionEncryption: { pubkey: Scalars["Bytes"]; signature: Scalars["Bytes"]; txHash: Scalars["Hash"] }

Signature of the transaction

Type declaration

  • pubkey: Scalars["Bytes"]

    The public key of transfer

  • signature: Scalars["Bytes"]

    The signature of the transaction

  • txHash: Scalars["Hash"]

    The digest of the transaction

Maybe

Maybe<T>: T | null

Type parameters

  • T

Mutation

Mutation: { sendTransaction: Scalars["Hash"]; unsafeSendTransaction: Scalars["Hash"] }

Type declaration

  • sendTransaction: Scalars["Hash"]

    send transaction

  • unsafeSendTransaction: Scalars["Hash"]
    deprecated

    DON'T use it in production! This is just for development.

MutationSendTransactionArgs

MutationSendTransactionArgs: { inputEncryption: InputTransactionEncryption; inputRaw: InputRawTransaction }

Type declaration

MutationUnsafeSendTransactionArgs

MutationUnsafeSendTransactionArgs: { inputPrivkey: Scalars["Bytes"]; inputRaw: InputRawTransaction }

Type declaration

Proof

Proof: { bitmap: Scalars["Bytes"]; blockHash: Scalars["Hash"]; height: Scalars["Uint64"]; round: Scalars["Uint64"]; signature: Scalars["Bytes"] }

The verifier of the block header proved

Type declaration

  • bitmap: Scalars["Bytes"]
  • blockHash: Scalars["Hash"]
  • height: Scalars["Uint64"]
  • round: Scalars["Uint64"]
  • signature: Scalars["Bytes"]

Query

Query: { getBlock?: Maybe<Block>; getReceipt?: Maybe<Receipt>; getTransaction?: Maybe<SignedTransaction>; queryService: ServiceResponse }

Type declaration

QueryGetBlockArgs

QueryGetBlockArgs: { height?: Maybe<Scalars["Uint64"]> }

Type declaration

  • Optional height?: Maybe<Scalars["Uint64"]>

QueryGetReceiptArgs

QueryGetReceiptArgs: { txHash: Scalars["Hash"] }

Type declaration

  • txHash: Scalars["Hash"]

QueryGetTransactionArgs

QueryGetTransactionArgs: { txHash: Scalars["Hash"] }

Type declaration

  • txHash: Scalars["Hash"]

QueryQueryServiceArgs

QueryQueryServiceArgs: { caller: Scalars["Address"]; cyclesLimit?: Maybe<Scalars["Uint64"]>; cyclesPrice?: Maybe<Scalars["Uint64"]>; height?: Maybe<Scalars["Uint64"]>; method: Scalars["String"]; payload: Scalars["String"]; serviceName: Scalars["String"] }

Type declaration

  • caller: Scalars["Address"]
  • Optional cyclesLimit?: Maybe<Scalars["Uint64"]>
  • Optional cyclesPrice?: Maybe<Scalars["Uint64"]>
  • Optional height?: Maybe<Scalars["Uint64"]>
  • method: Scalars["String"]
  • payload: Scalars["String"]
  • serviceName: Scalars["String"]

QueryServiceQuery

QueryServiceQuery: { queryService: Pick<ServiceResponse, "code" | "errorMessage" | "succeedData"> }

Type declaration

  • queryService: Pick<ServiceResponse, "code" | "errorMessage" | "succeedData">

QueryServiceQueryVariables

QueryServiceQueryVariables: Exact<{ caller: Scalars["Address"]; cycleLimit?: Maybe<Scalars["Uint64"]>; cyclePrice?: Maybe<Scalars["Uint64"]>; height?: Maybe<Scalars["Uint64"]>; method: Scalars["String"]; payload: Scalars["String"]; serviceName: Scalars["String"] }>

Receipt

Receipt: { cyclesUsed: Scalars["Uint64"]; events: Array<Event>; height: Scalars["Uint64"]; response: ReceiptResponse; stateRoot: Scalars["Hash"]; txHash: Scalars["Hash"] }

Type declaration

  • cyclesUsed: Scalars["Uint64"]
  • events: Array<Event>
  • height: Scalars["Uint64"]
  • response: ReceiptResponse
  • stateRoot: Scalars["Hash"]
  • txHash: Scalars["Hash"]

ReceiptResponse

ReceiptResponse: { method: Scalars["String"]; response: ServiceResponse; serviceName: Scalars["String"] }

Type declaration

  • method: Scalars["String"]
  • response: ServiceResponse
  • serviceName: Scalars["String"]

Scalars

Scalars: { Address: string; Boolean: boolean; Bytes: string; Float: number; Hash: string; ID: string; Int: number; String: string; Uint64: string }

All built-in and custom scalars, mapped to their actual values

Type declaration

  • Address: string

    20 bytes of account address

  • Boolean: boolean
  • Bytes: string

    Bytes corresponding hex string.

  • Float: number
  • Hash: string

    The output digest of Keccak hash function

  • ID: string
  • Int: number
  • String: string
  • Uint64: string

    Uint64

Sdk

Sdk: ReturnType<typeof getSdk>

SdkFunctionWrapper

SdkFunctionWrapper: <T>(action: () => Promise<T>) => Promise<T>

Type declaration

    • <T>(action: () => Promise<T>): Promise<T>
    • Type parameters

      • T

      Parameters

      • action: () => Promise<T>
          • (): Promise<T>
          • Returns Promise<T>

      Returns Promise<T>

SendTransactionMutation

SendTransactionMutation: Pick<Mutation, "sendTransaction">

SendTransactionMutationVariables

SendTransactionMutationVariables: Exact<{ inputEncryption: InputTransactionEncryption; inputRaw: InputRawTransaction }>

ServicePayloadFragment

ServicePayloadFragment: Pick<SignedTransaction, "serviceName" | "method" | "payload">

ServiceResponse

ServiceResponse: { code: Scalars["Uint64"]; errorMessage: Scalars["String"]; succeedData: Scalars["String"] }

Type declaration

  • code: Scalars["Uint64"]
  • errorMessage: Scalars["String"]
  • succeedData: Scalars["String"]

SignedTransaction

SignedTransaction: { chainId: Scalars["Hash"]; cyclesLimit: Scalars["Uint64"]; cyclesPrice: Scalars["Uint64"]; method: Scalars["String"]; nonce: Scalars["Hash"]; payload: Scalars["String"]; pubkey: Scalars["Bytes"]; sender: Scalars["Address"]; serviceName: Scalars["String"]; signature: Scalars["Bytes"]; timeout: Scalars["Uint64"]; txHash: Scalars["Hash"] }

Type declaration

  • chainId: Scalars["Hash"]
  • cyclesLimit: Scalars["Uint64"]
  • cyclesPrice: Scalars["Uint64"]
  • method: Scalars["String"]
  • nonce: Scalars["Hash"]
  • payload: Scalars["String"]
  • pubkey: Scalars["Bytes"]
  • sender: Scalars["Address"]
  • serviceName: Scalars["String"]
  • signature: Scalars["Bytes"]
  • timeout: Scalars["Uint64"]
  • txHash: Scalars["Hash"]

Validator

Validator: { proposeWeight: Scalars["Int"]; pubkey: Scalars["Bytes"]; voteWeight: Scalars["Int"] }

Validator address set

Type declaration

  • proposeWeight: Scalars["Int"]
  • pubkey: Scalars["Bytes"]
  • voteWeight: Scalars["Int"]

Variables

Const GetBlockDocument

GetBlockDocument: DocumentNode = gql`query getBlock($height: Uint64) {getBlock(height: $height) {header {chainIdconfirmRootcyclesUsedexecHeightheightorderRootorderSignedTransactionsHashprevHashproof {bitmapblockHashheightroundsignature}proposerreceiptRootstateRoottimestampvalidatorVersionvalidators {pubkeyproposeWeightvoteWeight}}orderedTxHasheshash}}`

Const GetReceiptDocument

GetReceiptDocument: DocumentNode = gql`query getReceipt($txHash: Hash!) {getReceipt(txHash: $txHash) {txHashheightcyclesUsedevents {datanameservice}stateRootresponse {serviceNamemethodresponse {codeerrorMessagesucceedData}}}}`

Const GetTransactionDocument

GetTransactionDocument: DocumentNode = gql`query getTransaction($txHash: Hash!) {getTransaction(txHash: $txHash) {...ServicePayloadnoncechainIdcyclesLimitcyclesPricetimeouttxHashpubkeysignaturesender}}${ServicePayloadFragmentDoc}`

Const QueryServiceDocument

QueryServiceDocument: DocumentNode = gql`query queryService($serviceName: String!, $method: String!, $payload: String!, $height: Uint64, $caller: Address!, $cyclePrice: Uint64, $cycleLimit: Uint64) {queryService(height: $height, serviceName: $serviceName, method: $method, payload: $payload, caller: $caller, cyclesPrice: $cyclePrice, cyclesLimit: $cycleLimit) {codeerrorMessagesucceedData}}`

Const SendTransactionDocument

SendTransactionDocument: DocumentNode = gql`mutation sendTransaction($inputRaw: InputRawTransaction!, $inputEncryption: InputTransactionEncryption!) {sendTransaction(inputRaw: $inputRaw, inputEncryption: $inputEncryption)}`

Const ServicePayloadFragmentDoc

ServicePayloadFragmentDoc: DocumentNode = gql`fragment ServicePayload on SignedTransaction {serviceNamemethodpayload}`

Functions

Const defaultWrapper

  • defaultWrapper(sdkFunction: () => Promise<T>): Promise<T>

getSdk

  • getSdk(client: GraphQLClient, withWrapper?: SdkFunctionWrapper): { getBlock: any; getReceipt: any; getTransaction: any; queryService: any; sendTransaction: any }

Generated using TypeDoc