@daocloud-proto/leopard 0.10.0-rc3 → 0.11.0-dev1
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/package.json +1 -1
- package/v1alpha1/wallet.pb.ts +96 -6
package/package.json
CHANGED
package/v1alpha1/wallet.pb.ts
CHANGED
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
8
|
|
|
9
|
+
type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
|
|
10
|
+
type OneOf<T> =
|
|
11
|
+
| { [k in keyof T]?: undefined }
|
|
12
|
+
| (
|
|
13
|
+
keyof T extends infer K ?
|
|
14
|
+
(K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
|
|
15
|
+
: never)
|
|
16
|
+
: never);
|
|
17
|
+
|
|
9
18
|
export enum PaymentChannel {
|
|
10
19
|
ALIPAY = "ALIPAY",
|
|
11
20
|
WECHAT = "WECHAT",
|
|
@@ -22,12 +31,55 @@ export enum OperationType {
|
|
|
22
31
|
DECREASE = "DECREASE",
|
|
23
32
|
}
|
|
24
33
|
|
|
34
|
+
export type CreateDomainReceivingBankInfoRequest = {
|
|
35
|
+
domain?: string
|
|
36
|
+
bankInfo?: ReceivingBankInfo
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type CreateDomainReceivingBankInfoResponse = {
|
|
40
|
+
id?: string
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type DeleteDomainReceivingBankInfoRequest = {
|
|
44
|
+
id?: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type DeleteDomainReceivingBankInfoResponse = {
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type UpdateDomainReceivingBankInfoRequest = {
|
|
51
|
+
id?: string
|
|
52
|
+
domain?: string
|
|
53
|
+
bankInfo?: ReceivingBankInfo
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type UpdateDomainReceivingBankInfoResponse = {
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type ListDomainReceivingBankInfosRequest = {
|
|
60
|
+
domain?: string
|
|
61
|
+
page?: number
|
|
62
|
+
pageSize?: number
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type ListDomainReceivingBankInfosResponse = {
|
|
66
|
+
items?: DomainReceivingBankInfo[]
|
|
67
|
+
pagination?: Pagination
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type Pagination = {
|
|
71
|
+
total?: number
|
|
72
|
+
page?: number
|
|
73
|
+
pageSize?: number
|
|
74
|
+
}
|
|
75
|
+
|
|
25
76
|
export type BalanceRequest = {
|
|
26
77
|
}
|
|
27
78
|
|
|
28
79
|
export type BalanceResponse = {
|
|
29
80
|
balance?: string
|
|
30
81
|
isVirtual?: boolean
|
|
82
|
+
alertsEnabled?: boolean
|
|
31
83
|
}
|
|
32
84
|
|
|
33
85
|
export type RechargeRequest = {
|
|
@@ -62,6 +114,13 @@ export type GetUserStateResponse = {
|
|
|
62
114
|
enableSub?: boolean
|
|
63
115
|
}
|
|
64
116
|
|
|
117
|
+
export type DomainReceivingBankInfo = {
|
|
118
|
+
accountName?: string
|
|
119
|
+
bankAccount?: string
|
|
120
|
+
bankName?: string
|
|
121
|
+
domain?: string
|
|
122
|
+
}
|
|
123
|
+
|
|
65
124
|
export type ReceivingBankInfo = {
|
|
66
125
|
accountName?: string
|
|
67
126
|
bankAccount?: string
|
|
@@ -99,12 +158,6 @@ export type VirtualWallet = {
|
|
|
99
158
|
arrearsStop?: boolean
|
|
100
159
|
}
|
|
101
160
|
|
|
102
|
-
export type Pagination = {
|
|
103
|
-
total?: number
|
|
104
|
-
page?: number
|
|
105
|
-
pageSize?: number
|
|
106
|
-
}
|
|
107
|
-
|
|
108
161
|
export type ListVirtualWalletsResponse = {
|
|
109
162
|
items?: VirtualWallet[]
|
|
110
163
|
pagination?: Pagination
|
|
@@ -143,6 +196,25 @@ export type DeleteVirtualWalletRequest = {
|
|
|
143
196
|
export type DeleteVirtualWalletResponse = {
|
|
144
197
|
}
|
|
145
198
|
|
|
199
|
+
export type GetBalanceAlertRequest = {
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export type GetBalanceAlertResponse = {
|
|
203
|
+
enabled?: boolean
|
|
204
|
+
threshold?: string
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
type BaseUpdateBalanceAlertRequest = {
|
|
209
|
+
threshold?: string
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export type UpdateBalanceAlertRequest = BaseUpdateBalanceAlertRequest
|
|
213
|
+
& OneOf<{ enabled: boolean }>
|
|
214
|
+
|
|
215
|
+
export type UpdateBalanceAlertResponse = {
|
|
216
|
+
}
|
|
217
|
+
|
|
146
218
|
export class Wallet {
|
|
147
219
|
static Balance(req: BalanceRequest, initReq?: fm.InitReq): Promise<BalanceResponse> {
|
|
148
220
|
return fm.fetchReq<BalanceRequest, BalanceResponse>(`/apis/leopard.io/v1alpha1/wallet/balance?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -174,4 +246,22 @@ export class Wallet {
|
|
|
174
246
|
static UserState(req: UserStateRequest, initReq?: fm.InitReq): Promise<UserStateResponse> {
|
|
175
247
|
return fm.fetchReq<UserStateRequest, UserStateResponse>(`/v1alpha1.wallet.Wallet/UserState`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
176
248
|
}
|
|
249
|
+
static CreateDomainReceivingBankInfo(req: CreateDomainReceivingBankInfoRequest, initReq?: fm.InitReq): Promise<CreateDomainReceivingBankInfoResponse> {
|
|
250
|
+
return fm.fetchReq<CreateDomainReceivingBankInfoRequest, CreateDomainReceivingBankInfoResponse>(`/apis/leopard.io/v1alpha1/wallet/domain-receiving-bank-info`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
251
|
+
}
|
|
252
|
+
static DeleteDomainReceivingBankInfo(req: DeleteDomainReceivingBankInfoRequest, initReq?: fm.InitReq): Promise<DeleteDomainReceivingBankInfoResponse> {
|
|
253
|
+
return fm.fetchReq<DeleteDomainReceivingBankInfoRequest, DeleteDomainReceivingBankInfoResponse>(`/apis/leopard.io/v1alpha1/wallet/domain-receiving-bank-info/${req["id"]}`, {...initReq, method: "DELETE"})
|
|
254
|
+
}
|
|
255
|
+
static UpdateDomainReceivingBankInfo(req: UpdateDomainReceivingBankInfoRequest, initReq?: fm.InitReq): Promise<UpdateDomainReceivingBankInfoResponse> {
|
|
256
|
+
return fm.fetchReq<UpdateDomainReceivingBankInfoRequest, UpdateDomainReceivingBankInfoResponse>(`/apis/leopard.io/v1alpha1/wallet/domain-receiving-bank-info/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
257
|
+
}
|
|
258
|
+
static ListDomainReceivingBankInfos(req: ListDomainReceivingBankInfosRequest, initReq?: fm.InitReq): Promise<ListDomainReceivingBankInfosResponse> {
|
|
259
|
+
return fm.fetchReq<ListDomainReceivingBankInfosRequest, ListDomainReceivingBankInfosResponse>(`/apis/leopard.io/v1alpha1/wallet/domain-receiving-bank-infos?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
260
|
+
}
|
|
261
|
+
static GetBalanceAlert(req: GetBalanceAlertRequest, initReq?: fm.InitReq): Promise<GetBalanceAlertResponse> {
|
|
262
|
+
return fm.fetchReq<GetBalanceAlertRequest, GetBalanceAlertResponse>(`/apis/leopard.io/v1alpha1/wallet/balance/alert?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
263
|
+
}
|
|
264
|
+
static UpdateBalanceAlert(req: UpdateBalanceAlertRequest, initReq?: fm.InitReq): Promise<UpdateBalanceAlertResponse> {
|
|
265
|
+
return fm.fetchReq<UpdateBalanceAlertRequest, UpdateBalanceAlertResponse>(`/apis/leopard.io/v1alpha1/wallet/balance/alert`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
266
|
+
}
|
|
177
267
|
}
|