@xkova/sdk 0.1.0-alpha.1

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 (76) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +453 -0
  3. package/dist/abi.d.ts +10288 -0
  4. package/dist/abi.js +6645 -0
  5. package/dist/client.d.ts +80 -0
  6. package/dist/client.js +251 -0
  7. package/dist/cursor.d.ts +21 -0
  8. package/dist/cursor.js +28 -0
  9. package/dist/errors.d.ts +31 -0
  10. package/dist/errors.js +63 -0
  11. package/dist/generated/types.d.ts +13371 -0
  12. package/dist/generated/types.js +3 -0
  13. package/dist/idempotency.d.ts +25 -0
  14. package/dist/idempotency.js +46 -0
  15. package/dist/index.d.ts +11 -0
  16. package/dist/index.js +8 -0
  17. package/dist/member-action-intents.d.ts +72 -0
  18. package/dist/member-action-intents.js +181 -0
  19. package/dist/member-bff.d.ts +535 -0
  20. package/dist/member-bff.js +1594 -0
  21. package/dist/member-resources.d.ts +203 -0
  22. package/dist/member-resources.js +56 -0
  23. package/dist/request-signing.d.ts +23 -0
  24. package/dist/request-signing.js +112 -0
  25. package/dist/resources/account-holders.d.ts +295 -0
  26. package/dist/resources/account-holders.js +166 -0
  27. package/dist/resources/base.d.ts +47 -0
  28. package/dist/resources/base.js +25 -0
  29. package/dist/resources/branding.d.ts +154 -0
  30. package/dist/resources/branding.js +34 -0
  31. package/dist/resources/chains.d.ts +6 -0
  32. package/dist/resources/chains.js +6 -0
  33. package/dist/resources/contacts.d.ts +55 -0
  34. package/dist/resources/contacts.js +22 -0
  35. package/dist/resources/escrows.d.ts +45 -0
  36. package/dist/resources/escrows.js +18 -0
  37. package/dist/resources/fee-schedules.d.ts +40 -0
  38. package/dist/resources/fee-schedules.js +15 -0
  39. package/dist/resources/index.d.ts +21 -0
  40. package/dist/resources/index.js +21 -0
  41. package/dist/resources/integration-gateways.d.ts +114 -0
  42. package/dist/resources/integration-gateways.js +27 -0
  43. package/dist/resources/onboarding.d.ts +18 -0
  44. package/dist/resources/onboarding.js +9 -0
  45. package/dist/resources/payment-requests.d.ts +115 -0
  46. package/dist/resources/payment-requests.js +27 -0
  47. package/dist/resources/payments.d.ts +182 -0
  48. package/dist/resources/payments.js +33 -0
  49. package/dist/resources/ramps.d.ts +163 -0
  50. package/dist/resources/ramps.js +44 -0
  51. package/dist/resources/rwa.d.ts +397 -0
  52. package/dist/resources/rwa.js +150 -0
  53. package/dist/resources/tenant.d.ts +136 -0
  54. package/dist/resources/tenant.js +42 -0
  55. package/dist/resources/tokenization.d.ts +394 -0
  56. package/dist/resources/tokenization.js +126 -0
  57. package/dist/resources/transactions.d.ts +8 -0
  58. package/dist/resources/transactions.js +6 -0
  59. package/dist/resources/wallets.d.ts +56 -0
  60. package/dist/resources/wallets.js +21 -0
  61. package/dist/resources/webhooks.d.ts +115 -0
  62. package/dist/resources/webhooks.js +43 -0
  63. package/dist/resources/workflows.d.ts +44 -0
  64. package/dist/resources/workflows.js +70 -0
  65. package/dist/resources/workspace-tokens.d.ts +6 -0
  66. package/dist/resources/workspace-tokens.js +6 -0
  67. package/dist/resources/workspaces.d.ts +25 -0
  68. package/dist/resources/workspaces.js +12 -0
  69. package/dist/retry.d.ts +21 -0
  70. package/dist/retry.js +44 -0
  71. package/dist/rwa-verify.d.ts +50 -0
  72. package/dist/rwa-verify.js +159 -0
  73. package/dist/webhook.d.ts +24 -0
  74. package/dist/webhook.js +56 -0
  75. package/llms.txt +84 -0
  76. package/package.json +62 -0
@@ -0,0 +1,115 @@
1
+ import { Resource, type ReqBody, type Query } from './base.js';
2
+ import type { XKOVAMutationOptions } from '../client.js';
3
+ export interface PaymentRequestApprovalContext {
4
+ senderWalletId: string;
5
+ accountHolderId: string;
6
+ }
7
+ export declare class PaymentRequestsResource extends Resource {
8
+ list(query?: Query<'listPaymentRequests'>): Promise<{
9
+ data: import("../generated/types.js").components["schemas"]["PaymentRequest"][];
10
+ next_cursor?: string | null;
11
+ has_more: boolean;
12
+ }>;
13
+ create(body: ReqBody<'createPaymentRequest'>, opts?: XKOVAMutationOptions): Promise<{
14
+ id?: import("../generated/types.js").components["schemas"]["PaymentRequestId"];
15
+ requester_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"];
16
+ payer_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
17
+ payer_lookup?: string | null;
18
+ amount?: import("../generated/types.js").components["schemas"]["Money"];
19
+ token_deployment_id?: string;
20
+ memo?: string | null;
21
+ state?: "pending" | "approved" | "declined" | "expired" | "cancelled";
22
+ expires_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
23
+ spawned_txn_id?: import("../generated/types.js").components["schemas"]["PaymentId"] | null;
24
+ decline_reason?: string | null;
25
+ created_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
26
+ updated_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
27
+ }>;
28
+ retrieve(id: string): Promise<{
29
+ id?: import("../generated/types.js").components["schemas"]["PaymentRequestId"];
30
+ requester_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"];
31
+ payer_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
32
+ payer_lookup?: string | null;
33
+ amount?: import("../generated/types.js").components["schemas"]["Money"];
34
+ token_deployment_id?: string;
35
+ memo?: string | null;
36
+ state?: "pending" | "approved" | "declined" | "expired" | "cancelled";
37
+ expires_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
38
+ spawned_txn_id?: import("../generated/types.js").components["schemas"]["PaymentId"] | null;
39
+ decline_reason?: string | null;
40
+ created_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
41
+ updated_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
42
+ }>;
43
+ approve(id: string, context: PaymentRequestApprovalContext, opts?: XKOVAMutationOptions): Promise<{
44
+ id: import("../generated/types.js").components["schemas"]["PaymentId"];
45
+ tenant_id: string;
46
+ channel: string;
47
+ chain_id: string;
48
+ chain: import("../generated/types.js").components["schemas"]["ChainDescriptor"];
49
+ tx_ref: string | null;
50
+ from_wallet_id: import("../generated/types.js").components["schemas"]["WalletId"];
51
+ from_wallet_address: string;
52
+ to_account_holder_id: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
53
+ open_compliance_case_id: import("../generated/types.js").components["schemas"]["ComplianceCaseId"] | null;
54
+ from_account_holder_id: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
55
+ to_address: string;
56
+ to_wallet_id: import("../generated/types.js").components["schemas"]["WalletId"] | null;
57
+ token_deployment_id: string;
58
+ token_symbol: string;
59
+ gross_amount: import("../generated/types.js").components["schemas"]["Money"];
60
+ net_amount: import("../generated/types.js").components["schemas"]["Money"];
61
+ fee_snapshot: {
62
+ beneficiary?: string;
63
+ basis?: string;
64
+ rate?: import("../generated/types.js").components["schemas"]["Money"];
65
+ computed_amount?: import("../generated/types.js").components["schemas"]["Money"];
66
+ }[];
67
+ fee_schedule_ref: {
68
+ schedule_id?: string;
69
+ version?: number;
70
+ };
71
+ memo: string | null;
72
+ display_type: "p2p_send" | "external_send" | "escrow_create" | "escrow_release" | "funding" | "off_ramp" | "receive";
73
+ status: "pending_quote" | "pending_compliance" | "pending_approval" | "pending_confirm" | "pending_sign" | "submission_pending" | "submission_unknown" | "on_chain_pending" | "confirmed" | "reorg_detected" | "blocked" | "failed" | "cancelled";
74
+ status_canonical: import("../generated/types.js").components["schemas"]["StatusCanonical"];
75
+ failure_reason_code: string | null;
76
+ failure_reason_detail: string | null;
77
+ is_retryable: boolean | null;
78
+ idempotency_key: string;
79
+ correlation_id: import("../generated/types.js").components["schemas"]["CorrelationId"];
80
+ signing_expires_at: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
81
+ created_at: import("../generated/types.js").components["schemas"]["TimestampUtc"];
82
+ finalized_at: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
83
+ }>;
84
+ cancel(id: string, opts?: XKOVAMutationOptions): Promise<{
85
+ id?: import("../generated/types.js").components["schemas"]["PaymentRequestId"];
86
+ requester_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"];
87
+ payer_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
88
+ payer_lookup?: string | null;
89
+ amount?: import("../generated/types.js").components["schemas"]["Money"];
90
+ token_deployment_id?: string;
91
+ memo?: string | null;
92
+ state?: "pending" | "approved" | "declined" | "expired" | "cancelled";
93
+ expires_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
94
+ spawned_txn_id?: import("../generated/types.js").components["schemas"]["PaymentId"] | null;
95
+ decline_reason?: string | null;
96
+ created_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
97
+ updated_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
98
+ }>;
99
+ decline(id: string, body?: ReqBody<'declinePaymentRequest'>, opts?: XKOVAMutationOptions): Promise<{
100
+ id?: import("../generated/types.js").components["schemas"]["PaymentRequestId"];
101
+ requester_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"];
102
+ payer_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
103
+ payer_lookup?: string | null;
104
+ amount?: import("../generated/types.js").components["schemas"]["Money"];
105
+ token_deployment_id?: string;
106
+ memo?: string | null;
107
+ state?: "pending" | "approved" | "declined" | "expired" | "cancelled";
108
+ expires_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
109
+ spawned_txn_id?: import("../generated/types.js").components["schemas"]["PaymentId"] | null;
110
+ decline_reason?: string | null;
111
+ created_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
112
+ updated_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
113
+ }>;
114
+ remind(id: string, opts?: XKOVAMutationOptions): Promise<void>;
115
+ }
@@ -0,0 +1,27 @@
1
+ import { Resource } from './base.js';
2
+ export class PaymentRequestsResource extends Resource {
3
+ list(query = {}) {
4
+ return this.getJson('/payment-requests', query);
5
+ }
6
+ create(body, opts) {
7
+ return this.postJson('/payment-requests', body, opts);
8
+ }
9
+ retrieve(id) {
10
+ return this.getJson(`/payment-requests/${this.enc(id)}`);
11
+ }
12
+ approve(id, context, opts) {
13
+ return this.postJson(`/payment-requests/${this.enc(id)}/approve`, undefined, opts, undefined, {
14
+ 'X-Sender-Wallet-Id': context.senderWalletId,
15
+ 'X-Account-Holder-Id': context.accountHolderId,
16
+ });
17
+ }
18
+ cancel(id, opts) {
19
+ return this.postJson(`/payment-requests/${this.enc(id)}/cancel`, undefined, opts);
20
+ }
21
+ decline(id, body = {}, opts) {
22
+ return this.postJson(`/payment-requests/${this.enc(id)}/decline`, body, opts);
23
+ }
24
+ remind(id, opts) {
25
+ return this.postJson(`/payment-requests/${this.enc(id)}/remind`, undefined, opts);
26
+ }
27
+ }
@@ -0,0 +1,182 @@
1
+ import { Resource, type ReqBody, type Query } from './base.js';
2
+ import type { XKOVAMutationOptions } from '../client.js';
3
+ type PaymentMemberHeaders = {
4
+ memberSessionId: string;
5
+ memberAuthPublishableKey: string;
6
+ } | {
7
+ memberSessionId?: never;
8
+ memberAuthPublishableKey?: never;
9
+ };
10
+ export type PaymentCreateOptions = XKOVAMutationOptions & PaymentMemberHeaders;
11
+ export declare class PaymentsResource extends Resource {
12
+ list(query?: Query<'listPayments'>): Promise<{
13
+ data: unknown[];
14
+ next_cursor: string | null;
15
+ has_more: boolean;
16
+ } & {
17
+ data?: import("../generated/types.js").components["schemas"]["Payment"][];
18
+ }>;
19
+ /** Validates the proposed payment and records the quoted fees. */
20
+ quote(body: ReqBody<'quotePayment'>, opts?: XKOVAMutationOptions): Promise<{
21
+ quote_id?: string;
22
+ gross_amount?: import("../generated/types.js").components["schemas"]["Money"];
23
+ net_amount?: import("../generated/types.js").components["schemas"]["Money"];
24
+ fee_snapshot?: {
25
+ beneficiary?: string;
26
+ basis?: "flat" | "bps" | "percent";
27
+ rate?: import("../generated/types.js").components["schemas"]["Money"];
28
+ computed_amount?: import("../generated/types.js").components["schemas"]["Money"];
29
+ }[];
30
+ fee_fingerprint?: string;
31
+ compliance_fingerprint?: string;
32
+ compliance_decision?: "allow" | "review" | "block";
33
+ compliance_reason_code?: string;
34
+ expires_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
35
+ within_limits?: boolean;
36
+ daily_remaining?: {
37
+ tx_count?: number;
38
+ gross_amount?: import("../generated/types.js").components["schemas"]["Money"];
39
+ };
40
+ }>;
41
+ /** Simulate a payment without creating it. */
42
+ simulate(body: ReqBody<'simulatePayment'>, opts?: XKOVAMutationOptions): Promise<{
43
+ would_succeed: boolean;
44
+ revert_reason: string | null;
45
+ balance_sufficient: boolean;
46
+ allowance_sufficient: boolean;
47
+ gas_estimate: string;
48
+ fees: {
49
+ gross_amount: import("../generated/types.js").components["schemas"]["Money"];
50
+ net_amount: import("../generated/types.js").components["schemas"]["Money"];
51
+ total_fee_amount: import("../generated/types.js").components["schemas"]["Money"];
52
+ };
53
+ }>;
54
+ /** Pending member-signed payments need fresh authorization before signing. */
55
+ create(body: ReqBody<'createPayment'>, opts?: PaymentCreateOptions): Promise<{
56
+ id: import("../generated/types.js").components["schemas"]["PaymentId"];
57
+ tenant_id: string;
58
+ channel: string;
59
+ chain_id: string;
60
+ chain: import("../generated/types.js").components["schemas"]["ChainDescriptor"];
61
+ tx_ref: string | null;
62
+ from_wallet_id: import("../generated/types.js").components["schemas"]["WalletId"];
63
+ from_wallet_address: string;
64
+ to_account_holder_id: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
65
+ open_compliance_case_id: import("../generated/types.js").components["schemas"]["ComplianceCaseId"] | null;
66
+ from_account_holder_id: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
67
+ to_address: string;
68
+ to_wallet_id: import("../generated/types.js").components["schemas"]["WalletId"] | null;
69
+ token_deployment_id: string;
70
+ token_symbol: string;
71
+ gross_amount: import("../generated/types.js").components["schemas"]["Money"];
72
+ net_amount: import("../generated/types.js").components["schemas"]["Money"];
73
+ fee_snapshot: {
74
+ beneficiary?: string;
75
+ basis?: string;
76
+ rate?: import("../generated/types.js").components["schemas"]["Money"];
77
+ computed_amount?: import("../generated/types.js").components["schemas"]["Money"];
78
+ }[];
79
+ fee_schedule_ref: {
80
+ schedule_id?: string;
81
+ version?: number;
82
+ };
83
+ memo: string | null;
84
+ display_type: "p2p_send" | "external_send" | "escrow_create" | "escrow_release" | "funding" | "off_ramp" | "receive";
85
+ status: "pending_quote" | "pending_compliance" | "pending_approval" | "pending_confirm" | "pending_sign" | "submission_pending" | "submission_unknown" | "on_chain_pending" | "confirmed" | "reorg_detected" | "blocked" | "failed" | "cancelled";
86
+ status_canonical: import("../generated/types.js").components["schemas"]["StatusCanonical"];
87
+ failure_reason_code: string | null;
88
+ failure_reason_detail: string | null;
89
+ is_retryable: boolean | null;
90
+ idempotency_key: string;
91
+ correlation_id: import("../generated/types.js").components["schemas"]["CorrelationId"];
92
+ signing_expires_at: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
93
+ created_at: import("../generated/types.js").components["schemas"]["TimestampUtc"];
94
+ finalized_at: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
95
+ }>;
96
+ retrieve(id: string, query?: Query<'getPayment'>): Promise<{
97
+ id: import("../generated/types.js").components["schemas"]["PaymentId"];
98
+ tenant_id: string;
99
+ channel: string;
100
+ chain_id: string;
101
+ chain: import("../generated/types.js").components["schemas"]["ChainDescriptor"];
102
+ tx_ref: string | null;
103
+ from_wallet_id: import("../generated/types.js").components["schemas"]["WalletId"];
104
+ from_wallet_address: string;
105
+ to_account_holder_id: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
106
+ open_compliance_case_id: import("../generated/types.js").components["schemas"]["ComplianceCaseId"] | null;
107
+ from_account_holder_id: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
108
+ to_address: string;
109
+ to_wallet_id: import("../generated/types.js").components["schemas"]["WalletId"] | null;
110
+ token_deployment_id: string;
111
+ token_symbol: string;
112
+ gross_amount: import("../generated/types.js").components["schemas"]["Money"];
113
+ net_amount: import("../generated/types.js").components["schemas"]["Money"];
114
+ fee_snapshot: {
115
+ beneficiary?: string;
116
+ basis?: string;
117
+ rate?: import("../generated/types.js").components["schemas"]["Money"];
118
+ computed_amount?: import("../generated/types.js").components["schemas"]["Money"];
119
+ }[];
120
+ fee_schedule_ref: {
121
+ schedule_id?: string;
122
+ version?: number;
123
+ };
124
+ memo: string | null;
125
+ display_type: "p2p_send" | "external_send" | "escrow_create" | "escrow_release" | "funding" | "off_ramp" | "receive";
126
+ status: "pending_quote" | "pending_compliance" | "pending_approval" | "pending_confirm" | "pending_sign" | "submission_pending" | "submission_unknown" | "on_chain_pending" | "confirmed" | "reorg_detected" | "blocked" | "failed" | "cancelled";
127
+ status_canonical: import("../generated/types.js").components["schemas"]["StatusCanonical"];
128
+ failure_reason_code: string | null;
129
+ failure_reason_detail: string | null;
130
+ is_retryable: boolean | null;
131
+ idempotency_key: string;
132
+ correlation_id: import("../generated/types.js").components["schemas"]["CorrelationId"];
133
+ signing_expires_at: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
134
+ created_at: import("../generated/types.js").components["schemas"]["TimestampUtc"];
135
+ finalized_at: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
136
+ }>;
137
+ listEvents(id: string): Promise<{
138
+ data?: import("../generated/types.js").components["schemas"]["PaymentEvent"][];
139
+ }>;
140
+ cancel(id: string, opts?: XKOVAMutationOptions): Promise<{
141
+ id: import("../generated/types.js").components["schemas"]["PaymentId"];
142
+ tenant_id: string;
143
+ channel: string;
144
+ chain_id: string;
145
+ chain: import("../generated/types.js").components["schemas"]["ChainDescriptor"];
146
+ tx_ref: string | null;
147
+ from_wallet_id: import("../generated/types.js").components["schemas"]["WalletId"];
148
+ from_wallet_address: string;
149
+ to_account_holder_id: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
150
+ open_compliance_case_id: import("../generated/types.js").components["schemas"]["ComplianceCaseId"] | null;
151
+ from_account_holder_id: import("../generated/types.js").components["schemas"]["AccountHolderId"] | null;
152
+ to_address: string;
153
+ to_wallet_id: import("../generated/types.js").components["schemas"]["WalletId"] | null;
154
+ token_deployment_id: string;
155
+ token_symbol: string;
156
+ gross_amount: import("../generated/types.js").components["schemas"]["Money"];
157
+ net_amount: import("../generated/types.js").components["schemas"]["Money"];
158
+ fee_snapshot: {
159
+ beneficiary?: string;
160
+ basis?: string;
161
+ rate?: import("../generated/types.js").components["schemas"]["Money"];
162
+ computed_amount?: import("../generated/types.js").components["schemas"]["Money"];
163
+ }[];
164
+ fee_schedule_ref: {
165
+ schedule_id?: string;
166
+ version?: number;
167
+ };
168
+ memo: string | null;
169
+ display_type: "p2p_send" | "external_send" | "escrow_create" | "escrow_release" | "funding" | "off_ramp" | "receive";
170
+ status: "pending_quote" | "pending_compliance" | "pending_approval" | "pending_confirm" | "pending_sign" | "submission_pending" | "submission_unknown" | "on_chain_pending" | "confirmed" | "reorg_detected" | "blocked" | "failed" | "cancelled";
171
+ status_canonical: import("../generated/types.js").components["schemas"]["StatusCanonical"];
172
+ failure_reason_code: string | null;
173
+ failure_reason_detail: string | null;
174
+ is_retryable: boolean | null;
175
+ idempotency_key: string;
176
+ correlation_id: import("../generated/types.js").components["schemas"]["CorrelationId"];
177
+ signing_expires_at: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
178
+ created_at: import("../generated/types.js").components["schemas"]["TimestampUtc"];
179
+ finalized_at: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
180
+ }>;
181
+ }
182
+ export {};
@@ -0,0 +1,33 @@
1
+ import { Resource } from './base.js';
2
+ export class PaymentsResource extends Resource {
3
+ list(query = {}) {
4
+ return this.getJson('/payments', query);
5
+ }
6
+ /** Validates the proposed payment and records the quoted fees. */
7
+ quote(body, opts) {
8
+ return this.postJson('/payments/quote', body, opts);
9
+ }
10
+ /** Simulate a payment without creating it. */
11
+ simulate(body, opts) {
12
+ return this.postJson('/payments/simulate', body, opts);
13
+ }
14
+ /** Pending member-signed payments need fresh authorization before signing. */
15
+ create(body, opts = {}) {
16
+ const headers = opts.memberSessionId === undefined
17
+ ? undefined
18
+ : {
19
+ 'X-Member-Session-Id': opts.memberSessionId,
20
+ 'X-XKOVA-Publishable-Key': opts.memberAuthPublishableKey,
21
+ };
22
+ return this.postJson('/payments', body, opts, undefined, headers);
23
+ }
24
+ retrieve(id, query = {}) {
25
+ return this.getJson(`/payments/${this.enc(id)}`, query);
26
+ }
27
+ listEvents(id) {
28
+ return this.getJson(`/payments/${this.enc(id)}/events`);
29
+ }
30
+ cancel(id, opts) {
31
+ return this.postJson(`/payments/${this.enc(id)}/cancel`, undefined, opts);
32
+ }
33
+ }
@@ -0,0 +1,163 @@
1
+ import { Resource, type ReqBody, type Query } from './base.js';
2
+ import type { XKOVAMutationOptions, XKOVARequestControl } from '../client.js';
3
+ export interface RampRequestOptions extends XKOVAMutationOptions {
4
+ sandboxScenario?: string;
5
+ }
6
+ export type SandboxFundingBody = Omit<ReqBody<'createFundingRequest'>, 'stablecoin'>;
7
+ export declare class RampsResource extends Resource {
8
+ listFunding(query?: Query<'listFundingRequests'>, control?: XKOVARequestControl): Promise<{
9
+ data: import("../generated/types.js").components["schemas"]["FundingRequest"][];
10
+ next_cursor: string | null;
11
+ has_more: boolean;
12
+ }>;
13
+ createFunding(body: ReqBody<'createFundingRequest'>, opts?: RampRequestOptions): Promise<{
14
+ id?: import("../generated/types.js").components["schemas"]["FundingRequestId"];
15
+ tenant_id?: string;
16
+ workspace_id?: string;
17
+ chain: import("../generated/types.js").components["schemas"]["ChainDescriptor"];
18
+ account_holder_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"];
19
+ amount?: import("../generated/types.js").components["schemas"]["Money"];
20
+ currency?: string;
21
+ state?: "pending_compliance" | "pending_issuance" | "settled" | "failed";
22
+ failure_reason_code?: string | null;
23
+ x_partner_reference?: string | null;
24
+ quote_id?: string | null;
25
+ bank_debit_transfer_id?: string | null;
26
+ partner_status?: string | null;
27
+ last_event_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
28
+ metadata?: {
29
+ [key: string]: unknown;
30
+ } | null;
31
+ settlement_order: "hold_first" | "debit_first" | null;
32
+ idempotency_key?: string;
33
+ correlation_id?: string;
34
+ ramp_profile?: "mock" | "sandbox" | "coinbase";
35
+ hosted_redirect_url?: string | null;
36
+ created_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
37
+ updated_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
38
+ settled_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
39
+ }>;
40
+ /**
41
+ * One-call sandbox funding convenience. This invokes the normal funding
42
+ * request operation and therefore returns the same production-shaped ramp
43
+ * resource, state transitions, webhooks, and idempotency behavior.
44
+ */
45
+ fundSandboxWallet(body: SandboxFundingBody, opts?: RampRequestOptions): Promise<{
46
+ id?: import("../generated/types.js").components["schemas"]["FundingRequestId"];
47
+ tenant_id?: string;
48
+ workspace_id?: string;
49
+ chain: import("../generated/types.js").components["schemas"]["ChainDescriptor"];
50
+ account_holder_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"];
51
+ amount?: import("../generated/types.js").components["schemas"]["Money"];
52
+ currency?: string;
53
+ state?: "pending_compliance" | "pending_issuance" | "settled" | "failed";
54
+ failure_reason_code?: string | null;
55
+ x_partner_reference?: string | null;
56
+ quote_id?: string | null;
57
+ bank_debit_transfer_id?: string | null;
58
+ partner_status?: string | null;
59
+ last_event_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
60
+ metadata?: {
61
+ [key: string]: unknown;
62
+ } | null;
63
+ settlement_order: "hold_first" | "debit_first" | null;
64
+ idempotency_key?: string;
65
+ correlation_id?: string;
66
+ ramp_profile?: "mock" | "sandbox" | "coinbase";
67
+ hosted_redirect_url?: string | null;
68
+ created_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
69
+ updated_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
70
+ settled_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
71
+ }>;
72
+ getFunding(id: string): Promise<{
73
+ id?: import("../generated/types.js").components["schemas"]["FundingRequestId"];
74
+ tenant_id?: string;
75
+ workspace_id?: string;
76
+ chain: import("../generated/types.js").components["schemas"]["ChainDescriptor"];
77
+ account_holder_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"];
78
+ amount?: import("../generated/types.js").components["schemas"]["Money"];
79
+ currency?: string;
80
+ state?: "pending_compliance" | "pending_issuance" | "settled" | "failed";
81
+ failure_reason_code?: string | null;
82
+ x_partner_reference?: string | null;
83
+ quote_id?: string | null;
84
+ bank_debit_transfer_id?: string | null;
85
+ partner_status?: string | null;
86
+ last_event_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
87
+ metadata?: {
88
+ [key: string]: unknown;
89
+ } | null;
90
+ settlement_order: "hold_first" | "debit_first" | null;
91
+ idempotency_key?: string;
92
+ correlation_id?: string;
93
+ ramp_profile?: "mock" | "sandbox" | "coinbase";
94
+ hosted_redirect_url?: string | null;
95
+ created_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
96
+ updated_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
97
+ settled_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
98
+ }>;
99
+ listOffRamp(query?: Query<'listOffRampRequests'>): Promise<{
100
+ data: import("../generated/types.js").components["schemas"]["OffRampRequest"][];
101
+ next_cursor: string | null;
102
+ has_more: boolean;
103
+ }>;
104
+ createOffRamp(body: ReqBody<'createOffRampRequest'>, opts?: RampRequestOptions): Promise<{
105
+ id?: import("../generated/types.js").components["schemas"]["OffRampRequestId"];
106
+ tenant_id?: string;
107
+ workspace_id?: string;
108
+ chain: import("../generated/types.js").components["schemas"]["ChainDescriptor"];
109
+ account_holder_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"];
110
+ amount?: import("../generated/types.js").components["schemas"]["Money"];
111
+ currency?: string;
112
+ state?: "pending_compliance" | "pending_burn" | "awaiting_institution_credit" | "settled" | "failed";
113
+ failure_reason_code?: string | null;
114
+ x_partner_reference?: string | null;
115
+ bank_credit_transfer_id?: string | null;
116
+ partner_status?: string | null;
117
+ last_event_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
118
+ metadata?: {
119
+ [key: string]: unknown;
120
+ } | null;
121
+ idempotency_key?: string;
122
+ correlation_id?: string;
123
+ ramp_profile?: "mock" | "sandbox" | "coinbase";
124
+ hosted_redirect_url?: string | null;
125
+ created_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
126
+ updated_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
127
+ settled_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
128
+ }>;
129
+ getOffRamp(id: string): Promise<{
130
+ id?: import("../generated/types.js").components["schemas"]["OffRampRequestId"];
131
+ tenant_id?: string;
132
+ workspace_id?: string;
133
+ chain: import("../generated/types.js").components["schemas"]["ChainDescriptor"];
134
+ account_holder_id?: import("../generated/types.js").components["schemas"]["AccountHolderId"];
135
+ amount?: import("../generated/types.js").components["schemas"]["Money"];
136
+ currency?: string;
137
+ state?: "pending_compliance" | "pending_burn" | "awaiting_institution_credit" | "settled" | "failed";
138
+ failure_reason_code?: string | null;
139
+ x_partner_reference?: string | null;
140
+ bank_credit_transfer_id?: string | null;
141
+ partner_status?: string | null;
142
+ last_event_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
143
+ metadata?: {
144
+ [key: string]: unknown;
145
+ } | null;
146
+ idempotency_key?: string;
147
+ correlation_id?: string;
148
+ ramp_profile?: "mock" | "sandbox" | "coinbase";
149
+ hosted_redirect_url?: string | null;
150
+ created_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
151
+ updated_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"];
152
+ settled_at?: import("../generated/types.js").components["schemas"]["TimestampUtc"] | null;
153
+ }>;
154
+ /** Resolve the partner redeem (burn) address for an off-ramp. */
155
+ offRampBurnAddress(query: Query<'getOffRampBurnAddress'>): Promise<{
156
+ burn_address: string;
157
+ stablecoin: "USDC" | "dUSDC";
158
+ chain: {
159
+ kind: string;
160
+ chain_id: number;
161
+ };
162
+ }>;
163
+ }
@@ -0,0 +1,44 @@
1
+ import { Resource } from './base.js';
2
+ function rampHeaders(opts) {
3
+ if (opts.sandboxScenario === undefined)
4
+ return undefined;
5
+ return {
6
+ ...(opts.sandboxScenario !== undefined && { 'X-Sandbox-Scenario': opts.sandboxScenario }),
7
+ };
8
+ }
9
+ export class RampsResource extends Resource {
10
+ listFunding(query = {}, control) {
11
+ return this.getJson('/funding-requests', query, control);
12
+ }
13
+ createFunding(body, opts = {}) {
14
+ return this.postJson('/funding-requests', body, opts, undefined, rampHeaders(opts));
15
+ }
16
+ /**
17
+ * One-call sandbox funding convenience. This invokes the normal funding
18
+ * request operation and therefore returns the same production-shaped ramp
19
+ * resource, state transitions, webhooks, and idempotency behavior.
20
+ */
21
+ fundSandboxWallet(body, opts = {}) {
22
+ const funding = {
23
+ ...body,
24
+ stablecoin: 'dUSDC',
25
+ };
26
+ return this.createFunding(funding, opts);
27
+ }
28
+ getFunding(id) {
29
+ return this.getJson(`/funding-requests/${this.enc(id)}`);
30
+ }
31
+ listOffRamp(query = {}) {
32
+ return this.getJson('/off-ramp-requests', query);
33
+ }
34
+ createOffRamp(body, opts = {}) {
35
+ return this.postJson('/off-ramp-requests', body, opts, undefined, rampHeaders(opts));
36
+ }
37
+ getOffRamp(id) {
38
+ return this.getJson(`/off-ramp-requests/${this.enc(id)}`);
39
+ }
40
+ /** Resolve the partner redeem (burn) address for an off-ramp. */
41
+ offRampBurnAddress(query) {
42
+ return this.getJson('/off-ramp-requests/burn-address', query);
43
+ }
44
+ }