@haven_ai/sdk 0.1.20-alpha.0 → 0.1.21-alpha.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.
package/dist/index.d.cts CHANGED
@@ -101,6 +101,12 @@ interface PaymentRequest {
101
101
  amount: string;
102
102
  /** Recipient Ethereum address (0x...) */
103
103
  to: string;
104
+ /**
105
+ * Optional dedupe key (#1207): a retried request with the same key returns
106
+ * the FIRST request's result instead of minting a second transfer or a
107
+ * second approval. Same contract as /machine-payments/send. Max 128 chars.
108
+ */
109
+ idempotencyKey?: string;
104
110
  }
105
111
  interface SignData {
106
112
  /** The hash to sign (keccak256, 0x-prefixed) */
package/dist/index.d.ts CHANGED
@@ -101,6 +101,12 @@ interface PaymentRequest {
101
101
  amount: string;
102
102
  /** Recipient Ethereum address (0x...) */
103
103
  to: string;
104
+ /**
105
+ * Optional dedupe key (#1207): a retried request with the same key returns
106
+ * the FIRST request's result instead of minting a second transfer or a
107
+ * second approval. Same contract as /machine-payments/send. Max 128 chars.
108
+ */
109
+ idempotencyKey?: string;
104
110
  }
105
111
  interface SignData {
106
112
  /** The hash to sign (keccak256, 0x-prefixed) */
package/dist/index.js CHANGED
@@ -949,7 +949,8 @@ var HavenClient = class {
949
949
  const raw = await this.post("/payments", {
950
950
  token: request.token,
951
951
  amount: request.amount,
952
- to: request.to
952
+ to: request.to,
953
+ ...request.idempotencyKey ? { idempotency_key: request.idempotencyKey } : {}
953
954
  });
954
955
  if (raw.status === "pending_approval") {
955
956
  this.throwPaymentStateError("Payment", raw);