diff --git a/README.md b/README.md index a29abcb..8aa41ae 100644 --- a/README.md +++ b/README.md @@ -37,4 +37,12 @@ The deploys are automatically done by merging using semantic-release. Follow the [commit style guide](https://github.com/semantic-release/semantic-release#how-does-it-work) so the commits will be added to the changelog. -Later, during the CI (in develop and main branches) a new package version will be created and uploaded to npmjs registry. +# Documentation + +Read the [docs](https://ripio.github.io/sdkjs) on github pages. + +- [sdk](https://ripio.github.io/sdkjs/sdk) +- [sdk nft](https://ripio.github.io/sdkjs/sdk-nft) +- [sdk storage aws](https://ripio.github.io/sdkjs/sdk-storage-aws) +- [sdk storage http](https://ripio.github.io/sdkjs/sdk-storage-http) +- [sdk storage ipfs](https://ripio.github.io/sdkjs/sdk-storage-ipfs) \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..1c12622 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,23 @@ +## What is Ripio SDK js? + +Ripio SDK js is a library written in javascript that allows you to interact with any EVM. As a main feature, Ripio SDK grants simplicity in writing code to transact on blockchain. It has 3 layers of abstraction that goes from, the most generic in terms of interaction with Smart Contracts, to a more oriented design for each of the use cases/industries where you can develop a dApp. + +Ripio SDK js uses [Ethers js](https://docs.ethers.io/v5/) to perform the interaction with the blockchain while simplifying its use. Also Ripio SDK uses [ipfs-http-client](https://www.npmjs.com/package/ipfs-http-client) to be able to interact with the InterPlanetary File System (IPFS - a protocol, hypermedia and file sharing peer-to-peer network for storing and sharing data in a distributed file system). + +## Architecture + +Ripio SDK has several layers of abstraction that range from the most generic in terms of interaction with Smart Contracts to a design more oriented to each of the industries where a dApp can be developed. + +Contract Layer: This set of classes allows developers to interact with the blockchain using few lines of code. It also allows you to execute transactions with any type of smart contract. + +Standard Layer: Contains a set of classes that allow developers to interact more clearly with many of the ERC standards (e.g. ERC20, ERC721). It also makes it easier to perform some tasks associated with this type of contract. + +Gaming Layer (work in progress): set of classes that represent specific functionalities of a use case, in this particular case gaming. The game developer can interact only with these classes in the layer without getting involved with contracts or ERCs. The game developer can increase functionality by inheriting from any of these classes. + +### Resources + +- [sdk](https://ripio.github.io/sdkjs/sdk) +- [sdk nft](https://ripio.github.io/sdkjs/sdk-nft) +- [sdk storage aws](https://ripio.github.io/sdkjs/sdk-storage-aws) +- [sdk storage http](https://ripio.github.io/sdkjs/sdk-storage-http) +- [sdk storage ipfs](https://ripio.github.io/sdkjs/sdk-storage-ipfs) \ No newline at end of file diff --git a/docs/sdk-nft/README.md b/docs/sdk-nft/README.md new file mode 100644 index 0000000..08b5d39 --- /dev/null +++ b/docs/sdk-nft/README.md @@ -0,0 +1,98 @@ +## Installation + +To install ripio sdk-nft we recommend node 16 or above, although it might work with lower versions. + +``` +npm install @ripio/sdk-nft +``` + +## Overview + +### NFT + +Class to represent a NFT + +```javascript +// commonJS +const { NFT } = require('@ripio/sdk-nft'); +// TS +import { NFT } from '@ripio/sdk-nft'; +// Create NFT instance +const nft = new NFT({ + tokenId: '42', + nftMetadata: { + name: 'fake-name', + description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', + image: 'ipfs://fake-uri', + attributes: [ + { + trait_type: 'fake-trait', + value: 'fake-value' + }, + { + trait_type: 'fake-trait-2', + value: 'fake-value' + } + ] + } +}); +// Access nft properties +nft.tokenId; +// 43 +nft.name; +// 'fake-name' +nft.description; +// 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' +nft.imageUri; +// 'ipfs://fake-uri' +nft.attributes; +// [ +// { trait_type: 'fake-trait', value: 'fake-value' }, +// { trait_type: 'fake-trait-2', value: 'fake-value' } +// ] +nft.jsonData; +// { +// name: 'fake-name', +// description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', +// image: 'ipfs://fake-uri', +// attributes: [ +// { trait_type: 'fake-trait', value: 'fake-value' }, +// { trait_type: 'fake-trait-2', value: 'fake-value' } +// ] +// } +``` + +#### NFTFactory + +Given a NFT721Manager, a StorageType (StorageIpfs, StorageAws, StorageHttp) and a NFT_METADATA_FORMAT, it creates a NFTFactory instance to interact with NFTs + +```javascript +// commonJS +const { NFTFactory } = require('@ripio/sdk-nft'); +// TS +import { NFTFactory } from '@ripio/sdk-nft'; +// Create NFTFactory instance +const nftFactory = new NFTFactory(NFT_MANAGER, STORAGE, FORMAT); +``` + +Where: + +- NFT_MANAGER is a NFT721Manager instance activated +- STORAGE is a StorageIpfs, StorageAws or StorageHttp instance +- FORMAT is a NFT_METADATA_FORMAT enum (IMAGE, JSON, JSON_WITH_IMAGE) + +NFTFactory methods: + +- createNFT: + +```javascript +nftFactory.createNFT("aTokenId"); +NFT {...} // NFT instance +``` + +### Other resources + +- [sdk](https://ripio.github.io/sdkjs/sdk) +- [sdk storage aws](https://ripio.github.io/sdkjs/sdk-storage-aws) +- [sdk storage http](https://ripio.github.io/sdkjs/sdk-storage-http) +- [sdk storage ipfs](https://ripio.github.io/sdkjs/sdk-storage-ipfs) \ No newline at end of file diff --git a/docs/sdk-storage-aws/README.md b/docs/sdk-storage-aws/README.md new file mode 100644 index 0000000..c582fd3 --- /dev/null +++ b/docs/sdk-storage-aws/README.md @@ -0,0 +1,69 @@ +## Installation + +To install ripio sdk-storage-aws we recommend node 16 or above, although it might work with lower versions. + +``` +npm install @ripio/sdk-storage-aws +``` + +## Overview + +### StorageAws + +You can also store your NFTs data on Aws S3 Buckets. For this reason a StorageAws class is given: + +```javascript +// commonJS +const { StorageAws } = require('@ripio/sdk-storage-aws'); +// TS +import { StorageAws } from '@ripio/sdk-storage-aws'; +// Create StorageAws instance +const aws = new StorageAws('sa-east-1'); +``` + +The StorageAws class arranges a variety of methods to interact: + +- storeFile: + +```javascript +await aws.storeFile(“./images/cat.png”); +‘cat.png’ +``` + +- storeMetadata: + +```javascript +const data = {image: 'QmP…Weh', {description: ‘Marvin the Paranoid Android’} }; +await aws.storeMetadata(data); +‘metada.json’ +``` + +- getStringData: + +```javascript +const resource = await aws.getData(‘text.txt’); +await resource.getStringData(); +‘Marvin the Paranoid Android’ +``` +- getJsonData: + +```javascript +const resource = await aws.getData(‘metadata.json’); +await resource.getJsonData(); +{image: 'aws://fake-uri/image.png', level: 42, name: 'Marvin'} +``` + +- getBase64Data: + +```javascript +const resource = await aws.getData(‘cat.png’); +await resource.getBase64Data(); +‘RWwgc2VudGlkbyBkZSBsYSB2aWRhLCBlbCB1bml2ZXJzbyB5IHRvZG8gbG8gZGVtw6Fz’ +``` + +### Other resources + +- [sdk](https://ripio.github.io/sdkjs/sdk) +- [sdk nft](https://ripio.github.io/sdkjs/sdk-nft) +- [sdk storage http](https://ripio.github.io/sdkjs/sdk-storage-http) +- [sdk storage ipfs](https://ripio.github.io/sdkjs/sdk-storage-ipfs) \ No newline at end of file diff --git a/docs/sdk-storage-http/README.md b/docs/sdk-storage-http/README.md new file mode 100644 index 0000000..93d5143 --- /dev/null +++ b/docs/sdk-storage-http/README.md @@ -0,0 +1,55 @@ +## Installation + +To install ripio sdk-storage-http we recommend node 16 or above, although it might work with lower versions. + +``` +npm install @ripio/sdk-storage-http +``` + +## Overview + +### StorageHttp + +Get NFTs data on Aws S3 Buckets with http. For that, a StorageHttp class is given: + +```javascript +// commonJS +const { StorageHttp } = require('@ripio/sdk-storage-http'); +// TS +import { StorageHttp } from '@ripio/sdk-storage-http'; +// Create StorageHttp instance +const client = new StorageHttp(); +``` + +The StorageHttp class arranges a variety of methods to interact: + +- getStringData: + +```javascript +const resource = await client.getData(‘https://text.txt’); +await resource.getStringData(); +‘Marvin the Paranoid Android’ +``` + +- getJsonData: + +```javascript +const resource = await client.getData(‘https://metadata.json’); +await resource.getJsonData(); +{image: 'aws://fake-uri/image.png', level: 42, name: 'Marvin'} +``` + +- getBase64Data: + +```javascript +const resource = await client.getData(‘https://cat.png’); +await resource.getBase64Data(); +‘RWwgc2VudGlkbyBkZSBsYSB2aWRhLCBlbCB1bml2ZXJzbyB5IHRvZG8gbG8gZGVtw6Fz’ +``` + +### Other resources + +- [sdk](https://ripio.github.io/sdkjs/sdk) +- [sdk nft](https://ripio.github.io/sdkjs/sdk-nft) +- [sdk storage aws](https://ripio.github.io/sdkjs/sdk-storage-aws) +- [sdk storage ipfs](https://ripio.github.io/sdkjs/sdk-storage-ipfs) \ No newline at end of file diff --git a/docs/sdk-storage-ipfs/README.md b/docs/sdk-storage-ipfs/README.md new file mode 100644 index 0000000..5f0d739 --- /dev/null +++ b/docs/sdk-storage-ipfs/README.md @@ -0,0 +1,72 @@ +## Installation + +To install ripio sdk-storage-ipfs we recommend node 16 or above, although it might work with lower versions. + +``` +npm install @ripio/sdk-storage-ipfs +``` + +## Overview + +### StorageIpfs + +When working with NFTs a good practice is to store your NFTs data on Ipfs, which is a protocol and peer-to-peer network for storing and sharing data in a distributed file system. For this reason a StorageIpfs class is given: + +```javascript +// commonJS +const { StorageIpfs } = require('@ripio/sdk-storage-ipfs'); +// TS +import { StorageIpfs } from '@ripio/sdk-storage-ipfs'; +// Create StorageIpfs instance +const ipfs = new StorageIpfs(IPFS_URL); +``` + +Where IPFS_URL is the api gateway to a node. + +The StorageIpfs class arranges a variety of methods to interact with the ipfs nodes: + +- storeFile: + +```javascript +await ipfs.storeFile(“./images/cat.png”); +‘Qmj…Ehb’ // CID of the file +``` + +- storeMetadata: + +```javascript +const data = {image: 'QmP…Weh', {description: ‘Marvin the Paranoid Android’} }; +await ipfs.storeMetadata(data); +‘Qmj…Ehb’ +``` + +- getStringData: + +```javascript +const resource = await ipfs.getData(‘Qmj…Ehb’); +await resource.getStringData(); +‘Marvin the Paranoid Android’ +``` + +- getJsonData: + +```javascript +const resource = await ipfs.getData(‘Qmj…Ehb’); +await resource.getJsonData(); +{image: 'ipfs://fake-uri/image.png', level: 42, name: 'Marvin'} +``` + +- getBase64Data: + +```javascript +const resource = await ipfs.getData(‘Qmj…Ehb’); +await resource.getBase64Data(); +‘RWwgc2VudGlkbyBkZSBsYSB2aWRhLCBlbCB1bml2ZXJzbyB5IHRvZG8gbG8gZGVtw6Fz’ +``` + +### Other resources + +- [sdk](https://ripio.github.io/sdkjs/sdk) +- [sdk nft](https://ripio.github.io/sdkjs/sdk-nft) +- [sdk storage aws](https://ripio.github.io/sdkjs/sdk-storage-aws) +- [sdk storage http](https://ripio.github.io/sdkjs/sdk-storage-http) \ No newline at end of file diff --git a/docs/sdk/README.md b/docs/sdk/README.md new file mode 100644 index 0000000..6a18aad --- /dev/null +++ b/docs/sdk/README.md @@ -0,0 +1,639 @@ +## Installation + +To install ripio sdk we recommend node 16 or above, although it might work with lower versions. + +``` +npm i @ripio/sdk +``` + +## Overview + +### Connectors + +Connectors are classes that allow you to interact with the blockchain by wrapping up the account and provider. The connectors provide you with the ability to interact with the RPC API and they work as a bridge between Manager classes and the blockchain (see: Managers documentation section) + +The following classes are exported on the connectors submodule for CommonJS: + +```javascript +const { BrowserWeb3Connector, JsonRPCWeb3Connector } = require('@ripio/sdk/connectors'); +``` + +For TypeScript import them from the origin (submodules will come in the near future): + +```javascript +import { BrowserWeb3Connector, JsonRPCWeb3Connector } from '@ripio/sdk'; +``` + +BrowserWeb3Connector | This class uses an injected web3 browser extension (e.g. Metamask) to connect to the Blockchain and provide the user with the ability to sign transactions. This connector provides the functionality to switch and add chains to the web3 browser extension as well as to sign messages. +-- | -- +JsonRPCWeb3Connector | The JSON-RPC API is another popular method for interacting with EVM Blockchain and is available in all major Ethereum node implementations as well as many third-party web services (e.g. INFURA). To use this connector, you must provide a url of the EVM node to connect to and private key with which the transactions will be signed (it can be ignored if you only want a read-only connection). + +Sometimes it is necessary to have a connector instance to perform certain tasks. It is possible to instantiate a BrowserWeb3Connector and JsonRPCWeb3Connector and they must be activated as well. Also, those instances can be used in activation of a ContractManager (see: Contract Manager activation section). + +#### BrowserWeb3Connector + +When activating the BrowserWeb3Connector a web3 browser extension is required to inject on window.ethereum a Web3 Provider: + +```javascript +const connector = new BrowserWeb3Connector(); +const {chainId, provider, account} = await connector.activate(); +``` + +Is a good idea to deactivate the connector when you are not going to use it anymore or your program ends. To remove any listeners to events that are still active. + +```javascript +await connector.deactivate(); +``` + +#### JsonRPCWeb3Conector + +When activating the JsonRPCWeb3Connector the Json RPC url is required to connect to the blockchain, and an optional private key can be passed to be able to sing transactions or messages: + +```javascript +const WSS = 'JSON-RPC-API-URL' +const PRIVATE_KEY = '...'; +const connector = new JsonRPCWeb3Connector(WSS, PRIVATE_KEY); +const {chainId, provider, account} = await connector.activate(); +``` + +With this connector you could also deactivate it after finishing working with it or before your program ends to remove any listeners to events that are still active. We strongly recommend doing it when you are using a websocket provider. + +```javascript +await connector.deactivate(); +``` + +### Shared functionality: + +The connectors share the following functionalities: + +- Sign messages: + +```javascript +const message = “The answer to life, the universe and everything.”; +await connector.signMessage(message); '0x058...91c' +``` + +- Obtain transaction data: + +```javascript +const txHash = “0xf3c...586”; +await connector.getTransaction(txHash); +{ + hash: '0x4ad...f4a', + type: 0, + accessList: null, + blockHash: '0x749...469', + blockNumber: 2641, + transactionIndex: 0, + confirmations: 6, + from: '0xB19...048D', + gasPrice: BigNumber { _hex: '0x00', _isBigNumber: true }, + gasLimit: BigNumber { _hex: '0x6691b7', _isBigNumber: true }, + to: '0xd2e...222', + value: BigNumber { _hex: '0x00', _isBigNumber: true }, + nonce: 239, + data: '0x162...000', + r: '0x3e4...07c', + s: '0x60c...c5c', + v: 42, + creates: null, + chainId: 1, + wait: [Function (anonymous)] +} +``` + +- Obtain native chain balance: + +```javascript +await connector.getBalance(“0x5dB...36b”); +‘84.4242’ +``` + +- Transfer native chain balance: + +```javascript +await connector.transferBalance("1", "0x5dB...36b"); +{  + chainId: 1337,  + confirmations: 0,  + data: '0x',  + from: '0x8577181F3D8A38a532Ef8F3D6Fd9a31baE73b1EA',  + gasLimit: { BigNumber: "21000" },  + gasPrice: { BigNumber: "1" },  + hash: '0xdbf6b710ded42ae0fcfb0ec601235afce5acd0a01b785002cf0581fab4d53b52',  + nonce: 5,  + r: '0x7502ebb9c10e1664d9a344b636c1151a9ebc6b9dd1aa2bad9f739d15368a83f9',  + s: '0x3a71b2b3a2a90527e2cf221606b89af5ac8195b8146f9d2776e4ca342b7e37b2',  + to: '0x8ba1f109551bD432803012645Ac136ddd64DBA72',  + type: null,  + v: 2710,  + value: { BigNumber: "1000000000000000000" },  + wait: [Function],  + cancel: [Function: cancelTransaction],  + speedUp: [Function: speedUpTransaction],  + change: [Function: changeBalanceTransaction] +} +``` + +- Change balance transfer on native chain: + +```javascript +const to = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; +const value = BigNumber { _hex: '0xDE0B6B3A7640000', _isBigNumber: true }; +const gasSpeed = BigNumber { _hex: '0x01', _isBigNumber: true }; +const txResponse = await connector.transferBalance("1", "0x5dB...36b"); +await connector.changeBalanceTransaction(txResponse, to, value, gasSpeed); +{  + chainId: 1337,  + confirmations: 0,  + data: '0x',  + from: '0x8577181F3D8A38a532Ef8F3D6Fd9a31baE73b1EA',  + gasLimit: { BigNumber: "21000" },  + gasPrice: { BigNumber: "1" },  + hash: '0xdbf6b710ded42ae0fcfb0ec601235afce5acd0a01b785002cf0581fab4d53b52',  + nonce: 5,  + r: '0x7502ebb9c10e1664d9a344b636c1151a9ebc6b9dd1aa2bad9f739d15368a83f9',  + s: '0x3a71b2b3a2a90527e2cf221606b89af5ac8195b8146f9d2776e4ca342b7e37b2',  + to: '0x8ba1f109551bD432803012645Ac136ddd64DBA72',  + type: null,  + v: 2710,  + value: { BigNumber: "1000000000000000000" },  + wait: [Function] +} +``` + +- Sign typed data: + +```javascript +const domain = { + name: “ContractName”, + version: '1', + chainId: “100”, + verifyingContract: “0x123...789”} +const value = “0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff”; +const deadline = “0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff”; +const nonce = “0x0000000000000000000000000000000000000000000000000000000000000000”; +const message = { + owner: “0x123...888”, + spender: “0x123...999”, + value, + nonce, + deadline +} +const signer = new EIP2612PermitTypedDataSigner(domain, message); +await connector.signTypedData(signer); +{ + r: '0xff406d8a920f957f867379275961a5ac94a7376c02c5b89e64f9715c6b4ff31f', + s: '0x7bb422355272555eca2757411c9a127ce6260387558940715b51fca444b8edcd', + _vs: '0xfbb422355272555eca2757411c9a127ce6260387558940715b51fca444b8edcd', + recoveryParam: 1, + v: 28, + yParityAndS: '0xfbb422355272555eca2757411c9a127ce6260387558940715b51fca444b8edcd', + compact: '0xff406d8a920f957f867379275961a5ac94a7376c02c5b89e64f9715c6b4ff31ffbb422355272555eca2757411c9a127ce6260387558940715b51fca444b8edcd' +} +``` + +### Managers + +A ContractManager is an abstraction which represents a connection to a specific contract on the Blockchain, so that applications can interact with the contract methods and events. + +To instantiate a ContractManager class it must be imported from the base export or the managers module. + +```javascript +import { ContractManager } from ‘@ripio/sdk’; +// Or from managers module +import { ContractManager } from ‘@ripio/sdk/managers’; +const contract = new ContractManager(); +``` + +The Contract Manager class allows you to interact with an on-chain contract regardless of the functions it contains. In order to use it, it must be activated. + +```javascript +await contract.activate({ + contractAddress: CONTRACT_ADDRESS, + contractAbi: CONTRACT_ABI +}); +``` + +The CONTRACT_ADDRESS parameter is the string address of a contract available on the blockchain which you want to interact with. + +In order to communicate with the on-chain contract, this class needs to know what methods are available and the parameters that the functions require, which is what the CONTRACT_ABI parameter (Application Binary Interface, ABI) provides. + +ABI Example: + +```javascript +let abi = [ +...  + { + "inputs": [], + "name": "name", + "outputs": [  + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function"  + }, +... +] +``` + +After activating the ContractManager instance you can make a call to a method of the instantiated contract by calling the ‘execute’ function provided by the manager class. The following example gets the result of calling a "name" method that returns a string value, in case that the method called does not exists on the contract’s ABI it will throw an error: + +```javascript +await contract.execute({ method: “name” }); +{ + value: ‘ContractName’, + isTransaction: false +} +await contract.execute({ + method: ‘balanceOf’, + params: [‘0x12...789’] +}); +{ + value: BigNumber { _hex: '0x42', _isBigNumber: true }, + isTransaction: false +} +await contract.execute({ + method: ‘mint’, + params: [ ‘0x12...789’ ], + value: ‘1’, // paying 1 ether   +}); +{ + value: { + chainId: 1337, + confirmations: 0, + data: '0x', + from: '0x8577181F3D8A38a532Ef8F3D6Fd9a31baE73b1EA', + gasLimit: { BigNumber: "21000" }, + gasPrice: { BigNumber: "1" }, + hash: '0xdbf6b710ded42ae0fcfb0ec601235afce5acd0a01b785002cf0581fab4d53b52', + nonce: 5, + r: '0x7502ebb9c10e1664d9a344b636c1151a9ebc6b9dd1aa2bad9f739d15368a83f9', + s: '0x3a71b2b3a2a90527e2cf221606b89af5ac8195b8146f9d2776e4ca342b7e37b2', + to: '0x8ba1f109551bD432803012645Ac136ddd64DBA72', + type: null, + v: 2710, + value: { BigNumber: "1000000000000000000" }, + wait: [Function], + cancel: [Function: cancelTransaction], + speedUp: [Function: speedUpTransaction], + change: [Function: changeTransaction] + },   + isTransaction: true +} +``` + +In this case the function only returns a value. It does not sign any transaction (modify contract values). These cases will be shown in the following sections. + +In case that an error occurs during the execution of the “execute” function, an error will be thrown, containing a generic error and the error that originated that exception. By catching the error with a try-catch statement, and inspecting the “cause” of the exception, you’ll be able to see what happened internally. + +```javascript +// Let's assume that something goes wrong while calling the previous function. Be cautious and wrap it in a try-catch and inspect the error. +try { + await contract.execute({ + method: ‘balanceOf’, + params: [‘0x12...789’] + }); +} catch (error) { + console.log(error); + console.log(error.cause); +} +``` + +The following list are managers that follow the standards but can also be used with contracts that extend or implement them, whether standards or a particular design: + + +Token20Manager | It represents a standard ERC20 contract that implements a fungible token (a coin). +-- | -- +NFT721Manager | It represents a standard ERC721 contract that implements non-fungible tokens (NFTs). + +#### Token20Manager + +In most cases you will want to instantiate a contract designed under an ERC standard (eg ERC20 for a fungible token contract). In that case you can instantiate the contract with a specific class of the mentioned standard: + +```javascript +// commonJS +const { Token20Manager } = require('@ripio/sdk/managers'); +// TS +import { Token20Manager } from '@ripio/sdk'; +const contract = new Token20Manager(); +``` + +The advantage of using a specific class from a standard is that the concrete functions are coded to be called directly: + +```javascript +const contract = new Token20Manager(); +const address = ‘0x123...789’ +await contract.activate({ + contractAddress: CONTRACT_ADDRESS, + contractAbi: CONTRACT_ABI +}); +const name = await contract.name(); +const symbol = await contract.symbol(); +const balance = await contract.balanceOf(address); +``` + +#### NFT721Manager + +When working with NFTs it is recommended to use the NFT721Manager that follows the ERC721 standard (for a non fungible token contract). If that’s the case you can instantiate the manager of the mentioned standard: + +```javascript +// commonJS +const { NFT721Manager } = require('@ripio/sdk/managers'); +// TS +import { NFT721Manager } from '@ripio/sdk'; + +const contract = new NFT721Manager(); + +``` + +The advantage of using a specific class from a standard is that the concrete functions are coded to be called directly: + +```javascript +const contract = new NFT721Manager(); +const address = ‘0x123...789’ +await contract.activate({ + contractAddress: CONTRACT_ADDRESS, + contractAbi: CONTRACT_ABI +}); +const owner = ‘0x12...789’; +const spender = ‘0x23...678’; +const allowance = await contract.allowance(owner, spender); +const balance = await contract.balanceOf(address); +const totalSupply = await contract.totalSupply(); +``` + +#### Activation + +ContractManager and any class that represents a standard must be activated in order to be used. The activation process includes providing the ABI and the contract’s address on the blockchain. In addition to that, activation is important because it allows you to set up the connection to the Blockchain and the way in which transactions will be signed (except in read-only functions). +When you activate a ContractManager a connector is generated internally depending on the parameters provided in the activate method. + +Activating a manager without parameters in addition to contractAddress and ABI generates a BrowserWeb3Connector, which will connect and sign transactions with the injected web3 browser extension: + +```javascript +await contract.activate({ + contractAddress: CONTRACT_ADDRESS, + contractAbi: CONTRACT_ABI +}); +``` + +On the other hand, if the Blockchain node URL is added, it will generate a JsonRPCWeb3Connector, which will connect without depending on any browser extension. In this case, the manager will be in read only mode(transactions cannot be signed): + + +```javascript +await contract.activate({ + contractAddress: CONTRACT_ADDRESS, + contractAbi: CONTRACT_ABI, + providerWss: WSS +}); +``` + +If a private key is added to this last call, it will generate a JsonRPCWeb3Connector, same as the previous one, but it will be possible to sign transactions using the private key provided. + +```javascript +await contract.activate({ +contractAddress: CONTRACT_ADDRESS, + contractAbi: CONTRACT_ABI, + providerWss: WSS, + privateKey: PRIVATE_KEY +}); +``` + +Sometimes it is necessary to have a connector instance to perform certain tasks. It is possible to instantiate a BrowserWeb3Connector and JsonRPCWeb3Connector and they must be activated as well. Also, those instances can be used in activation of a ContractManager. + +With BrowserWeb3Connector: + +```javascript +let browserConn = new BrowserWeb3Connector(); +let chain = await browserConn.activate(); +await contract.activate({ + contractAddress: CONTRACT_ADDRESS, + contractAbi: CONTRACT_ABI, + connector: browserConn +}); +``` + +With JsonRPCWeb3Connector: + +```javascript +let jsonRPCConn = new JsonRPCWeb3Connector(WSS, PRIVATE_KEY); +chain = await jsonRPCConn.activate(); +await contract.activate({ + contractAddress: CONTRACT_ADDRESS, + contractAbi: CONTRACT_ABI, + connector: jsonRPCConn +}); +``` + +### Injected web3 interaction + +When activating a BrowserWeb3Connector the web3 browser extension will receive a request that the user must approve so that the connector can operate on behalf of the connected account. If this request is rejected then the activation process will fail. + +Once the BrowserWeb3Connector is active the following methods are available to be used: + +- Add a new chain: + +```javascript +const chainId = 100; +const chainName = ‘Ripio testnet’; +const rpcUrl = ‘https://testnet.ripio.com’; +const currencyName = ‘NAME’; +const currencySymbol = ‘SYMBOL’; +await connector.addChain( + chainId, + chainName, + rpcUrl, + currencyName, + currencySymbol +); +``` + +- Request a chain switch: + +```javascript +const chainId = 100; +await connector.switchChain(chainId); +``` + +An injected web3 provider will emit events so that the user can listen to them and act accordingly. To do that, the manager instances contain a [NodeJS EventEmitter](https://nodejs.org/api/events.html) that will be listening to these events, handling the changes and re-emitting them. The manager instances have methods for the user to create or delete listeners as follows: + +```javascript +const manager = new ContractManager(); +await manager.activate(...); +const event = ProviderEvents.CHAIN_CHANGED; +function listener(chainId){...} +// add a listener to a certain event +manager.on(event, listener); // alias: addListener(...) +// add a one-time listener to a certain event +manager.once(event, listener); +// remove an event listener from an event +manager.off(event, listener); // alias: removeListener(...) +// remove all listeners for an event +manager.removeAllListeners(event?); +``` + +Once the manager gets activated with a BrowserWeb3Provider it will subscribe to the following injected web3 provider events so that the user can listen to them with the previous explained methods: + +- CONNECT: 'connect' (Emits a ConnectInfo object). +- DISCONNECT: 'disconnect' (Emits a ProviderRpcError object). +- ACCOUNT_CHANGED: 'accountsChanged' (Emits a JsonRpcSigner or Wallet object). +- CHAIN_CHANGED: 'chainChanged' (Emits a number representing the chain Id). + +### Transaction management + +The manager instances have a safeMode, active by default, that will impact on the execute function by first executing the transaction with callStatic (this does not actually change any state, but is free). This can be used to determine if a transaction will fail or succeed. + +When sending a transaction, this could be through the execute function of a manager instance or a transferBalance of a connector instance, the response obtained includes all properties of a Transaction as well as several properties that are useful once it has been mined, for example: + +- wait(confirmations?): + +An asynchronous function that receives the amount of confirmations to wait for before considering that the transaction has been included in the chain. It is recommended to use the getMinConfirmations function, it will return an amount based on the chainId being provided or a default value. + +```javascript +const tx = await manager.execute(...); +const confirmations = getMinConfirmations(manager.connector.chainId); +await tx.transactionResponse.wait(confirmations); // amount of confirmations for the specific chain or a default value +const confirmations = 10; +await tx.transactionResponse.wait(confirmations); // 10 confirmations +``` + +- cancel(gasSpeed?): + +An asynchronous function that cancels a transaction by sending a transaction with value 0, the same nonce and a higher fee. If no parameter was passed to the cancel function then it will use the speedUpPercentage value available on the connector class with a 10% default value.It can be canceled if the transaction is still in the mem pool, in case that the transaction was already mined then it will fail. + +```javascript +const tx = await manager.execute(...); +const response = await tx.transactionResponse.cancel(); // default gas price 10% up +const gasSpeed = BigNumber.from(40); +const response = await tx.transactionResponse.cancel(gasSpeed); +``` + +- speedUp(gasSpeed?): + +An asynchronous function that speeds up a transaction by re-sending it with a higher fee. If no parameter was passed to the speedUp function then it will use the speedUpPercentage value available on the connector class with a 10% default value. It can be speeded up if the transaction is still in the mem pool, in case that the transaction was already mined then it will fail. + +```javascript +const tx = await manager.execute(...); +const response = await tx.transactionResponse.speedUp(); // default gas price 10% up +const gasSpeed = BigNumber.from(40); +const response = await tx.transactionResponse.speedUp(gasSpeed); +``` + +- change(newParams, gasSpeed?): + +An asynchronous function that changes the transaction by repeating the execution of the same method but updating the parameters passed to the function with new ones. If no gasSpeed parameter was passed to the change function then it will use the speedUpPercentage value available on the connector class with a 10% default value. It can be changed if the transaction is still in the mem pool, in case that the transaction was already mined then it will fail. + +```javascript +const tx = await manager.execute(...); +const response = await tx.transactionResponse.change({to: ‘0x...123’}); // default gas price 10% up +const gasSpeed = BigNumber.from(100); +const response = await tx.transactionResponse.change({to: ‘0x...123’}, gasSpeed); +``` + +### Utils and others + +The utils submodule exports certain functionalities related to: + +#### Connectors + +- verifyMessage(nonce, signature, expectedAddress): It takes a nonce, a signature, and an expected address, and returns true if the signature is valid for the nonce and the expected address. + +```javascript +// commonJS +const { connectorsUtils } = require('@ripio/sdk/utils'); +// TS +import { connectorsUtils } from '@ripio/sdk'; + +const message = ‘Log in with nonce: 999’; +const expected = ‘0x12...789’ +const signature = ‘abc...123’; +connectorsUtils.verifyMessage(message, signature, expected); +true + +``` + +- getMinConfirmations(chainId): It returns the minimum number of confirmations required for a transaction to be considered valid for a specific chain. + +```javascript +// commonJS +const { connectorsUtils } = require('@ripio/sdk/utils'); +// TS +import { connectorsUtils } from '@ripio/sdk'; + +connectorsUtils.getMinConfirmations(100); +1 +``` + + +#### Conversions + +- fromWei(value, unit): It takes a BigNumberish value and a unit and returns a string. + +```javascript +// commonJS +const { conversions } = require('@ripio/sdk/utils'); +const { enums } = require('@ripio/sdk/types'); +// TS +import { conversions } from '@ripio/sdk'; +import { enums } from '@ripio/sdk'; + +conversions.fromWei('1', enums.UnitTypes.ETHER); +'0.000000000000000001' +conversions.fromWei('1', enums.UnitTypes.WEI); +'1' + +``` + +- toWei(value, unit): It converts a string value representing a unit type into WEI (BigNumber). + +```javascript +// commonJS +const { conversions } = require('@ripio/sdk/utils'); +const { enums } = require('@ripio/sdk/types'); +// TS +import { conversions } from '@ripio/sdk'; +import { enums } from '@ripio/sdk'; + +conversions.toWei('1', enums.UnitTypes.ETHER)BigNumber { _hex: '0x0de0b6b3a7640000', _isBigNumber: true } +conversions.toWei('1', enums.UnitTypes.WEI)BigNumber { _hex: '0x01', _isBigNumber: true } +conversions.toWei('1', enums.UnitTypes.ETHER).toString(); +'1000000000000000000' +conversions.toWei('1', enums.UnitTypes.WEI).toString(); +'1' +``` + +- numberToHex(num): It converts a number to a hex string (only integers). + +```javascript +// commonJS +const { conversions } = require('@ripio/sdk/utils'); +// TS +import { conversions } from '@ripio/sdk'; + +conversions.numberToHex(123); +‘0x7b’ + +``` + +- hexToNumber(hex): It takes a hexadecimal string and returns a number. + +```javascript +// commonJS +const { conversions } = require('@ripio/sdk/utils'); +// TS +import { conversions } from '@ripio/sdk'; + +conversions.hexToNumber(‘0x7b’); +123 +``` + +### Other resources + +- [sdk nft](https://ripio.github.io/sdkjs/sdk-nft) +- [sdk storage aws](https://ripio.github.io/sdkjs/sdk-storage-aws) +- [sdk storage http](https://ripio.github.io/sdkjs/sdk-storage-http) +- [sdk storage ipfs](https://ripio.github.io/sdkjs/sdk-storage-ipfs) \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4428841..4e60ba1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7173,58 +7173,6 @@ "node": ">= 10.0.0" } }, - "node_modules/ganache/node_modules/base64-js": { - "version": "1.5.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/ganache/node_modules/bn.js": { - "version": "4.12.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache/node_modules/brorand": { - "version": "1.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache/node_modules/buffer": { - "version": "6.0.3", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/ganache/node_modules/bufferutil": { "version": "4.0.5", "dev": true, @@ -7249,20 +7197,6 @@ "node": ">=6" } }, - "node_modules/ganache/node_modules/elliptic": { - "version": "6.5.4", - "dev": true, - "license": "MIT", - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "node_modules/ganache/node_modules/emittery": { "version": "0.10.0", "dev": true, @@ -7274,71 +7208,6 @@ "url": "https://github.com/sindresorhus/emittery?sponsor=1" } }, - "node_modules/ganache/node_modules/hash.js": { - "version": "1.1.7", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "node_modules/ganache/node_modules/hmac-drbg": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/ganache/node_modules/ieee754": { - "version": "1.2.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" - }, - "node_modules/ganache/node_modules/inherits": { - "version": "2.0.4", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache/node_modules/is-buffer": { - "version": "2.0.5", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/ganache/node_modules/keccak": { "version": "3.0.1", "dev": true, @@ -7401,16 +7270,6 @@ "node": ">=10" } }, - "node_modules/ganache/node_modules/minimalistic-assert": { - "version": "1.0.1", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache/node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, "node_modules/ganache/node_modules/napi-macros": { "version": "2.0.0", "dev": true, @@ -7421,35 +7280,6 @@ "dev": true, "license": "MIT" }, - "node_modules/ganache/node_modules/node-gyp-build": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, - "node_modules/ganache/node_modules/queue-microtask": { - "version": "1.2.3", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/ganache/node_modules/queue-tick": { "version": "1.0.0", "dev": true, @@ -9211,9 +9041,10 @@ "license": "ISC" }, "node_modules/json5": { - "version": "2.2.1", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, - "license": "MIT", "bin": { "json5": "lib/cli.js" }, @@ -9788,9 +9619,8 @@ }, "node_modules/node-gyp-build": { "version": "4.3.0", + "devOptional": true, "license": "MIT", - "optional": true, - "peer": true, "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -12960,9 +12790,10 @@ } }, "node_modules/protobufjs": { - "version": "6.11.3", + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", "hasInstallScript": true, - "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -14798,7 +14629,7 @@ }, "packages/nft": { "name": "@ripio/sdk-nft", - "version": "1.0.0-dev.1", + "version": "1.0.2", "license": "Apache 2.0", "dependencies": { "@babel/runtime": "^7.17.7", @@ -14808,7 +14639,7 @@ }, "packages/sdk": { "name": "@ripio/sdk", - "version": "2.0.0-dev.1", + "version": "2.0.1", "license": "Apache 2.0", "dependencies": { "@babel/runtime": "^7.17.7", @@ -14817,7 +14648,7 @@ }, "packages/storageAws": { "name": "@ripio/sdk-storage-aws", - "version": "1.0.0-dev.1", + "version": "1.0.1", "license": "Apache 2.0", "dependencies": { "@aws-sdk/client-s3": "^3.197.0", @@ -14827,7 +14658,7 @@ }, "packages/storageHttp": { "name": "@ripio/sdk-storage-http", - "version": "1.0.0-dev.1", + "version": "1.0.1", "license": "Apache 2.0", "dependencies": { "@babel/runtime": "^7.17.7", @@ -14837,7 +14668,7 @@ }, "packages/storageIpfs": { "name": "@ripio/sdk-storage-ipfs", - "version": "1.0.0-dev.1", + "version": "1.0.1", "license": "Apache 2.0", "dependencies": { "@babel/runtime": "^7.17.7", @@ -19644,26 +19475,6 @@ "node-gyp-build": "4.3.0" } }, - "base64-js": { - "version": "1.5.1", - "dev": true - }, - "bn.js": { - "version": "4.12.0", - "dev": true - }, - "brorand": { - "version": "1.1.0", - "dev": true - }, - "buffer": { - "version": "6.0.3", - "dev": true, - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "bufferutil": { "version": "4.0.5", "dev": true, @@ -19679,52 +19490,10 @@ "queue-tick": "^1.0.0" } }, - "elliptic": { - "version": "6.5.4", - "dev": true, - "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "emittery": { "version": "0.10.0", "dev": true }, - "hash.js": { - "version": "1.1.7", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hmac-drbg": { - "version": "1.0.1", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "ieee754": { - "version": "1.2.1", - "dev": true - }, - "inherits": { - "version": "2.0.4", - "dev": true - }, - "is-buffer": { - "version": "2.0.5", - "dev": true - }, "keccak": { "version": "3.0.1", "dev": true, @@ -19767,14 +19536,6 @@ } } }, - "minimalistic-assert": { - "version": "1.0.1", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "dev": true - }, "napi-macros": { "version": "2.0.0", "dev": true @@ -19783,14 +19544,6 @@ "version": "2.0.2", "dev": true }, - "node-gyp-build": { - "version": "4.3.0", - "dev": true - }, - "queue-microtask": { - "version": "1.2.3", - "dev": true - }, "queue-tick": { "version": "1.0.0", "dev": true @@ -20962,7 +20715,9 @@ "dev": true }, "json5": { - "version": "2.2.1", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, "jsonfile": { @@ -21320,8 +21075,7 @@ }, "node-gyp-build": { "version": "4.3.0", - "optional": true, - "peer": true + "devOptional": true }, "node-int64": { "version": "0.4.0", @@ -23465,7 +23219,9 @@ } }, "protobufjs": { - "version": "6.11.3", + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", diff --git a/packages/nft/CHANGELOG.md b/packages/nft/CHANGELOG.md index c9012e4..743c706 100644 --- a/packages/nft/CHANGELOG.md +++ b/packages/nft/CHANGELOG.md @@ -1,3 +1,17 @@ +# [@ripio/sdk-nft-v1.0.2](https://github.com/ripio/sdkjs/compare/@ripio/sdk-nft-v1.0.1...@ripio/sdk-nft-v1.0.2) (2023-02-16) + + +### Bug Fixes + +* Update readme ([dfe46b7](https://github.com/ripio/sdkjs/commit/dfe46b7eb9a9412f5fb0043732cad7f193110d71)) + +# [@ripio/sdk-nft-v1.0.1](https://github.com/ripio/sdkjs/compare/@ripio/sdk-nft-v1.0.0...@ripio/sdk-nft-v1.0.1) (2022-12-21) + + +### Bug Fixes + +* add uint8arrays as a dependency ([e8b36f2](https://github.com/ripio/sdkjs/commit/e8b36f2ab60ffc2f0ca4d249082f9ef93d911793)) + # [@ripio/sdk-nft-v1.0.1-dev.1](https://github.com/ripio/sdkjs/compare/@ripio/sdk-nft-v1.0.0...@ripio/sdk-nft-v1.0.1-dev.1) (2022-12-21) diff --git a/packages/nft/README.md b/packages/nft/README.md index 5f60496..f4e7032 100644 --- a/packages/nft/README.md +++ b/packages/nft/README.md @@ -2,7 +2,7 @@ Classes to interact with NFTs. -#### Disclaimer +### Disclaimer This repository is still a "work in progress", we appreciate any feedback you can provide us. @@ -18,11 +18,13 @@ npm install @ripio/sdk-nft ### Documentation -Read the [docs](https://github.com/ripio/sdkjs/wiki) in our project's wiki. +Read the [docs](https://ripio.github.io/sdkjs) on github pages. -- [Intro](https://github.com/ripio/sdkjs/wiki/1.-Intro) -- [Getting started](https://github.com/ripio/sdkjs/wiki/2.-Getting-started) -- [Overview](https://github.com/ripio/sdkjs/wiki/3.-Overview) +- [sdk](https://ripio.github.io/sdkjs/sdk) +- [sdk nft](https://ripio.github.io/sdkjs/sdk-nft) +- [sdk storage aws](https://ripio.github.io/sdkjs/sdk-storage-aws) +- [sdk storage http](https://ripio.github.io/sdkjs/sdk-storage-http) +- [sdk storage ipfs](https://ripio.github.io/sdkjs/sdk-storage-ipfs) # License diff --git a/packages/nft/package.json b/packages/nft/package.json index 883abbc..7928dc7 100644 --- a/packages/nft/package.json +++ b/packages/nft/package.json @@ -1,6 +1,6 @@ { "name": "@ripio/sdk-nft", - "version": "1.0.1-dev.1", + "version": "1.0.2", "description": "Tools to interact with a NFT", "files": [ "dist" diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index 4ece00d..962fead 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -1,3 +1,10 @@ +# [@ripio/sdk-v2.0.1](https://github.com/ripio/sdkjs/compare/@ripio/sdk-v2.0.0...@ripio/sdk-v2.0.1) (2023-02-16) + + +### Bug Fixes + +* Update readme ([dfe46b7](https://github.com/ripio/sdkjs/commit/dfe46b7eb9a9412f5fb0043732cad7f193110d71)) + # [@ripio/sdk-v2.0.0](https://github.com/ripio/sdkjs/compare/@ripio/sdk-v1.1.0...@ripio/sdk-v2.0.0) (2022-12-02) diff --git a/packages/sdk/README.md b/packages/sdk/README.md index 3f82a27..2e192ed 100644 --- a/packages/sdk/README.md +++ b/packages/sdk/README.md @@ -1,10 +1,10 @@ # Intro -#### What is Ripio SDK js? +### What is Ripio SDK js? Ripio SDK js is a library written in javascript that allows you to interact with any EVM. As a main feature, Ripio SDK grants simplicity in writing code to transact on blockchain. It has 3 layers of abstraction that goes from, the most generic in terms of interaction with Smart Contracts, to a more oriented design for each of the use cases/industries where you can develop a dApp. Ripio SDK js uses Ethers js to perform the interaction with the blockchain while simplifying its use. -#### Disclaimer +### Disclaimer This repository is still a "work in progress", we appreciate any feedback you can provide us. @@ -20,11 +20,13 @@ npm install @ripio/sdk ### Documentation -Read the [docs](https://github.com/ripio/sdkjs/wiki) in our project's wiki. +Read the [docs](https://ripio.github.io/sdkjs) on github pages. -- [Intro](https://github.com/ripio/sdkjs/wiki/1.-Intro) -- [Getting started](https://github.com/ripio/sdkjs/wiki/2.-Getting-started) -- [Overview](https://github.com/ripio/sdkjs/wiki/3.-Overview) +- [sdk](https://ripio.github.io/sdkjs/sdk) +- [sdk nft](https://ripio.github.io/sdkjs/sdk-nft) +- [sdk storage aws](https://ripio.github.io/sdkjs/sdk-storage-aws) +- [sdk storage http](https://ripio.github.io/sdkjs/sdk-storage-http) +- [sdk storage ipfs](https://ripio.github.io/sdkjs/sdk-storage-ipfs) # License diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 82c626f..d339930 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@ripio/sdk", - "version": "2.0.0", + "version": "2.0.1", "description": "SDK to interact with Smart Contracts and wallets", "files": [ "dist" diff --git a/packages/storageAws/CHANGELOG.md b/packages/storageAws/CHANGELOG.md index 39b4bdf..c925f59 100644 --- a/packages/storageAws/CHANGELOG.md +++ b/packages/storageAws/CHANGELOG.md @@ -1,3 +1,10 @@ +# [@ripio/sdk-storage-aws-v1.0.1](https://github.com/ripio/sdkjs/compare/@ripio/sdk-storage-aws-v1.0.0...@ripio/sdk-storage-aws-v1.0.1) (2023-02-16) + + +### Bug Fixes + +* Update readme ([dfe46b7](https://github.com/ripio/sdkjs/commit/dfe46b7eb9a9412f5fb0043732cad7f193110d71)) + # @ripio/sdk-storage-aws-v1.0.0 (2022-12-02) diff --git a/packages/storageAws/README.md b/packages/storageAws/README.md index b06c7ae..ec50aba 100644 --- a/packages/storageAws/README.md +++ b/packages/storageAws/README.md @@ -2,7 +2,7 @@ Upload and get NFTs data stored on an AWS S3 bucket -#### Disclaimer +### Disclaimer This repository is still a "work in progress", we appreciate any feedback you can provide us. @@ -18,12 +18,13 @@ npm install @ripio/sdk-storage-aws ### Documentation -Read the [docs](https://github.com/ripio/sdkjs/wiki) in our project's wiki. - -- [Intro](https://github.com/ripio/sdkjs/wiki/1.-Intro) -- [Getting started](https://github.com/ripio/sdkjs/wiki/2.-Getting-started) -- [Overview](https://github.com/ripio/sdkjs/wiki/3.-Overview) +Read the [docs](https://ripio.github.io/sdkjs) on github pages. +- [sdk](https://ripio.github.io/sdkjs/sdk) +- [sdk nft](https://ripio.github.io/sdkjs/sdk-nft) +- [sdk storage aws](https://ripio.github.io/sdkjs/sdk-storage-aws) +- [sdk storage http](https://ripio.github.io/sdkjs/sdk-storage-http) +- [sdk storage ipfs](https://ripio.github.io/sdkjs/sdk-storage-ipfs) # License Apache 2.0 diff --git a/packages/storageAws/package.json b/packages/storageAws/package.json index d427f2b..bc1a8b5 100644 --- a/packages/storageAws/package.json +++ b/packages/storageAws/package.json @@ -1,6 +1,6 @@ { "name": "@ripio/sdk-storage-aws", - "version": "1.0.0", + "version": "1.0.1", "description": "Get and upload data related to a NFT hosted on AWS", "files": [ "dist" diff --git a/packages/storageHttp/CHANGELOG.md b/packages/storageHttp/CHANGELOG.md index 0e3db17..8144d67 100644 --- a/packages/storageHttp/CHANGELOG.md +++ b/packages/storageHttp/CHANGELOG.md @@ -1,3 +1,10 @@ +# [@ripio/sdk-storage-http-v1.0.1](https://github.com/ripio/sdkjs/compare/@ripio/sdk-storage-http-v1.0.0...@ripio/sdk-storage-http-v1.0.1) (2023-02-16) + + +### Bug Fixes + +* Update readme ([dfe46b7](https://github.com/ripio/sdkjs/commit/dfe46b7eb9a9412f5fb0043732cad7f193110d71)) + # @ripio/sdk-storage-http-v1.0.0 (2022-12-02) diff --git a/packages/storageHttp/README.md b/packages/storageHttp/README.md index b0a91d3..ed67be7 100644 --- a/packages/storageHttp/README.md +++ b/packages/storageHttp/README.md @@ -2,7 +2,7 @@ Get NFTs data stored on an AWS S3 bucket -#### Disclaimer +### Disclaimer This repository is still a "work in progress", we appreciate any feedback you can provide us. @@ -18,11 +18,13 @@ npm install @ripio/sdk-storage-http ### Documentation -Read the [docs](https://github.com/ripio/sdkjs/wiki) in our project's wiki. +Read the [docs](https://ripio.github.io/sdkjs) on github pages. -- [Intro](https://github.com/ripio/sdkjs/wiki/1.-Intro) -- [Getting started](https://github.com/ripio/sdkjs/wiki/2.-Getting-started) -- [Overview](https://github.com/ripio/sdkjs/wiki/3.-Overview) +- [sdk](https://ripio.github.io/sdkjs/sdk) +- [sdk nft](https://ripio.github.io/sdkjs/sdk-nft) +- [sdk storage aws](https://ripio.github.io/sdkjs/sdk-storage-aws) +- [sdk storage http](https://ripio.github.io/sdkjs/sdk-storage-http) +- [sdk storage ipfs](https://ripio.github.io/sdkjs/sdk-storage-ipfs) # License diff --git a/packages/storageHttp/package.json b/packages/storageHttp/package.json index 2ea7d8c..7683527 100644 --- a/packages/storageHttp/package.json +++ b/packages/storageHttp/package.json @@ -1,6 +1,6 @@ { "name": "@ripio/sdk-storage-http", - "version": "1.0.0", + "version": "1.0.1", "description": "Get data related to a NFT through http", "files": [ "dist" diff --git a/packages/storageIpfs/CHANGELOG.md b/packages/storageIpfs/CHANGELOG.md index 89bbb35..d0fda03 100644 --- a/packages/storageIpfs/CHANGELOG.md +++ b/packages/storageIpfs/CHANGELOG.md @@ -1,3 +1,10 @@ +# [@ripio/sdk-storage-ipfs-v1.0.1](https://github.com/ripio/sdkjs/compare/@ripio/sdk-storage-ipfs-v1.0.0...@ripio/sdk-storage-ipfs-v1.0.1) (2023-02-16) + + +### Bug Fixes + +* Update readme ([dfe46b7](https://github.com/ripio/sdkjs/commit/dfe46b7eb9a9412f5fb0043732cad7f193110d71)) + # @ripio/sdk-storage-ipfs-v1.0.0 (2022-12-02) diff --git a/packages/storageIpfs/README.md b/packages/storageIpfs/README.md index 3877fd1..ae3c9e8 100644 --- a/packages/storageIpfs/README.md +++ b/packages/storageIpfs/README.md @@ -2,7 +2,7 @@ Upload and get NFTs data stored on IPFS -#### Disclaimer +### Disclaimer This repository is still a "work in progress", we appreciate any feedback you can provide us. @@ -18,11 +18,13 @@ npm install @ripio/sdk-storage-ipfs ### Documentation -Read the [docs](https://github.com/ripio/sdkjs/wiki) in our project's wiki. +Read the [docs](https://ripio.github.io/sdkjs) on github pages. -- [Intro](https://github.com/ripio/sdkjs/wiki/1.-Intro) -- [Getting started](https://github.com/ripio/sdkjs/wiki/2.-Getting-started) -- [Overview](https://github.com/ripio/sdkjs/wiki/3.-Overview) +- [sdk](https://ripio.github.io/sdkjs/sdk) +- [sdk nft](https://ripio.github.io/sdkjs/sdk-nft) +- [sdk storage aws](https://ripio.github.io/sdkjs/sdk-storage-aws) +- [sdk storage http](https://ripio.github.io/sdkjs/sdk-storage-http) +- [sdk storage ipfs](https://ripio.github.io/sdkjs/sdk-storage-ipfs) # License diff --git a/packages/storageIpfs/package.json b/packages/storageIpfs/package.json index a123b25..aaaae8d 100644 --- a/packages/storageIpfs/package.json +++ b/packages/storageIpfs/package.json @@ -1,6 +1,6 @@ { "name": "@ripio/sdk-storage-ipfs", - "version": "1.0.0", + "version": "1.0.1", "description": "Get and upload data related to a NFT hosted on Ipfs", "files": [ "dist"