@proofchain/sdk 2.12.0 → 2.12.2

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.
package/dist/index.d.mts CHANGED
@@ -1025,9 +1025,12 @@ interface SwapQuote {
1025
1025
  to_token: string;
1026
1026
  from_amount: string;
1027
1027
  to_amount: string;
1028
+ min_to_amount: string;
1028
1029
  exchange_rate: string;
1029
- price_impact: string;
1030
- gas_estimate: string;
1030
+ quote_id: string;
1031
+ slippage_bps: number;
1032
+ network: string;
1033
+ liquidity_available: boolean;
1031
1034
  expires_at: string;
1032
1035
  }
1033
1036
  interface SwapResult {
package/dist/index.d.ts CHANGED
@@ -1025,9 +1025,12 @@ interface SwapQuote {
1025
1025
  to_token: string;
1026
1026
  from_amount: string;
1027
1027
  to_amount: string;
1028
+ min_to_amount: string;
1028
1029
  exchange_rate: string;
1029
- price_impact: string;
1030
- gas_estimate: string;
1030
+ quote_id: string;
1031
+ slippage_bps: number;
1032
+ network: string;
1033
+ liquidity_available: boolean;
1031
1034
  expires_at: string;
1032
1035
  }
1033
1036
  interface SwapResult {
package/dist/index.js CHANGED
@@ -1275,12 +1275,12 @@ var EndUsersClient = class {
1275
1275
  * ```
1276
1276
  */
1277
1277
  async ensureWallet(externalId, network = "base-mainnet") {
1278
- const existingWallets = await this.http.get(
1279
- `/wallets/user/${encodeURIComponent(externalId)}`
1280
- );
1281
- if (existingWallets && existingWallets.length > 0) {
1282
- const eoa = existingWallets.find((w) => w.wallet_type === "eoa");
1283
- const smart = existingWallets.find((w) => w.wallet_type === "smart");
1278
+ try {
1279
+ const result = await this.http.get(
1280
+ `/wallets/user/${encodeURIComponent(externalId)}/all`
1281
+ );
1282
+ const eoa = result?.asset_wallets?.[0];
1283
+ const smart = result?.smart_wallets?.[0];
1284
1284
  if (eoa && smart) {
1285
1285
  return {
1286
1286
  user_id: externalId,
@@ -1319,6 +1319,7 @@ var EndUsersClient = class {
1319
1319
  created: true
1320
1320
  };
1321
1321
  }
1322
+ } catch {
1322
1323
  }
1323
1324
  const dual = await this.http.post("/wallets/dual", {
1324
1325
  user_id: externalId,
package/dist/index.mjs CHANGED
@@ -1221,12 +1221,12 @@ var EndUsersClient = class {
1221
1221
  * ```
1222
1222
  */
1223
1223
  async ensureWallet(externalId, network = "base-mainnet") {
1224
- const existingWallets = await this.http.get(
1225
- `/wallets/user/${encodeURIComponent(externalId)}`
1226
- );
1227
- if (existingWallets && existingWallets.length > 0) {
1228
- const eoa = existingWallets.find((w) => w.wallet_type === "eoa");
1229
- const smart = existingWallets.find((w) => w.wallet_type === "smart");
1224
+ try {
1225
+ const result = await this.http.get(
1226
+ `/wallets/user/${encodeURIComponent(externalId)}/all`
1227
+ );
1228
+ const eoa = result?.asset_wallets?.[0];
1229
+ const smart = result?.smart_wallets?.[0];
1230
1230
  if (eoa && smart) {
1231
1231
  return {
1232
1232
  user_id: externalId,
@@ -1265,6 +1265,7 @@ var EndUsersClient = class {
1265
1265
  created: true
1266
1266
  };
1267
1267
  }
1268
+ } catch {
1268
1269
  }
1269
1270
  const dual = await this.http.post("/wallets/dual", {
1270
1271
  user_id: externalId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proofchain/sdk",
3
- "version": "2.12.0",
3
+ "version": "2.12.2",
4
4
  "description": "Official JavaScript/TypeScript SDK for ProofChain - blockchain-anchored document attestation",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",