Catalog npm
Back to packageRELEASE DETAILS

3.3.17

npm

@0bsnetwork/zbs-transactions

Build and sign(multi-sign) transactions for Zbs blockchain.

0bsnetworkbinarycryptocryptographyprotocolsignaturetransactions
Published1 May 2020
Direct dependencies24
Transitive dependenciesNot calculated

README

Current package documentation

zbs-transactions

Using this library you can easily create and sign transactions for Zbs blockchain. It also allows you to multi-sign existing transactions or create them without signature at all.

This library is a set of transaction constructing functions:

Check full documentation on GitHub Pages.

Transactions

The idea is really simple - you create transaction and sign it from a minimal set of required params. If you want to create Transfer transaction the minimum you need to provide is amount and recipient as defined in Transfer params:


const { transfer } = require('@0bsnetwork/zbs-transactions')
const seed = 'some example seed phrase'
const signedTranserTx = transfer({
  amount: 1,
  recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',
  //Timestamp is optional but it was overrided, in case timestamp is not provided it will fallback to Date.now(). You can set any oftional params yourself. go check full docs
  timestamp: 1536917842558
}, seed)

Output will be a signed transfer transaction:

{
  id: '8NrUwgKRCMFbUbqXKQAHkGnspmWHEjKUSi5opEC6Havq',
  type: 4,
  version: 2,
  recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',
  attachment: undefined,
  feeAssetId: undefined,
  assetId: undefined,
  amount: 1,
  fee: 100000,
  senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq',
  timestamp: 1536917842558,
  proofs: [
    '25kyX6HGjS3rkPTJRj5NVH6LLuZe6SzCzFtoJ8GDkojY9U5oPfVrnwBgrCHXZicfsmLthPUjTrfT9TQL2ciYrPGE'
  ]
}

You can also create transaction, but not sign it:

const unsignedTransferTx = transfer({
  amount: 1,
  recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',
  //senderPublicKey is required if you omit seed
  senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq'
})

Now you are able to POST it to Zbs API or store for future purpose or you can add another signature from other party:

const otherPartySeed = 'other party seed phrase'
const transferSignedWithTwoParties = transfer(signedTranserTx, seed)

So now there are two proofs:

{
  id: '8NrUwgKRCMFbUbqXKQAHkGnspmWHEjKUSi5opEC6Havq',
  type: 4,
  version: 2,
  recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',
  attachment: undefined,
  feeAssetId: undefined,
  assetId: undefined,
  amount: 1,
  fee: 100000,
  senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq',
  timestamp: 1536917842558,
  proofs: [
    '25kyX6HGjS3rkPTJRj5NVH6LLuZe6SzCzFtoJ8GDkojY9U5oPfVrnwBgrCHXZicfsmLthPUjTrfT9TQL2ciYrPGE',
    'CM9emPzpe6Ram7ZxcYax6s7Hkw6698wXCMPSckveFAS2Yh9vqJpy1X9nL7p4RKgU3UEa8c9RGXfUK6mFFq4dL9z'
  ]
}

Broadcast

To send transaction you can use either node REST API or broadcast helper function:

const {broadcast} =  require('@0bsnetwork/zbs-transaction');
const nodeUrl = 'https://node1.testnet-0bsnetwork.com';

broadcast(signedTx, nodeUrl).then(resp => console.log(resp))

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 25

Native requirements
24 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@waves/marshall
Environment
{
  "local_name": "@waves/marshall",
  "alias": false,
  "peer_metadata": null
}
^0.6.0runtime
@waves/waves-crypto
Environment
{
  "local_name": "@waves/waves-crypto",
  "alias": false,
  "peer_metadata": null
}
^2.0.4runtime
ajv
Environment
{
  "local_name": "ajv",
  "alias": false,
  "peer_metadata": null
}
^6.5.5runtime
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^0.18.0runtime
@types/axios
Environment
{
  "local_name": "@types/axios",
  "alias": false,
  "peer_metadata": null
}
^0.14.0development
@types/jest
Environment
{
  "local_name": "@types/jest",
  "alias": false,
  "peer_metadata": null
}
^23.3.9development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^10.12.3development
copy-webpack-plugin
Environment
{
  "local_name": "copy-webpack-plugin",
  "alias": false,
  "peer_metadata": null
}
^4.5.2development
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^23.6.0development
jsdoc-to-markdown
Environment
{
  "local_name": "jsdoc-to-markdown",
  "alias": false,
  "peer_metadata": null
}
^4.0.1development
nativescript-typedoc-theme
Environment
{
  "local_name": "nativescript-typedoc-theme",
  "alias": false,
  "peer_metadata": null
}
0.0.7development
ncp
Environment
{
  "local_name": "ncp",
  "alias": false,
  "peer_metadata": null
}
^2.0.0development
preprocess
Environment
{
  "local_name": "preprocess",
  "alias": false,
  "peer_metadata": null
}
^3.1.0development
rimraf
Environment
{
  "local_name": "rimraf",
  "alias": false,
  "peer_metadata": null
}
^2.6.2development
ts-jest
Environment
{
  "local_name": "ts-jest",
  "alias": false,
  "peer_metadata": null
}
^23.10.4development
ts-jsdoc
Environment
{
  "local_name": "ts-jsdoc",
  "alias": false,
  "peer_metadata": null
}
^3.0.1development
ts-loader
Environment
{
  "local_name": "ts-loader",
  "alias": false,
  "peer_metadata": null
}
^5.1.0development
ts-node
Environment
{
  "local_name": "ts-node",
  "alias": false,
  "peer_metadata": null
}
^7.0.1development
typedoc
Environment
{
  "local_name": "typedoc",
  "alias": false,
  "peer_metadata": null
}
^0.13.0development
typedoc-clarity-theme
Environment
{
  "local_name": "typedoc-clarity-theme",
  "alias": false,
  "peer_metadata": null
}
^1.1.0development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^3.2.2development
typescript-json-schema
Environment
{
  "local_name": "typescript-json-schema",
  "alias": false,
  "peer_metadata": null
}
^0.33.0development
webpack
Environment
{
  "local_name": "webpack",
  "alias": false,
  "peer_metadata": null
}
^4.17.2development
webpack-cli
Environment
{
  "local_name": "webpack-cli",
  "alias": false,
  "peer_metadata": null
}
^3.1.0development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^3.2.2peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-qSiuddP0MaS/ag6KmmXnMRPB0t1rkScKp8+zyg473lhFEWcO15RjhO9V3NT7h1D0rONufTKa/Mn5nYrq2pVXNw==",
  "shasum": "9982f71496763e8f08f546af73e3f5072e747eec",
  "tarball": "https://registry.npmjs.org/@0bsnetwork/zbs-transactions/-/zbs-transactions-3.3.17.tgz",
  "fileCount": 166,
  "unpackedSize": 543173,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq/RDCRA9TVsSAnZWagAA0GEP/R4H+fRy6kcyklFwZ9jm\nrSn9UomU1K5OtKd3vndE1mLStjp7brFzPfN65bDK7g8IZiQSn3V65BoIVnEA\n29YxDB3jlpk+8IRNYKBODVB5SNDLl1vcnRi7urqkLw0oK2v9W0BeZBJjuRth\nbTXw6f7qXbJHuiwvmj0N3mccAGPuRWxasJWq370yy1smXVgt74g2gKir/phn\nCCFkM/q+AdbAqL+t7vrfBlh3PdE2NTPChYUK4oYSqyc3pGECHNxjYxo9kTx4\nt2CzvbrVZ9Qze4hawAa53ZKFgoxpg7Pt4lz5bM+++HIVRX2gJX5kVgB2m0Ly\nscBPmvun5P++M/Lam44SWxBrhAZHCoeJNUsrnQA5KgFHmzl/8zGFzizDlzHn\n6JjqP6o35Z5keN6HBJUb2I21piiysFq1QFaPmqQq6EwfGRdA9tyYkjrzzZh5\nOSgLPzBqKgnACm35/A4p1ZlPkRIYCPCffBneNOnpn0GNoevhibjL/s3K/m7u\ntig1u3Rrb52cYN/A06Jb8cmp2iGvIhvn5Ryg+VP0Pen7Km30kGqzCE8z6dL9\nXebeBjRFc+5b0agtmIldaLL3CdlpU0nGahc7CZpT8R3BcGNUDn1qvepBqiNN\nHtYobwQAP6ej/UAljlZPww9H2kcvJER8VVXyb+yn/njQjzhvHdQ3SRHmd57A\nDHR9\r\n=G0H8\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIGeUHe2e9ouDgzu5UH+742O5hNxxiO8W9hJJzbiSXwjGAiBVBB3F5JXZEhhWV8NDoAWBW3pkA9wFHsXJQ4FyMYk+uw=="
    }
  ]
}

Repository

PENDING
wavesplatform/zbs-transactions

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:05 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:f36242c9a38aba0e0d391990c76c329f397ea4afed7ebd4620cc680dcabebcdf

Other collected versions

3.3.1919 May3.3.1620 Apr3.3.1514 Apr3.3.149 Apr3.3.139 Apr3.3.129 AprView all collected versions →