@blockless/sdk-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@blockless/sdk-ts

This sdk is designed to work with Javascript/Typescript.

The SDK natively supports

  • json
  • http
  • crypto

Install this SDK

$ yarn add @blockless/sdk-ts
# or using npm
$ npm i @blockless/sdk-ts

Example of using this SDK.

import { InputProps, entryMain } from '@blockless/sdk-ts'
import { AbiCoder } from 'ethers'

interface Arguments {
	n: number
	v: string
}

entryMain(async (input: InputProps<Arguments>) => {
	console.log('\n Example: Stdin')

	if (Object.keys(input.args).length === 0) {
		console.log('Missing args.')
		return {}
	}

	const coder = AbiCoder.defaultAbiCoder()
	const coded = coder.encode(['string'], [input.args.v])

	return { nonce: input.args.n, value: coded }
})

How to build

bls-sdk-ts build ./index.ts -o <outDirectory> -f <outFile>

Readme

Keywords

none

Package Sidebar

Install

npm i @blockless/sdk-ts

Weekly Downloads

2

Version

1.0.1

License

Apache-2.0

Unpacked Size

16.7 kB

Total Files

17

Last publish

Collaborators

  • udit_txlabs
  • toxigenicpoem