@onflow/sdk
A collection of modules that make interacting with Flow easier.
Install
npm install --save @onflow/sdk
Usage
import * as sdk from "@onflow/sdk"
import * as t from "@onflow/types"
const ixBuilt = await sdk.build([
sdk.script`
pub fun main(): UFix64 {
let a = ${p => p.a}
let b = ${p => p.b}
return a + b
}
`,
sdk.params([sdk.param(5, t.UFix64, "a"), sdk.param(6, t.UFix64, "b")]),
])
const ixResolved = await sdk.resolve(ixBuild, [sdk.resolveParams])
const response = await sdk.send(ixResolved, {
node: "accessNode url",
})
const result = await sdk.decodeResponse(response, {
UFix64: v => BigInt(v),
})
console.log(result === 11n)
Exposes