@stableops/api-sdk 0.1.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/LICENSE +184 -0
- package/README.md +117 -0
- package/README.zh-CN.md +107 -0
- package/dist/chunk-B2JLHYXK.mjs +83 -0
- package/dist/chunk-B2JLHYXK.mjs.map +1 -0
- package/dist/index.d.mts +247 -0
- package/dist/index.d.ts +247 -0
- package/dist/index.js +481 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +453 -0
- package/dist/index.mjs.map +1 -0
- package/dist/mock.d.mts +74 -0
- package/dist/mock.d.ts +74 -0
- package/dist/mock.js +268 -0
- package/dist/mock.js.map +1 -0
- package/dist/mock.mjs +219 -0
- package/dist/mock.mjs.map +1 -0
- package/dist/webhooks.d.mts +44 -0
- package/dist/webhooks.d.ts +44 -0
- package/dist/webhooks.js +134 -0
- package/dist/webhooks.js.map +1 -0
- package/dist/webhooks.mjs +37 -0
- package/dist/webhooks.mjs.map +1 -0
- package/package.json +87 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
type StableOpsEnvironment = 'sandbox' | 'live';
|
|
2
|
+
type RetryOptions = {
|
|
3
|
+
maxRetries?: number;
|
|
4
|
+
baseDelayMs?: number;
|
|
5
|
+
maxDelayMs?: number;
|
|
6
|
+
};
|
|
7
|
+
type ClientOptions = {
|
|
8
|
+
apiKey?: string;
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
organizationSlug?: string;
|
|
11
|
+
environment?: StableOpsEnvironment;
|
|
12
|
+
fetch?: typeof fetch;
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
retry?: RetryOptions;
|
|
15
|
+
_sleep?: (ms: number) => Promise<void>;
|
|
16
|
+
_random?: () => number;
|
|
17
|
+
};
|
|
18
|
+
type RequestInit = {
|
|
19
|
+
method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
20
|
+
path: string;
|
|
21
|
+
body?: unknown;
|
|
22
|
+
query?: Record<string, string | number | undefined>;
|
|
23
|
+
idempotencyKey?: string;
|
|
24
|
+
retryable?: boolean;
|
|
25
|
+
};
|
|
26
|
+
declare class StableOpsError extends Error {
|
|
27
|
+
readonly status: number;
|
|
28
|
+
readonly code: string;
|
|
29
|
+
readonly details: unknown;
|
|
30
|
+
constructor(status: number, code: string, message: string, details: unknown);
|
|
31
|
+
}
|
|
32
|
+
declare class HttpClient {
|
|
33
|
+
private readonly baseUrl;
|
|
34
|
+
private readonly headers;
|
|
35
|
+
private readonly fetchImpl;
|
|
36
|
+
private readonly timeoutMs;
|
|
37
|
+
private readonly maxRetries;
|
|
38
|
+
private readonly backoff;
|
|
39
|
+
private readonly sleep;
|
|
40
|
+
private readonly random;
|
|
41
|
+
constructor(options: ClientOptions);
|
|
42
|
+
request<T>(init: RequestInit): Promise<T>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type ChainId = 'ethereum' | 'base' | 'base-sepolia' | 'arbitrum' | 'polygon' | 'tron' | 'solana' | 'ethereum-sepolia' | 'arbitrum-sepolia' | 'polygon-amoy' | 'solana-devnet' | 'tron-nile';
|
|
46
|
+
type Asset = 'USDC' | 'USDT';
|
|
47
|
+
type PaymentOrderStatus = 'created' | 'detected' | 'confirmed' | 'finalized' | 'reverted' | 'expired' | 'canceled';
|
|
48
|
+
type PaymentOrderScenario = 'saas_subscription' | 'trading_deposit' | 'agent_workflow' | 'generic';
|
|
49
|
+
type AcceptedAssetInput = {
|
|
50
|
+
chain: ChainId;
|
|
51
|
+
asset: Asset;
|
|
52
|
+
};
|
|
53
|
+
type WebhookEventType = 'payment_order.created' | 'payment.detected' | 'payment.confirmed' | 'payment.finalized' | 'payment.reverted' | 'payment.expired' | 'address.pool.low' | 'webhook.delivery.failed' | 'agent.action.requested' | 'agent.action.approved' | 'agent.action.executed';
|
|
54
|
+
type WebhookDeliveryStatus = 'pending' | 'succeeded' | 'failed' | 'dead_letter';
|
|
55
|
+
type CreatePaymentOrderInput = {
|
|
56
|
+
merchantOrderId: string;
|
|
57
|
+
amount: string;
|
|
58
|
+
amountMode?: 'exact' | 'auto';
|
|
59
|
+
settlementAsset: Asset;
|
|
60
|
+
acceptedAssets: AcceptedAssetInput[];
|
|
61
|
+
scenario?: PaymentOrderScenario;
|
|
62
|
+
expiresAt?: string;
|
|
63
|
+
metadata?: Record<string, unknown>;
|
|
64
|
+
};
|
|
65
|
+
type PaymentOrderInstruction = {
|
|
66
|
+
chain: ChainId;
|
|
67
|
+
asset: Asset;
|
|
68
|
+
address: string;
|
|
69
|
+
};
|
|
70
|
+
type PaymentOrder = {
|
|
71
|
+
id: string;
|
|
72
|
+
merchantOrderId: string;
|
|
73
|
+
scenario: PaymentOrderScenario;
|
|
74
|
+
amount: string;
|
|
75
|
+
requestedAmount: string;
|
|
76
|
+
settlementAsset: Asset;
|
|
77
|
+
status: PaymentOrderStatus;
|
|
78
|
+
expiresAt: string | null;
|
|
79
|
+
metadata: unknown;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
acceptedAssets?: AcceptedAssetInput[];
|
|
82
|
+
paymentInstructions: PaymentOrderInstruction[];
|
|
83
|
+
};
|
|
84
|
+
type PaymentOrderTimelineEntry = {
|
|
85
|
+
from: PaymentOrderStatus | null;
|
|
86
|
+
to: PaymentOrderStatus;
|
|
87
|
+
reason: string | null;
|
|
88
|
+
at: string;
|
|
89
|
+
};
|
|
90
|
+
type PaymentOrderDetail = PaymentOrder & {
|
|
91
|
+
timeline: PaymentOrderTimelineEntry[];
|
|
92
|
+
};
|
|
93
|
+
type NormalizedEvent = {
|
|
94
|
+
id: string;
|
|
95
|
+
chain: ChainId;
|
|
96
|
+
asset: Asset;
|
|
97
|
+
fromAddress: string;
|
|
98
|
+
toAddress: string;
|
|
99
|
+
amount: string;
|
|
100
|
+
txHash: string;
|
|
101
|
+
logIndex: number;
|
|
102
|
+
blockNumber: string;
|
|
103
|
+
paymentOrderId: string | null;
|
|
104
|
+
confirmations: number;
|
|
105
|
+
detectedAt: string;
|
|
106
|
+
};
|
|
107
|
+
type RawChainEvent = {
|
|
108
|
+
id: string;
|
|
109
|
+
source: string;
|
|
110
|
+
blockHash: string | null;
|
|
111
|
+
receivedAt: string;
|
|
112
|
+
payload: unknown;
|
|
113
|
+
};
|
|
114
|
+
type EventPaymentOrderSummary = {
|
|
115
|
+
id: string;
|
|
116
|
+
merchantOrderId: string;
|
|
117
|
+
status: PaymentOrderStatus;
|
|
118
|
+
settlementAsset: Asset;
|
|
119
|
+
amount: string;
|
|
120
|
+
};
|
|
121
|
+
type EventWebhookDelivery = {
|
|
122
|
+
id: string;
|
|
123
|
+
webhookEndpointId: string;
|
|
124
|
+
eventType: WebhookEventType;
|
|
125
|
+
status: WebhookDeliveryStatus;
|
|
126
|
+
attempts: number;
|
|
127
|
+
responseStatus: number | null;
|
|
128
|
+
errorMessage: string | null;
|
|
129
|
+
lastAttemptAt: string | null;
|
|
130
|
+
createdAt: string;
|
|
131
|
+
};
|
|
132
|
+
type NormalizedEventDetail = NormalizedEvent & {
|
|
133
|
+
rawChainEvent: RawChainEvent;
|
|
134
|
+
paymentOrder: EventPaymentOrderSummary | null;
|
|
135
|
+
deliveries: EventWebhookDelivery[];
|
|
136
|
+
};
|
|
137
|
+
type WebhookEndpoint = {
|
|
138
|
+
id: string;
|
|
139
|
+
url: string;
|
|
140
|
+
description: string | null;
|
|
141
|
+
enabledEvents: WebhookEventType[];
|
|
142
|
+
redactMetadata: boolean;
|
|
143
|
+
disabledAt: string | null;
|
|
144
|
+
createdAt: string;
|
|
145
|
+
secret?: string;
|
|
146
|
+
};
|
|
147
|
+
type CreateWebhookEndpointInput = {
|
|
148
|
+
url: string;
|
|
149
|
+
description?: string;
|
|
150
|
+
enabledEvents?: WebhookEventType[];
|
|
151
|
+
redactMetadata?: boolean;
|
|
152
|
+
};
|
|
153
|
+
type UpdateWebhookEndpointInput = {
|
|
154
|
+
description?: string | null;
|
|
155
|
+
enabledEvents?: WebhookEventType[];
|
|
156
|
+
redactMetadata?: boolean;
|
|
157
|
+
};
|
|
158
|
+
type WebhookDelivery = {
|
|
159
|
+
id: string;
|
|
160
|
+
webhookEndpointId: string;
|
|
161
|
+
eventId: string;
|
|
162
|
+
eventType: WebhookEventType;
|
|
163
|
+
paymentOrderId: string | null;
|
|
164
|
+
status: WebhookDeliveryStatus;
|
|
165
|
+
attempts: number;
|
|
166
|
+
responseStatus: number | null;
|
|
167
|
+
responseDurationMs: number | null;
|
|
168
|
+
errorMessage: string | null;
|
|
169
|
+
nextRetryAt: string | null;
|
|
170
|
+
lastAttemptAt: string | null;
|
|
171
|
+
succeededAt: string | null;
|
|
172
|
+
deadLetteredAt: string | null;
|
|
173
|
+
createdAt: string;
|
|
174
|
+
};
|
|
175
|
+
type ReplayDeliveryResult = {
|
|
176
|
+
deliveryId: string;
|
|
177
|
+
};
|
|
178
|
+
type ReplayDeadLettersInput = {
|
|
179
|
+
endpointId?: string;
|
|
180
|
+
limit?: number;
|
|
181
|
+
};
|
|
182
|
+
type ReplayDeadLettersResult = {
|
|
183
|
+
replayed: number;
|
|
184
|
+
items: {
|
|
185
|
+
originalId: string;
|
|
186
|
+
deliveryId: string;
|
|
187
|
+
}[];
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
declare class PaymentOrdersApi {
|
|
191
|
+
private readonly http;
|
|
192
|
+
constructor(http: HttpClient);
|
|
193
|
+
create(input: CreatePaymentOrderInput, options: {
|
|
194
|
+
idempotencyKey: string;
|
|
195
|
+
}): Promise<PaymentOrder>;
|
|
196
|
+
retrieve(id: string): Promise<PaymentOrderDetail>;
|
|
197
|
+
list(params?: {
|
|
198
|
+
status?: PaymentOrderStatus;
|
|
199
|
+
limit?: number;
|
|
200
|
+
}): Promise<PaymentOrder[]>;
|
|
201
|
+
cancel(id: string): Promise<PaymentOrder>;
|
|
202
|
+
}
|
|
203
|
+
declare class EventsApi {
|
|
204
|
+
private readonly http;
|
|
205
|
+
constructor(http: HttpClient);
|
|
206
|
+
list(params?: {
|
|
207
|
+
chain?: ChainId;
|
|
208
|
+
asset?: Asset;
|
|
209
|
+
paymentOrderId?: string;
|
|
210
|
+
limit?: number;
|
|
211
|
+
toAddress?: string;
|
|
212
|
+
txHash?: string;
|
|
213
|
+
}): Promise<NormalizedEvent[]>;
|
|
214
|
+
retrieve(id: string): Promise<NormalizedEventDetail>;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
declare class WebhookEndpointsApi {
|
|
218
|
+
private readonly http;
|
|
219
|
+
constructor(http: HttpClient);
|
|
220
|
+
create(input: CreateWebhookEndpointInput): Promise<WebhookEndpoint>;
|
|
221
|
+
list(): Promise<WebhookEndpoint[]>;
|
|
222
|
+
update(endpointId: string, input: UpdateWebhookEndpointInput): Promise<WebhookEndpoint>;
|
|
223
|
+
rotateSecret(endpointId: string): Promise<WebhookEndpoint>;
|
|
224
|
+
replay(endpointId: string, eventId: string): Promise<ReplayDeliveryResult>;
|
|
225
|
+
}
|
|
226
|
+
declare class WebhookDeliveriesApi {
|
|
227
|
+
private readonly http;
|
|
228
|
+
constructor(http: HttpClient);
|
|
229
|
+
list(params?: {
|
|
230
|
+
status?: WebhookDeliveryStatus;
|
|
231
|
+
endpointId?: string;
|
|
232
|
+
paymentOrderId?: string;
|
|
233
|
+
limit?: number;
|
|
234
|
+
}): Promise<WebhookDelivery[]>;
|
|
235
|
+
replay(deliveryId: string): Promise<ReplayDeliveryResult>;
|
|
236
|
+
replayDeadLetters(input?: ReplayDeadLettersInput): Promise<ReplayDeadLettersResult>;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare class StableOps {
|
|
240
|
+
readonly paymentOrders: PaymentOrdersApi;
|
|
241
|
+
readonly events: EventsApi;
|
|
242
|
+
readonly webhookEndpoints: WebhookEndpointsApi;
|
|
243
|
+
readonly webhookDeliveries: WebhookDeliveriesApi;
|
|
244
|
+
constructor(options?: ClientOptions);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export { type AcceptedAssetInput, type Asset, type ChainId, type ClientOptions, type CreatePaymentOrderInput, type CreateWebhookEndpointInput, type EventPaymentOrderSummary, type EventWebhookDelivery, type NormalizedEvent, type NormalizedEventDetail, type PaymentOrder, type PaymentOrderDetail, type PaymentOrderInstruction, type PaymentOrderScenario, type PaymentOrderStatus, type PaymentOrderTimelineEntry, type RawChainEvent, type ReplayDeadLettersInput, type ReplayDeadLettersResult, type ReplayDeliveryResult, type RetryOptions, StableOps, StableOpsError, type UpdateWebhookEndpointInput, type WebhookDelivery, type WebhookDeliveryStatus, type WebhookEndpoint, type WebhookEventType };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
type StableOpsEnvironment = 'sandbox' | 'live';
|
|
2
|
+
type RetryOptions = {
|
|
3
|
+
maxRetries?: number;
|
|
4
|
+
baseDelayMs?: number;
|
|
5
|
+
maxDelayMs?: number;
|
|
6
|
+
};
|
|
7
|
+
type ClientOptions = {
|
|
8
|
+
apiKey?: string;
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
organizationSlug?: string;
|
|
11
|
+
environment?: StableOpsEnvironment;
|
|
12
|
+
fetch?: typeof fetch;
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
retry?: RetryOptions;
|
|
15
|
+
_sleep?: (ms: number) => Promise<void>;
|
|
16
|
+
_random?: () => number;
|
|
17
|
+
};
|
|
18
|
+
type RequestInit = {
|
|
19
|
+
method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
20
|
+
path: string;
|
|
21
|
+
body?: unknown;
|
|
22
|
+
query?: Record<string, string | number | undefined>;
|
|
23
|
+
idempotencyKey?: string;
|
|
24
|
+
retryable?: boolean;
|
|
25
|
+
};
|
|
26
|
+
declare class StableOpsError extends Error {
|
|
27
|
+
readonly status: number;
|
|
28
|
+
readonly code: string;
|
|
29
|
+
readonly details: unknown;
|
|
30
|
+
constructor(status: number, code: string, message: string, details: unknown);
|
|
31
|
+
}
|
|
32
|
+
declare class HttpClient {
|
|
33
|
+
private readonly baseUrl;
|
|
34
|
+
private readonly headers;
|
|
35
|
+
private readonly fetchImpl;
|
|
36
|
+
private readonly timeoutMs;
|
|
37
|
+
private readonly maxRetries;
|
|
38
|
+
private readonly backoff;
|
|
39
|
+
private readonly sleep;
|
|
40
|
+
private readonly random;
|
|
41
|
+
constructor(options: ClientOptions);
|
|
42
|
+
request<T>(init: RequestInit): Promise<T>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type ChainId = 'ethereum' | 'base' | 'base-sepolia' | 'arbitrum' | 'polygon' | 'tron' | 'solana' | 'ethereum-sepolia' | 'arbitrum-sepolia' | 'polygon-amoy' | 'solana-devnet' | 'tron-nile';
|
|
46
|
+
type Asset = 'USDC' | 'USDT';
|
|
47
|
+
type PaymentOrderStatus = 'created' | 'detected' | 'confirmed' | 'finalized' | 'reverted' | 'expired' | 'canceled';
|
|
48
|
+
type PaymentOrderScenario = 'saas_subscription' | 'trading_deposit' | 'agent_workflow' | 'generic';
|
|
49
|
+
type AcceptedAssetInput = {
|
|
50
|
+
chain: ChainId;
|
|
51
|
+
asset: Asset;
|
|
52
|
+
};
|
|
53
|
+
type WebhookEventType = 'payment_order.created' | 'payment.detected' | 'payment.confirmed' | 'payment.finalized' | 'payment.reverted' | 'payment.expired' | 'address.pool.low' | 'webhook.delivery.failed' | 'agent.action.requested' | 'agent.action.approved' | 'agent.action.executed';
|
|
54
|
+
type WebhookDeliveryStatus = 'pending' | 'succeeded' | 'failed' | 'dead_letter';
|
|
55
|
+
type CreatePaymentOrderInput = {
|
|
56
|
+
merchantOrderId: string;
|
|
57
|
+
amount: string;
|
|
58
|
+
amountMode?: 'exact' | 'auto';
|
|
59
|
+
settlementAsset: Asset;
|
|
60
|
+
acceptedAssets: AcceptedAssetInput[];
|
|
61
|
+
scenario?: PaymentOrderScenario;
|
|
62
|
+
expiresAt?: string;
|
|
63
|
+
metadata?: Record<string, unknown>;
|
|
64
|
+
};
|
|
65
|
+
type PaymentOrderInstruction = {
|
|
66
|
+
chain: ChainId;
|
|
67
|
+
asset: Asset;
|
|
68
|
+
address: string;
|
|
69
|
+
};
|
|
70
|
+
type PaymentOrder = {
|
|
71
|
+
id: string;
|
|
72
|
+
merchantOrderId: string;
|
|
73
|
+
scenario: PaymentOrderScenario;
|
|
74
|
+
amount: string;
|
|
75
|
+
requestedAmount: string;
|
|
76
|
+
settlementAsset: Asset;
|
|
77
|
+
status: PaymentOrderStatus;
|
|
78
|
+
expiresAt: string | null;
|
|
79
|
+
metadata: unknown;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
acceptedAssets?: AcceptedAssetInput[];
|
|
82
|
+
paymentInstructions: PaymentOrderInstruction[];
|
|
83
|
+
};
|
|
84
|
+
type PaymentOrderTimelineEntry = {
|
|
85
|
+
from: PaymentOrderStatus | null;
|
|
86
|
+
to: PaymentOrderStatus;
|
|
87
|
+
reason: string | null;
|
|
88
|
+
at: string;
|
|
89
|
+
};
|
|
90
|
+
type PaymentOrderDetail = PaymentOrder & {
|
|
91
|
+
timeline: PaymentOrderTimelineEntry[];
|
|
92
|
+
};
|
|
93
|
+
type NormalizedEvent = {
|
|
94
|
+
id: string;
|
|
95
|
+
chain: ChainId;
|
|
96
|
+
asset: Asset;
|
|
97
|
+
fromAddress: string;
|
|
98
|
+
toAddress: string;
|
|
99
|
+
amount: string;
|
|
100
|
+
txHash: string;
|
|
101
|
+
logIndex: number;
|
|
102
|
+
blockNumber: string;
|
|
103
|
+
paymentOrderId: string | null;
|
|
104
|
+
confirmations: number;
|
|
105
|
+
detectedAt: string;
|
|
106
|
+
};
|
|
107
|
+
type RawChainEvent = {
|
|
108
|
+
id: string;
|
|
109
|
+
source: string;
|
|
110
|
+
blockHash: string | null;
|
|
111
|
+
receivedAt: string;
|
|
112
|
+
payload: unknown;
|
|
113
|
+
};
|
|
114
|
+
type EventPaymentOrderSummary = {
|
|
115
|
+
id: string;
|
|
116
|
+
merchantOrderId: string;
|
|
117
|
+
status: PaymentOrderStatus;
|
|
118
|
+
settlementAsset: Asset;
|
|
119
|
+
amount: string;
|
|
120
|
+
};
|
|
121
|
+
type EventWebhookDelivery = {
|
|
122
|
+
id: string;
|
|
123
|
+
webhookEndpointId: string;
|
|
124
|
+
eventType: WebhookEventType;
|
|
125
|
+
status: WebhookDeliveryStatus;
|
|
126
|
+
attempts: number;
|
|
127
|
+
responseStatus: number | null;
|
|
128
|
+
errorMessage: string | null;
|
|
129
|
+
lastAttemptAt: string | null;
|
|
130
|
+
createdAt: string;
|
|
131
|
+
};
|
|
132
|
+
type NormalizedEventDetail = NormalizedEvent & {
|
|
133
|
+
rawChainEvent: RawChainEvent;
|
|
134
|
+
paymentOrder: EventPaymentOrderSummary | null;
|
|
135
|
+
deliveries: EventWebhookDelivery[];
|
|
136
|
+
};
|
|
137
|
+
type WebhookEndpoint = {
|
|
138
|
+
id: string;
|
|
139
|
+
url: string;
|
|
140
|
+
description: string | null;
|
|
141
|
+
enabledEvents: WebhookEventType[];
|
|
142
|
+
redactMetadata: boolean;
|
|
143
|
+
disabledAt: string | null;
|
|
144
|
+
createdAt: string;
|
|
145
|
+
secret?: string;
|
|
146
|
+
};
|
|
147
|
+
type CreateWebhookEndpointInput = {
|
|
148
|
+
url: string;
|
|
149
|
+
description?: string;
|
|
150
|
+
enabledEvents?: WebhookEventType[];
|
|
151
|
+
redactMetadata?: boolean;
|
|
152
|
+
};
|
|
153
|
+
type UpdateWebhookEndpointInput = {
|
|
154
|
+
description?: string | null;
|
|
155
|
+
enabledEvents?: WebhookEventType[];
|
|
156
|
+
redactMetadata?: boolean;
|
|
157
|
+
};
|
|
158
|
+
type WebhookDelivery = {
|
|
159
|
+
id: string;
|
|
160
|
+
webhookEndpointId: string;
|
|
161
|
+
eventId: string;
|
|
162
|
+
eventType: WebhookEventType;
|
|
163
|
+
paymentOrderId: string | null;
|
|
164
|
+
status: WebhookDeliveryStatus;
|
|
165
|
+
attempts: number;
|
|
166
|
+
responseStatus: number | null;
|
|
167
|
+
responseDurationMs: number | null;
|
|
168
|
+
errorMessage: string | null;
|
|
169
|
+
nextRetryAt: string | null;
|
|
170
|
+
lastAttemptAt: string | null;
|
|
171
|
+
succeededAt: string | null;
|
|
172
|
+
deadLetteredAt: string | null;
|
|
173
|
+
createdAt: string;
|
|
174
|
+
};
|
|
175
|
+
type ReplayDeliveryResult = {
|
|
176
|
+
deliveryId: string;
|
|
177
|
+
};
|
|
178
|
+
type ReplayDeadLettersInput = {
|
|
179
|
+
endpointId?: string;
|
|
180
|
+
limit?: number;
|
|
181
|
+
};
|
|
182
|
+
type ReplayDeadLettersResult = {
|
|
183
|
+
replayed: number;
|
|
184
|
+
items: {
|
|
185
|
+
originalId: string;
|
|
186
|
+
deliveryId: string;
|
|
187
|
+
}[];
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
declare class PaymentOrdersApi {
|
|
191
|
+
private readonly http;
|
|
192
|
+
constructor(http: HttpClient);
|
|
193
|
+
create(input: CreatePaymentOrderInput, options: {
|
|
194
|
+
idempotencyKey: string;
|
|
195
|
+
}): Promise<PaymentOrder>;
|
|
196
|
+
retrieve(id: string): Promise<PaymentOrderDetail>;
|
|
197
|
+
list(params?: {
|
|
198
|
+
status?: PaymentOrderStatus;
|
|
199
|
+
limit?: number;
|
|
200
|
+
}): Promise<PaymentOrder[]>;
|
|
201
|
+
cancel(id: string): Promise<PaymentOrder>;
|
|
202
|
+
}
|
|
203
|
+
declare class EventsApi {
|
|
204
|
+
private readonly http;
|
|
205
|
+
constructor(http: HttpClient);
|
|
206
|
+
list(params?: {
|
|
207
|
+
chain?: ChainId;
|
|
208
|
+
asset?: Asset;
|
|
209
|
+
paymentOrderId?: string;
|
|
210
|
+
limit?: number;
|
|
211
|
+
toAddress?: string;
|
|
212
|
+
txHash?: string;
|
|
213
|
+
}): Promise<NormalizedEvent[]>;
|
|
214
|
+
retrieve(id: string): Promise<NormalizedEventDetail>;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
declare class WebhookEndpointsApi {
|
|
218
|
+
private readonly http;
|
|
219
|
+
constructor(http: HttpClient);
|
|
220
|
+
create(input: CreateWebhookEndpointInput): Promise<WebhookEndpoint>;
|
|
221
|
+
list(): Promise<WebhookEndpoint[]>;
|
|
222
|
+
update(endpointId: string, input: UpdateWebhookEndpointInput): Promise<WebhookEndpoint>;
|
|
223
|
+
rotateSecret(endpointId: string): Promise<WebhookEndpoint>;
|
|
224
|
+
replay(endpointId: string, eventId: string): Promise<ReplayDeliveryResult>;
|
|
225
|
+
}
|
|
226
|
+
declare class WebhookDeliveriesApi {
|
|
227
|
+
private readonly http;
|
|
228
|
+
constructor(http: HttpClient);
|
|
229
|
+
list(params?: {
|
|
230
|
+
status?: WebhookDeliveryStatus;
|
|
231
|
+
endpointId?: string;
|
|
232
|
+
paymentOrderId?: string;
|
|
233
|
+
limit?: number;
|
|
234
|
+
}): Promise<WebhookDelivery[]>;
|
|
235
|
+
replay(deliveryId: string): Promise<ReplayDeliveryResult>;
|
|
236
|
+
replayDeadLetters(input?: ReplayDeadLettersInput): Promise<ReplayDeadLettersResult>;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare class StableOps {
|
|
240
|
+
readonly paymentOrders: PaymentOrdersApi;
|
|
241
|
+
readonly events: EventsApi;
|
|
242
|
+
readonly webhookEndpoints: WebhookEndpointsApi;
|
|
243
|
+
readonly webhookDeliveries: WebhookDeliveriesApi;
|
|
244
|
+
constructor(options?: ClientOptions);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export { type AcceptedAssetInput, type Asset, type ChainId, type ClientOptions, type CreatePaymentOrderInput, type CreateWebhookEndpointInput, type EventPaymentOrderSummary, type EventWebhookDelivery, type NormalizedEvent, type NormalizedEventDetail, type PaymentOrder, type PaymentOrderDetail, type PaymentOrderInstruction, type PaymentOrderScenario, type PaymentOrderStatus, type PaymentOrderTimelineEntry, type RawChainEvent, type ReplayDeadLettersInput, type ReplayDeadLettersResult, type ReplayDeliveryResult, type RetryOptions, StableOps, StableOpsError, type UpdateWebhookEndpointInput, type WebhookDelivery, type WebhookDeliveryStatus, type WebhookEndpoint, type WebhookEventType };
|