queryRaw
Allows you to submit scripts to query the blockchain and get raw response data.
Import
You can import the entire package and access the function:
_10import * as fcl from "@onflow/fcl"_10_10fcl.queryRaw(opts)
Or import directly the specific function:
_10import { queryRaw } from "@onflow/fcl"_10_10queryRaw(opts)
Usage
_15import * as fcl from '@onflow/fcl';_15_15const result = await fcl.queryRaw({_15 cadence: `_15 access(all) fun main(a: Int, b: Int, addr: Address): Int {_15 log(addr)_15 return a + b_15 }_15 `,_15 args: (arg, t) => [_15 arg(7, t.Int), // a: Int_15 arg(6, t.Int), // b: Int_15 arg('0xba1132bc08f82fe2', t.Address), // addr: Address_15 ],_15});
Parameters
opts
(optional)
- Type:
_10export interface QueryOptions {_10 cadence?: string_10 args?: ArgsFn_10 template?: any_10 isSealed?: boolean_10 limit?: number_10}
- Description: Query Options and configuration
Returns
Promise<any>
A promise that resolves to the raw query result