Submit and Retrieve a Payload
Submit a payload through an XL1 gateway and retrieve it through typed viewers.
Use a write-capable XL1 gateway for submission and its typed viewer surface for retrieval.
import { PayloadBuilder } from '@xyo-network/sdk'
import { GatewayBuilder } from '@xyo-network/xl1-sdk'Build and validate the application payload.
Obtain a write-capable gateway using a public browser-wallet provider or a server-side
GatewayBuilderwith an application-managed account.Submit through
gateway.addPayloadsToChain(...).Retain the returned transaction hash.
Retrieve the transaction through
gateway.connection.viewer?.transaction.byHash(hash).Validate every application payload body before using it.
Never call raw JSON-RPC method names and never use Ethereum RPC methods against XL1. Use the typed gateway and viewer APIs from @xyo-network/xl1-sdk.
Last updated