From aa36768b5138419896bfa0c03823db45ffae1142 Mon Sep 17 00:00:00 2001 From: Mohammad Cheikh Date: Fri, 20 Dec 2024 13:36:04 -0500 Subject: [PATCH 1/2] add xrp default accounts --- packages/sdk-browser/src/turnkey-helpers.ts | 11 +++++++++++ packages/sdk-server/src/turnkey-helpers.ts | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/packages/sdk-browser/src/turnkey-helpers.ts b/packages/sdk-browser/src/turnkey-helpers.ts index 8314ba343..f482817f9 100644 --- a/packages/sdk-browser/src/turnkey-helpers.ts +++ b/packages/sdk-browser/src/turnkey-helpers.ts @@ -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"; } @@ -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), ]; diff --git a/packages/sdk-server/src/turnkey-helpers.ts b/packages/sdk-server/src/turnkey-helpers.ts index 8314ba343..f482817f9 100644 --- a/packages/sdk-server/src/turnkey-helpers.ts +++ b/packages/sdk-server/src/turnkey-helpers.ts @@ -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"; } @@ -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), ]; From 328d6aa22caf19c67709c68d42335e94c77fc26d Mon Sep 17 00:00:00 2001 From: Mohammad Cheikh Date: Fri, 20 Dec 2024 13:37:04 -0500 Subject: [PATCH 2/2] add changeset --- .changeset/cyan-beers-promise.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/cyan-beers-promise.md diff --git a/.changeset/cyan-beers-promise.md b/.changeset/cyan-beers-promise.md new file mode 100644 index 000000000..e12223ec4 --- /dev/null +++ b/.changeset/cyan-beers-promise.md @@ -0,0 +1,6 @@ +--- +"@turnkey/sdk-browser": patch +"@turnkey/sdk-server": patch +--- + +Add defaultXrpAccountAtIndex helper