1.0.7 • Published 1 year ago

tabla-client v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

TablaClient

A class for interacting with the Tabla ComplianceSigner contract.

Installation

To install the required packages:

npm install;

Usage

  1. Import Tabla client library
import {TablaClient} from 'tabla-client';
  1. Create client instance.

Where:

  • token - provider access token
  • provider - provider address
const client = new TablaClient(<token>, <provider>);
  1. Request transaction object
const transaction = await client.requestTransaction(<provider>, <KYCdata>, <network>, <dev>?);

Where:

  • provider - platform provider address
  • KYCdata - JSON that contains KYC Data { 'fullName', 'dateOfBirth', 'country', 'postal_code', 'residence_address', 'region', 'walletAddress', 'status' }
  • network - name of network (celo or eth)
  • dev - boolean optional value. If true will use testnet contracts depending on provided chain

The response will be transaction object {to: "0xproviderSigner"; data: "0xcalldata"}

Calling provider contract

import { ethers } from 'ethers';
import { TablaClient } from 'tabla-client';

const KYCData = {
    'fullName' : 'John Doe',
    'dateOfBirth' : '1970-01-01',
    'country' : 'US',
    'postal_code' : '12000',
    'residence_address' : '1230 Ocean Avenue',
    'region' : '',
    'walletAddress' : '0xd67952680485f9E55b7acaFac54E9ec7874F1211',
    'status' : 'accredited'
    }

const client = new TablaClient(token, providerAddress);
const rpcProvider = new ethers.providers.JsonRpcProvider(ethNodeUrl);
const wallet = new ethers.Wallet(privateKey, rpcProvider);
const transaction = await client.requestTransaction(providerAddress, KYCData, network);
await wallet.sendTransaction(transaction);

Here is the example of smart contract instance creation and calling setProperty() using ethers.js on ethereum mainnet

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago