@arbiwallet/contracts 1.0.107 → 1.0.108
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/gen/card.ts +62 -0
- package/gen/deposit.ts +9 -1
- package/package.json +1 -1
- package/proto/card.proto +47 -0
- package/proto/deposit.proto +4 -0
package/gen/card.ts
CHANGED
|
@@ -125,6 +125,51 @@ export interface GetTopupFeeResponse {
|
|
|
125
125
|
amountToCard: string;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
export interface QuoteTopupByTargetRequest {
|
|
129
|
+
accountId: number;
|
|
130
|
+
cardId: number;
|
|
131
|
+
targetAmount: string;
|
|
132
|
+
targetCurrency: string;
|
|
133
|
+
cardCryptoCurrency: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface QuoteTopupByTargetResponse {
|
|
137
|
+
targetAmount: string;
|
|
138
|
+
targetCurrency: string;
|
|
139
|
+
inputUsdt: string;
|
|
140
|
+
feeUsdt: string;
|
|
141
|
+
requiredDebitUsdt: string;
|
|
142
|
+
amountToCard: string;
|
|
143
|
+
cardCurrency: string;
|
|
144
|
+
cardCryptoCurrency: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface ExecuteTopupWithLedgerRequest {
|
|
148
|
+
accountId: number;
|
|
149
|
+
cardId: number;
|
|
150
|
+
inputUsdt: string;
|
|
151
|
+
cardCryptoCurrency: string;
|
|
152
|
+
otpCode: string;
|
|
153
|
+
idempotencySeed: string;
|
|
154
|
+
skipBalanceCheck: boolean;
|
|
155
|
+
previewOnly: boolean;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface ExecuteTopupWithLedgerResponse {
|
|
159
|
+
status: string;
|
|
160
|
+
flow: string;
|
|
161
|
+
cardId: number;
|
|
162
|
+
targetCardAmount: string;
|
|
163
|
+
targetCardCurrency: string;
|
|
164
|
+
actualCardAmount: string;
|
|
165
|
+
actualCardCurrency: string;
|
|
166
|
+
inputAmount: string;
|
|
167
|
+
feeAmount: string;
|
|
168
|
+
requiredDebitAmount: string;
|
|
169
|
+
cardCryptoCurrency: string;
|
|
170
|
+
message: string;
|
|
171
|
+
}
|
|
172
|
+
|
|
128
173
|
export interface ListCardsRequest {
|
|
129
174
|
accountId: number;
|
|
130
175
|
}
|
|
@@ -344,6 +389,10 @@ export interface CardServiceClient {
|
|
|
344
389
|
|
|
345
390
|
getTopupFee(request: GetTopupFeeRequest): Observable<GetTopupFeeResponse>;
|
|
346
391
|
|
|
392
|
+
quoteTopupByTarget(request: QuoteTopupByTargetRequest): Observable<QuoteTopupByTargetResponse>;
|
|
393
|
+
|
|
394
|
+
executeTopupWithLedger(request: ExecuteTopupWithLedgerRequest): Observable<ExecuteTopupWithLedgerResponse>;
|
|
395
|
+
|
|
347
396
|
listCards(request: ListCardsRequest): Observable<ListCardsResponse>;
|
|
348
397
|
|
|
349
398
|
listCardsPaginated(request: ListCardsPaginatedRequest): Observable<ListCardsPaginatedResponse>;
|
|
@@ -394,6 +443,17 @@ export interface CardServiceController {
|
|
|
394
443
|
request: GetTopupFeeRequest,
|
|
395
444
|
): Promise<GetTopupFeeResponse> | Observable<GetTopupFeeResponse> | GetTopupFeeResponse;
|
|
396
445
|
|
|
446
|
+
quoteTopupByTarget(
|
|
447
|
+
request: QuoteTopupByTargetRequest,
|
|
448
|
+
): Promise<QuoteTopupByTargetResponse> | Observable<QuoteTopupByTargetResponse> | QuoteTopupByTargetResponse;
|
|
449
|
+
|
|
450
|
+
executeTopupWithLedger(
|
|
451
|
+
request: ExecuteTopupWithLedgerRequest,
|
|
452
|
+
):
|
|
453
|
+
| Promise<ExecuteTopupWithLedgerResponse>
|
|
454
|
+
| Observable<ExecuteTopupWithLedgerResponse>
|
|
455
|
+
| ExecuteTopupWithLedgerResponse;
|
|
456
|
+
|
|
397
457
|
listCards(request: ListCardsRequest): Promise<ListCardsResponse> | Observable<ListCardsResponse> | ListCardsResponse;
|
|
398
458
|
|
|
399
459
|
listCardsPaginated(
|
|
@@ -456,6 +516,8 @@ export function CardServiceControllerMethods() {
|
|
|
456
516
|
"createCardsBatch",
|
|
457
517
|
"topupCard",
|
|
458
518
|
"getTopupFee",
|
|
519
|
+
"quoteTopupByTarget",
|
|
520
|
+
"executeTopupWithLedger",
|
|
459
521
|
"listCards",
|
|
460
522
|
"listCardsPaginated",
|
|
461
523
|
"getCard",
|
package/gen/deposit.ts
CHANGED
|
@@ -37,7 +37,15 @@ export interface CreatePaymentDillDepositRequest {
|
|
|
37
37
|
| string
|
|
38
38
|
| undefined;
|
|
39
39
|
/** Сеть баланса в Ledger (по умолчанию TRON) */
|
|
40
|
-
creditNetwork?:
|
|
40
|
+
creditNetwork?:
|
|
41
|
+
| string
|
|
42
|
+
| undefined;
|
|
43
|
+
/** WALLET_TOPUP | CARD_TOPUP */
|
|
44
|
+
purpose?:
|
|
45
|
+
| string
|
|
46
|
+
| undefined;
|
|
47
|
+
/** JSON payload for downstream orchestration (e.g. card top-up). */
|
|
48
|
+
purposePayloadJson?: string | undefined;
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
export interface CreatePaymentDillDepositResponse {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbiwallet/contracts",
|
|
3
3
|
"descriptions": "Generate and manage smart contracts for ArbiWallet",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.108",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
7
7
|
},
|
package/proto/card.proto
CHANGED
|
@@ -12,6 +12,8 @@ service CardService {
|
|
|
12
12
|
rpc CreateCardsBatch(CreateCardsBatchRequest) returns (CreateCardsBatchResponse);
|
|
13
13
|
rpc TopupCard(TopupCardRequest) returns (TopupCardResponse);
|
|
14
14
|
rpc GetTopupFee(GetTopupFeeRequest) returns (GetTopupFeeResponse);
|
|
15
|
+
rpc QuoteTopupByTarget(QuoteTopupByTargetRequest) returns (QuoteTopupByTargetResponse);
|
|
16
|
+
rpc ExecuteTopupWithLedger(ExecuteTopupWithLedgerRequest) returns (ExecuteTopupWithLedgerResponse);
|
|
15
17
|
|
|
16
18
|
rpc ListCards(ListCardsRequest) returns (ListCardsResponse);
|
|
17
19
|
rpc ListCardsPaginated(ListCardsPaginatedRequest) returns (ListCardsPaginatedResponse);
|
|
@@ -148,6 +150,51 @@ message GetTopupFeeResponse {
|
|
|
148
150
|
string amount_to_card = 7;
|
|
149
151
|
}
|
|
150
152
|
|
|
153
|
+
message QuoteTopupByTargetRequest {
|
|
154
|
+
int64 account_id = 1;
|
|
155
|
+
int64 card_id = 2;
|
|
156
|
+
string target_amount = 3;
|
|
157
|
+
string target_currency = 4;
|
|
158
|
+
string card_crypto_currency = 5;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
message QuoteTopupByTargetResponse {
|
|
162
|
+
string target_amount = 1;
|
|
163
|
+
string target_currency = 2;
|
|
164
|
+
string input_usdt = 3;
|
|
165
|
+
string fee_usdt = 4;
|
|
166
|
+
string required_debit_usdt = 5;
|
|
167
|
+
string amount_to_card = 6;
|
|
168
|
+
string card_currency = 7;
|
|
169
|
+
string card_crypto_currency = 8;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
message ExecuteTopupWithLedgerRequest {
|
|
173
|
+
int64 account_id = 1;
|
|
174
|
+
int64 card_id = 2;
|
|
175
|
+
string input_usdt = 3;
|
|
176
|
+
string card_crypto_currency = 4;
|
|
177
|
+
string otp_code = 5;
|
|
178
|
+
string idempotency_seed = 6;
|
|
179
|
+
bool skip_balance_check = 7;
|
|
180
|
+
bool preview_only = 8;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
message ExecuteTopupWithLedgerResponse {
|
|
184
|
+
string status = 1;
|
|
185
|
+
string flow = 2;
|
|
186
|
+
int64 card_id = 3;
|
|
187
|
+
string target_card_amount = 4;
|
|
188
|
+
string target_card_currency = 5;
|
|
189
|
+
string actual_card_amount = 6;
|
|
190
|
+
string actual_card_currency = 7;
|
|
191
|
+
string input_amount = 8;
|
|
192
|
+
string fee_amount = 9;
|
|
193
|
+
string required_debit_amount = 10;
|
|
194
|
+
string card_crypto_currency = 11;
|
|
195
|
+
string message = 12;
|
|
196
|
+
}
|
|
197
|
+
|
|
151
198
|
|
|
152
199
|
message ListCardsRequest {
|
|
153
200
|
int64 account_id = 1;
|
package/proto/deposit.proto
CHANGED
|
@@ -42,6 +42,10 @@ message CreatePaymentDillDepositRequest {
|
|
|
42
42
|
optional string credit_asset = 4;
|
|
43
43
|
/** Сеть баланса в Ledger (по умолчанию TRON) */
|
|
44
44
|
optional string credit_network = 5;
|
|
45
|
+
/** WALLET_TOPUP | CARD_TOPUP */
|
|
46
|
+
optional string purpose = 6;
|
|
47
|
+
/** JSON payload for downstream orchestration (e.g. card top-up). */
|
|
48
|
+
optional string purpose_payload_json = 7;
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
message CreatePaymentDillDepositResponse {
|