0.0.1 • Published 2 years ago

dashpro v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago
import { dashpro, Wallet } from 'dashpro'

const wallet = Wallet(process.env.DASHPRO_WALLET_BACKUP_PHRASE)
const newWallet = Wallet()

console.log('New Dash wallet created, please write down your backup phrase to access your funds:\n\n')
console.log(newWallet.backup_phrase)

const { uri, check, paid, cancel } = await dashpro({

  to: [{
    address: newWallet.address,
    amount: {
      value: 2500000,
      currency: 'ARS'
    }
  }, {
    address: wallet.address,
    amount: {
      value: 25,
      currency: 'DASH'
    }
  }],

  webhook_url: process.env.DASHPRO_WEBHOOK_URL,

  memo: 'Split Payment to Two Wallets'

})

paid.then(({ txid, txhex }) => {
  

})

const shouldCancel = false

if (shouldCancel) {

  cancel()

}

const { txid, txhex } = await wallet.pay(uri)

const { status } = await check()

const { uri: receive } = await wallet.receive({
  amount: {
    currency: 'USD',
    value: 52.00
  }
})
0.0.1

2 years ago