Coder Social home page Coder Social logo

xrp-raw-tools's Introduction

accessibility text

Fireblocks Developer Portal
Fireblocks Sandbox Sign-up

Set 'Require Destination Tags' configuration on your XRP account


⚠️ Warning: This code example utilizes the Fireblocks RAW signing feature.

Raw Signing is an insecure signing method and is not generally recommended.
Bad actors can trick someone into signing a valid transaction message and use it to steal funds.

For this reason, Raw Signing is a premium feature that requires an additional purchase and is not available in production workspaces by default. If you're interested in this feature and want to see if your use case is eligible for it, please contact your Customer Success Manager.

Fireblocks Sandbox workspaces have Raw Signing enabled by default to allow for testing purposes.



✅ Enabling 'Require Destination Tags' configuration:

Clone the repo:

git clone <repo_link>
cd xrp_set_dest_tag

Install:

npm install -g typescript
npm install

Create .env file and set:

  • FIREBLOCKS_API_KEY - your API Key
  • FIREBLOCKS_SECRET_KEY_PATH - path to your API secret key
  • VAULT_ACCOUNT_ID - the ID of the vault account to execute the RAW signing request from

Example:

FIREBLOCKS_API_KEY="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
FIREBLOCKS_SECRET_KEY_PATH="/path/to/secret_key/file.key"
VAULT_ACCOUNT_ID=1 

Runnig the script:

ts-node setDestTag.ts

Sign the RAW signing operation in your Fireblocks Mobile app. Make sure that you have the following result printed out to the console:

resultCode: 'tesSUCCESS',
resultMessage: 'The transaction was applied. Only final in a validated ledger.'
.
.
.
https://xrpscan.com/tx/<tx_id>

Check the transaction's hash in the XRP block explorer and make sure that the transaction was executed successfully.


❌ Disabling 'Require Destination Tags':

If you want to disable an already enabled 'Require Destination Tags' configuration on your account, please update the transaction object in the setDestTag.ts file as following:

  const transaction: TransactionJSON = {
    "TransactionType": "AccountSet",
    "Account": account,
    "Fee": "1000",
    //"SetFlag": 1 // --> Enable dest tag required 
    "ClearFlag": 1 // --> Disable test tag required (remove SetFlag in this case)
  }

While SetFlag: 1 enables 'Require Destination Tags' configuration on your account, ClearFlag: 1 disables it.


📌 NOTE:

Since XRP transactions require lastLedgerSequence as a part of the transaction's body, when using RAW signing it is limited for a quite short period of time (up to 2 mins), which means that the transcation should be signed immediately after the submission. Waiting for longer signing time will result in unsuccessful transaction's broadcasting.

xrp-raw-tools's People

Contributors

slavasereb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.