0.0.21 • Published 1 year ago
@cryptoseller-tools/payments-sdk-v1 v0.0.21
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
1 year ago
0.0.21
1 year ago
0.0.18
1 year ago
0.0.19
1 year ago
0.0.17
1 year ago
0.0.16
1 year ago
0.0.14
1 year ago
0.0.15
1 year ago
0.0.13
1 year ago
0.0.12
1 year ago
0.0.10
1 year ago
0.0.11
1 year ago
0.0.9
1 year ago
0.0.8
1 year ago
0.0.7
1 year ago
0.0.5
1 year ago
0.0.4
1 year ago
0.0.6
1 year ago
0.0.3
1 year ago
0.0.2
1 year ago
0.0.1
1 year ago