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?
- Enables quick integration with XUMM. We have a full-featured integration with the XUMM API including things like refreshing payloads and viewing payload metadata.
- Crossmark is a non-custodial wallet. We never collect users private keys or sensitive information.
- 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.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.signAndSubmitAndWait({
TransactionType: 'Payment',
Account: signInResp.response.address,
Destination: [insert destination address here]
Amount: "1000000" // XRP in drops
});
// log payload response
console.log(repsonse.data.resp);
4. Confirm Transaction Hash
Using the wallet address retrieved in step 2, issue a payment request,
// log transaction hash response
console.log(repsonse.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.signInAndWait();
// log address
console.log(signIn.response.address);
// Step 3 - Issues an XRPL transaction for signing
let {
request,
response,
createdAt,
resolvedAt
} = await sdk.signAndSubmitAndWait({
TransactionType: 'Payment',
Account: signInResp.response.address,
Destination: [insert destination address here]
Amount: "1000000" // XRP in drops
});
// log payload response
console.log(repsonse.data.resp);
// Step 4 - Review hash
// log transaction hash response
console.log(repsonse.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).