@conto_finance/sdk 0.6.2-beta.1 → 0.7.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/README.md +3 -3
- package/dist/browserbase.d.mts +2 -1
- package/dist/browserbase.d.ts +2 -1
- package/dist/browserbase.js +5 -2
- package/dist/browserbase.mjs +1 -1
- package/dist/checkout-verifier.d.mts +2 -1
- package/dist/checkout-verifier.d.ts +2 -1
- package/dist/{chunk-VSIO6PYA.mjs → chunk-JBTJXIMI.mjs} +5 -2
- package/dist/index.d.mts +94 -4
- package/dist/index.d.ts +94 -4
- package/dist/index.js +26 -8
- package/dist/index.mjs +26 -8
- package/dist/link-wallet.d.mts +2 -1
- package/dist/link-wallet.d.ts +2 -1
- package/dist/playwright.d.mts +2 -1
- package/dist/playwright.d.ts +2 -1
- package/dist/playwright.js +5 -2
- package/dist/playwright.mjs +1 -1
- package/package.json +6 -7
package/README.md
CHANGED
|
@@ -112,8 +112,8 @@ await conto.checkout.reportOutcome(confirmed.id, { outcome: 'PAID', reference: o
|
|
|
112
112
|
|
|
113
113
|
## Stripe Link cards
|
|
114
114
|
|
|
115
|
-
The Link
|
|
116
|
-
|
|
115
|
+
The Stripe Link card integration ships in SDK 0.7.0 and later (`npm install @conto_finance/sdk`).
|
|
116
|
+
The Link controls integration kit bundles the same SDK.
|
|
117
117
|
The [minimal trusted-runtime example](https://github.com/Conto-Finance/conto/tree/main/examples/link-wallet-agent)
|
|
118
118
|
uses the existing agent SDK key, requires no shopping frontend, and never pays.
|
|
119
119
|
|
|
@@ -121,7 +121,7 @@ Stripe Link is Stripe's payment wallet, and Conto integrates with it. `conto.che
|
|
|
121
121
|
asks Conto first, then asks Stripe Link for a card only after Conto approves the purchase, for
|
|
122
122
|
exactly the approved amount at that store. Stripe Link issues the card. It runs Stripe's `link-cli`
|
|
123
123
|
on your machine with your own Link login (`npm i -g @stripe/link-cli`, then `link-cli auth login`).
|
|
124
|
-
The person approves each card in the
|
|
124
|
+
The person approves each card in Link, in the app or on the web. Conto does not receive the card. It stores only the
|
|
125
125
|
Link request ID.
|
|
126
126
|
|
|
127
127
|
```typescript
|
package/dist/browserbase.d.mts
CHANGED
|
@@ -151,4 +151,5 @@ declare function createBrowserbaseSessionManager(config: BrowserbaseSessionConfi
|
|
|
151
151
|
*/
|
|
152
152
|
declare function createBrowserbaseGuardedPlaywrightCheckoutRuntimeHost(config: BrowserbaseGuardedPlaywrightCheckoutRuntimeHostConfig): BrowserbaseGuardedPlaywrightCheckoutRuntimeHost;
|
|
153
153
|
|
|
154
|
-
export { BROWSERBASE_CONNECT_ORIGINS,
|
|
154
|
+
export { BROWSERBASE_CONNECT_ORIGINS, BrowserbaseSessionError, createBrowserbaseGuardedPlaywrightCheckoutRuntimeHost, createBrowserbaseSessionHandoffAssertion, createBrowserbaseSessionManager };
|
|
155
|
+
export type { BrowserbaseAttachedSession, BrowserbaseGuardedPlaywrightCheckoutRuntimeHost, BrowserbaseGuardedPlaywrightCheckoutRuntimeHostConfig, BrowserbaseOwnedLiveView, BrowserbaseOwnedSession, BrowserbaseSessionBinding, BrowserbaseSessionBindingState, BrowserbaseSessionBindingStore, BrowserbaseSessionConfig, BrowserbaseSessionErrorCode, BrowserbaseSessionHandoff, BrowserbaseSessionHandoffAssertionInput, BrowserbaseSessionLifecycleOwner, BrowserbaseSessionManager, BrowserbaseSessionStatus };
|
package/dist/browserbase.d.ts
CHANGED
|
@@ -151,4 +151,5 @@ declare function createBrowserbaseSessionManager(config: BrowserbaseSessionConfi
|
|
|
151
151
|
*/
|
|
152
152
|
declare function createBrowserbaseGuardedPlaywrightCheckoutRuntimeHost(config: BrowserbaseGuardedPlaywrightCheckoutRuntimeHostConfig): BrowserbaseGuardedPlaywrightCheckoutRuntimeHost;
|
|
153
153
|
|
|
154
|
-
export { BROWSERBASE_CONNECT_ORIGINS,
|
|
154
|
+
export { BROWSERBASE_CONNECT_ORIGINS, BrowserbaseSessionError, createBrowserbaseGuardedPlaywrightCheckoutRuntimeHost, createBrowserbaseSessionHandoffAssertion, createBrowserbaseSessionManager };
|
|
155
|
+
export type { BrowserbaseAttachedSession, BrowserbaseGuardedPlaywrightCheckoutRuntimeHost, BrowserbaseGuardedPlaywrightCheckoutRuntimeHostConfig, BrowserbaseOwnedLiveView, BrowserbaseOwnedSession, BrowserbaseSessionBinding, BrowserbaseSessionBindingState, BrowserbaseSessionBindingStore, BrowserbaseSessionConfig, BrowserbaseSessionErrorCode, BrowserbaseSessionHandoff, BrowserbaseSessionHandoffAssertionInput, BrowserbaseSessionLifecycleOwner, BrowserbaseSessionManager, BrowserbaseSessionStatus };
|
package/dist/browserbase.js
CHANGED
|
@@ -322,13 +322,16 @@ function createEncryptedPlaywrightCheckoutTargetStore(config) {
|
|
|
322
322
|
if (envelope.version !== TARGET_STORE_ENVELOPE_VERSION || typeof envelope.iv !== "string" || typeof envelope.ciphertext !== "string" || typeof envelope.tag !== "string") {
|
|
323
323
|
throw new Error("invalid envelope");
|
|
324
324
|
}
|
|
325
|
+
const tag = Buffer.from(envelope.tag, "base64url");
|
|
326
|
+
if (tag.length !== 16) throw new Error("invalid envelope");
|
|
325
327
|
const decipher = (0, import_node_crypto2.createDecipheriv)(
|
|
326
328
|
"aes-256-gcm",
|
|
327
329
|
key,
|
|
328
|
-
Buffer.from(envelope.iv, "base64url")
|
|
330
|
+
Buffer.from(envelope.iv, "base64url"),
|
|
331
|
+
{ authTagLength: 16 }
|
|
329
332
|
);
|
|
330
333
|
decipher.setAAD(Buffer.from(storageKey));
|
|
331
|
-
decipher.setAuthTag(
|
|
334
|
+
decipher.setAuthTag(tag);
|
|
332
335
|
const plaintext = Buffer.concat([
|
|
333
336
|
decipher.update(Buffer.from(envelope.ciphertext, "base64url")),
|
|
334
337
|
decipher.final()
|
package/dist/browserbase.mjs
CHANGED
|
@@ -92,4 +92,5 @@ interface VerifyCheckoutIntegrationOptions {
|
|
|
92
92
|
*/
|
|
93
93
|
declare function verifyCheckoutIntegration(value: CheckoutCapabilityManifest | unknown, options?: VerifyCheckoutIntegrationOptions): Promise<CheckoutIntegrationVerificationReport>;
|
|
94
94
|
|
|
95
|
-
export { CHECKOUT_CAPABILITY_KINDS, CHECKOUT_CAPABILITY_MANIFEST_VERSION, CHECKOUT_CONFORMANCE_PROBE_IDS, CHECKOUT_METHOD_IDS, CHECKOUT_VERIFICATION_REPORT_VERSION,
|
|
95
|
+
export { CHECKOUT_CAPABILITY_KINDS, CHECKOUT_CAPABILITY_MANIFEST_VERSION, CHECKOUT_CONFORMANCE_PROBE_IDS, CHECKOUT_METHOD_IDS, CHECKOUT_VERIFICATION_REPORT_VERSION, verifyCheckoutIntegration };
|
|
96
|
+
export type { CheckoutCapabilityDescriptor, CheckoutCapabilityExposure, CheckoutCapabilityInventoryScope, CheckoutCapabilityKind, CheckoutCapabilityManifest, CheckoutCapabilityPaymentBoundary, CheckoutConformanceProbeId, CheckoutConformanceProbeObservation, CheckoutConformanceProbeOutcome, CheckoutConformanceProbeRequest, CheckoutConformanceProbeResult, CheckoutConformanceProbeRunner, CheckoutIntegrationComponent, CheckoutIntegrationStatus, CheckoutIntegrationVerificationReport, CheckoutMethodId, CheckoutSessionBinding, CheckoutVerificationFinding, CheckoutVerificationFindingCode, VerifyCheckoutIntegrationOptions };
|
|
@@ -92,4 +92,5 @@ interface VerifyCheckoutIntegrationOptions {
|
|
|
92
92
|
*/
|
|
93
93
|
declare function verifyCheckoutIntegration(value: CheckoutCapabilityManifest | unknown, options?: VerifyCheckoutIntegrationOptions): Promise<CheckoutIntegrationVerificationReport>;
|
|
94
94
|
|
|
95
|
-
export { CHECKOUT_CAPABILITY_KINDS, CHECKOUT_CAPABILITY_MANIFEST_VERSION, CHECKOUT_CONFORMANCE_PROBE_IDS, CHECKOUT_METHOD_IDS, CHECKOUT_VERIFICATION_REPORT_VERSION,
|
|
95
|
+
export { CHECKOUT_CAPABILITY_KINDS, CHECKOUT_CAPABILITY_MANIFEST_VERSION, CHECKOUT_CONFORMANCE_PROBE_IDS, CHECKOUT_METHOD_IDS, CHECKOUT_VERIFICATION_REPORT_VERSION, verifyCheckoutIntegration };
|
|
96
|
+
export type { CheckoutCapabilityDescriptor, CheckoutCapabilityExposure, CheckoutCapabilityInventoryScope, CheckoutCapabilityKind, CheckoutCapabilityManifest, CheckoutCapabilityPaymentBoundary, CheckoutConformanceProbeId, CheckoutConformanceProbeObservation, CheckoutConformanceProbeOutcome, CheckoutConformanceProbeRequest, CheckoutConformanceProbeResult, CheckoutConformanceProbeRunner, CheckoutIntegrationComponent, CheckoutIntegrationStatus, CheckoutIntegrationVerificationReport, CheckoutMethodId, CheckoutSessionBinding, CheckoutVerificationFinding, CheckoutVerificationFindingCode, VerifyCheckoutIntegrationOptions };
|
|
@@ -184,13 +184,16 @@ function createEncryptedPlaywrightCheckoutTargetStore(config) {
|
|
|
184
184
|
if (envelope.version !== TARGET_STORE_ENVELOPE_VERSION || typeof envelope.iv !== "string" || typeof envelope.ciphertext !== "string" || typeof envelope.tag !== "string") {
|
|
185
185
|
throw new Error("invalid envelope");
|
|
186
186
|
}
|
|
187
|
+
const tag = Buffer.from(envelope.tag, "base64url");
|
|
188
|
+
if (tag.length !== 16) throw new Error("invalid envelope");
|
|
187
189
|
const decipher = createDecipheriv(
|
|
188
190
|
"aes-256-gcm",
|
|
189
191
|
key,
|
|
190
|
-
Buffer.from(envelope.iv, "base64url")
|
|
192
|
+
Buffer.from(envelope.iv, "base64url"),
|
|
193
|
+
{ authTagLength: 16 }
|
|
191
194
|
);
|
|
192
195
|
decipher.setAAD(Buffer.from(storageKey));
|
|
193
|
-
decipher.setAuthTag(
|
|
196
|
+
decipher.setAuthTag(tag);
|
|
194
197
|
const plaintext = Buffer.concat([
|
|
195
198
|
decipher.update(Buffer.from(envelope.ciphertext, "base64url")),
|
|
196
199
|
decipher.final()
|
package/dist/index.d.mts
CHANGED
|
@@ -40,6 +40,48 @@ interface PurchaseGroceryItem {
|
|
|
40
40
|
interface PurchaseGroceryList {
|
|
41
41
|
items: PurchaseGroceryItem[];
|
|
42
42
|
}
|
|
43
|
+
/** A grocery list purchase's items, delivery and fees at the store. */
|
|
44
|
+
interface PurchaseGrocery {
|
|
45
|
+
/** Each list item that has settled so far, by its position in the list. */
|
|
46
|
+
items: ({
|
|
47
|
+
index: number;
|
|
48
|
+
label: string;
|
|
49
|
+
status: 'added';
|
|
50
|
+
/** The store's product name. */
|
|
51
|
+
name: string;
|
|
52
|
+
quantity: number;
|
|
53
|
+
/** The line's price for that quantity. */
|
|
54
|
+
price: PurchaseMoney;
|
|
55
|
+
} | {
|
|
56
|
+
index: number;
|
|
57
|
+
label: string;
|
|
58
|
+
status: 'skipped';
|
|
59
|
+
reason: 'no_match' | 'size_unavailable' | 'brand_unavailable' | 'excluded';
|
|
60
|
+
})[];
|
|
61
|
+
/** The delivery time chosen at checkout. */
|
|
62
|
+
delivery: {
|
|
63
|
+
title: string;
|
|
64
|
+
window: string;
|
|
65
|
+
kind: 'priority' | 'standard' | 'scheduled' | 'other';
|
|
66
|
+
windowStart: string | null;
|
|
67
|
+
windowEnd: string | null;
|
|
68
|
+
price: PurchaseMoney | null;
|
|
69
|
+
} | null;
|
|
70
|
+
/** The store checkout's totals and fees, as it showed them. */
|
|
71
|
+
summary: {
|
|
72
|
+
itemsSubtotal: PurchaseMoney | null;
|
|
73
|
+
deliveryFee: PurchaseMoney | null;
|
|
74
|
+
serviceFee: PurchaseMoney | null;
|
|
75
|
+
bagFee: PurchaseMoney | null;
|
|
76
|
+
tax: PurchaseMoney | null;
|
|
77
|
+
tip: PurchaseMoney | null;
|
|
78
|
+
otherFees: {
|
|
79
|
+
label: string;
|
|
80
|
+
amount: PurchaseMoney;
|
|
81
|
+
}[];
|
|
82
|
+
total: PurchaseMoney | null;
|
|
83
|
+
} | null;
|
|
84
|
+
}
|
|
43
85
|
interface PurchaseRequest {
|
|
44
86
|
url: string;
|
|
45
87
|
task?: string;
|
|
@@ -66,6 +108,15 @@ interface PurchaseAction {
|
|
|
66
108
|
maximum: PurchaseMoney;
|
|
67
109
|
maxCost: PurchaseMoney;
|
|
68
110
|
};
|
|
111
|
+
/**
|
|
112
|
+
* For a merchant_signin you answer: the store sign-in step. Answer `email`
|
|
113
|
+
* with `{ email }` (or `{ email, createAccount: true, agreedToStoreTerms: true }`)
|
|
114
|
+
* and `code` with `{ code }`, the 6-digit code the store sent the buyer.
|
|
115
|
+
*/
|
|
116
|
+
signin?: {
|
|
117
|
+
store: 'instacart';
|
|
118
|
+
step: 'email' | 'code';
|
|
119
|
+
};
|
|
69
120
|
/**
|
|
70
121
|
* For buyer, cardholder and reviewer actions: the Conto page that completes
|
|
71
122
|
* it. It works only inside a hosted buyer session or the dashboard, so it is
|
|
@@ -119,7 +170,15 @@ interface Purchase {
|
|
|
119
170
|
result: {
|
|
120
171
|
outcome: 'merchant_confirmed' | 'checkout_reported' | 'credential_unused' | 'not_completed' | 'denied' | 'cancelled';
|
|
121
172
|
merchantReference: string | null;
|
|
173
|
+
/** merchant_confirmed: the store's order number, when shown. */
|
|
174
|
+
orderNumber?: string | null;
|
|
175
|
+
/** merchant_confirmed: the store's receipt or order page, when shown. */
|
|
176
|
+
receiptUrl?: string | null;
|
|
177
|
+
/** merchant_confirmed: the amount the store charged, when shown. */
|
|
178
|
+
charged?: PurchaseMoney | null;
|
|
122
179
|
} | null;
|
|
180
|
+
/** Present for a grocery list purchase. */
|
|
181
|
+
grocery?: PurchaseGrocery;
|
|
123
182
|
paymentEvidence: PurchaseEvidence;
|
|
124
183
|
progress: {
|
|
125
184
|
steps: number;
|
|
@@ -190,8 +249,8 @@ interface CreatePurchaseInput {
|
|
|
190
249
|
delegationId: string;
|
|
191
250
|
};
|
|
192
251
|
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
252
|
+
* New purchases snapshot saved delivery details at creation for the store's
|
|
253
|
+
* delivery form. Leave out to use them when present, pass the buyer id
|
|
195
254
|
* to require them, or null to never use them.
|
|
196
255
|
*/
|
|
197
256
|
buyerProfileId?: string | null;
|
|
@@ -1294,6 +1353,29 @@ interface RefreshBalanceResult {
|
|
|
1294
1353
|
balances: WalletChainBalanceSnapshot[];
|
|
1295
1354
|
lastRefreshed: string;
|
|
1296
1355
|
}
|
|
1356
|
+
/** A one-time message for a self-custody wallet's address to sign. */
|
|
1357
|
+
interface WalletOwnershipChallenge {
|
|
1358
|
+
walletId: string;
|
|
1359
|
+
address: string;
|
|
1360
|
+
chainType: ChainType;
|
|
1361
|
+
chainId: string;
|
|
1362
|
+
/** Sign exactly this text: EIP-191 personal_sign on EVM, Ed25519 on Solana. */
|
|
1363
|
+
message: string;
|
|
1364
|
+
expiresAt: string;
|
|
1365
|
+
/** When the wallet was last proven, or null if never. */
|
|
1366
|
+
provenAt: string | null;
|
|
1367
|
+
}
|
|
1368
|
+
interface ProveWalletOwnershipInput {
|
|
1369
|
+
/** The challenge message, unchanged. */
|
|
1370
|
+
message: string;
|
|
1371
|
+
/** EVM: 0x-prefixed hex signature. Solana: base58 or base64 signature. */
|
|
1372
|
+
signature: string;
|
|
1373
|
+
}
|
|
1374
|
+
interface WalletOwnershipProof {
|
|
1375
|
+
walletId: string;
|
|
1376
|
+
proven: true;
|
|
1377
|
+
provenAt: string;
|
|
1378
|
+
}
|
|
1297
1379
|
interface PolicyRule {
|
|
1298
1380
|
id: string;
|
|
1299
1381
|
policyId: string;
|
|
@@ -1583,6 +1665,13 @@ declare class WalletsClient {
|
|
|
1583
1665
|
provision(walletId: string): Promise<ProvisionWalletResult>;
|
|
1584
1666
|
/** Refresh a wallet's balance from the chain */
|
|
1585
1667
|
refreshBalance(walletId: string): Promise<RefreshBalanceResult>;
|
|
1668
|
+
/**
|
|
1669
|
+
* Get a one-time message for a self-custody wallet's address to sign. It
|
|
1670
|
+
* expires after 10 minutes and replaces any earlier challenge.
|
|
1671
|
+
*/
|
|
1672
|
+
createOwnershipChallenge(walletId: string): Promise<WalletOwnershipChallenge>;
|
|
1673
|
+
/** Prove your organization controls a self-custody wallet's address. */
|
|
1674
|
+
proveOwnership(walletId: string, input: ProveWalletOwnershipInput): Promise<WalletOwnershipProof>;
|
|
1586
1675
|
}
|
|
1587
1676
|
declare class PoliciesClient {
|
|
1588
1677
|
private client;
|
|
@@ -3765,7 +3854,7 @@ declare class CheckoutClient {
|
|
|
3765
3854
|
* 1. Conto runs checkpoint 1 and holds the spend. When a rule requires the
|
|
3766
3855
|
* owner's approval, this waits for it.
|
|
3767
3856
|
* 2. Only then does the wallet ask Link for a card for exactly the approved
|
|
3768
|
-
* amount at this merchant. The person approves it in
|
|
3857
|
+
* amount at this merchant. The person approves it in Link.
|
|
3769
3858
|
* 3. The card is returned. It never reaches Conto.
|
|
3770
3859
|
*
|
|
3771
3860
|
* Then fill in the card, call confirm(result.checkpoint, { amountMinor,
|
|
@@ -3790,4 +3879,5 @@ declare class CheckoutClient {
|
|
|
3790
3879
|
replaceLinkCard(previous: LinkCardResult, input: ReplaceLinkCardInput): Promise<LinkCardResult>;
|
|
3791
3880
|
}
|
|
3792
3881
|
|
|
3793
|
-
export {
|
|
3882
|
+
export { AdminPurchasingClient, BrowserActionFinalizationPendingError, BrowserCheckoutTargetVerificationError, CardsClient, CheckoutApprovalDeniedError, CheckoutApprovalExpiredError, CheckoutApprovalPendingError, CheckoutApprovalTimeoutError, CheckoutCheckpointClosedError, CheckoutClient, ConnectedCardsClient, Conto, ContoAdmin, ContoAdminError, ContoError, ControlledExternalCardPaymentTool, ExternalCardConfirmationPendingError, Conto as Giro, ContoError as GiroError, LinkCardCredential, LinkCardDeniedError, LinkCardError, LinkCardExpiredError, LinkCardTimeoutError, LinkWallet, LinkWalletUnavailableError, OrganizationPurchasesClient, OrganizationRecurringPurchasesClient, PurchasesClient, RecurringPurchasesClient, TestCardsClient, canonicalizeBrowserCheckoutTarget, createVerifiedBrowserCheckoutDriver, Conto as default, fingerprintBrowserCheckoutTarget, isFinalPurchaseStatus, parseServerSentEvents, verifyPurchaseWebhook };
|
|
3883
|
+
export type { AdminExternalCardOverlayEnforcement, Agent, AgentCheckoutAction, AgentCheckoutActionKind, AgentExternalCard, AgentSetupResult, AgentStatus, AgentType, AgentWalletLink, ApprovedExternalCardExecution, AssignExternalCardInput, AssignedPolicy, AuthorizeCheckoutActionResult, BeginCheckoutCheckpointInput, BeginCommerceExecutionInput, BrowserActionClaimResult, BrowserActionDispatchObservationInput, BrowserActionFinalizeResult, BrowserCheckoutAction, BrowserCheckoutTargetResolver, BrowserCheckoutTargetSnapshot, BrowserCheckoutTargetVerificationCode, CancellationOutcome, CanonicalBrowserCheckoutTargetSnapshot, ChainType, CheckoutActionAuthorization, CheckoutCheckpoint, CheckoutCheckpointApproval, CheckoutCheckpointMethod, CheckoutCheckpointNextAction, CheckoutCheckpointStage, CheckoutOutcome, CheckoutPaymentReference, CommerceCheckoutMethod, CommerceContextRequirement, CommerceExecution, CommerceExecutionAdapterKind, CommerceExecutionArtifactKind, CommerceExecutionChannel, CommerceExecutionConstraint, CommerceExecutionConstraintCoverage, CommerceExecutionConstraintCoverageLevel, CommerceExecutionDeliveryMode, CommerceExecutionEvidence, CommerceExecutionProvider, CommerceExecutionResult, CommerceExecutionSourceKind, CommerceExecutionStatus, CommerceFactConfidence, CommerceFactProvenanceInput, CommerceFactSource, CommerceFulfillmentInput, CommerceLineItemInput, CommerceProposalFactKey, CommerceProposalMissingFact, CommerceProposalResolution, CommerceProposalState, CommerceSettlementRail, CommerceTotalInput, CommerceTotalType, ComparePolicyVersionsResponse, ConfirmCheckoutCheckpointInput, ConnectedCardBrief, ConnectedCardCredential, ConnectedCardDrawInput, ConnectedCardDrawMerchant, ConnectedCardDrawResult, ConnectedCardDrawable, ConnectedCardListResult, ConnectedCardMandate, ConnectedCardMandateMerchant, ConnectedCardOutcomeReport, ConnectedCardOutcomeReportResult, ConnectedCardReference, ContoAdminConfig, ContoConfig, ContoRequestOptions, ControlledExternalCardPaymentResult, CreateAgentInput, CreatePolicyInput, CreatePolicyRuleInput, CreatePurchaseInput, CreateSdkKeyInput, CreateSdkKeyResult, CreateWalletInput, CustodyType, CustomerCustodyMode, CustomerWalletControlModel, CustomerWalletKeyAccess, DelegationType, ExecuteCommerceExecutionResult, ExternalCard, ExternalCardApprovalInput, ExternalCardApprovalResult, ExternalCardConfirmationInput, ExternalCardConfirmationResult, ExternalCardExecutionClaimResult, ExternalCardExecutionResult, ExternalCardExecutor, ExternalCardOverlayEnforcement, ExternalCardRequestStatusResult, ExternalWalletApprovalInput, ExternalWalletApprovalResult, ExternalWalletConfirmationInput, ExternalWalletConfirmationResult, FreezeAgentInput, GetLinkCardInput, ContoConfig as GiroConfig, GuardCheckoutResult, GuardedBrowserDispatchResult, GuardedCheckoutInput, LinkCardResult, LinkWalletInput, ListAgentsParams, ListAgentsResponse, ListPoliciesParams, ListPoliciesResponse, ListPolicyVersionsResponse, ListWalletsParams, ListWalletsResponse, MppBudgetResult, MppPreAuthorizeInput, MppPreAuthorizeResult, MppRecordInput, MppRecordResult, NormalizeCommerceProposalInput, OrganizationMember, PaginatedResponse, PaginationParams, PauseExternalCardAssignmentResult, PaymentExecuteResult, PaymentRequestInput, PaymentRequestResult, PaymentStatusResult, Policy, PolicyRule, PolicyType, PolicyVersionChangeType, PolicyVersionDetail, PolicyVersionDiff, PolicyVersionFieldChange, PolicyVersionSnapshot, PolicyVersionSnapshotRule, PolicyVersionSummary, PrivilegedBrowserCheckoutDriver, ProtocolBudgetResult, ProtocolPreAuthorizeResult, ProtocolRecordGrant, ProtocolRecordGrantResult, ProtocolServiceSummary, ProtocolServicesResult, ProveWalletOwnershipInput, ProvisionWalletResult, Purchase, PurchaseAction, PurchaseActionAuthority, PurchaseActionKind, PurchaseAllowance, PurchaseBuyer, PurchaseBuyerCompanyCard, PurchaseBuyerCompanyCardLimits, PurchaseBuyerKitchenContext, PurchaseCompanyCard, PurchaseDelegation, PurchaseEvent, PurchaseEventPage, PurchaseEvidence, PurchaseGrocery, PurchaseGroceryItem, PurchaseGroceryList, PurchaseHostedLink, PurchaseItem, PurchaseKitchenContext, PurchaseKitchenInventoryItem, PurchaseKitchenListItem, PurchaseKitchenPreferences, PurchaseKitchenRecipe, PurchaseKitchenUsual, PurchaseList, PurchaseMoney, PurchasePaymentMethod, PurchasePhase, PurchaseRequest, PurchaseResponseAck, PurchaseStatus, PurchasingCapabilities, PurchasingSettings, RecurringPurchase, RecurringPurchaseCycleResult, RecurringPurchaseCycleStatus, RefreshBalanceResult, RegisterExternalCardInput, ReplaceLinkCardInput, ReportCheckoutOutcomeInput, RollbackPolicyVersionResponse, RuleAction, RuleOperator, RuleType, RunGuardedCheckoutResult, SdkKey, SdkKeyType, SetupCapabilityState, SetupCardDiagnostics, SetupDiagnosticAction, SetupDiagnosticIssue, SetupDiagnosticIssueCode, SetupDiagnostics, SetupWalletDiagnostics, TestCardCredential, TestCardDrawResult, TestCardDrawable, TestCardListResult, TestCardReceipt, TestCheckoutInput, TestCheckoutResult, TestMerchant, TestMerchantProduct, UnfreezeAgentInput, UpdateAgentInput, UpdateExternalCardAssignmentInput, UpdatePolicyInput, UpdatePolicyRuleInput, UpdateWalletInput, VerifiedBrowserCheckoutTarget, WaitForCheckoutApprovalOptions, Wallet, WalletChainBalanceSnapshot, WalletOwnershipChallenge, WalletOwnershipProof, WalletStatus, WalletType, WatchPurchaseOptions, X402Authorization, X402BudgetResult, X402PayInput, X402PayResult, X402PaymentRequirements, X402PreAuthorizeInput, X402PreAuthorizeResult, X402RecordInput, X402RecordResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -40,6 +40,48 @@ interface PurchaseGroceryItem {
|
|
|
40
40
|
interface PurchaseGroceryList {
|
|
41
41
|
items: PurchaseGroceryItem[];
|
|
42
42
|
}
|
|
43
|
+
/** A grocery list purchase's items, delivery and fees at the store. */
|
|
44
|
+
interface PurchaseGrocery {
|
|
45
|
+
/** Each list item that has settled so far, by its position in the list. */
|
|
46
|
+
items: ({
|
|
47
|
+
index: number;
|
|
48
|
+
label: string;
|
|
49
|
+
status: 'added';
|
|
50
|
+
/** The store's product name. */
|
|
51
|
+
name: string;
|
|
52
|
+
quantity: number;
|
|
53
|
+
/** The line's price for that quantity. */
|
|
54
|
+
price: PurchaseMoney;
|
|
55
|
+
} | {
|
|
56
|
+
index: number;
|
|
57
|
+
label: string;
|
|
58
|
+
status: 'skipped';
|
|
59
|
+
reason: 'no_match' | 'size_unavailable' | 'brand_unavailable' | 'excluded';
|
|
60
|
+
})[];
|
|
61
|
+
/** The delivery time chosen at checkout. */
|
|
62
|
+
delivery: {
|
|
63
|
+
title: string;
|
|
64
|
+
window: string;
|
|
65
|
+
kind: 'priority' | 'standard' | 'scheduled' | 'other';
|
|
66
|
+
windowStart: string | null;
|
|
67
|
+
windowEnd: string | null;
|
|
68
|
+
price: PurchaseMoney | null;
|
|
69
|
+
} | null;
|
|
70
|
+
/** The store checkout's totals and fees, as it showed them. */
|
|
71
|
+
summary: {
|
|
72
|
+
itemsSubtotal: PurchaseMoney | null;
|
|
73
|
+
deliveryFee: PurchaseMoney | null;
|
|
74
|
+
serviceFee: PurchaseMoney | null;
|
|
75
|
+
bagFee: PurchaseMoney | null;
|
|
76
|
+
tax: PurchaseMoney | null;
|
|
77
|
+
tip: PurchaseMoney | null;
|
|
78
|
+
otherFees: {
|
|
79
|
+
label: string;
|
|
80
|
+
amount: PurchaseMoney;
|
|
81
|
+
}[];
|
|
82
|
+
total: PurchaseMoney | null;
|
|
83
|
+
} | null;
|
|
84
|
+
}
|
|
43
85
|
interface PurchaseRequest {
|
|
44
86
|
url: string;
|
|
45
87
|
task?: string;
|
|
@@ -66,6 +108,15 @@ interface PurchaseAction {
|
|
|
66
108
|
maximum: PurchaseMoney;
|
|
67
109
|
maxCost: PurchaseMoney;
|
|
68
110
|
};
|
|
111
|
+
/**
|
|
112
|
+
* For a merchant_signin you answer: the store sign-in step. Answer `email`
|
|
113
|
+
* with `{ email }` (or `{ email, createAccount: true, agreedToStoreTerms: true }`)
|
|
114
|
+
* and `code` with `{ code }`, the 6-digit code the store sent the buyer.
|
|
115
|
+
*/
|
|
116
|
+
signin?: {
|
|
117
|
+
store: 'instacart';
|
|
118
|
+
step: 'email' | 'code';
|
|
119
|
+
};
|
|
69
120
|
/**
|
|
70
121
|
* For buyer, cardholder and reviewer actions: the Conto page that completes
|
|
71
122
|
* it. It works only inside a hosted buyer session or the dashboard, so it is
|
|
@@ -119,7 +170,15 @@ interface Purchase {
|
|
|
119
170
|
result: {
|
|
120
171
|
outcome: 'merchant_confirmed' | 'checkout_reported' | 'credential_unused' | 'not_completed' | 'denied' | 'cancelled';
|
|
121
172
|
merchantReference: string | null;
|
|
173
|
+
/** merchant_confirmed: the store's order number, when shown. */
|
|
174
|
+
orderNumber?: string | null;
|
|
175
|
+
/** merchant_confirmed: the store's receipt or order page, when shown. */
|
|
176
|
+
receiptUrl?: string | null;
|
|
177
|
+
/** merchant_confirmed: the amount the store charged, when shown. */
|
|
178
|
+
charged?: PurchaseMoney | null;
|
|
122
179
|
} | null;
|
|
180
|
+
/** Present for a grocery list purchase. */
|
|
181
|
+
grocery?: PurchaseGrocery;
|
|
123
182
|
paymentEvidence: PurchaseEvidence;
|
|
124
183
|
progress: {
|
|
125
184
|
steps: number;
|
|
@@ -190,8 +249,8 @@ interface CreatePurchaseInput {
|
|
|
190
249
|
delegationId: string;
|
|
191
250
|
};
|
|
192
251
|
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
252
|
+
* New purchases snapshot saved delivery details at creation for the store's
|
|
253
|
+
* delivery form. Leave out to use them when present, pass the buyer id
|
|
195
254
|
* to require them, or null to never use them.
|
|
196
255
|
*/
|
|
197
256
|
buyerProfileId?: string | null;
|
|
@@ -1294,6 +1353,29 @@ interface RefreshBalanceResult {
|
|
|
1294
1353
|
balances: WalletChainBalanceSnapshot[];
|
|
1295
1354
|
lastRefreshed: string;
|
|
1296
1355
|
}
|
|
1356
|
+
/** A one-time message for a self-custody wallet's address to sign. */
|
|
1357
|
+
interface WalletOwnershipChallenge {
|
|
1358
|
+
walletId: string;
|
|
1359
|
+
address: string;
|
|
1360
|
+
chainType: ChainType;
|
|
1361
|
+
chainId: string;
|
|
1362
|
+
/** Sign exactly this text: EIP-191 personal_sign on EVM, Ed25519 on Solana. */
|
|
1363
|
+
message: string;
|
|
1364
|
+
expiresAt: string;
|
|
1365
|
+
/** When the wallet was last proven, or null if never. */
|
|
1366
|
+
provenAt: string | null;
|
|
1367
|
+
}
|
|
1368
|
+
interface ProveWalletOwnershipInput {
|
|
1369
|
+
/** The challenge message, unchanged. */
|
|
1370
|
+
message: string;
|
|
1371
|
+
/** EVM: 0x-prefixed hex signature. Solana: base58 or base64 signature. */
|
|
1372
|
+
signature: string;
|
|
1373
|
+
}
|
|
1374
|
+
interface WalletOwnershipProof {
|
|
1375
|
+
walletId: string;
|
|
1376
|
+
proven: true;
|
|
1377
|
+
provenAt: string;
|
|
1378
|
+
}
|
|
1297
1379
|
interface PolicyRule {
|
|
1298
1380
|
id: string;
|
|
1299
1381
|
policyId: string;
|
|
@@ -1583,6 +1665,13 @@ declare class WalletsClient {
|
|
|
1583
1665
|
provision(walletId: string): Promise<ProvisionWalletResult>;
|
|
1584
1666
|
/** Refresh a wallet's balance from the chain */
|
|
1585
1667
|
refreshBalance(walletId: string): Promise<RefreshBalanceResult>;
|
|
1668
|
+
/**
|
|
1669
|
+
* Get a one-time message for a self-custody wallet's address to sign. It
|
|
1670
|
+
* expires after 10 minutes and replaces any earlier challenge.
|
|
1671
|
+
*/
|
|
1672
|
+
createOwnershipChallenge(walletId: string): Promise<WalletOwnershipChallenge>;
|
|
1673
|
+
/** Prove your organization controls a self-custody wallet's address. */
|
|
1674
|
+
proveOwnership(walletId: string, input: ProveWalletOwnershipInput): Promise<WalletOwnershipProof>;
|
|
1586
1675
|
}
|
|
1587
1676
|
declare class PoliciesClient {
|
|
1588
1677
|
private client;
|
|
@@ -3765,7 +3854,7 @@ declare class CheckoutClient {
|
|
|
3765
3854
|
* 1. Conto runs checkpoint 1 and holds the spend. When a rule requires the
|
|
3766
3855
|
* owner's approval, this waits for it.
|
|
3767
3856
|
* 2. Only then does the wallet ask Link for a card for exactly the approved
|
|
3768
|
-
* amount at this merchant. The person approves it in
|
|
3857
|
+
* amount at this merchant. The person approves it in Link.
|
|
3769
3858
|
* 3. The card is returned. It never reaches Conto.
|
|
3770
3859
|
*
|
|
3771
3860
|
* Then fill in the card, call confirm(result.checkpoint, { amountMinor,
|
|
@@ -3790,4 +3879,5 @@ declare class CheckoutClient {
|
|
|
3790
3879
|
replaceLinkCard(previous: LinkCardResult, input: ReplaceLinkCardInput): Promise<LinkCardResult>;
|
|
3791
3880
|
}
|
|
3792
3881
|
|
|
3793
|
-
export {
|
|
3882
|
+
export { AdminPurchasingClient, BrowserActionFinalizationPendingError, BrowserCheckoutTargetVerificationError, CardsClient, CheckoutApprovalDeniedError, CheckoutApprovalExpiredError, CheckoutApprovalPendingError, CheckoutApprovalTimeoutError, CheckoutCheckpointClosedError, CheckoutClient, ConnectedCardsClient, Conto, ContoAdmin, ContoAdminError, ContoError, ControlledExternalCardPaymentTool, ExternalCardConfirmationPendingError, Conto as Giro, ContoError as GiroError, LinkCardCredential, LinkCardDeniedError, LinkCardError, LinkCardExpiredError, LinkCardTimeoutError, LinkWallet, LinkWalletUnavailableError, OrganizationPurchasesClient, OrganizationRecurringPurchasesClient, PurchasesClient, RecurringPurchasesClient, TestCardsClient, canonicalizeBrowserCheckoutTarget, createVerifiedBrowserCheckoutDriver, Conto as default, fingerprintBrowserCheckoutTarget, isFinalPurchaseStatus, parseServerSentEvents, verifyPurchaseWebhook };
|
|
3883
|
+
export type { AdminExternalCardOverlayEnforcement, Agent, AgentCheckoutAction, AgentCheckoutActionKind, AgentExternalCard, AgentSetupResult, AgentStatus, AgentType, AgentWalletLink, ApprovedExternalCardExecution, AssignExternalCardInput, AssignedPolicy, AuthorizeCheckoutActionResult, BeginCheckoutCheckpointInput, BeginCommerceExecutionInput, BrowserActionClaimResult, BrowserActionDispatchObservationInput, BrowserActionFinalizeResult, BrowserCheckoutAction, BrowserCheckoutTargetResolver, BrowserCheckoutTargetSnapshot, BrowserCheckoutTargetVerificationCode, CancellationOutcome, CanonicalBrowserCheckoutTargetSnapshot, ChainType, CheckoutActionAuthorization, CheckoutCheckpoint, CheckoutCheckpointApproval, CheckoutCheckpointMethod, CheckoutCheckpointNextAction, CheckoutCheckpointStage, CheckoutOutcome, CheckoutPaymentReference, CommerceCheckoutMethod, CommerceContextRequirement, CommerceExecution, CommerceExecutionAdapterKind, CommerceExecutionArtifactKind, CommerceExecutionChannel, CommerceExecutionConstraint, CommerceExecutionConstraintCoverage, CommerceExecutionConstraintCoverageLevel, CommerceExecutionDeliveryMode, CommerceExecutionEvidence, CommerceExecutionProvider, CommerceExecutionResult, CommerceExecutionSourceKind, CommerceExecutionStatus, CommerceFactConfidence, CommerceFactProvenanceInput, CommerceFactSource, CommerceFulfillmentInput, CommerceLineItemInput, CommerceProposalFactKey, CommerceProposalMissingFact, CommerceProposalResolution, CommerceProposalState, CommerceSettlementRail, CommerceTotalInput, CommerceTotalType, ComparePolicyVersionsResponse, ConfirmCheckoutCheckpointInput, ConnectedCardBrief, ConnectedCardCredential, ConnectedCardDrawInput, ConnectedCardDrawMerchant, ConnectedCardDrawResult, ConnectedCardDrawable, ConnectedCardListResult, ConnectedCardMandate, ConnectedCardMandateMerchant, ConnectedCardOutcomeReport, ConnectedCardOutcomeReportResult, ConnectedCardReference, ContoAdminConfig, ContoConfig, ContoRequestOptions, ControlledExternalCardPaymentResult, CreateAgentInput, CreatePolicyInput, CreatePolicyRuleInput, CreatePurchaseInput, CreateSdkKeyInput, CreateSdkKeyResult, CreateWalletInput, CustodyType, CustomerCustodyMode, CustomerWalletControlModel, CustomerWalletKeyAccess, DelegationType, ExecuteCommerceExecutionResult, ExternalCard, ExternalCardApprovalInput, ExternalCardApprovalResult, ExternalCardConfirmationInput, ExternalCardConfirmationResult, ExternalCardExecutionClaimResult, ExternalCardExecutionResult, ExternalCardExecutor, ExternalCardOverlayEnforcement, ExternalCardRequestStatusResult, ExternalWalletApprovalInput, ExternalWalletApprovalResult, ExternalWalletConfirmationInput, ExternalWalletConfirmationResult, FreezeAgentInput, GetLinkCardInput, ContoConfig as GiroConfig, GuardCheckoutResult, GuardedBrowserDispatchResult, GuardedCheckoutInput, LinkCardResult, LinkWalletInput, ListAgentsParams, ListAgentsResponse, ListPoliciesParams, ListPoliciesResponse, ListPolicyVersionsResponse, ListWalletsParams, ListWalletsResponse, MppBudgetResult, MppPreAuthorizeInput, MppPreAuthorizeResult, MppRecordInput, MppRecordResult, NormalizeCommerceProposalInput, OrganizationMember, PaginatedResponse, PaginationParams, PauseExternalCardAssignmentResult, PaymentExecuteResult, PaymentRequestInput, PaymentRequestResult, PaymentStatusResult, Policy, PolicyRule, PolicyType, PolicyVersionChangeType, PolicyVersionDetail, PolicyVersionDiff, PolicyVersionFieldChange, PolicyVersionSnapshot, PolicyVersionSnapshotRule, PolicyVersionSummary, PrivilegedBrowserCheckoutDriver, ProtocolBudgetResult, ProtocolPreAuthorizeResult, ProtocolRecordGrant, ProtocolRecordGrantResult, ProtocolServiceSummary, ProtocolServicesResult, ProveWalletOwnershipInput, ProvisionWalletResult, Purchase, PurchaseAction, PurchaseActionAuthority, PurchaseActionKind, PurchaseAllowance, PurchaseBuyer, PurchaseBuyerCompanyCard, PurchaseBuyerCompanyCardLimits, PurchaseBuyerKitchenContext, PurchaseCompanyCard, PurchaseDelegation, PurchaseEvent, PurchaseEventPage, PurchaseEvidence, PurchaseGrocery, PurchaseGroceryItem, PurchaseGroceryList, PurchaseHostedLink, PurchaseItem, PurchaseKitchenContext, PurchaseKitchenInventoryItem, PurchaseKitchenListItem, PurchaseKitchenPreferences, PurchaseKitchenRecipe, PurchaseKitchenUsual, PurchaseList, PurchaseMoney, PurchasePaymentMethod, PurchasePhase, PurchaseRequest, PurchaseResponseAck, PurchaseStatus, PurchasingCapabilities, PurchasingSettings, RecurringPurchase, RecurringPurchaseCycleResult, RecurringPurchaseCycleStatus, RefreshBalanceResult, RegisterExternalCardInput, ReplaceLinkCardInput, ReportCheckoutOutcomeInput, RollbackPolicyVersionResponse, RuleAction, RuleOperator, RuleType, RunGuardedCheckoutResult, SdkKey, SdkKeyType, SetupCapabilityState, SetupCardDiagnostics, SetupDiagnosticAction, SetupDiagnosticIssue, SetupDiagnosticIssueCode, SetupDiagnostics, SetupWalletDiagnostics, TestCardCredential, TestCardDrawResult, TestCardDrawable, TestCardListResult, TestCardReceipt, TestCheckoutInput, TestCheckoutResult, TestMerchant, TestMerchantProduct, UnfreezeAgentInput, UpdateAgentInput, UpdateExternalCardAssignmentInput, UpdatePolicyInput, UpdatePolicyRuleInput, UpdateWalletInput, VerifiedBrowserCheckoutTarget, WaitForCheckoutApprovalOptions, Wallet, WalletChainBalanceSnapshot, WalletOwnershipChallenge, WalletOwnershipProof, WalletStatus, WalletType, WatchPurchaseOptions, X402Authorization, X402BudgetResult, X402PayInput, X402PayResult, X402PaymentRequirements, X402PreAuthorizeInput, X402PreAuthorizeResult, X402RecordInput, X402RecordResult };
|
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ var require_package = __commonJS({
|
|
|
47
47
|
"package.json"(exports2, module2) {
|
|
48
48
|
module2.exports = {
|
|
49
49
|
name: "@conto_finance/sdk",
|
|
50
|
-
version: "0.
|
|
50
|
+
version: "0.7.0",
|
|
51
51
|
description: "Conto SDK for AI agent payment authorization",
|
|
52
52
|
main: "./dist/index.js",
|
|
53
53
|
module: "./dist/index.mjs",
|
|
@@ -80,8 +80,7 @@ var require_package = __commonJS({
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
publishConfig: {
|
|
83
|
-
access: "public"
|
|
84
|
-
tag: "beta"
|
|
83
|
+
access: "public"
|
|
85
84
|
},
|
|
86
85
|
engines: {
|
|
87
86
|
node: ">=20.19.0"
|
|
@@ -119,7 +118,7 @@ var require_package = __commonJS({
|
|
|
119
118
|
email: "support@conto.finance"
|
|
120
119
|
},
|
|
121
120
|
dependencies: {
|
|
122
|
-
"@sentry/node": "^
|
|
121
|
+
"@sentry/node": "^11.8.0"
|
|
123
122
|
},
|
|
124
123
|
peerDependencies: {
|
|
125
124
|
"playwright-core": ">=1.50.0"
|
|
@@ -133,10 +132,10 @@ var require_package = __commonJS({
|
|
|
133
132
|
esbuild: "0.28.1"
|
|
134
133
|
},
|
|
135
134
|
devDependencies: {
|
|
136
|
-
"@types/node": "
|
|
135
|
+
"@types/node": "26.6.5",
|
|
137
136
|
"playwright-core": "1.61.0",
|
|
138
|
-
tsup: "^
|
|
139
|
-
typescript: "^
|
|
137
|
+
tsup: "^9.0.0",
|
|
138
|
+
typescript: "^6.0.3"
|
|
140
139
|
}
|
|
141
140
|
};
|
|
142
141
|
}
|
|
@@ -1414,6 +1413,25 @@ var WalletsClient = class {
|
|
|
1414
1413
|
{}
|
|
1415
1414
|
);
|
|
1416
1415
|
}
|
|
1416
|
+
/**
|
|
1417
|
+
* Get a one-time message for a self-custody wallet's address to sign. It
|
|
1418
|
+
* expires after 10 minutes and replaces any earlier challenge.
|
|
1419
|
+
*/
|
|
1420
|
+
async createOwnershipChallenge(walletId) {
|
|
1421
|
+
return this.client.request(
|
|
1422
|
+
"POST",
|
|
1423
|
+
`/api/wallets/${encodeURIComponent(walletId)}/ownership-proof/challenge`,
|
|
1424
|
+
{}
|
|
1425
|
+
);
|
|
1426
|
+
}
|
|
1427
|
+
/** Prove your organization controls a self-custody wallet's address. */
|
|
1428
|
+
async proveOwnership(walletId, input) {
|
|
1429
|
+
return this.client.request(
|
|
1430
|
+
"POST",
|
|
1431
|
+
`/api/wallets/${encodeURIComponent(walletId)}/ownership-proof`,
|
|
1432
|
+
input
|
|
1433
|
+
);
|
|
1434
|
+
}
|
|
1417
1435
|
};
|
|
1418
1436
|
var PoliciesClient = class {
|
|
1419
1437
|
constructor(client) {
|
|
@@ -3167,7 +3185,7 @@ var CheckoutClient = class {
|
|
|
3167
3185
|
* 1. Conto runs checkpoint 1 and holds the spend. When a rule requires the
|
|
3168
3186
|
* owner's approval, this waits for it.
|
|
3169
3187
|
* 2. Only then does the wallet ask Link for a card for exactly the approved
|
|
3170
|
-
* amount at this merchant. The person approves it in
|
|
3188
|
+
* amount at this merchant. The person approves it in Link.
|
|
3171
3189
|
* 3. The card is returned. It never reaches Conto.
|
|
3172
3190
|
*
|
|
3173
3191
|
* Then fill in the card, call confirm(result.checkpoint, { amountMinor,
|
package/dist/index.mjs
CHANGED
|
@@ -18,7 +18,7 @@ var require_package = __commonJS({
|
|
|
18
18
|
"package.json"(exports, module) {
|
|
19
19
|
module.exports = {
|
|
20
20
|
name: "@conto_finance/sdk",
|
|
21
|
-
version: "0.
|
|
21
|
+
version: "0.7.0",
|
|
22
22
|
description: "Conto SDK for AI agent payment authorization",
|
|
23
23
|
main: "./dist/index.js",
|
|
24
24
|
module: "./dist/index.mjs",
|
|
@@ -51,8 +51,7 @@ var require_package = __commonJS({
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
publishConfig: {
|
|
54
|
-
access: "public"
|
|
55
|
-
tag: "beta"
|
|
54
|
+
access: "public"
|
|
56
55
|
},
|
|
57
56
|
engines: {
|
|
58
57
|
node: ">=20.19.0"
|
|
@@ -90,7 +89,7 @@ var require_package = __commonJS({
|
|
|
90
89
|
email: "support@conto.finance"
|
|
91
90
|
},
|
|
92
91
|
dependencies: {
|
|
93
|
-
"@sentry/node": "^
|
|
92
|
+
"@sentry/node": "^11.8.0"
|
|
94
93
|
},
|
|
95
94
|
peerDependencies: {
|
|
96
95
|
"playwright-core": ">=1.50.0"
|
|
@@ -104,10 +103,10 @@ var require_package = __commonJS({
|
|
|
104
103
|
esbuild: "0.28.1"
|
|
105
104
|
},
|
|
106
105
|
devDependencies: {
|
|
107
|
-
"@types/node": "
|
|
106
|
+
"@types/node": "26.6.5",
|
|
108
107
|
"playwright-core": "1.61.0",
|
|
109
|
-
tsup: "^
|
|
110
|
-
typescript: "^
|
|
108
|
+
tsup: "^9.0.0",
|
|
109
|
+
typescript: "^6.0.3"
|
|
111
110
|
}
|
|
112
111
|
};
|
|
113
112
|
}
|
|
@@ -1229,6 +1228,25 @@ var WalletsClient = class {
|
|
|
1229
1228
|
{}
|
|
1230
1229
|
);
|
|
1231
1230
|
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Get a one-time message for a self-custody wallet's address to sign. It
|
|
1233
|
+
* expires after 10 minutes and replaces any earlier challenge.
|
|
1234
|
+
*/
|
|
1235
|
+
async createOwnershipChallenge(walletId) {
|
|
1236
|
+
return this.client.request(
|
|
1237
|
+
"POST",
|
|
1238
|
+
`/api/wallets/${encodeURIComponent(walletId)}/ownership-proof/challenge`,
|
|
1239
|
+
{}
|
|
1240
|
+
);
|
|
1241
|
+
}
|
|
1242
|
+
/** Prove your organization controls a self-custody wallet's address. */
|
|
1243
|
+
async proveOwnership(walletId, input) {
|
|
1244
|
+
return this.client.request(
|
|
1245
|
+
"POST",
|
|
1246
|
+
`/api/wallets/${encodeURIComponent(walletId)}/ownership-proof`,
|
|
1247
|
+
input
|
|
1248
|
+
);
|
|
1249
|
+
}
|
|
1232
1250
|
};
|
|
1233
1251
|
var PoliciesClient = class {
|
|
1234
1252
|
constructor(client) {
|
|
@@ -2982,7 +3000,7 @@ var CheckoutClient = class {
|
|
|
2982
3000
|
* 1. Conto runs checkpoint 1 and holds the spend. When a rule requires the
|
|
2983
3001
|
* owner's approval, this waits for it.
|
|
2984
3002
|
* 2. Only then does the wallet ask Link for a card for exactly the approved
|
|
2985
|
-
* amount at this merchant. The person approves it in
|
|
3003
|
+
* amount at this merchant. The person approves it in Link.
|
|
2986
3004
|
* 3. The card is returned. It never reaches Conto.
|
|
2987
3005
|
*
|
|
2988
3006
|
* Then fill in the card, call confirm(result.checkpoint, { amountMinor,
|
package/dist/link-wallet.d.mts
CHANGED
|
@@ -117,4 +117,5 @@ declare function isLinkRequestId(value: unknown): value is string;
|
|
|
117
117
|
*/
|
|
118
118
|
declare function linkCliWallet(options?: LinkCliWalletOptions): LinkWallet;
|
|
119
119
|
|
|
120
|
-
export {
|
|
120
|
+
export { LinkWalletError, isLinkRequestId, linkCliWallet };
|
|
121
|
+
export type { LinkCallOptions, LinkCardCredential, LinkCardRequestInput, LinkCliWalletOptions, LinkSpendRequest, LinkSpendRequestStatus, LinkWaitOptions, LinkWallet, LinkWalletErrorReason };
|
package/dist/link-wallet.d.ts
CHANGED
|
@@ -117,4 +117,5 @@ declare function isLinkRequestId(value: unknown): value is string;
|
|
|
117
117
|
*/
|
|
118
118
|
declare function linkCliWallet(options?: LinkCliWalletOptions): LinkWallet;
|
|
119
119
|
|
|
120
|
-
export {
|
|
120
|
+
export { LinkWalletError, isLinkRequestId, linkCliWallet };
|
|
121
|
+
export type { LinkCallOptions, LinkCardCredential, LinkCardRequestInput, LinkCliWalletOptions, LinkSpendRequest, LinkSpendRequestStatus, LinkWaitOptions, LinkWallet, LinkWalletErrorReason };
|
package/dist/playwright.d.mts
CHANGED
|
@@ -256,4 +256,5 @@ declare function createGuardedPlaywrightCheckoutRuntimeHost(config: GuardedPlayw
|
|
|
256
256
|
*/
|
|
257
257
|
declare function createGuardedPlaywrightCheckoutHttpHandler(config: GuardedPlaywrightCheckoutHttpHandlerConfig): GuardedPlaywrightCheckoutHttpHandler;
|
|
258
258
|
|
|
259
|
-
export {
|
|
259
|
+
export { createEncryptedPlaywrightCheckoutTargetStore, createGuardedPlaywrightCheckoutHttpHandler, createGuardedPlaywrightCheckoutRuntime, createGuardedPlaywrightCheckoutRuntimeHost, createInMemoryPlaywrightCheckoutTargetStore, createPlaywrightCdpSessionRegistry, createPlaywrightCheckoutAdapter, createPlaywrightSessionObserver };
|
|
260
|
+
export type { DiscoverPlaywrightCheckoutTargetInput, DiscoveredPlaywrightCheckoutTarget, EncryptedPlaywrightCheckoutTargetStoreConfig, GuardedPlaywrightCheckoutClient, GuardedPlaywrightCheckoutHttpHandler, GuardedPlaywrightCheckoutHttpHandlerConfig, GuardedPlaywrightCheckoutHttpRequest, GuardedPlaywrightCheckoutRuntime, GuardedPlaywrightCheckoutRuntimeConfig, GuardedPlaywrightCheckoutRuntimeHost, GuardedPlaywrightCheckoutRuntimeHostConfig, PlaywrightCdpSessionRegistry, PlaywrightCdpSessionRegistryConfig, PlaywrightCheckoutAdapter, PlaywrightCheckoutAdapterConfig, PlaywrightCheckoutDispatchResult, PlaywrightCheckoutTargetBlobStore, PlaywrightCheckoutTargetRegistration, PlaywrightCheckoutTargetStore, PlaywrightSessionInteractiveTarget, PlaywrightSessionObservation, PlaywrightSessionObserver, PlaywrightSessionObserverConfig };
|
package/dist/playwright.d.ts
CHANGED
|
@@ -256,4 +256,5 @@ declare function createGuardedPlaywrightCheckoutRuntimeHost(config: GuardedPlayw
|
|
|
256
256
|
*/
|
|
257
257
|
declare function createGuardedPlaywrightCheckoutHttpHandler(config: GuardedPlaywrightCheckoutHttpHandlerConfig): GuardedPlaywrightCheckoutHttpHandler;
|
|
258
258
|
|
|
259
|
-
export {
|
|
259
|
+
export { createEncryptedPlaywrightCheckoutTargetStore, createGuardedPlaywrightCheckoutHttpHandler, createGuardedPlaywrightCheckoutRuntime, createGuardedPlaywrightCheckoutRuntimeHost, createInMemoryPlaywrightCheckoutTargetStore, createPlaywrightCdpSessionRegistry, createPlaywrightCheckoutAdapter, createPlaywrightSessionObserver };
|
|
260
|
+
export type { DiscoverPlaywrightCheckoutTargetInput, DiscoveredPlaywrightCheckoutTarget, EncryptedPlaywrightCheckoutTargetStoreConfig, GuardedPlaywrightCheckoutClient, GuardedPlaywrightCheckoutHttpHandler, GuardedPlaywrightCheckoutHttpHandlerConfig, GuardedPlaywrightCheckoutHttpRequest, GuardedPlaywrightCheckoutRuntime, GuardedPlaywrightCheckoutRuntimeConfig, GuardedPlaywrightCheckoutRuntimeHost, GuardedPlaywrightCheckoutRuntimeHostConfig, PlaywrightCdpSessionRegistry, PlaywrightCdpSessionRegistryConfig, PlaywrightCheckoutAdapter, PlaywrightCheckoutAdapterConfig, PlaywrightCheckoutDispatchResult, PlaywrightCheckoutTargetBlobStore, PlaywrightCheckoutTargetRegistration, PlaywrightCheckoutTargetStore, PlaywrightSessionInteractiveTarget, PlaywrightSessionObservation, PlaywrightSessionObserver, PlaywrightSessionObserverConfig };
|
package/dist/playwright.js
CHANGED
|
@@ -322,13 +322,16 @@ function createEncryptedPlaywrightCheckoutTargetStore(config) {
|
|
|
322
322
|
if (envelope.version !== TARGET_STORE_ENVELOPE_VERSION || typeof envelope.iv !== "string" || typeof envelope.ciphertext !== "string" || typeof envelope.tag !== "string") {
|
|
323
323
|
throw new Error("invalid envelope");
|
|
324
324
|
}
|
|
325
|
+
const tag = Buffer.from(envelope.tag, "base64url");
|
|
326
|
+
if (tag.length !== 16) throw new Error("invalid envelope");
|
|
325
327
|
const decipher = (0, import_node_crypto2.createDecipheriv)(
|
|
326
328
|
"aes-256-gcm",
|
|
327
329
|
key,
|
|
328
|
-
Buffer.from(envelope.iv, "base64url")
|
|
330
|
+
Buffer.from(envelope.iv, "base64url"),
|
|
331
|
+
{ authTagLength: 16 }
|
|
329
332
|
);
|
|
330
333
|
decipher.setAAD(Buffer.from(storageKey));
|
|
331
|
-
decipher.setAuthTag(
|
|
334
|
+
decipher.setAuthTag(tag);
|
|
332
335
|
const plaintext = Buffer.concat([
|
|
333
336
|
decipher.update(Buffer.from(envelope.ciphertext, "base64url")),
|
|
334
337
|
decipher.final()
|
package/dist/playwright.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conto_finance/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Conto SDK for AI agent payment authorization",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -33,8 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
|
-
"access": "public"
|
|
37
|
-
"tag": "beta"
|
|
36
|
+
"access": "public"
|
|
38
37
|
},
|
|
39
38
|
"engines": {
|
|
40
39
|
"node": ">=20.19.0"
|
|
@@ -72,7 +71,7 @@
|
|
|
72
71
|
"email": "support@conto.finance"
|
|
73
72
|
},
|
|
74
73
|
"dependencies": {
|
|
75
|
-
"@sentry/node": "^
|
|
74
|
+
"@sentry/node": "^11.8.0"
|
|
76
75
|
},
|
|
77
76
|
"peerDependencies": {
|
|
78
77
|
"playwright-core": ">=1.50.0"
|
|
@@ -86,9 +85,9 @@
|
|
|
86
85
|
"esbuild": "0.28.1"
|
|
87
86
|
},
|
|
88
87
|
"devDependencies": {
|
|
89
|
-
"@types/node": "
|
|
88
|
+
"@types/node": "26.6.5",
|
|
90
89
|
"playwright-core": "1.61.0",
|
|
91
|
-
"tsup": "^
|
|
92
|
-
"typescript": "^
|
|
90
|
+
"tsup": "^9.0.0",
|
|
91
|
+
"typescript": "^6.0.3"
|
|
93
92
|
}
|
|
94
93
|
}
|