@metagptx/wallet 1.0.0 → 1.3.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.
Files changed (37) hide show
  1. package/README.md +1 -31
  2. package/dist/google/api/http_pb.js +1 -1
  3. package/dist/index.d.ts +4 -1
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +7 -1
  6. package/dist/v1/account/quota_service_pb.d.ts +361 -1
  7. package/dist/v1/account/quota_service_pb.d.ts.map +1 -1
  8. package/dist/v1/account/quota_service_pb.js +76 -12
  9. package/dist/v1/common/code_pb.d.ts +16 -0
  10. package/dist/v1/common/code_pb.d.ts.map +1 -1
  11. package/dist/v1/common/code_pb.js +17 -1
  12. package/dist/v1/config/config_service_pb.d.ts +226 -0
  13. package/dist/v1/config/config_service_pb.d.ts.map +1 -0
  14. package/dist/v1/config/config_service_pb.js +55 -0
  15. package/dist/v1/task/task_service_pb.d.ts +268 -0
  16. package/dist/v1/task/task_service_pb.d.ts.map +1 -0
  17. package/dist/v1/task/task_service_pb.js +57 -0
  18. package/dist/v1/topup/order_service_pb.d.ts +31 -1
  19. package/dist/v1/topup/order_service_pb.d.ts.map +1 -1
  20. package/dist/v1/topup/order_service_pb.js +13 -1
  21. package/dist/v1/webhook/payment_webhook_pb.d.ts +227 -0
  22. package/dist/v1/webhook/payment_webhook_pb.d.ts.map +1 -0
  23. package/dist/v1/webhook/payment_webhook_pb.js +33 -0
  24. package/dist/v1/webhook/webhook_service_pb.d.ts +20 -0
  25. package/dist/v1/webhook/webhook_service_pb.d.ts.map +1 -0
  26. package/dist/v1/webhook/webhook_service_pb.js +14 -0
  27. package/package.json +4 -1
  28. package/src/google/api/http_pb.ts +1 -1
  29. package/src/index.ts +10 -1
  30. package/src/v1/account/quota_service_pb.ts +433 -13
  31. package/src/v1/common/code_pb.ts +21 -1
  32. package/src/v1/config/config_service_pb.ts +283 -0
  33. package/src/v1/task/task_service_pb.ts +320 -0
  34. package/src/v1/topup/order_service_pb.ts +36 -1
  35. package/src/v1/webhook/payment_webhook_pb.ts +272 -0
  36. package/src/v1/webhook/webhook_service_pb.ts +31 -0
  37. package/src/v1/common/base_pb.ts +0 -51
@@ -0,0 +1,272 @@
1
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
2
+ // @generated from file v1/webhook/payment_webhook.proto (package mgx.wallet.v1.webhook, syntax proto3)
3
+ /* eslint-disable */
4
+
5
+ // Copied from shared/payment/webhook/payment_webhook.proto.
6
+
7
+ import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
8
+ import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
9
+ import type { Message } from "@bufbuild/protobuf";
10
+
11
+ /**
12
+ * Describes the file v1/webhook/payment_webhook.proto.
13
+ */
14
+ export const file_v1_webhook_payment_webhook: GenFile = /*@__PURE__*/
15
+ fileDesc("CiB2MS93ZWJob29rL3BheW1lbnRfd2ViaG9vay5wcm90bxIVbWd4LndhbGxldC52MS53ZWJob29rIqwBChNQYXltZW50V2ViaG9va0V2ZW50EhAKCGV2ZW50X2lkGAEgASgJEhIKCmV2ZW50X3R5cGUYAiABKAkSEgoKZXZlbnRfdGltZRgDIAEoCRIWCglzaWduYXR1cmUYBCABKAlIAIgBARI1CgRkYXRhGAUgASgLMicubWd4LndhbGxldC52MS53ZWJob29rLlBheW1lbnRFdmVudERhdGFCDAoKX3NpZ25hdHVyZSK4BAoQUGF5bWVudEV2ZW50RGF0YRIPCgd1c2VyX2lkGAEgASgDEhAKCGJpel9uYW1lGAIgASgJEhQKDGJpel9vcmRlcl9pZBgDIAEoCRIZChFwYXltZW50X3JlZmVyZW5jZRgEIAEoCRIOCgZzdGF0dXMYBSABKAkSHwoSY2hhbm5lbF9wYXltZW50X2lkGAYgASgJSACIAQESTAoTcGF5bWVudF9tZXRob2RfaW5mbxgHIAEoCzIvLm1neC53YWxsZXQudjEud2ViaG9vay5XZWJob29rUGF5bWVudE1ldGhvZEluZm8SEwoGYW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iLmRlZXB3aXNkb21haS5jb20vaWRsL2dvbGFuZy9tZ3gvd2FsbGV0L3Byb3RvL3YxL3dlYmhvb2tiBnByb3RvMw");
16
+
17
+ /**
18
+ * @generated from message mgx.wallet.v1.webhook.PaymentWebhookEvent
19
+ */
20
+ export type PaymentWebhookEvent = Message<"mgx.wallet.v1.webhook.PaymentWebhookEvent"> & {
21
+ /**
22
+ * Event unique ID.
23
+ *
24
+ * @generated from field: string event_id = 1;
25
+ */
26
+ eventId: string;
27
+
28
+ /**
29
+ * Supported values: payment.success / payment.failed / payment.refunded. payment.success maps to status=success; payment.failed maps to status=expired / canceled / failed; payment.refunded maps to status=partial_refunded / refunded.
30
+ *
31
+ * @generated from field: string event_type = 2;
32
+ */
33
+ eventType: string;
34
+
35
+ /**
36
+ * Event occurrence time, ISO 8601.
37
+ *
38
+ * @generated from field: string event_time = 3;
39
+ */
40
+ eventTime: string;
41
+
42
+ /**
43
+ * Optional request signature.
44
+ *
45
+ * @generated from field: optional string signature = 4;
46
+ */
47
+ signature?: string;
48
+
49
+ /**
50
+ * Payment payload for payment.success, payment.failed, and payment.refunded.
51
+ *
52
+ * @generated from field: mgx.wallet.v1.webhook.PaymentEventData data = 5;
53
+ */
54
+ data?: PaymentEventData;
55
+ };
56
+
57
+ /**
58
+ * Describes the message mgx.wallet.v1.webhook.PaymentWebhookEvent.
59
+ * Use `create(PaymentWebhookEventSchema)` to create a new message.
60
+ */
61
+ export const PaymentWebhookEventSchema: GenMessage<PaymentWebhookEvent> = /*@__PURE__*/
62
+ messageDesc(file_v1_webhook_payment_webhook, 0);
63
+
64
+ /**
65
+ * @generated from message mgx.wallet.v1.webhook.PaymentEventData
66
+ */
67
+ export type PaymentEventData = Message<"mgx.wallet.v1.webhook.PaymentEventData"> & {
68
+ /**
69
+ * user ID.
70
+ *
71
+ * @generated from field: int64 user_id = 1;
72
+ */
73
+ userId: bigint;
74
+
75
+ /**
76
+ * Business domain name. Together with biz_order_id it can be used as a business idempotency key.
77
+ *
78
+ * @generated from field: string biz_name = 2;
79
+ */
80
+ bizName: string;
81
+
82
+ /**
83
+ * Business-side order ID.
84
+ *
85
+ * @generated from field: string biz_order_id = 3;
86
+ */
87
+ bizOrderId: string;
88
+
89
+ /**
90
+ * Payment-domain reference for this payment.
91
+ *
92
+ * @generated from field: string payment_reference = 4;
93
+ */
94
+ paymentReference: string;
95
+
96
+ /**
97
+ * Current payment status. payment.success uses success; payment.failed uses expired / canceled / failed; payment.refunded uses partial_refunded / refunded.
98
+ *
99
+ * @generated from field: string status = 5;
100
+ */
101
+ status: string;
102
+
103
+ /**
104
+ * Channel-side payment ID, if available.
105
+ *
106
+ * @generated from field: optional string channel_payment_id = 6;
107
+ */
108
+ channelPaymentId?: string;
109
+
110
+ /**
111
+ * Payment method snapshot for this payment.
112
+ *
113
+ * @generated from field: mgx.wallet.v1.webhook.WebhookPaymentMethodInfo payment_method_info = 7;
114
+ */
115
+ paymentMethodInfo?: WebhookPaymentMethodInfo;
116
+
117
+ /**
118
+ * Original payment amount in minor units.
119
+ *
120
+ * @generated from field: optional int64 amount = 8;
121
+ */
122
+ amount?: bigint;
123
+
124
+ /**
125
+ * Payment currency, e.g. USD.
126
+ *
127
+ * @generated from field: string currency = 9;
128
+ */
129
+ currency: string;
130
+
131
+ /**
132
+ * Failure reason. Only meaningful for payment.failed.
133
+ *
134
+ * @generated from field: optional string failure_reason = 10;
135
+ */
136
+ failureReason?: string;
137
+
138
+ /**
139
+ * Business metadata originally provided when creating the payment.
140
+ *
141
+ * @generated from field: map<string, string> metadata = 11;
142
+ */
143
+ metadata: { [key: string]: string };
144
+
145
+ /**
146
+ * Whether the payment can be retried after the current failed result. Omit for non-failed events.
147
+ *
148
+ * @generated from field: optional bool retryable = 12;
149
+ */
150
+ retryable?: boolean;
151
+
152
+ /**
153
+ * Only meaningful for payment.refunded / partial_refunded.
154
+ *
155
+ * @generated from field: mgx.wallet.v1.webhook.WebhookRefundInfo refund = 13;
156
+ */
157
+ refund?: WebhookRefundInfo;
158
+ };
159
+
160
+ /**
161
+ * Describes the message mgx.wallet.v1.webhook.PaymentEventData.
162
+ * Use `create(PaymentEventDataSchema)` to create a new message.
163
+ */
164
+ export const PaymentEventDataSchema: GenMessage<PaymentEventData> = /*@__PURE__*/
165
+ messageDesc(file_v1_webhook_payment_webhook, 1);
166
+
167
+ /**
168
+ * @generated from message mgx.wallet.v1.webhook.WebhookRefundInfo
169
+ */
170
+ export type WebhookRefundInfo = Message<"mgx.wallet.v1.webhook.WebhookRefundInfo"> & {
171
+ /**
172
+ * Cumulative refunded principal amount in minor units.
173
+ *
174
+ * @generated from field: optional int64 refund_principal_amount = 1;
175
+ */
176
+ refundPrincipalAmount?: bigint;
177
+
178
+ /**
179
+ * Cumulative net refunded amount in minor units actually returned to the user.
180
+ *
181
+ * @generated from field: optional int64 refund_net_amount = 2;
182
+ */
183
+ refundNetAmount?: bigint;
184
+
185
+ /**
186
+ * Cumulative fee amount in minor units allocated to refunded principal.
187
+ *
188
+ * @generated from field: optional int64 refund_fee_amount = 3;
189
+ */
190
+ refundFeeAmount?: bigint;
191
+ };
192
+
193
+ /**
194
+ * Describes the message mgx.wallet.v1.webhook.WebhookRefundInfo.
195
+ * Use `create(WebhookRefundInfoSchema)` to create a new message.
196
+ */
197
+ export const WebhookRefundInfoSchema: GenMessage<WebhookRefundInfo> = /*@__PURE__*/
198
+ messageDesc(file_v1_webhook_payment_webhook, 2);
199
+
200
+ /**
201
+ * @generated from message mgx.wallet.v1.webhook.WebhookPaymentMethodInfo
202
+ */
203
+ export type WebhookPaymentMethodInfo = Message<"mgx.wallet.v1.webhook.WebhookPaymentMethodInfo"> & {
204
+ /**
205
+ * Business-side bound payment method ID.
206
+ *
207
+ * @generated from field: optional string payment_method_bind_id = 1;
208
+ */
209
+ paymentMethodBindId?: string;
210
+
211
+ /**
212
+ * Payment method type, e.g. card, alipay, amazon_pay.
213
+ *
214
+ * @generated from field: string type = 2;
215
+ */
216
+ type: string;
217
+
218
+ /**
219
+ * Last 4 digits of the card or wallet account.
220
+ *
221
+ * @generated from field: optional string last4 = 3;
222
+ */
223
+ last4?: string;
224
+
225
+ /**
226
+ * Card brand, e.g. visa / mastercard / amex.
227
+ *
228
+ * @generated from field: optional string card_brand = 4;
229
+ */
230
+ cardBrand?: string;
231
+
232
+ /**
233
+ * First 6 digits of the card number, if available.
234
+ *
235
+ * @generated from field: optional string card_bin = 5;
236
+ */
237
+ cardBin?: string;
238
+
239
+ /**
240
+ * Wallet type, e.g. apple_pay / google_pay / link.
241
+ *
242
+ * @generated from field: optional string wallet_type = 6;
243
+ */
244
+ walletType?: string;
245
+ };
246
+
247
+ /**
248
+ * Describes the message mgx.wallet.v1.webhook.WebhookPaymentMethodInfo.
249
+ * Use `create(WebhookPaymentMethodInfoSchema)` to create a new message.
250
+ */
251
+ export const WebhookPaymentMethodInfoSchema: GenMessage<WebhookPaymentMethodInfo> = /*@__PURE__*/
252
+ messageDesc(file_v1_webhook_payment_webhook, 3);
253
+
254
+ /**
255
+ * @generated from message mgx.wallet.v1.webhook.WebhookAckResponse
256
+ */
257
+ export type WebhookAckResponse = Message<"mgx.wallet.v1.webhook.WebhookAckResponse"> & {
258
+ /**
259
+ * When the webhook is accepted, the HTTP response can be either "[OK]" or {"ack":"[OK]"}.
260
+ *
261
+ * @generated from field: string ack = 1;
262
+ */
263
+ ack: string;
264
+ };
265
+
266
+ /**
267
+ * Describes the message mgx.wallet.v1.webhook.WebhookAckResponse.
268
+ * Use `create(WebhookAckResponseSchema)` to create a new message.
269
+ */
270
+ export const WebhookAckResponseSchema: GenMessage<WebhookAckResponse> = /*@__PURE__*/
271
+ messageDesc(file_v1_webhook_payment_webhook, 4);
272
+
@@ -0,0 +1,31 @@
1
+ // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
2
+ // @generated from file v1/webhook/webhook_service.proto (package mgx.wallet.v1.webhook, syntax proto3)
3
+ /* eslint-disable */
4
+
5
+ import type { GenFile, GenService } from "@bufbuild/protobuf/codegenv2";
6
+ import { fileDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
7
+ import { file_google_api_annotations } from "../../google/api/annotations_pb";
8
+ import type { PaymentWebhookEventSchema, WebhookAckResponseSchema } from "./payment_webhook_pb";
9
+ import { file_v1_webhook_payment_webhook } from "./payment_webhook_pb";
10
+
11
+ /**
12
+ * Describes the file v1/webhook/webhook_service.proto.
13
+ */
14
+ export const file_v1_webhook_webhook_service: GenFile = /*@__PURE__*/
15
+ fileDesc("CiB2MS93ZWJob29rL3dlYmhvb2tfc2VydmljZS5wcm90bxIVbWd4LndhbGxldC52MS53ZWJob29rMqsBCg5XZWJob29rU2VydmljZRKYAQoUTm90aWZ5UGF5bWVudFdlYmhvb2sSKi5tZ3gud2FsbGV0LnYxLndlYmhvb2suUGF5bWVudFdlYmhvb2tFdmVudBopLm1neC53YWxsZXQudjEud2ViaG9vay5XZWJob29rQWNrUmVzcG9uc2UiKYLT5JMCIzoBKiIeL2FwaS92MS93YWxsZXQvd2ViaG9vay9wYXltZW50QkBaPmdpdGxhYi5kZWVwd2lzZG9tYWkuY29tL2lkbC9nb2xhbmcvbWd4L3dhbGxldC9wcm90by92MS93ZWJob29rYgZwcm90bzM", [file_google_api_annotations, file_v1_webhook_payment_webhook]);
16
+
17
+ /**
18
+ * @generated from service mgx.wallet.v1.webhook.WebhookService
19
+ */
20
+ export const WebhookService: GenService<{
21
+ /**
22
+ * @generated from rpc mgx.wallet.v1.webhook.WebhookService.NotifyPaymentWebhook
23
+ */
24
+ notifyPaymentWebhook: {
25
+ methodKind: "unary";
26
+ input: typeof PaymentWebhookEventSchema;
27
+ output: typeof WebhookAckResponseSchema;
28
+ },
29
+ }> = /*@__PURE__*/
30
+ serviceDesc(file_v1_webhook_webhook_service, 0);
31
+
@@ -1,51 +0,0 @@
1
- // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
2
- // @generated from file v1/common/base.proto (package mgx.wallet.v1.common, syntax proto3)
3
- /* eslint-disable */
4
-
5
- import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
6
- import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
7
- import type { Code } from "./code_pb";
8
- import { file_v1_common_code } from "./code_pb";
9
- import type { Message } from "@bufbuild/protobuf";
10
-
11
- /**
12
- * Describes the file v1/common/base.proto.
13
- */
14
- export const file_v1_common_base: GenFile = /*@__PURE__*/
15
- fileDesc("ChR2MS9jb21tb24vYmFzZS5wcm90bxIUbWd4LndhbGxldC52MS5jb21tb24ifgoOQ29tbW9uUmVzcG9uc2USLQoEY29kZRgBIAEoDjIaLm1neC53YWxsZXQudjEuY29tbW9uLkNvZGVIAIgBARIUCgdtZXNzYWdlGAIgASgJSAGIAQESEgoKcmVxdWVzdF9pZBgDIAEoCUIHCgVfY29kZUIKCghfbWVzc2FnZUI/Wj1naXRsYWIuZGVlcHdpc2RvbWFpLmNvbS9pZGwvZ29sYW5nL21neC93YWxsZXQvcHJvdG8vdjEvY29tbW9uYgZwcm90bzM", [file_v1_common_code]);
16
-
17
- /**
18
- * Common response body (reused by all interfaces, simplifies duplicate definitions)
19
- *
20
- * @generated from message mgx.wallet.v1.common.CommonResponse
21
- */
22
- export type CommonResponse = Message<"mgx.wallet.v1.common.CommonResponse"> & {
23
- /**
24
- * Response code
25
- *
26
- * @generated from field: optional mgx.wallet.v1.common.Code code = 1;
27
- */
28
- code?: Code;
29
-
30
- /**
31
- * Message
32
- *
33
- * @generated from field: optional string message = 2;
34
- */
35
- message?: string;
36
-
37
- /**
38
- * Request ID (for tracing)
39
- *
40
- * @generated from field: string request_id = 3;
41
- */
42
- requestId: string;
43
- };
44
-
45
- /**
46
- * Describes the message mgx.wallet.v1.common.CommonResponse.
47
- * Use `create(CommonResponseSchema)` to create a new message.
48
- */
49
- export const CommonResponseSchema: GenMessage<CommonResponse> = /*@__PURE__*/
50
- messageDesc(file_v1_common_base, 0);
51
-