Verify The Transaction on Mainnet: XUMM SDK

Once payload is signed and a valid transaction is made, it is crucial to check for the transaction on main/live XRP ledger network.

For this we will be making use of a npm package: xrpl-txdata

Installing xrpl-txdata

npm install xrpl-txdata

Once this package is installed on your system, you can verify the transaction on live XRP ledger locally. “Locally” because the xrpl-txdata package will be installed locally on your machine.

Video Tutorial: Verify The Transaction on Mainnet: XUMM SDK


[youtube https://www.youtube.com/watch?v=kkGFMiX8bCY]

YouTube Link: https://www.youtube.com/watch?v=kkGFMiX8bCY [Watch the Video In Full Screen.]

Why do we need to verify transaction on main XRP Ledger?

1. The end user signed the request successfully in XUMM, but with a key that is no longer valid for a certain account (because multisign has been configured, an account has been rekeyed, etc.)

2. The user sent a Partial Payment (e.g., sending EUR to deliver XRP, while the owned amount of EUR was insufficient due to exchange rate slippage).

3. The user tried to trick you into accepting a testnet payment, by signing with a funded Testnet account.

Source Code: Verify The Transaction on Mainnet: XUMM SDK

const {XummSdk} = require('xumm-sdk')
const {TxData}  = require('xrpl-txdata')

const Sdk       = new XummSdk('xumm-app-id', 'xumm-app-secret')
const Verify    = new TxData()

const main      = async() => {
    
      const request = {
        "txjson": {
            "TransactionType": "Payment",
            "Destination": "rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ",
            "Amount": "1000000"
        },
        "user_token": "343a2f1e-8160-4984-a0f0-208086509617"
      }

      const subscription = await Sdk.payload.createAndSubscribe(request, event => {
          //console.log('New payload event',event.data)

          if(Object.keys(event.data).indexOf('signed') > -1)
          {
              return event.data
          }
      }) 
      console.log('sign request URL',subscription.created.next.always)
      console.log('Pushed ',subscription.created.pushed ? 'Yes' : 'No')

      const resolveData = await subscription.resolved
      if(resolveData.signed == false)
      {
          console.log('The sign request was rejected!')
      }
      else
      {
        console.log('The sign request was Signed!!')
        const result = await Sdk.payload.get(resolveData.payload_uuidv4)
        const VerifiedResult = await Verify.getOne(result.response.txid)
        console.log('On ledger Balance ',VerifiedResult.balanceChanges)
      }
}
main()

Output of above code

sign request URL https://xumm.app/sign/b51bda5e-ebfe-48fe-b7ba-75797147c837
Pushed  Yes

On ledger Balance {
 rHdkzpxr3VfabJh9tUEDv7N4DJEsA4UioT : [{counterparty: '', currency: 'XRP', value: '-1.000012'}],
 rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ : [{counterparty: '', currency: 'XRP', value: '1'}]
}

We are interested in On ledger Balance output. Here the first address is that of sender and the second address is that of receiver. So in this transaction 1.000012 XRP was sent by the end user and 0.000012 XRP was the network fee. Also note that the transaction fee will not be distributed to miners in XRPL, but instead it gets burnt permanently, reducing the over all supply of XRP.

Transaction verification Code Explained

We import xrpl-txdata package into our nodejs application, using require keyword. Next we create an instance of it called Verify.
Once the sign request is signed we get the transaction ID. i.e., we get the transaction ID only when the transaction is done.

So once we programmatically know that the transaction is made(by looking into signed: true key value in the output), we check the transaction on main/live XRP ledger, using following code:

        console.log('The sign request was Signed!!')
        const result = await Sdk.payload.get(resolveData.payload_uuidv4)
        const VerifiedResult = await Verify.getOne(result.response.txid)
        console.log('On ledger Balance ',VerifiedResult.balanceChanges)

The instance Verify has a method called getOne() which checks the transaction on live XRP ledger, if we provide it with the transaction ID.

Switching from Testnet to Mainnet inside XUMM App

Open XUMM app present in your mobile phone. Navigate to Settings tab. Go to Advanced section. Then click on Node under the label XRP Ledger node and Explorer. Here you can switch between Main net and Test net. These are Main XRP ledger network and Test XRP ledger networks.

xrpl-txdata checks only against live XRP Ledger

Since xrpl-txdata checks only against live/main XRP ledger network, if you’re using testnet to send payments, it’ll throw error message that the transaction is not found on the main XRPL network – as your transactions will be present on test XRPL network and not on main/live XRPL network.

That’s it! You made it

If you’re this far into learning about XUMM SDK and working with XRP Ledger, then you might consider building some app, even if it’s just a hobby project.

For full “XUMM SDK/API” free video tutorial list visit: Working With XUMM SDK/API: XRPL

Send Sign Request As Push Notification: XUMM SDK

You have sent your first Payload request and also signed and/or rejected the sign request, by scanning the QR code. Now lets see how we can get user specific user token and start sending sign request as push notification to the end user.

Payload using create() method

const {XummSdk} = require('xumm-sdk')
const Sdk = new XummSdk('xumm-app-id', 'xumm-app-secret')

const main = async () => {
  const request = {
    "TransactionType": "Payment",
    "Destination": "rHdkzpxr3VfabJh9tUEDv7N4DJEsA4UioT",
    "Amount": "1000000"
  }

  const payload = await Sdk.payload.create(request, true)
  console.log(payload)
}
main()

Above code is from our previous video tutorial where we sent our first payload using create method.

Video Tutorial: Send Sign Request As Push Notification: XUMM SDK


[youtube https://www.youtube.com/watch?v=4Wxcz0jvA9A]

YouTube Link: https://www.youtube.com/watch?v=4Wxcz0jvA9A [Watch the Video In Full Screen.]

Payload using createAndSubscribe() method

const {XummSdk} = require('xumm-sdk')
const Sdk = new XummSdk('xumm-app-id', 'xumm-app-secret')

const main = async () => {
  const request = {
    "TransactionType": "Payment",
    "Destination": "rHdkzpxr3VfabJh9tUEDv7N4DJEsA4UioT",
    "Amount": "1000000"
  }

  const subscription = await Sdk.payload.createAndSubscribe(request, event => {
      console.log('New payload event',event.data)
  })
  console.log('sign request URL',subscription.created.next.always)
  console.log('Pushed ',subscription.created.pushed)
}

main()

Here we use createAndSubscribe() method instead of create() method. createAndSubscribe() also takes 2 arguments. The first argument is the payload information and the second argument is method/function that gets invoked every time the XUMM platform asynchronously sends an update about the created payload.

Running The Application

We issue the command node index.js to run our application and we get the following output:

sign request URL https://xumm.app/sign/e917182a-b64f-474d-ab24-8792d6b0ca6c
Pushed  false
New payload event { message: 'Welcome e917182a-b64f-474d-ab24-8792d6b0ca6c' }
New payload event { expires_in_seconds: 86399 }
New payload event { expires_in_seconds: 86384 }

Since main() is a asynchronous method and a child thread keeps waiting for Sdk.payload.createAndSubscribe() method to be resolved(it gets resolved once end user either signs or rejects the sign request, or when the payload expires). If we want to exit the waiting and kill the child process – get on the output terminal and press CTRL + C buttons(on windows PC).

The constant subscription(from above code) has information regarding the payload, payload status, signing URL, QR code information etc. Sdk.payload.createAndSubscribe() second argument keeps updating the payload status like expiration time until the user performs some action on the sign request. If user doesn’t perform any action until the payload gets expired, then the payload information gets expired and will be removed from the XUMM platform.

Once Payload is Resolved

Once user opens the QR code present on sign request URL(check above code output), scans it and signs or rejects the sign request, the method in seconds argument of Sdk.payload.createAndSubscribe() gets triggered and sends the updated status of the sign request.

const {XummSdk} = require('xumm-sdk')
const Sdk = new XummSdk('xumm-app-id', 'xumm-app-secret')

const main = async () => {
  const request = {
    "TransactionType": "Payment",
    "Destination": "rHdkzpxr3VfabJh9tUEDv7N4DJEsA4UioT",
    "Amount": "1000000"
  }

  const subscription = await Sdk.payload.createAndSubscribe(request, event => {
          console.log('New payload event',event.data)
          if(Object.keys(event.data).indexOf('signed') > -1)
          {
              return event.data
          }
  })
  console.log('sign request URL',subscription.created.next.always)
  console.log('Pushed ',subscription.created.pushed)
}

main()

The Object.keys you see in above code is standard Javascript code. When we pass an object to it, and chain indexOf() method and pass the key name to indexOf() method, it returns the index position of that key in the object. Index starts from 0. So it returns the event.data if and when the user interacts with the payload QR code and either signs or rejects the payload. Until user performs some action with the generated payload, event.data will not have the key signed in its output.

Lets execute above code
We issue the command node index.js to run our application and we get the following output:

sign request URL https://xumm.app/sign/e917182a-b64f-474d-ab24-8792d6b0ca6c
Pushed  false
New payload event { message: 'Welcome e917182a-b64f-474d-ab24-8792d6b0ca6c' }
New payload event { expires_in_seconds: 86399 }
New payload event { expires_in_seconds: 86384 }

Copy the sign request URL from above output and past it in a browser and open your XUMM app in your phone, scan the QR code and sign or reject the sign request and look out for the status change.

Output when the sign request gets rejected

sign request URL https://xumm.app/sign/972d25fe-413a-48a3-8935-dd95c6cdf8ef
Pushed  false
New payload event { message: 'Welcome 972d25fe-413a-48a3-8935-dd95c6cdf8ef' }
New payload event { expires_in_seconds: 86399 }
New payload event { expires_in_seconds: 86384 }
New payload event { opened: true }
New payload event {
  payload_uuidv4: '972d25fe-413a-48a3-8935-dd95c6cdf8ef',
  reference_call_uuidv4: 'd81ae124-527d-40b6-ad38-c272f9b71134',  
  signed: false,
  user_token: true,
  return_url: { app: null, web: null },
  opened_by_deeplink: false,
  custom_meta: { identifier: null, blob: null, instruction: null }
}

As you can see in the output above, the payload event status shows when the user opened his/her XUMM app and scanned the QR code { opened: true }. In above case the end user has rejected the sign request, so the signed key has a value of false. The key opened_by_deeplink is new and is implemented in XUMM SDK 0.2.2 to further improve user flows – its value is null if unopened, true if opened using a mobile deeplink/push, false if QR scan opened. Technically it is present to let the developer know whether the sign request was opened from a deeplink URL or not.

Output when the sign request is signed

sign request URL https://xumm.app/sign/848ff099-4161-4911-a024-d27c15e87f62
Pushed  false
New payload event { message: 'Welcome 848ff099-4161-4911-a024-d27c15e87f62' }
New payload event { expires_in_seconds: 86399 }
New payload event { opened: true }
New payload event { expires_in_seconds: 86384 }
New payload event {
  payload_uuidv4: '848ff099-4161-4911-a024-d27c15e87f62',
  reference_call_uuidv4: 'bc98f5b6-d960-41a3-884a-3c9dced5b0e2',  
  signed: true,
  user_token: true,
  return_url: { app: null, web: null },
  opened_by_deeplink: false,
  custom_meta: { identifier: null, blob: null, instruction: null }
}

As you can see from above output, the value of signed is true. That means end user has successfully signed the sign request. Now we take the payload_uuidv4 value and fetch the user token from it.

Fetching user_token from payload_uuidv4

const {XummSdk} = require('xumm-sdk')
const Sdk = new XummSdk('xumm-app-id', 'xumm-app-secret')

const main = async () => {
  const request = {
    "TransactionType": "Payment",
    "Destination": "rHdkzpxr3VfabJh9tUEDv7N4DJEsA4UioT",
    "Amount": "1000000"
  }

  const subscription = await Sdk.payload.createAndSubscribe(request, event => {
          // console.log('New payload event',event.data)
          if(Object.keys(event.data).indexOf('signed') > -1)
          {
              return event.data
          }
  })
      console.log('sign request URL',subscription.created.next.always)
      console.log('Pushed ',subscription.created.pushed ? 'Yes' : 'No')

      const resolveData = await subscription.resolved
      if(resolveData.signed == false)
      {
          console.log('The sign request was rejected!')
      }
      else
      {
        console.log('The sign request was Signed!!')
        const result = await Sdk.payload.get(resolveData.payload_uuidv4)
        console.log('User_token: ',result.application)
      }
}

main()

We take another constant and await for subscription to be resolved. Once the end user signs the sign request we pass the resolveData.payload_uuidv4 information to Sdk.payload.get() which outputs a lot of json results. In that we pick up the user_token present under result.application as value for key issued_user_token.

Output of above code:

sign request URL https://xumm.app/sign/da54ac54-549f-42d2-a239-8ae6086eafbd
Pushed  No
New payload event { message: 'Welcome da54ac54-549f-42d2-a239-8ae6086eafbd' }
New payload event { expires_in_seconds: 86397 }
New payload event { opened: true }
New payload event { expires_in_seconds: 86382 }
The sign request was Signed!!
User_token: {
    name: 'My Super Duper App!',
    description: 'Demo App To Show New SDK Features',
    disabled: 0,
    uuidv4: '401015ee-7edc-4469-bdfd-3af11f229885',
    icon_url: 'https://xumm-cdn.imgix.net/app-logo/2a14d2f7-d0a8-432a-a40f-b45eddb70fc4.png',
    issued_user_token: '343a2f1e-8160-4984-a0f0-208086509617'
  }

In this we are interested in issued_user_token, which will be used to send push notifications to end user. To pick it up we write result.application.issued_user_token and store it inside the database.

Sending sign request as Push Notification

The user_token is a unique token for your XUMM app in combination with the specific XUMM user. To use the token to deliver a sign requst per Push notification, let’s adjust our first (minimal) sample payload or the ‘transaction template’ to include the user token:
This payload is XRPL specific

const request = {
    "TransactionType": "Payment",
    "Destination": "rHdkzpxr3VfabJh9tUEDv7N4DJEsA4UioT",
    "Amount": "10000",
  }

Now lets add user_token information to it.

{
  "txjson": {
    "TransactionType": "Payment",
    "Destination": "rHdkzpxr3VfabJh9tUEDv7N4DJEsA4UioT",
    "Amount": "10000"
  },
  "user_token": "343a2f1e-8160-4984-a0f0-208086509617"
}

As you can see from above code, all the XRP Ledger specific payload information has been moved into a separate block under key txjson. All the other information outside of object txjson is specific to XUMM platform. Other XUMM platform specific information are: options, custom_meta and the user_token etc.

Stage is set to send sign request as Push Notification

Now lets use the user_token we received from our previously signed payload and use that in our final source code. Once you execute this final source code, the end user(user identified by user_token) will receive the sign request as push notification. Exciting!!

Source Code: To Send Sign Request As Push Notification: XUMM SDK

const {XummSdk} = require('xumm-sdk')
const {Txdata, TxData}  = require('xrpl-txdata')

const Sdk       = new XummSdk('401015ee-7edc-4469-bdfd-3af11f229885', '267b909b-0374-450b-a05b-5df60bc1f57a')
const Verify    = new TxData()

const main      = async() => {
    
      const request = {
        "txjson": {
            "TransactionType": "Payment",
            "Destination": "rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ",
            "Amount": "1000000"
        },
        "user_token": "343a2f1e-8160-4984-a0f0-208086509617"
      }

      const subscription = await Sdk.payload.createAndSubscribe(request, event => {
          if(Object.keys(event.data).indexOf('signed') > -1)
          {
              return event.data
          }
      }) 
      console.log('sign request URL',subscription.created.next.always)
      console.log('Pushed ',subscription.created.pushed ? 'Yes' : 'No')

      const resolveData = await subscription.resolved
      if(resolveData.signed == false)
      {
          console.log('The sign request was rejected!')
      }
      else
      {
        console.log('The sign request was Signed!!')
        const result = await Sdk.payload.get(resolveData.payload_uuidv4)
        console.log('User_token: ',result.application.issued_user_token)
      }
}
main()

Here is the push notification on my phone
xumm sign request as push notification

We can click on the push notification bubble or open the XUMM App directly on our phone and navigate to “Events” tab and open the new sign request there and choose to sign or reject the request.

Output
The output of above source code will be same as we’ve posted previously for signing and rejecting the sign request. Now the only difference is, value of key pushed will be true as sign request was sent as push notification directly to the end users phone.

Important Note

Its best practice to check the value of key pushed in the output. If its false(maybe user revoked the permission), then its always good to show the user with the QR code to manually scan and make the payment. If value of pushed is false, that means the end user has not received the push notification.

For full “XUMM SDK/API” free video tutorial list visit: Working With XUMM SDK/API: XRPL

Send Ping Request To XUMM Platform and Get Application Details

Lets write a nodejs program to fetch application details from XUMM platform. We’ll also see how to retrieve all the IOU details using single line of code.

Video Tutorial: Send Ping Request To XUMM Platform and Get Application Details


[youtube https://www.youtube.com/watch?v=3jvkJUJMUpQ]

YouTube Link: https://www.youtube.com/watch?v=3jvkJUJMUpQ [Watch the Video In Full Screen.]

Source Code: Send Ping Request To XUMM Platform and Get Application Details

const {XummSdk} = require('xumm-sdk')  
const Sdk = new XummSdk('Your-API-Id', 'Your-API-Secret')  
  
const main = async () => {  
  const appInfo = await Sdk.ping() 
}  
  
main() 

Output

$ node index.js
{
  quota: {},
  application: {
    uuidv4: '401015ee-7edc-4469-bdfd-3af11f229885',       
    name: 'My Super Duper App!',
    webhookurl: 'https://technotip.com',
    disabled: 0
  },
  call: { uuidv4: 'a47219a5-8802-44d2-84bf-0c692ff05e48' }
}

Most part of above code in taken from our previous video tutorial, so please visit Prepare Your Project & Start Coding: XUMM SDK before going further.

Explanation of Above Source Code

We are writing a asynchronous function and the child process waits for the result from Sdk.ping() method. Once the result is retrieved, the result is printed on to the console window.

Since we are writing asynchronous method, we need to use await keyword to wait for the result or the promise to be resolved.

If we do not write the await keyword, you’ll get the following result:

const {XummSdk} = require('xumm-sdk')  
const Sdk = new XummSdk('Your-API-Id', 'Your-API-Secret')  
  
const main = async () => {  
  const appInfo = Sdk.ping() 
}  
  
main() 

Output

$ node index.js 
Promise {  }

That’s because the child process didn’t wait for the result to be returned or the promise to be resolved.

Display XUMM Application Name

const {XummSdk} = require('xumm-sdk')  
const Sdk = new XummSdk('Your-API-Id', 'Your-API-Secret')  
  
const main = async () => {  
  const appInfo = await Sdk.ping() 
  console.log(appInfo.application.name)
}  
  
main() 

Output

$ node index.js 
My Super Duper App!

Here we fetch the name of the XUMM application by traversing the json output, using DOT(.) notation. name key is present inside key application.

Display XUMM Curated Assets: IOU Details

const {XummSdk} = require('xumm-sdk')  
const Sdk = new XummSdk('Your-API-Id', 'Your-API-Secret')  
  
const main = async () => {  
      const IOU = await Sdk.getCuratedAssets()
      console.log(IOU)
}  
  
main() 

Output

$ node index.js 
{
  issuers: [ 'Bitstamp', 'GateHub', 'Towo Labs', 'Sologenic', 'Wietse' ],
  currencies: [
    'USD',
    'BTC',
    'EUR',
    'ETH',
    'BCH',
    'ETC',
    'XAU',
    'DSH',
    'REP',
    'XTK',
    '534F4C4F00000000000000000000000000000000',
    'WIE'
  ],
  details: {
    Bitstamp: {
      id: 185,
      name: 'Bitstamp',
      domain: 'bitstamp.net',
      avatar: 
'https://xumm.app/assets/icons/currencies/ex-bitstamp.png',
      shortlist: 1,
        currencies: {
            USD: {
            id: 178,
            issuer_id: 185,
            issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B',
            currency: 'USD',
            name: 'US Dollar',
            avatar: 
'https://xumm.app/assets/icons/currencies/fiat-dollar.png',
            shortlist: 1
            },
            BTC: {
            id: 492,
            issuer_id: 185,
            issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B',
            currency: 'BTC',
            name: 'Bitcoin',
            avatar: 
'https://xumm.app/assets/icons/currencies/crypto-btc.png',
            shortlist: 1
            }
        }
    },
    GateHub: {
      id: 182,
      name: 'GateHub',
      domain: 'gatehub.net',
      avatar: 
'https://xumm.app/assets/icons/currencies/ex-gatehub.png',
      shortlist: 1,
        currencies: {
            EUR: {
                id: 169,
                issuer_id: 182,
                issuer: 'rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq',
                currency: 'EUR',
                name: 'Euro',
                avatar: 
'https://xumm.app/assets/icons/currencies/fiat-euro.png',  
                shortlist: 1
            },
            USD: {
                id: 170,
                issuer_id: 182,
                issuer: 'rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq',
                currency: 'USD',
                name: 'US Dollar',
                avatar: 
'https://xumm.app/assets/icons/currencies/fiat-dollar.png',
                shortlist: 1
            },
            BTC: {
                id: 172,
                issuer_id: 182,
                issuer: 'rchGBxcD1A1C2tdxF6papQYZ8kjRKMYcL',
                currency: 'BTC',
                name: 'Bitcoin',
                avatar: 
'https://xumm.app/assets/icons/currencies/crypto-btc.png',
                shortlist: 1
            },
            ETH: {
                id: 174,
                issuer_id: 182,
                issuer: 'rcA8X3TVMST1n3CJeAdGk1RdRCHii7N2h',
                currency: 'ETH',
                name: 'Ethereum',
                avatar: 
'https://xumm.app/assets/icons/currencies/crypto-eth.png',
                shortlist: 1
            },
            BCH: {
                id: 173,
                issuer_id: 182,
                issuer: 'rcyS4CeCZVYvTiKcxj6Sx32ibKwcDHLds',
                currency: 'BCH',
                name: 'Bitcoin Cash',
                avatar: 
'https://xumm.app/assets/icons/currencies/crypto-bch.png',
                shortlist: 1
            },
            ETC: {
                id: 175,
                issuer_id: 182,
                issuer: 'rDAN8tzydyNfnNf2bfUQY6iR96UbpvNsze',
                currency: 'ETC',
                name: 'Ethereum Classic',
                avatar: 
'https://xumm.app/assets/icons/currencies/crypto-etc.png',
                shortlist: 1
            },
            XAU: {
                id: 171,
                issuer_id: 182,
                issuer: 'rcoef87SYMJ58NAFx7fNM5frVknmvHsvJ',
                currency: 'XAU',
                name: 'Gold Gram',
                avatar: 
'https://xumm.app/assets/icons/currencies/crypto-gold.png',
                shortlist: 1
            },
            DSH: {
                id: 177,
                issuer_id: 182,
                issuer: 'rcXY84C4g14iFp6taFXjjQGVeHqSCh9RX',
                currency: 'DSH',
                name: 'Dash',
                avatar: 
'https://xumm.app/assets/icons/currencies/crypto-dash.png',
                shortlist: 1
            },
            REP: {
                id: 176,
                issuer_id: 182,
                issuer: 'rckzVpTnKpP4TJ1puQe827bV3X4oYtdTP',
                currency: 'REP',
                name: 'REP',
                avatar: 
'https://xumm.app/assets/icons/currencies/crypto-rep.png',
                shortlist: 1
            }
        }
    },
    'Towo Labs': {
      id: 2601,
      name: 'Towo Labs',
      domain: 'xrptoolkit.com',
      avatar: 
'https://xumm.app/assets/icons/currencies/xtk-symbol.png?2',
      shortlist: 1,
        currencies:{
            XTK: {
                id: 9622,
                issuer_id: 2601,
                issuer: 'rXTKdHWuppSjkbiKoEv53bfxHAn1MxmTb',
                currency: 'XTK',
                name: 'XTK',
                avatar: 
'https://xumm.app/assets/icons/currencies/xtk-symbol.png?2',
                shortlist: 1
            }
        }
    },
    Sologenic: {
      id: 4380,
      name: 'Sologenic',
      domain: 'sologenic.com',
      avatar: 
'https://xumm.app/assets/icons/currencies/icon-sologenic.png',
      shortlist: 0,
        currencies:{
            '534F4C4F00000000000000000000000000000000': {
                id: 861,
                issuer_id: 4380,
                issuer: 'rsoLo2S1kiGeCcn6hCUXVrCpGMWLrRrLZz',
                currency: '534F4C4F00000000000000000000000000000000',
                name: 'SOLO',
                avatar: 
'https://xumm.app/assets/icons/currencies/icon-sologenic.png',
                shortlist: 0
            }
        }
    },
    Wietse: {
      id: 17553,
      name: 'Wietse',
      domain: 'wietse.com',
      avatar: 
'https://xumm.app/assets/icons/currencies/wietse.jpg',
      shortlist: 0,
        currencies:{
            WIE: {
                id: 17552,
                issuer_id: 17553,
                issuer: 'rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ',
                currency: 'WIE',
                name: 'Wietse',
                avatar: 
'https://xumm.app/assets/icons/currencies/transparent.png',
                shortlist: 0
            }
        }
    }
  }
}

IOU means “I owe you”. An “issuer” is the one who owe you, if you get funds as IOU transaction on XRP Ledger.

The acronym IOU stands for “I owe you” and refers to an informal document that acknowledges a debt one party owes to another.

When you run above code you can, programmatically, get to see all the supported IOU’s on XUMM platform. You can even get the issuer details, currency symbol and the name of the currency – just by running a single line of code.

IOU Details From Above Output

Bitstamp supports following currencies:
1. USD(US Dollar)
2. BTC(Bitcoin).

GateHub supports following currencies:
1. EUR(Euro)
2. USD(US Dollar)
3. BTC(Bitcoin)
4. ETH(Ethereum)
5. BCH(Bitcoin Cash)
6. ETC(Ethereum Classic)
7. XAU(Gold Gram)
8. DSH(Dash)
9. REP(REP)

Towo Labs supports following currency:
1. XTK(XTK)

Sologenic supports following currency:
1. SOLO(SOLO)

Wietse supports following currency:
1. WIE(Wietse)

Here ‘Bitstamp’, ‘GateHub’, ‘Towo Labs’, ‘Sologenic’, ‘Wietse’ are the issuers of the respective currencies. So you can transact above currencies on XRP Ledger via XUMM application.

As you can see from above examples, we’re successfully able to connect and communicate with XUMM platform. So in our next video tutorial lets send a simple PAYLOAD. More on that in next video tutorial, stay subscribed to our blog and YouTube channel.

For full “XUMM SDK/API” free video tutorial list visit: Working With XUMM SDK/API: XRPL

Prepare Your Project & Start Coding: XUMM SDK

Lets install the software and packages needed to run a nodejs application and try to connect with the XUMM platform.

Software Required

1. Visual Studio Code Editor
2. Nodejs

Package To Be Installed

xumm-sdk (install via node package manager).

Video Tutorial: Prepare Your Project & Start Coding: XUMM SDK


[youtube https://www.youtube.com/watch?v=pgSckFopZ6Q]

YouTube Link: https://www.youtube.com/watch?v=pgSckFopZ6Q [Watch the Video In Full Screen.]

Lets test our installation

After installing Visual Studio Code Editor and Nodejs, lets create a new project. Create a file called index.js inside the project folder.
index.js

console.log("WELCOME TO XUMM SDK/API VIDEO TUTORIALS!")

Running Node Application
Command

 >node index.js

Output
WELCOME TO XUMM SDK/API VIDEO TUTORIALS!

If you get above output then your installation is working correctly. Lets move forward.

Installing xumm-sdk Package

Lets install xumm-sdk node package and try to connect with XUMM platform.

npm install xumm-sdk

It might take couple of seconds to couple of minutes depending on your internet connection speed. So you may have to wait patiently.

Error Message: Your npm doesn’t work with the version of Node

If you start getting error messages like: “npm WARN npm npm does not support Node.js” Just download lower version of Nodejs and try to run the program once again. In most of the cases the issue will be resolved.

Source Code: Importing xumm-sdk package into our project

const {XummSdk} = require('xumm-sdk')
const Sdk = new XummSdk('Your-API-Id', 'Your-API-Secret')

const main = async () => {
  console.log('XUMM SDK VIDEO TUTORIALS!')
}

main()

Run The Application
Command

 >node index.js

Output
XUMM SDK VIDEO TUTORIALS!

In the first line, we are importing xumm-sdk package. Next we create an instance of XummSdk, by passing XUMM application credentials.

Next we write a asynchronous function, which creates a child progress or a thread and waits for the response. Meanwhile the main thread or the main process continues to execute the code after it.

In above code, we simply output a message to the console window.

Note: By connecting to XUMM platform we can indirectly interact with XRP Ledger(XRPL).

For full “XUMM SDK/API” free video tutorial list visit: Working With XUMM SDK/API: XRPL

Working With XUMM SDK/API: XRPL

XRP Ledger(XRPL) was developed by Ripple founders and is now open sourced.

Ripple is a real-time gross settlement system, currency exchange and remittance network created by Ripple Labs Inc., a US-based technology company. XRP is the underlying crypto-asset.

Not everyone will be comfortable digging deep into how XRPL works and how to change/modify the code once the XRPL gets updated(through proposals, voting & amendments). And not everyone of us can host a XRPL node. But still if you are willing to create applications for payments, subscription, signing in, escrow account creation etc, then you can simply make use of XUMM platform.

xumm logo

Developers can use XUMM platform to interact with XRPL and also make use of XUMM specific features like sending payments/subscription related messages as push notification. The best thing about XUMM app is there is very less changes of miss transactions, as there are only 2 types of transactions your users will be involved – either they initiate a transaction or they scan a QR code and make a payment. In both the cases it involves very less to no possibilities of making a miss transaction using this app.

Also note that XUMM is developed by “XRPL LABS” team and the project is supported by Ripple / RippleX.

In this video tutorial series we shall learn how to work with XUMM SDK and XUMM API to interact with XRP Ledger, and also see how to make use of XUMM platform specific features to enhance the end user experience.

While following these video tutorials, occasionally you may have to create new XRPL accounts and make transactions and check the results: you can use OsmWallet for that. OsmWallet is a non-custodial wallet and it is a browser extension like MetaMask, but for XRP Ledger.

Sample App Built using XUMM API

Automate Digital Sales using XUMM Payment

XUMM SDK/API Video Tutorial Playlist


[youtube https://www.youtube.com/watch?v=tdoLbHiMTGo&list=PLM4pPs1mzl_NjoQPoMlJEx2XAEpDQ-Vhq]

YouTube Link: XUMM SDK/API playlist [Watch the Video In Full Screen.]

XUMM SDK/API, Free Video Tutorials List

Please follow the tutorials in the same order as listed below