Skip to content

Commit

Permalink
Merge pull-request #463
Browse files Browse the repository at this point in the history
  • Loading branch information
moe-dev committed Dec 20, 2024
2 parents d9a0465 + 328d6aa commit 2d88707
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/cyan-beers-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@turnkey/sdk-browser": patch
"@turnkey/sdk-server": patch
---

Add defaultXrpAccountAtIndex helper
11 changes: 11 additions & 0 deletions packages/sdk-browser/src/turnkey-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ interface WalletAccount {
| "ADDRESS_FORMAT_DOGE_TESTNET"
| "ADDRESS_FORMAT_SUI"
| "ADDRESS_FORMAT_APTOS"
| "ADDRESS_FORMAT_XRP"
| "ADDRESS_FORMAT_TON_V3R2"
| "ADDRESS_FORMAT_TON_V4R2";
}
Expand Down Expand Up @@ -451,6 +452,16 @@ export const defaultSeiAccountAtIndex = (pathIndex: number): WalletAccount => {
};
};

// Xrp
export const defaultXrpAccountAtIndex = (pathIndex: number): WalletAccount => {
return {
curve: "CURVE_SECP256K1",
pathFormat: "PATH_FORMAT_BIP32",
path: `m/44'/144'/${pathIndex}'/0'/0'`,
addressFormat: "ADDRESS_FORMAT_XRP",
};
};

export const DEFAULT_SEI_ACCOUNTS: WalletAccount[] = [
defaultSeiAccountAtIndex(0),
];
Expand Down
11 changes: 11 additions & 0 deletions packages/sdk-server/src/turnkey-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ interface WalletAccount {
| "ADDRESS_FORMAT_DOGE_TESTNET"
| "ADDRESS_FORMAT_SUI"
| "ADDRESS_FORMAT_APTOS"
| "ADDRESS_FORMAT_XRP"
| "ADDRESS_FORMAT_TON_V3R2"
| "ADDRESS_FORMAT_TON_V4R2";
}
Expand Down Expand Up @@ -451,6 +452,16 @@ export const defaultSeiAccountAtIndex = (pathIndex: number): WalletAccount => {
};
};

// Xrp
export const defaultXrpAccountAtIndex = (pathIndex: number): WalletAccount => {
return {
curve: "CURVE_SECP256K1",
pathFormat: "PATH_FORMAT_BIP32",
path: `m/44'/144'/${pathIndex}'/0'/0'`,
addressFormat: "ADDRESS_FORMAT_XRP",
};
};

export const DEFAULT_SEI_ACCOUNTS: WalletAccount[] = [
defaultSeiAccountAtIndex(0),
];
Expand Down

0 comments on commit 2d88707

Please sign in to comment.