Socket
Book a DemoInstallSign in
Socket

@okxweb3/coin-flow

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@okxweb3/coin-flow

A flow SDK for building Web3 wallets and applications.

1.1.0
latest
Source
npmnpm
Version published
Weekly downloads
7
Maintainers
0
Weekly downloads
 
Created
Source

@okxweb3/coin-flow

Flow SDK is used to interact with the Flow blockchain, it contains various functions can be used to web3 wallet.

Installation

Npm

To obtain the latest version, simply require the project using npm :

npm install @okxweb3/coin-flow

Usage

Verify address

const b = validateAddress("0x95da9cfb6eb92daf")
console.info(b)

Create new account transaction

const publicKeyHex = 'eb9c46556b51ba101be8392a16fb9a33e78d268c21269b9cdd7091246e16c3200fc74e4a75539ff5f265bd9af84dcc5001615a1a91757df103fcdfdcb0a1c4bc';
const payer = '0x67e94015e6472711';
const refBlockId = '5b16b81239e950261b54583ef3cfd3837977ab85a3149d6b75e297b3b7c0ebf2';
const payerSequenceNumber = 0;
const gasLimit = 9999;
const tx = CreateNewAccountTx(publicKeyHex, payer, refBlockId, payerSequenceNumber, gasLimit);

const signPrivKeyHex = "bdd80f4421968142b3a4a6c27a1d84a3623384d085a04a895f109fd8d49cef0a"
const signAddr = "0x67e94015e6472711"
const signed = signTransaction(tx, [], [{id: 0, address: signAddr, private_key: signPrivKeyHex}])
const httpTx = transactionToHTTP(signed)
console.info(httpTx)

Sign transaction

const payer = '0x67e94015e6472711';
const refBlockId = '5cf95880b48e6cbe5a7f9ec60daa0942910b6b93f45022fbbc1e08a0e1999b38';
const payerSequenceNumber = 2;
const gasLimit = 9999;
const amount = "1.000000"
const toAddr = "0x95da9cfb6eb92daf"

const tx = CreateTransferTx(amount, toAddr, payer, refBlockId, payerSequenceNumber, gasLimit);

const signPrivKeyHex = "bdd80f4421968142b3a4a6c27a1d84a3623384d085a04a895f109fd8d49cef0a"
const signAddr = "0x67e94015e6472711"
const signed = signTransaction(tx, [], [{id: 0, address: signAddr, private_key: signPrivKeyHex}])
console.info(signed)

const httpTx = transactionToHTTP(signed)
console.info(httpTx)

License

Current package is MIT licensed.

Keywords

flow

FAQs

Package last updated on 15 Jan 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.