o3-dapi-pay
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

o3-dapi-pay

Simple Payments Plugin for o3-dapi

Requires o3-dapi-core to operate.

Usage

In a browser - cdn

<script src="https://cdn.jsdelivr.net/npm/o3-dapi-pay/lib/o3-dapi-pay.min.js"></script>
window.o3dapiPay

Install via npm npm version

npm i --save o3-dapi-pay

or

yarn add o3-dapi-pay
var o3dapiPay = require('o3-dapi-pay');

import o3dapiPay from 'o3-dapi-pay';

Example

import o3dapi from 'o3-dapi-core';
import o3dapiPay from 'o3-dapi-pay';

o3dapi.initPlugins([o3dapiPay]);

o3dapi.PAY.send({
  asset: o3dapi.PAY.ASSETS.USDC,
  toAddress: 'ATphdznMVmtdREtr3nWAq4C5H4A8ioV4Bd',
  amount: '1'
})
.then(result => {
  const {
    asset,
    toAddress,
    amount,
    txid,
  };
  console.log('sent: ', txid);
})
.catch(err => {
  console.error('failed or rejected', err);
});

Readme

Keywords

none

Package Sidebar

Install

npm i o3-dapi-pay

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

137 kB

Total Files

21

Last publish

Collaborators

  • nickfujita