1.0.7 • Published 2 years ago

tezos-arbundles v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Art By City - Tezos Arbundles

This project is a wrapper library written in TypeScript to add Tezos support to arbundles.

Install

$ npm i --save @tezos-arbundles

Usage

Create a TezosSigner & sign a DataItem

import { bundleAndSignData, createData, TezosSigner } from 'tezos-arbundles'

// Create an ArBundles signer using Tezos secret key
const signer = new TezosSigner('<tezos secret key>')
await signer.setPublicKey()

// Create & sign a DataItem
const data: string | Uint8Array = 'Signed by a tezos wallet!'
const dataItem = createData(data, signer)
await dataItem.sign(signer)

// Add DataItem to a Bundle
const dataItems = [ dataItem ]
const bundle = await bundleAndSignData(dataItems, signer)

// POST to tezos-bundler
myFavoritePostMethod('/bundle/xtz', bundle.getRaw())