@opendatalabs/vana-sdk 3.13.4-pr.186.afb5a4f → 3.14.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.
Files changed (56) hide show
  1. package/dist/config/contracts.config.cjs +1 -1
  2. package/dist/config/contracts.config.cjs.map +1 -1
  3. package/dist/config/contracts.config.js +1 -1
  4. package/dist/config/contracts.config.js.map +1 -1
  5. package/dist/direct/access-request-client.cjs +3 -1
  6. package/dist/direct/access-request-client.cjs.map +1 -1
  7. package/dist/direct/access-request-client.js +3 -1
  8. package/dist/direct/access-request-client.js.map +1 -1
  9. package/dist/direct/controller.cjs +72 -32
  10. package/dist/direct/controller.cjs.map +1 -1
  11. package/dist/direct/controller.d.ts +41 -3
  12. package/dist/direct/controller.js +77 -33
  13. package/dist/direct/controller.js.map +1 -1
  14. package/dist/direct/errors.cjs +11 -2
  15. package/dist/direct/errors.cjs.map +1 -1
  16. package/dist/direct/errors.d.ts +13 -0
  17. package/dist/direct/errors.js +9 -1
  18. package/dist/direct/errors.js.map +1 -1
  19. package/dist/direct/escrow-payment.cjs.map +1 -1
  20. package/dist/direct/escrow-payment.d.ts +2 -2
  21. package/dist/direct/escrow-payment.js.map +1 -1
  22. package/dist/direct/types.cjs.map +1 -1
  23. package/dist/direct/types.d.ts +33 -1
  24. package/dist/direct/types.js.map +1 -1
  25. package/dist/generated/addresses.cjs +6 -6
  26. package/dist/generated/addresses.cjs.map +1 -1
  27. package/dist/generated/addresses.d.ts +6 -6
  28. package/dist/generated/addresses.js +6 -6
  29. package/dist/generated/addresses.js.map +1 -1
  30. package/dist/index.browser.d.ts +2 -2
  31. package/dist/index.browser.js +7 -136
  32. package/dist/index.browser.js.map +2 -2
  33. package/dist/index.node.cjs +18 -151
  34. package/dist/index.node.cjs.map +3 -3
  35. package/dist/index.node.d.ts +2 -2
  36. package/dist/index.node.js +17 -146
  37. package/dist/index.node.js.map +3 -3
  38. package/dist/protocol/eip712.cjs +2 -28
  39. package/dist/protocol/eip712.cjs.map +1 -1
  40. package/dist/protocol/eip712.d.ts +0 -70
  41. package/dist/protocol/eip712.js +1 -24
  42. package/dist/protocol/eip712.js.map +1 -1
  43. package/dist/protocol/escrow.cjs +2 -118
  44. package/dist/protocol/escrow.cjs.map +1 -1
  45. package/dist/protocol/escrow.d.ts +2 -108
  46. package/dist/protocol/escrow.js +1 -116
  47. package/dist/protocol/escrow.js.map +1 -1
  48. package/dist/protocol/gateway.cjs.map +1 -1
  49. package/dist/protocol/gateway.d.ts +38 -8
  50. package/dist/protocol/gateway.js.map +1 -1
  51. package/dist/server.cjs +2 -0
  52. package/dist/server.cjs.map +1 -1
  53. package/dist/server.d.ts +2 -2
  54. package/dist/server.js +2 -0
  55. package/dist/server.js.map +1 -1
  56. package/package.json +1 -1
@@ -28454,7 +28454,7 @@ var CONTRACTS = {
28454
28454
  },
28455
28455
  DataPortabilityServers: {
28456
28456
  addresses: {
28457
- 14800: "0x1483B1F634DBA75AeaE60da7f01A679aabd5ee2c",
28457
+ 14800: "0xCae2CE0e9caa6643ed28186cF57bd40Bd9E17Eab",
28458
28458
  1480: "0x1483B1F634DBA75AeaE60da7f01A679aabd5ee2c"
28459
28459
  }
28460
28460
  },
@@ -28612,7 +28612,7 @@ var CONTRACTS = {
28612
28612
  },
28613
28613
  _meta: {
28614
28614
  discoveredFrom: "ComputeEngine",
28615
- lastUpdated: "2026-06-25"
28615
+ lastUpdated: "2026-08-18"
28616
28616
  }
28617
28617
  },
28618
28618
  VanaTreasury: {
@@ -28622,7 +28622,7 @@ var CONTRACTS = {
28622
28622
  },
28623
28623
  _meta: {
28624
28624
  discoveredFrom: "QueryEngine",
28625
- lastUpdated: "2026-06-25"
28625
+ lastUpdated: "2026-08-18"
28626
28626
  }
28627
28627
  },
28628
28628
  DLPRegistryTreasury: {
@@ -28632,7 +28632,7 @@ var CONTRACTS = {
28632
28632
  },
28633
28633
  _meta: {
28634
28634
  discoveredFrom: "DLPRegistry",
28635
- lastUpdated: "2026-06-25"
28635
+ lastUpdated: "2026-08-18"
28636
28636
  }
28637
28637
  },
28638
28638
  VanaPoolTreasury: {
@@ -28642,7 +28642,7 @@ var CONTRACTS = {
28642
28642
  },
28643
28643
  _meta: {
28644
28644
  discoveredFrom: "VanaPoolStaking",
28645
- lastUpdated: "2026-06-25"
28645
+ lastUpdated: "2026-08-18"
28646
28646
  }
28647
28647
  },
28648
28648
  VanaPoolEntity: {
@@ -28652,7 +28652,7 @@ var CONTRACTS = {
28652
28652
  },
28653
28653
  _meta: {
28654
28654
  discoveredFrom: "VanaPoolStaking",
28655
- lastUpdated: "2026-06-25"
28655
+ lastUpdated: "2026-08-18"
28656
28656
  }
28657
28657
  }
28658
28658
  };
@@ -32088,9 +32088,6 @@ function escrowPaymentDomain(config) {
32088
32088
  config.contracts.dataPortabilityEscrow
32089
32089
  );
32090
32090
  }
32091
- function withdrawAuthorizationDomain(config) {
32092
- return escrowPaymentDomain(config);
32093
- }
32094
32091
  var GRANT_REGISTRATION_TYPES = {
32095
32092
  GrantRegistration: [
32096
32093
  { name: "grantorAddress", type: "address" },
@@ -32123,15 +32120,6 @@ var BUILDER_REGISTRATION_TYPES = {
32123
32120
  { name: "appUrl", type: "string" }
32124
32121
  ]
32125
32122
  };
32126
- var WITHDRAW_AUTHORIZATION_TYPES = {
32127
- WithdrawAuthorization: [
32128
- { name: "account", type: "address" },
32129
- { name: "asset", type: "address" },
32130
- { name: "amount", type: "uint256" },
32131
- { name: "withdrawNonce", type: "uint256" },
32132
- { name: "deadline", type: "uint256" }
32133
- ]
32134
- };
32135
32123
  var ADD_DATA_TYPES = {
32136
32124
  AddData: [
32137
32125
  { name: "ownerAddress", type: "address" },
@@ -32150,14 +32138,6 @@ var RECORD_DATA_ACCESS_TYPES = {
32150
32138
  { name: "recordId", type: "bytes32" }
32151
32139
  ]
32152
32140
  };
32153
- function buildWithdrawAuthorizationTypedData(config, message) {
32154
- return {
32155
- domain: withdrawAuthorizationDomain(config),
32156
- types: WITHDRAW_AUTHORIZATION_TYPES,
32157
- primaryType: "WithdrawAuthorization",
32158
- message
32159
- };
32160
- }
32161
32141
 
32162
32142
  // src/protocol/personal-server-registration.ts
32163
32143
  import {
@@ -33268,7 +33248,6 @@ function createGatewayClient(baseUrl) {
33268
33248
  }
33269
33249
 
33270
33250
  // src/protocol/escrow.ts
33271
- import { isHex } from "viem";
33272
33251
  var GENERIC_PAYMENT_TYPES = {
33273
33252
  GenericPayment: [
33274
33253
  { name: "payerAddress", type: "address" },
@@ -33308,26 +33287,6 @@ var ESCROW_DEPOSIT_ABI2 = [
33308
33287
  }
33309
33288
  ];
33310
33289
  var NATIVE_ASSET_ADDRESS = "0x0000000000000000000000000000000000000000";
33311
- var EscrowWithdrawalLifecycleError = class extends Error {
33312
- constructor(httpStatus, result) {
33313
- super(result.error);
33314
- this.httpStatus = httpStatus;
33315
- this.result = result;
33316
- }
33317
- httpStatus;
33318
- result;
33319
- name = "EscrowWithdrawalLifecycleError";
33320
- };
33321
- var EscrowWithdrawalRejectionError = class extends Error {
33322
- constructor(httpStatus, result) {
33323
- super(result.error);
33324
- this.httpStatus = httpStatus;
33325
- this.result = result;
33326
- }
33327
- httpStatus;
33328
- result;
33329
- name = "EscrowWithdrawalRejectionError";
33330
- };
33331
33290
  function createEscrowGatewayClient(baseUrl) {
33332
33291
  const base = baseUrl.replace(/\/+$/, "");
33333
33292
  async function throwOnError(res, context) {
@@ -33343,27 +33302,6 @@ function createEscrowGatewayClient(baseUrl) {
33343
33302
  );
33344
33303
  }
33345
33304
  }
33346
- async function throwOnWithdrawError(res) {
33347
- if (res.ok) return;
33348
- let body;
33349
- try {
33350
- body = await res.json();
33351
- } catch {
33352
- throw new Error(
33353
- `Escrow gateway error (POST /v1/escrow/withdraw): ${res.status} ${res.statusText}`
33354
- );
33355
- }
33356
- if (isEscrowWithdrawalFailureResult(body)) {
33357
- throw new EscrowWithdrawalLifecycleError(res.status, body);
33358
- }
33359
- if (isEscrowWithdrawalRejectedResult(body)) {
33360
- throw new EscrowWithdrawalRejectionError(res.status, body);
33361
- }
33362
- const error = getGatewayErrorMessage(body);
33363
- throw new Error(
33364
- `Escrow gateway error (POST /v1/escrow/withdraw): ${res.status} ${res.statusText}${error ? `: ${error}` : ""}`
33365
- );
33366
- }
33367
33305
  return {
33368
33306
  async submitDeposit({ txHash }) {
33369
33307
  const res = await fetch(`${base}/v1/escrow/deposit`, {
@@ -33419,72 +33357,9 @@ function createEscrowGatewayClient(baseUrl) {
33419
33357
  });
33420
33358
  await throwOnError(res, "POST /v1/escrow/pay");
33421
33359
  return res.json();
33422
- },
33423
- async withdraw({
33424
- account,
33425
- asset,
33426
- amount,
33427
- withdrawNonce,
33428
- deadline,
33429
- signature
33430
- }) {
33431
- const res = await fetch(`${base}/v1/escrow/withdraw`, {
33432
- method: "POST",
33433
- headers: {
33434
- "Content-Type": "application/json",
33435
- Authorization: `Web3Signed ${signature}`
33436
- },
33437
- body: JSON.stringify({
33438
- account,
33439
- asset,
33440
- amount,
33441
- withdrawNonce,
33442
- deadline
33443
- })
33444
- });
33445
- await throwOnWithdrawError(res);
33446
- return res.json();
33447
33360
  }
33448
33361
  };
33449
33362
  }
33450
- function getGatewayErrorMessage(body) {
33451
- if (typeof body === "object" && body !== null && "error" in body && typeof body.error === "string") {
33452
- return body.error;
33453
- }
33454
- return void 0;
33455
- }
33456
- function isEscrowWithdrawalFailureResult(body) {
33457
- if (typeof body !== "object" || body === null) return false;
33458
- const value = body;
33459
- return value.success === false && (value.status === "retryable" || value.status === "reorged" || value.status === "failed") && typeof value.error === "string" && isAddressHex(value.account) && isAddressHex(value.asset) && isUint256Decimal(value.amount) && isUint256Decimal(value.withdrawNonce) && isUint256Decimal(value.deadline) && (isHash(value.txHash) || value.txHash === null) && (!("blockNumber" in value) || isBlockNumber(value.blockNumber));
33460
- }
33461
- function isEscrowWithdrawalRejectedResult(body) {
33462
- if (typeof body !== "object" || body === null) return false;
33463
- const value = body;
33464
- return value.success === false && value.status === "rejected" && isWithdrawalRejectionCode(value.code) && typeof value.error === "string" && isAddressHex(value.account) && isAddressHex(value.asset) && isUint256Decimal(value.amount) && isUint256Decimal(value.withdrawNonce) && isUint256Decimal(value.deadline) && optionalUint256Decimal(value.balance) && optionalUint256Decimal(value.authorizedAmount) && optionalUint256Decimal(value.withdrawingAmount) && optionalUint256Decimal(value.availableAmount) && optionalUint256Decimal(value.requestedAmount) && optionalUint256Decimal(value.minimumAmount);
33465
- }
33466
- function isWithdrawalRejectionCode(value) {
33467
- return value === "below_minimum" || value === "deadline_too_far" || value === "expired" || value === "insufficient_available" || value === "stale_nonce";
33468
- }
33469
- function optionalUint256Decimal(value) {
33470
- return value === void 0 || isUint256Decimal(value);
33471
- }
33472
- function isAddressHex(value) {
33473
- return typeof value === "string" && isHex(value, { strict: true }) && value.length === 42;
33474
- }
33475
- function isHash(value) {
33476
- return typeof value === "string" && isHex(value, { strict: true }) && value.length === 66;
33477
- }
33478
- function isUint256Decimal(value) {
33479
- if (typeof value !== "string" || value.length === 0 || value.length > 78) {
33480
- return false;
33481
- }
33482
- if (!/^(0|[1-9]\d*)$/.test(value)) return false;
33483
- return BigInt(value) <= 2n ** 256n - 1n;
33484
- }
33485
- function isBlockNumber(value) {
33486
- return value === null || isUint256Decimal(value);
33487
- }
33488
33363
 
33489
33364
  // src/types/ps-errors.ts
33490
33365
  var PSError = class extends Error {
@@ -33567,7 +33442,6 @@ export {
33567
33442
  DropboxStorage,
33568
33443
  ECIESError,
33569
33444
  ESCROW_DEPOSIT_ABI2 as ESCROW_DEPOSIT_ABI,
33570
- EscrowWithdrawalLifecycleError,
33571
33445
  ExpiredTokenError,
33572
33446
  FEE_REGISTRY_ABI,
33573
33447
  GENERIC_PAYMENT_TYPES,
@@ -33613,7 +33487,6 @@ export {
33613
33487
  UserRejectedRequestError,
33614
33488
  VanaError,
33615
33489
  VanaStorage,
33616
- WITHDRAW_AUTHORIZATION_TYPES,
33617
33490
  assertValidPkceVerifier,
33618
33491
  buildDepositNativeRequest,
33619
33492
  buildDepositTokenRequest,
@@ -33625,7 +33498,6 @@ export {
33625
33498
  buildPersonalServerRegistrationTypedData,
33626
33499
  buildSetDataPointStatusRequest,
33627
33500
  buildWeb3SignedHeader,
33628
- buildWithdrawAuthorizationTypedData,
33629
33501
  builderRegistrationDomain,
33630
33502
  chains,
33631
33503
  clearContractCache,
@@ -33693,7 +33565,6 @@ export {
33693
33565
  vanaMainnet2 as vanaMainnet,
33694
33566
  verifyGrantRegistration,
33695
33567
  verifyPkceChallenge,
33696
- verifyWeb3Signed,
33697
- withdrawAuthorizationDomain
33568
+ verifyWeb3Signed
33698
33569
  };
33699
33570
  //# sourceMappingURL=index.browser.js.map