@@ -161,6 +161,7 @@ interface BaseApiRequestOptions extends RequestInit {
161
161
params? : Record <string , any >;
162
162
method? : ' GET' | ' POST' ;
163
163
requireToken? : boolean ;
164
+ allow404? : boolean ;
164
165
}
165
166
166
167
interface BtcAssetsApiToken {
@@ -188,7 +189,6 @@ interface BtcApis {
188
189
interface BtcApiBlockchainInfo {
189
190
chain: string ;
190
191
blocks: number ;
191
- headers: number ;
192
192
bestblockhash: number ;
193
193
difficulty: number ;
194
194
mediantime: number ;
@@ -222,11 +222,18 @@ interface BtcApiBlockTransactionIds {
222
222
txids: string [];
223
223
}
224
224
225
+ interface BtcApiRecommendedFeeRates {
226
+ fastestFee: number ;
227
+ halfHourFee: number ;
228
+ hourFee: number ;
229
+ economyFee: number ;
230
+ minimumFee: number ;
231
+ }
232
+
225
233
interface BtcApiBalanceParams {
226
234
min_satoshi? : number ;
227
235
no_cache? : boolean ;
228
236
}
229
-
230
237
interface BtcApiBalance {
231
238
address: string ;
232
239
// @deprecated Use available_satoshi instead
@@ -245,7 +252,6 @@ interface BtcApiUtxoParams {
245
252
min_satoshi? : number ;
246
253
no_cache? : boolean ;
247
254
}
248
-
249
255
interface BtcApiUtxo {
250
256
txid: string ;
251
257
vout: number ;
@@ -262,7 +268,7 @@ interface BtcApiSentTransaction {
262
268
txid: string ;
263
269
}
264
270
265
- export interface BtcApiTransactionParams {
271
+ interface BtcApiTransactionParams {
266
272
after_txid? : string ;
267
273
}
268
274
@@ -312,9 +318,11 @@ interface RgbppApis {
312
318
getRgbppPaymasterInfo(): Promise <RgbppApiPaymasterInfo >;
313
319
getRgbppTransactionHash(btcTxId : string ): Promise <RgbppApiCkbTransactionHash >;
314
320
getRgbppTransactionState(btcTxId : string ): Promise <RgbppApiTransactionState >;
315
- getRgbppAssetsByBtcTxId(btcTxId : string ): Promise <Cell []>;
316
- getRgbppAssetsByBtcUtxo(btcTxId : string , vout : number ): Promise <Cell []>;
317
- getRgbppAssetsByBtcAddress(btcAddress : string , params ? : RgbppApiAssetsByAddressParams ): Promise <Cell []>;
321
+ getRgbppAssetsByBtcTxId(btcTxId : string ): Promise <RgbppCell []>;
322
+ getRgbppAssetsByBtcUtxo(btcTxId : string , vout : number ): Promise <RgbppCell []>;
323
+ getRgbppAssetsByBtcAddress(btcAddress : string , params ? : RgbppApiAssetsByAddressParams ): Promise <RgbppCell []>;
324
+ getRgbppBalanceByBtcAddress(btcAddress : string , params ? : RgbppApiBalanceByAddressParams ): Promise <RgbppApiBalance >;
325
+ getRgbppActivityByBtcAddress(btcAddress : string , params ? : RgbppApiActivityByAddressParams ): Promise <RgbppApiActivity >;
318
326
getRgbppSpvProof(btcTxId : string , confirmations : number ): Promise <RgbppApiSpvProof >;
319
327
sendRgbppCkbTransaction(payload : RgbppApiSendCkbTransactionPayload ): Promise <RgbppApiTransactionState >;
320
328
retryRgbppCkbTransaction(payload : RgbppApiRetryCkbTransactionPayload ): Promise <RgbppApiTransactionRetry >;
@@ -331,15 +339,76 @@ interface RgbppApiCkbTransactionHash {
331
339
txhash: string ;
332
340
}
333
341
342
+ interface RgbppApiTransactionStateParams {
343
+ with_data? : boolean ;
344
+ }
345
+
334
346
interface RgbppApiTransactionState {
335
347
state: RgbppTransactionState ;
348
+ attempts: number ;
349
+ failedReason? : string ;
350
+ data? : {
351
+ txid: string ;
352
+ ckbVirtualResult: {
353
+ ckbRawTx: CKBComponents .RawTransaction ;
354
+ needPaymasterCell: boolean ;
355
+ sumInputsCapacity: string ;
356
+ commitment: string ;
357
+ };
358
+ };
359
+ }
360
+
361
+ interface RgbppCell extends Cell {
362
+ typeHash? : Hash ;
336
363
}
337
364
338
365
interface RgbppApiAssetsByAddressParams {
339
366
type_script? : string ;
340
367
no_cache? : boolean ;
341
368
}
342
369
370
+ interface RgbppApiBalanceByAddressParams {
371
+ type_script? : string ;
372
+ no_cache? : boolean ;
373
+ }
374
+ interface RgbppApiBalance {
375
+ address: string ;
376
+ xudt: RgbppApiXudtBalance [];
377
+ }
378
+ interface RgbppApiXudtBalance {
379
+ name: string ;
380
+ decimal: number ;
381
+ symbol: string ;
382
+ total_amount: string ;
383
+ available_amount: string ;
384
+ pending_amount: string ;
385
+ type_hash: string ;
386
+ type_script: Script ;
387
+ }
388
+
389
+ interface RgbppApiActivityByAddressParams {
390
+ rgbpp_only? : boolean ;
391
+ type_script? : string ;
392
+ after_btc_txid? : string ;
393
+ }
394
+ interface RgbppApiActivity {
395
+ address: string ;
396
+ cursor: string ;
397
+ txs: {
398
+ btcTx: BtcApiTransaction ;
399
+ isRgbpp: boolean ;
400
+ isomorphicTx? : {
401
+ ckbVirtualTx? : CKBComponents .RawTransaction ;
402
+ ckbTx? : CKBComponents .Transaction ;
403
+ inputs? : CKBComponents .CellOutput [];
404
+ outputs? : CKBComponents .CellOutput [];
405
+ status: {
406
+ confirmed: boolean ;
407
+ };
408
+ };
409
+ }[];
410
+ }
411
+
343
412
interface RgbppApiSpvProof {
344
413
proof: string ;
345
414
spv_client: {
@@ -350,12 +419,14 @@ interface RgbppApiSpvProof {
350
419
351
420
interface RgbppApiSendCkbTransactionPayload {
352
421
btc_txid: string ;
353
- ckb_virtual_result: {
354
- ckbRawTx: CKBComponents .RawTransaction ;
355
- needPaymasterCell: boolean ;
356
- sumInputsCapacity: string ;
357
- commitment: string ;
358
- };
422
+ // Support ckbVirtualTxResult and it's JSON string as request parameter
423
+ ckb_virtual_result: RgbppApiSendCkbVirtualResult | string ;
424
+ }
425
+ interface RgbppApiSendCkbVirtualResult {
426
+ ckbRawTx: CKBComponents .RawTransaction ;
427
+ needPaymasterCell: boolean ;
428
+ sumInputsCapacity: string ;
429
+ commitment: string ;
359
430
}
360
431
361
432
interface RgbppApiRetryCkbTransactionPayload {
@@ -366,4 +437,5 @@ interface RgbppApiTransactionRetry {
366
437
success: boolean ;
367
438
state: RgbppTransactionState ;
368
439
}
440
+
369
441
```
0 commit comments