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 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), ];