Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@onflow/types
Advanced tools
Utilities to transform javascript values into Cadence understandable values
npm install --save @onflow/types
import * as sdk from "@onflow/sdk"
import * as t from "@onflow/types"
sdk.build([
sdk.transaction`
transaction(to: Address, amount: UFix64) {
execute {
let addr: Address = to
let value: UFix64 = amount
}
}
`,
sdk.args([
sdk.arg(to, t.Address),
sdk.arg(amount, t.UFix64),
]),
])
import * as sdk from "@onflow/sdk"
import * as t from "@onflow/types"
sdk.build([
sdk.script`
pub fun main(a: Int, b: Int): Int {
return a + b
}
`,
sdk.args([
sdk.arg(1, t.Int),
sdk.arg(2, t.Int),
]),
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(1, t.UInt) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(1, t.Int) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(8, t.UInt8) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(8, t.Int8) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(16, t.UInt16) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(16, t.Int16) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(32, t.UInt32) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(32, t.Int32) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(64, t.UInt64) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(64, t.Int64) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(128, t.UInt128) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(128, t.Int128) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(256, t.UInt256) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(256, t.Int256) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(8, t.Word8) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(16, t.Word16) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(32, t.Word32) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(64, t.Word64) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg("64.123", t.UFix64) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg("64.123", t.Fix64) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg("Flow", t.String) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg("c", t.Character) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(true, t.Bool) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg("0xABC123DEF456", t.Address) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg("Flow", t.Optional(t.String)) ])
])
sdk.build([
sdk.args([ sdk.arg(null, t.Optional(t.String)) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(["First", "Second"], t.Array(t.String)) ])
])
sdk.build([
sdk.args([ sdk.arg(["First", 2], t.Array([t.String, t.Int])) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([
sdk.arg(
[
{key: 1, value: "one"},
{key: 2, value: "two"},
],
t.Dictionary({key: t.Int, value: t.String})
)
])
])
sdk.build([
sdk.args([
sdk.arg(
[
{key: "a", value: "one"},
{key: "b", value: "two"},
],
t.Dictionary({key: t.String, value: t.String})
)
])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([
sdk.arg(
{
domain: "public" // public | private | storage
identifier: "flowTokenVault"
},
t.Path
)
])
])
The following, while technically possible, are impracticle. We strongly recommend not using them as arguments for transactions or scripts.
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg(null, t.Void) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([
sdk.arg(
{
fields: [{name: "wasTheCodeClean?", value: "absolutely"}],
},
t.Event("0xABC123DEF456.JeffWroteSomeJS", [{value: t.String}]),
)
])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([ sdk.arg({address: "0xABC123DEF456", type: "0xABC123DEF456.CryptoKitty"}, t.Reference) ])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([
sdk.arg(
{
fields: [{name: "CryptoKitty_name", value: "Lil' Jimmy The CryptoKitty"}],
},
t.Struct("0xABC123DEF456.CryptoKitty", [{value: t.String}])
)
])
])
import * as t from "@onflow/types"
sdk.build([
sdk.args([
sdk.arg(
{
fields: [{name: "Jeffysaur_Name", value: "Mr Jeff The Dinosaur"}],
}
t.Resource("0x01.Jeffysaur", [{value: t.String}]),
)
])
])
FAQs
Utilities to transform javascript values into Cadence understandable values
We found that @onflow/types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.