@fabrica.city/fabrica-js-sdk

0.1.6 • Public • Published

#Fabrica Sdk

##Setup Run command npm i in the project root folder.

When the sdk is executed on a CLIENT you should pass a web3 instance and a config object with the following keys:

{
  "ipfsUrl": "https://ipfs.infura.io:5001"
}

When the sdk is executed on a SERVER you should pass a web3 instance and a config object with the following keys:

{
  "privateKey": "*************************************",
  "ipfsUrl": "https://ipfs.infura.io:5001"
}

Code example:

const Web3 = require("web3")
const Fabrica = require("fabrica-sdk") //for local testing just specify the local module folder
const config = {
  "privateKey": "*************************************", //if you are working on a client don't write this line
  "ipfsUrl": "https://ipfs.infura.io:5001"
}
  
const web3 = new Web3("http://localhost:8545")
const fabrica = new Fabrica(web3, config)

fabrica.init()
  .then(() => fabrica.token.mint(TOKEN_ID, "9q94yz3p4en6", "walletA", "ipfs uri here"))
  .then(console.log)
  .catch(console.error)             

##Test To execute a test run the command NODE_ENV=local TEST=<test name> npm test

Readme

Keywords

none

Package Sidebar

Install

npm i @fabrica.city/fabrica-js-sdk

Weekly Downloads

0

Version

0.1.6

License

MIT

Unpacked Size

18.4 kB

Total Files

13

Last publish

Collaborators

  • fedepo
  • dongambas
  • giovanni.bruno
  • calvinpak