LoginSignup
4
0

More than 5 years have passed since last update.

rippleの入金確認手順

Last updated at Posted at 2017-05-14

準備

事前に20xrp入金してアクティベートを済ませたリップルアドレス(address)を用意
入金の確認に秘密鍵は必要なし

リップルアドレスの入金を開始する台帳番号を取得して保存する(since_ledger)

const since_ledger = await api.getAccountInfo(address).then(res => res.previousAffectingTransactionLedgerVersion)

手順

  • 現在の最新台帳番号を取得する(current_ledger)
const current_ledger = await api.getLedger().then(res => res.ledgerVersion)
  • DBのトランザクションを開始する
  • DBをロックする
  • DBから入金を開始する台帳番号を取得する(since_ledger)

  • 台帳番号で範囲を指定してアドレスからトランザクション一覧を取得する

const transactions = await api.getTransactions(address, {
  minLedgerVersion:since_ledger,
  maxLedgerVersion:current_ledger,
})
  • トランザクションがリストで取得できるのでチェックして入金処理を行う(destination_tagやpartialpaymentあたり)

  • 現在の台帳番号を次の入金開始する台帳番号(since_ledger)としてDBに保存する

  • DBのトランザクションをコミットする

関連事項

4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0