0.0.21 • Published 10 months ago

@cryptoseller-tools/payments-sdk-v1 v0.0.21

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

CST Payments SDK v1

SDK for crypto payments through CST.Pay service

Make online shoping with cryptocurrency more secure and reliable with CST.Pay

Benefits of using CST.Pay

  • Validated tokens and recipient addresses, the customer will not be able to send tokens to the wrong address, or use fake tokens;
  • Do not require knowledge of web3 to start using;
  • Decentralized, customers can use self-custody wallets like Metamask or Ledger;
  • Smart Contracts do not store any tokens;
  • Small fees from 0% - 1%;

!IMPORTANT Before using SDK, you need to get recipientId. You can do it on cryptoseller.tools/pay/dashboard

Usage

import cst from '@cryptoseller-tools/payments-sdk-v1';

async function approveAndTransfer(){
    const provider = new ethers.BrowserProvider(window.ethereum); // or any other Eip1193Provider
    const signer = await provider.getSigner()

    const recipientId='0x0123...' // bytes32 in solidity
    const token='0x123...' // token address
    const id='0x123...' // bytes32
    const payload = JSON.stringify({
            name:'CST.Pay example',
            desc:'Test payload object'
        })
    const amount='100.2005' // real number, will be converted to 'wei' based on selected token's decimals.

    const a = await cst.approve({ token, amount, signer, wait: true });

    if(a.status){
        const t = await cst.transfer({ recipientId, amount, token, payload, id, signer, wait: true });
        return t.status? t.payload : t.error
    }else{
        return a.error
    }
}

!NOTE We also have ready to go widget.

Widget -> cryptoseller.tools/pay/widget

Example -> cryptoseller.tools/pay/iframe

Check cryptoseller.tools for more details

0.0.20

10 months ago

0.0.21

10 months ago

0.0.18

10 months ago

0.0.19

10 months ago

0.0.17

10 months ago

0.0.16

10 months ago

0.0.14

10 months ago

0.0.15

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.10

10 months ago

0.0.11

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.6

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago