@mysten-incubation/suipay-buyer 0.3.0-dev.2 → 0.3.0-dev.20

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.
@@ -1008,6 +1008,17 @@ var INDEXER_CODES = {
1008
1008
  user: null,
1009
1009
  logOnly: true
1010
1010
  },
1011
+ "indexer.native_settlement_deferred": {
1012
+ surfaces: ["indexer"],
1013
+ status: null,
1014
+ title: "Native settlement is deferred; holding the checkpoint",
1015
+ paymentState: "not_charged",
1016
+ retry: "after_delay",
1017
+ retryAfterSeconds: 5,
1018
+ nextAction: "retry_later",
1019
+ user: null,
1020
+ logOnly: true
1021
+ },
1011
1022
  "indexer.config_invalid": {
1012
1023
  surfaces: ["indexer"],
1013
1024
  status: null,
@@ -1138,7 +1149,7 @@ var LIMIT_CODES = {
1138
1149
  }
1139
1150
  },
1140
1151
  "limit.rate_limited": {
1141
- surfaces: ["gateway", "console_server"],
1152
+ surfaces: ["gateway", "console_server", "sdk"],
1142
1153
  status: 429,
1143
1154
  title: "Rate limit exceeded",
1144
1155
  paymentState: "not_charged",
@@ -1622,6 +1633,55 @@ var REQUEST_CODES = {
1622
1633
  nextAction: "fix_request",
1623
1634
  user: { title: "Address not found", message: "That web address doesn't exist. Check the spelling and try again." }
1624
1635
  },
1636
+ "request.recipient_changed": {
1637
+ surfaces: ["gateway"],
1638
+ status: 409,
1639
+ title: "Pay-to address changed while its registry was being checked",
1640
+ paymentState: "not_charged",
1641
+ retry: "never",
1642
+ nextAction: "fix_request",
1643
+ user: {
1644
+ title: "Retry this publish",
1645
+ message: "The payout address changed while its payment registry was being checked. Retry so the current address is checked."
1646
+ }
1647
+ },
1648
+ "request.recipient_registry_invalid": {
1649
+ surfaces: ["gateway"],
1650
+ status: 409,
1651
+ title: "Payment registry does not verify for this deployment",
1652
+ paymentState: "not_charged",
1653
+ retry: "never",
1654
+ nextAction: "fix_request",
1655
+ user: {
1656
+ title: "Registry does not match",
1657
+ message: "The payout address's payment registry does not match this deployment. Fix it, then publish again."
1658
+ }
1659
+ },
1660
+ "request.recipient_registry_missing": {
1661
+ surfaces: ["gateway"],
1662
+ status: 409,
1663
+ title: "Pay-to address has no payment registry",
1664
+ paymentState: "not_charged",
1665
+ retry: "never",
1666
+ nextAction: "fix_request",
1667
+ user: {
1668
+ title: "Create a payment registry",
1669
+ message: "This payout address has no payment registry on this network yet. Create it in the seller console, then publish again."
1670
+ }
1671
+ },
1672
+ "request.recipient_registry_unreadable": {
1673
+ surfaces: ["gateway"],
1674
+ status: 503,
1675
+ title: "Payment registry could not be read",
1676
+ paymentState: "not_charged",
1677
+ retry: "after_delay",
1678
+ retryAfterSeconds: 5,
1679
+ nextAction: "retry_later",
1680
+ user: {
1681
+ title: "Registry unread",
1682
+ message: "The payment registry could not be read just now. Wait a moment and try again."
1683
+ }
1684
+ },
1625
1685
  "request.redirect_refused": {
1626
1686
  surfaces: ["console_server", "sdk"],
1627
1687
  status: 422,
@@ -2861,6 +2921,8 @@ var CONTEXT_ALLOWLIST = /* @__PURE__ */ new Set([
2861
2921
  "seedId",
2862
2922
  "grantId",
2863
2923
  "grantObjectId",
2924
+ "policyId",
2925
+ "onChainPolicyId",
2864
2926
  "sameGrantObjectId",
2865
2927
  "verifiedGrant",
2866
2928
  "poolObjectId",
@@ -2926,6 +2988,11 @@ var CONTEXT_ALLOWLIST = /* @__PURE__ */ new Set([
2926
2988
  "rails",
2927
2989
  "shard",
2928
2990
  "metric",
2991
+ // Gateway readiness gauge. Fixed marks only: 0 or 1, and up, down, skipped, unknown.
2992
+ "ready",
2993
+ "grpc",
2994
+ "enoki",
2995
+ "postgres",
2929
2996
  "alarm",
2930
2997
  "alert",
2931
2998
  "from",
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { E as ErrorCode, P as PaymentState, N as NextAction, R as Receipt, C as CodeFor, D as DelegationScope, O as Offer } from './native-transfer-BN4VEDV0.js';
2
- export { B as BuildNativeTransferInput, M as McpPaymentSigner, a as NativeTransferAccept, b as NativeTransferBuild, c as NativeTransferError, d as NativeTransferGas, e as NativeTransferSignerInput, S as SuiPayError, f as SuiPayErrorFields, g as buildMcpPaymentPayload, h as buildNativeTransferBytes, i as createNativeTransferSigner, j as inspectNativeTransfer, t as toErrorFields } from './native-transfer-BN4VEDV0.js';
1
+ import { E as ErrorCode, P as PaymentState, N as NextAction, R as Receipt, C as CodeFor, D as DelegationScope, O as Offer } from './native-transfer-DspFvMQc.js';
2
+ export { B as BuildNativeTransferInput, M as McpPaymentSigner, a as NativeTransferAccept, b as NativeTransferBuild, c as NativeTransferError, d as NativeTransferGas, e as NativeTransferSignerInput, S as SuiPayError, f as SuiPayErrorFields, g as buildMcpPaymentPayload, h as buildNativeTransferBytes, i as createNativeTransferSigner, j as inspectNativeTransfer, t as toErrorFields } from './native-transfer-DspFvMQc.js';
3
3
  import { SuiGrpcClient } from '@mysten/sui/grpc';
4
4
  import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
5
5
  import { KeyObject } from 'node:crypto';
@@ -250,6 +250,16 @@ interface CreateDelegatedSignerResponse {
250
250
  method: string;
251
251
  idempotentReplay: boolean;
252
252
  grants: PreparedSessionTxKind[];
253
+ /**
254
+ * On a replay, grants whose create already executed. Finalize their digest;
255
+ * sponsoring them again could mint a second grant.
256
+ */
257
+ submitted?: SubmittedGrantCreate[];
258
+ }
259
+ interface SubmittedGrantCreate {
260
+ grantId: string;
261
+ asset: string;
262
+ digest: string;
253
263
  }
254
264
  interface FinalizeSessionResponse {
255
265
  delegatedSignerId: string;
@@ -385,6 +395,48 @@ interface CreatePolicyResponse {
385
395
  interface CreateProfileResponse {
386
396
  profile: AgentProfile;
387
397
  }
398
+ /**
399
+ * Discriminated union for prepared consent grant transactions.
400
+ * Returned by POST /v1/oauth/sessions/:id/grants/prepare.
401
+ */
402
+ type PreparedConsentGrant = {
403
+ kind: 'sponsored';
404
+ connectionGrantId: string;
405
+ connectionGrantIds?: string[];
406
+ asset: string;
407
+ coinType: string;
408
+ target: string;
409
+ sender: string;
410
+ bytes: string;
411
+ digest: string;
412
+ transactionKindBytes?: string;
413
+ completed?: false;
414
+ } | {
415
+ kind: 'unsponsored';
416
+ connectionGrantId: string;
417
+ connectionGrantIds?: string[];
418
+ asset: string;
419
+ coinType: string;
420
+ target: string;
421
+ sender: string;
422
+ transactionKindBytes: string;
423
+ bytes?: undefined;
424
+ digest?: undefined;
425
+ completed?: false;
426
+ } | {
427
+ kind: 'completed';
428
+ connectionGrantId: string;
429
+ connectionGrantIds?: string[];
430
+ asset: string;
431
+ coinType: string;
432
+ target: string;
433
+ sender: string;
434
+ bytes?: string;
435
+ digest?: string;
436
+ grantObjectId?: string;
437
+ completed: true;
438
+ transactionKindBytes?: string;
439
+ };
388
440
  /** @deprecated Renamed to {@link DelegatedSignerSession}. */
389
441
  type DelegatedSignerGrant = DelegatedSignerSession;
390
442
  /** @deprecated Renamed to {@link PreparedSessionTxKind}. */
@@ -1763,4 +1815,4 @@ interface VerifyPreparedSettlementInput {
1763
1815
  */
1764
1816
  declare function verifyPreparedPayment(input: VerifyPreparedSettlementInput): Promise<PreparedSettlement>;
1765
1817
 
1766
- export { type AccountApi, type AccountsApi, type AgentConnectionManifest, type AgentGrantBinding, type AgentProfile, type AgentSessionBinding, type AgentsApi, type AssetScopeInput, type BuyerAccount, type BuyerClient, type BuyerClientError, type BuyerClientOptions, type BuyerConnection, type BuyerPolicy, type BuyerResult, type CatalogApi, type CatalogService, type CreateAndActivateResult, type CreateDelegatedSignerInput, type CreateDelegatedSignerResponse, type CreatePolicyInput, type CreatePolicyResponse, type CreateProfileInput, type CreateProfileResponse, type DashboardBridgeResolvers, type DashboardConnectionManifest, type DelegatedSigner, type DelegatedSignerGrant, type DelegatedSignerGrantStatus, type DelegatedSignerSession, type DelegatedSignerStatus, type DelegatedSignersApi, ErrorCode, type ExecuteIntentKind, type ExecuteIntentResult, type FinalizeGrantResponse, type FinalizeIntentResult, type FinalizeSessionResponse, type FundHistoryItem, type GrantsApi, type ManifestError, type ManifestResult, NextAction, type PatchProfileInput, type PayInput, type PayResult, type Payer, type PayerOptions, type PaymentMethod, type PaymentReceipt, type PaymentRow, PaymentState, type PaymentStatusValue, type PaymentsApi, type PoliciesApi, type PolicyStatus, type PolicyTarget, type PrepareCreateGrantInput, type PrepareCreateSessionInput, type PreparedGrantTxKind, type PreparedIntent, type PreparedRevokeTxKind, type PreparedSessionTxKind, type ProfileStatus, type ProfilesApi, type ReceiptsApi, type RegistryApi, type RegistryService, type RevokeDelegatedSignerResponse, type ServiceRail, type ServicesApi, type SessionsApi, type SettlementRow, type SettlementsApi, type SpendAccount, type SpendAccountStatus, type SpendAccountsApi, type SponsoredTx, type TransactionSigner, type TrustSignal, createBuyer, createBuyerControlPlane, createMemoryLedger, createPayer, createReader, dashboardManifestToAgentManifest, manifestToSession, parseAgentManifest, personalMessageSigner, verifyPreparedPayment };
1818
+ export { type AccountApi, type AccountsApi, type AgentConnectionManifest, type AgentGrantBinding, type AgentProfile, type AgentSessionBinding, type AgentsApi, type AssetScopeInput, type BuyerAccount, type BuyerClient, type BuyerClientError, type BuyerClientOptions, type BuyerConnection, type BuyerPolicy, type BuyerResult, type CatalogApi, type CatalogService, type CreateAndActivateResult, type CreateDelegatedSignerInput, type CreateDelegatedSignerResponse, type CreatePolicyInput, type CreatePolicyResponse, type CreateProfileInput, type CreateProfileResponse, type DashboardBridgeResolvers, type DashboardConnectionManifest, type DelegatedSigner, type DelegatedSignerGrant, type DelegatedSignerGrantStatus, type DelegatedSignerSession, type DelegatedSignerStatus, type DelegatedSignersApi, ErrorCode, type ExecuteIntentKind, type ExecuteIntentResult, type FinalizeGrantResponse, type FinalizeIntentResult, type FinalizeSessionResponse, type FundHistoryItem, type GrantsApi, type ManifestError, type ManifestResult, NextAction, type PatchProfileInput, type PayInput, type PayResult, type Payer, type PayerOptions, type PaymentMethod, type PaymentReceipt, type PaymentRow, PaymentState, type PaymentStatusValue, type PaymentsApi, type PoliciesApi, type PolicyStatus, type PolicyTarget, type PrepareCreateGrantInput, type PrepareCreateSessionInput, type PreparedConsentGrant, type PreparedGrantTxKind, type PreparedIntent, type PreparedRevokeTxKind, type PreparedSessionTxKind, type ProfileStatus, type ProfilesApi, type ReceiptsApi, type RegistryApi, type RegistryService, type RevokeDelegatedSignerResponse, type ServiceRail, type ServicesApi, type SessionsApi, type SettlementRow, type SettlementsApi, type SpendAccount, type SpendAccountStatus, type SpendAccountsApi, type SponsoredTx, type SubmittedGrantCreate, type TransactionSigner, type TrustSignal, createBuyer, createBuyerControlPlane, createMemoryLedger, createPayer, createReader, dashboardManifestToAgentManifest, manifestToSession, parseAgentManifest, personalMessageSigner, verifyPreparedPayment };