@wopr-network/platform-core 1.35.2 → 1.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,8 @@ export interface UnifiedCheckoutDeps {
7
7
  oracle: IPriceOracle;
8
8
  evmXpub: string;
9
9
  btcXpub?: string;
10
+ /** UTXO network override (auto-detected from node in production). Default: "mainnet". */
11
+ utxoNetwork?: "mainnet" | "testnet" | "regtest";
10
12
  }
11
13
  export interface UnifiedCheckoutResult {
12
14
  depositAddress: string;
@@ -77,7 +77,7 @@ async function handleNativeUtxo(deps, method, tenant, amountUsdCents, amountUsd)
77
77
  depositAddress = deriveP2pkhAddress(xpub, derivationIndex, "dogecoin");
78
78
  }
79
79
  else {
80
- depositAddress = deriveAddress(xpub, derivationIndex, "mainnet", method.chain);
80
+ depositAddress = deriveAddress(xpub, derivationIndex, deps.utxoNetwork ?? "mainnet", method.chain);
81
81
  }
82
82
  const referenceId = `${method.token.toLowerCase()}:${depositAddress}`;
83
83
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wopr-network/platform-core",
3
- "version": "1.35.2",
3
+ "version": "1.36.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,6 +13,8 @@ export interface UnifiedCheckoutDeps {
13
13
  oracle: IPriceOracle;
14
14
  evmXpub: string;
15
15
  btcXpub?: string;
16
+ /** UTXO network override (auto-detected from node in production). Default: "mainnet". */
17
+ utxoNetwork?: "mainnet" | "testnet" | "regtest";
16
18
  }
17
19
 
18
20
  export interface UnifiedCheckoutResult {
@@ -133,7 +135,12 @@ async function handleNativeUtxo(
133
135
  if (method.chain === "dogecoin") {
134
136
  depositAddress = deriveP2pkhAddress(xpub, derivationIndex, "dogecoin");
135
137
  } else {
136
- depositAddress = deriveAddress(xpub, derivationIndex, "mainnet", method.chain as "bitcoin" | "litecoin");
138
+ depositAddress = deriveAddress(
139
+ xpub,
140
+ derivationIndex,
141
+ deps.utxoNetwork ?? "mainnet",
142
+ method.chain as "bitcoin" | "litecoin",
143
+ );
137
144
  }
138
145
 
139
146
  const referenceId = `${method.token.toLowerCase()}:${depositAddress}`;