Options
All
  • Public
  • Public/Protected
  • All
Menu

redstone-smartweave

Index

Type aliases

ArTransfer

ArTransfer: { target: string; winstonQty: string }

Type declaration

  • target: string
  • winstonQty: string

ArWallet

ArWallet: JWKInterface | "use_wallet"

ContractDefinition

ContractDefinition<State>: { initState: State; minFee: string; owner: string; src: string; srcTxId: string; txId: string }

contains all data and meta-data of the given contact.

Type parameters

  • State

Type declaration

  • initState: State
  • minFee: string
  • owner: string
  • src: string
  • srcTxId: string
  • txId: string

ContractInteraction

ContractInteraction<Input>: { caller: string; input: Input }

Type parameters

  • Input

Type declaration

  • caller: string
  • input: Input

ExecutionContext

ExecutionContext<State, Api>: { blockHeight: number; caller?: string; contract: Contract<State>; contractDefinition: ContractDefinition<State>; currentBlockData?: BlockData; currentNetworkInfo?: NetworkInfoInterface; evaluationOptions: EvaluationOptions; handler: Api; interactions: GQLEdgeInterface[]; smartweave: SmartWeave; sortedInteractions: GQLEdgeInterface[] }

current execution context of the contract - contains all elements that are required to call contract's code. This has been created to prevent some operations from loading certain data (eg. contract's definition - which is very time consuming) multiple times (eg. multiple calls to "loadContract" in "interactRead" in the current version of the SW SDK).

Type parameters

  • State

  • Api = unknown

Type declaration

HandlerFunction

HandlerFunction<State, Input, Result>: (state: State, interaction: ContractInteraction<Input>) => Promise<HandlerResult<State, Result>>

Type parameters

  • State

  • Input

  • Result

Type declaration

HandlerResult

HandlerResult<State, Result>: { result: Result; state: State }

Type parameters

  • State

  • Result

Type declaration

  • result: Result
  • state: State

InteractionResult

InteractionResult<State, Result>: HandlerResult<State, Result> & { errorMessage?: string; type: "ok" | "error" | "exception" }

Type parameters

  • State

  • Result

LogLevel

LogLevel: "fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silly"

Tags

Tags: { name: string; value: string }[]

Variables

Const defaultLoggerOptions

defaultLoggerOptions: ISettingsParam = ...

Const emptyTransfer

emptyTransfer: ArTransfer = ...

Functions

arrayToHex

  • arrayToHex(arr: Uint8Array): string

createTx

  • createTx(arweave: Arweave, wallet: ArWallet, contractId: string, input: any, tags: { name: string; value: string }[], target?: string, winstonQty?: string): Promise<Transaction>

getTag

  • getTag(tx: Transaction, name: string): any

Const sleep

  • sleep(ms: number): Promise<unknown>

Generated using TypeDoc