Getting Started

Let's Get Started

Overview

Crossmark is a browser extension for managing wallets and signing transactions on the XRP Ledger. Crossmark will be the gateway for projects to establish a line of communication between developers and users.

Why should you consider using adopting Crossmark?

  1. Crossmark is a self-custodial wallet. We never collect users private keys or sensitive information.
  2. Allows for a seamless, secure way to sign transaction on the XRP Ledger.

Simple Steps to Integrate

1. Installation

To install our npm / yarn package, run one of the following commands,

npm install @crossmarkio/sdk;

2. Sign-In

Use the CROSSMARK SDK to sign-in with an active wallet,

import sdk from '@crossmarkio/sdk';
 
let { request, response, createdAt, resolvedAt } = await sdk.methods.signInAndWait();
 
// log address
console.log(response.data.address);

3. Sign Payload

Using the wallet address retrieved in step 2, issue a payment request,

let {
    request,
    response,
    createdAt,
    resolvedAt
  } = await sdk.methods.signAndSubmitAndWait({
        TransactionType: 'Payment',
        Account: signInResp.response.address,
        Destination: [insert destination address here]
        Amount: "1000000" // XRP in drops
    });
 
// log payload response
console.log(response.data.resp);

4. Confirm Transaction Hash

Using the wallet address retrieved in step 2, issue a payment request,

// log transaction hash response
console.log(response.data.resp.hash);

All Steps Together

// Step 1 - Import package
import sdk from '@crossmarkio/sdk';
 
const example = () => {
 
    // Step 2 - Signin using Crossmark
    let signIn = await sdk.methods.signInAndWait();
 
    // log address
    console.log(signIn.response.address);
 
    // Step 3 - Issues an XRPL transaction for signing
    let {
        request,
        response,
        createdAt,
        resolvedAt
      } = await sdk.methods.signAndSubmitAndWait({
            TransactionType: 'Payment',
            Account: signIn.response.address,
            Destination: [insert destination address here]
            Amount: "1000000" // XRP in drops
        });
 
    // log payload response
    console.log(response.data.resp);
 
    // Step 4 - Review hash
    // log transaction hash response
    console.log(response.data.resp.result.hash);
    }
 
  // Mount function
  example()

If you would like to see more in-depth example using the crossmark, see here (opens in a new tab).