Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update develop with main #49

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8d701cf
Merge pull request #41 from ripio/develop
fedeaviles Dec 21, 2022
b4471a2
chore(release): 1.0.1 [skip ci]
semantic-release-bot Dec 21, 2022
fa7813c
feat: add docs
AgusVelez5 Jan 4, 2023
279d336
update docs
AgusVelez5 Jan 4, 2023
960cd29
update docs structure
AgusVelez5 Jan 4, 2023
3c9cbde
update sdk docs
AgusVelez5 Jan 4, 2023
aecc583
Merge pull request #42 from ripio/WS-134-gh-pages
AgusVelez5 Jan 4, 2023
7f759c0
remove html from docs
AgusVelez5 Jan 5, 2023
cdf0f1d
Merge pull request #43 from ripio/WS-135-fix-docs
AgusVelez5 Jan 5, 2023
84ad566
build(deps): bump json5 from 2.2.1 to 2.2.3
dependabot[bot] Jan 10, 2023
82ae1bb
Merge pull request #48 from ripio/dependabot/npm_and_yarn/json5-2.2.3
alfarkas Jan 10, 2023
6c183df
replace rgc with ripio
fedeaviles Feb 16, 2023
8e178fb
use correct package
fedeaviles Feb 16, 2023
dfe46b7
fix: Update readme
fedeaviles Feb 16, 2023
5adb78b
Merge pull request #58 from ripio/WS-156-documentation-rgc-x-ripio-m
fedeaviles Feb 16, 2023
0979b4f
chore(release): 2.0.1 [skip ci]
semantic-release-bot Feb 16, 2023
f652543
chore(release): 1.0.2 [skip ci]
semantic-release-bot Feb 16, 2023
773f0c7
chore(release): 1.0.1 [skip ci]
semantic-release-bot Feb 16, 2023
52431a7
chore(release): 1.0.1 [skip ci]
semantic-release-bot Feb 16, 2023
b44e151
chore(release): 1.0.1 [skip ci]
semantic-release-bot Feb 16, 2023
dd9868c
build(deps): bump protobufjs from 6.11.3 to 6.11.4
dependabot[bot] Aug 16, 2023
861a6d2
Merge pull request #69 from ripio/dependabot/npm_and_yarn/protobufjs-…
alfarkas Aug 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
23 changes: 23 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -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)
98 changes: 98 additions & 0 deletions docs/sdk-nft/README.md
Original file line number Diff line number Diff line change
@@ -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)
69 changes: 69 additions & 0 deletions docs/sdk-storage-aws/README.md
Original file line number Diff line number Diff line change
@@ -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)
55 changes: 55 additions & 0 deletions docs/sdk-storage-http/README.md
Original file line number Diff line number Diff line change
@@ -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)
72 changes: 72 additions & 0 deletions docs/sdk-storage-ipfs/README.md
Original file line number Diff line number Diff line change
@@ -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)
Loading