0.1.6 • Published 3 years ago

@fabrica.city/fabrica-js-sdk v0.1.6

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

#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

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago