infra-sdk-typescript 0.1.3 → 0.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.
- package/README.md +257 -254
- package/dist/index.cjs +66 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +166 -81
- package/dist/index.d.ts +166 -81
- package/dist/index.js +66 -10
- package/dist/index.js.map +1 -1
- package/package.json +77 -77
package/dist/index.d.ts
CHANGED
|
@@ -354,44 +354,59 @@ type TokenType = "ASSET" | "YIELD_BEARING";
|
|
|
354
354
|
type TokenStatus = LooseUnion<"PENDING" | "ACTIVE" | "PAUSED" | "RETIRED">;
|
|
355
355
|
type TokenTransactionType = LooseUnion<"MINT" | "BURN" | "TRANSFER" | "DEPLOY" | "REDEEM" | "SNAPSHOT">;
|
|
356
356
|
type TokenTransactionStatus = LooseUnion<"PENDING" | "CONFIRMED" | "FAILED">;
|
|
357
|
+
/**
|
|
358
|
+
* Chain id a token is deployed on, e.g. `84532` (Base Sepolia). The API accepts it as a number
|
|
359
|
+
* or a numeric string; responses always return it as a string.
|
|
360
|
+
*/
|
|
361
|
+
type TokenChainId = string | number;
|
|
362
|
+
type AssetClass = LooseUnion<"FIXED_INCOME" | "MONEY_MARKET" | "REAL_ESTATE" | "COMMODITY" | "EQUITY" | "LOYALTY_VOUCHER">;
|
|
363
|
+
/** Day-count convention used to accrue yield. */
|
|
364
|
+
type YieldDayCount = LooseUnion<"ACT_365" | "ACT_360" | "THIRTY_360">;
|
|
365
|
+
/** Stablecoin a yield payout is made in. Omit to pay out in the token's own settlement asset. */
|
|
366
|
+
type YieldPayoutToken = LooseUnion<"CNGN">;
|
|
357
367
|
interface YieldParams {
|
|
358
|
-
/**
|
|
368
|
+
/**
|
|
369
|
+
* Annual yield rate as a percentage, e.g. `5.5` for 5.5%. Must be greater than `0`, at most
|
|
370
|
+
* `100`, and have no more than 2 decimal places.
|
|
371
|
+
*/
|
|
359
372
|
annualRate: number;
|
|
360
|
-
/** Maturity date, `YYYY-MM-DD`. */
|
|
373
|
+
/** Maturity date, `YYYY-MM-DD`. Must be in the future. */
|
|
361
374
|
maturityDate: string;
|
|
362
|
-
/** First coupon date, `YYYY-MM-DD`. */
|
|
375
|
+
/** First coupon date, `YYYY-MM-DD`. Must be in the future and before `maturityDate`. */
|
|
363
376
|
firstCouponDate: string;
|
|
364
|
-
/** Coupon interval, in days. */
|
|
377
|
+
/** Coupon interval, in days. Must be at least `1`. */
|
|
365
378
|
couponInterval: number;
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
/** Face value per token, in fiat major units. */
|
|
379
|
+
dayCount: YieldDayCount;
|
|
380
|
+
/** Face value per token, in fiat major units. Must be at least `1`. */
|
|
369
381
|
faceValuePerToken: number;
|
|
370
382
|
/** Grace period, in seconds. */
|
|
371
|
-
gracePeriod
|
|
372
|
-
callable
|
|
373
|
-
/**
|
|
383
|
+
gracePeriod: number;
|
|
384
|
+
callable: boolean;
|
|
385
|
+
/**
|
|
386
|
+
* Call date, `YYYY-MM-DD`. Only meaningful when `callable` is `true`. Must be in the future
|
|
387
|
+
* and before `maturityDate`.
|
|
388
|
+
*/
|
|
374
389
|
callDate?: string;
|
|
375
390
|
/** Early redemption fee, in basis points. */
|
|
376
391
|
earlyRedemptionFee?: number;
|
|
377
392
|
}
|
|
378
393
|
interface CreateTokenParams {
|
|
379
|
-
/** Short token symbol, e.g. `"ACMB3"`. */
|
|
394
|
+
/** Short token symbol, e.g. `"ACMB3"`. At most 10 characters. */
|
|
380
395
|
ticker: string;
|
|
381
396
|
name: string;
|
|
382
|
-
/** Issue price per token, in fiat major units. */
|
|
383
|
-
price
|
|
384
|
-
chainId:
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
assetClass:
|
|
397
|
+
/** Issue price per token, in fiat major units. Must be at least `1`. */
|
|
398
|
+
price: number;
|
|
399
|
+
chainId: TokenChainId;
|
|
400
|
+
/** Between `1` and `18`. */
|
|
401
|
+
decimals?: number;
|
|
402
|
+
assetClass: AssetClass;
|
|
388
403
|
tokenType: TokenType;
|
|
389
404
|
/** Maximum holders; `0` for unlimited. */
|
|
390
|
-
maxShareholders
|
|
405
|
+
maxShareholders: number;
|
|
391
406
|
/** Per-investor cap; `0` for unlimited. */
|
|
392
|
-
maxTokensPerInvestor
|
|
407
|
+
maxTokensPerInvestor: number;
|
|
393
408
|
/** Lock-up duration, in seconds; `0` for none. */
|
|
394
|
-
lockUpDuration
|
|
409
|
+
lockUpDuration: number;
|
|
395
410
|
/** Required when `tokenType` is `"YIELD_BEARING"`. */
|
|
396
411
|
yieldParams?: YieldParams;
|
|
397
412
|
}
|
|
@@ -457,7 +472,7 @@ interface ListTokensParams {
|
|
|
457
472
|
}
|
|
458
473
|
interface BurnTokenParams {
|
|
459
474
|
tokenId: string;
|
|
460
|
-
chainId:
|
|
475
|
+
chainId: TokenChainId;
|
|
461
476
|
/** Holder address to burn from. */
|
|
462
477
|
fromAddress: string;
|
|
463
478
|
/** Amount to burn, in token units. */
|
|
@@ -467,7 +482,7 @@ interface BurnTokenParams {
|
|
|
467
482
|
}
|
|
468
483
|
interface MintTokenParams {
|
|
469
484
|
tokenId: string;
|
|
470
|
-
chainId:
|
|
485
|
+
chainId: TokenChainId;
|
|
471
486
|
/** Recipient wallet address. */
|
|
472
487
|
toAddress: string;
|
|
473
488
|
/** Amount to mint, in token units. */
|
|
@@ -476,45 +491,49 @@ interface MintTokenParams {
|
|
|
476
491
|
}
|
|
477
492
|
interface TransferTokenParams {
|
|
478
493
|
tokenId: string;
|
|
479
|
-
chainId:
|
|
494
|
+
chainId: TokenChainId;
|
|
495
|
+
/** HD address index of the sending holder wallet. Must be greater than `0`. */
|
|
496
|
+
fromAddressIndex: number;
|
|
497
|
+
toAddress: string;
|
|
498
|
+
/** Amount to transfer, in token units. */
|
|
499
|
+
amount: number;
|
|
500
|
+
memo?: string;
|
|
501
|
+
}
|
|
502
|
+
interface ForcedTransferTokenParams {
|
|
503
|
+
tokenId: string;
|
|
504
|
+
chainId: TokenChainId;
|
|
505
|
+
/** Holder address to move tokens out of. Must be a valid EVM address. */
|
|
480
506
|
fromAddress: string;
|
|
507
|
+
/** Must be a valid EVM address. */
|
|
481
508
|
toAddress: string;
|
|
482
509
|
/** Amount to transfer, in token units. */
|
|
483
510
|
amount: number;
|
|
484
511
|
memo?: string;
|
|
485
512
|
}
|
|
486
|
-
/**
|
|
513
|
+
/**
|
|
514
|
+
* Result of {@link TokenizationResource.mintToken} / {@link TokenizationResource.burnToken} /
|
|
515
|
+
* {@link TokenizationResource.forcedTransfer}.
|
|
516
|
+
*/
|
|
487
517
|
interface TokenOperationResult {
|
|
488
518
|
operationRef: string;
|
|
489
519
|
transactionId: string;
|
|
490
520
|
txHash: string;
|
|
491
521
|
}
|
|
492
|
-
/** Result of {@link TokenizationResource.transferToken}
|
|
522
|
+
/** Result of {@link TokenizationResource.transferToken}. */
|
|
493
523
|
interface TokenTransferResult {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
chainId: number;
|
|
499
|
-
signerType: string;
|
|
500
|
-
fromAddress: string;
|
|
501
|
-
addressIndex: number | null;
|
|
524
|
+
tokenId: string;
|
|
525
|
+
status: TokenTransactionStatus;
|
|
526
|
+
transactionId: string;
|
|
527
|
+
fromAddressIndex: number;
|
|
502
528
|
toAddress: string;
|
|
503
|
-
/** Amount in token units
|
|
504
|
-
amount:
|
|
505
|
-
tokenAddress: string | null;
|
|
506
|
-
data: string | null;
|
|
507
|
-
value: string | null;
|
|
529
|
+
/** Amount transferred, in token units. */
|
|
530
|
+
amount: number;
|
|
508
531
|
txHash: string;
|
|
509
|
-
|
|
510
|
-
gasUsed: string | null;
|
|
511
|
-
feeWei: string | null;
|
|
512
|
-
createdAt: string;
|
|
513
|
-
updatedAt: string;
|
|
532
|
+
operationRef: string;
|
|
514
533
|
}
|
|
515
534
|
interface RegisterTokenWalletParams {
|
|
516
535
|
tokenId: string;
|
|
517
|
-
chainId:
|
|
536
|
+
chainId: TokenChainId;
|
|
518
537
|
walletAddress: string;
|
|
519
538
|
}
|
|
520
539
|
interface RegisterTokenWalletResult {
|
|
@@ -524,7 +543,7 @@ interface RegisterTokenWalletResult {
|
|
|
524
543
|
}
|
|
525
544
|
interface GetTokenHoldersParams {
|
|
526
545
|
tokenId: string;
|
|
527
|
-
chainId?:
|
|
546
|
+
chainId?: TokenChainId;
|
|
528
547
|
page?: number;
|
|
529
548
|
pageSize?: number;
|
|
530
549
|
}
|
|
@@ -533,9 +552,24 @@ interface TokenHolder {
|
|
|
533
552
|
/** Balance in token units, as a decimal string. */
|
|
534
553
|
balance: string;
|
|
535
554
|
}
|
|
555
|
+
interface GetWalletBalanceParams {
|
|
556
|
+
tokenId: string;
|
|
557
|
+
chainId: TokenChainId;
|
|
558
|
+
walletAddress: string;
|
|
559
|
+
}
|
|
560
|
+
/** A single wallet's balance of a token, returned by {@link TokenizationResource.getWalletBalance}. */
|
|
561
|
+
interface TokenWalletBalance {
|
|
562
|
+
tokenId: string;
|
|
563
|
+
ticker: string;
|
|
564
|
+
chainId: string;
|
|
565
|
+
walletAddress: string;
|
|
566
|
+
/** Balance in token units, as a decimal string. */
|
|
567
|
+
balance: string;
|
|
568
|
+
decimals: number;
|
|
569
|
+
}
|
|
536
570
|
interface ListTokenTransactionsParams {
|
|
537
571
|
tokenId?: string;
|
|
538
|
-
chainId?:
|
|
572
|
+
chainId?: TokenChainId;
|
|
539
573
|
page?: number;
|
|
540
574
|
pageSize?: number;
|
|
541
575
|
type?: TokenTransactionType;
|
|
@@ -566,62 +600,100 @@ interface TokenTransactionRecord {
|
|
|
566
600
|
memo?: string;
|
|
567
601
|
createdAt?: string;
|
|
568
602
|
confirmedAt?: string;
|
|
603
|
+
/** Distribution snapshot id, set on `SNAPSHOT` transactions. */
|
|
604
|
+
snapshotId?: number;
|
|
569
605
|
}
|
|
570
606
|
interface UpdateTokenYieldParams {
|
|
571
607
|
/** Yield-bearing token id. */
|
|
572
608
|
tokenId: string;
|
|
573
|
-
chainId:
|
|
574
|
-
/** New annual yield rate, as a percentage. */
|
|
609
|
+
chainId: TokenChainId;
|
|
610
|
+
/** New annual yield rate, as a percentage. Same limits as {@link YieldParams.annualRate}. */
|
|
575
611
|
annualRate: number;
|
|
576
612
|
}
|
|
613
|
+
/** Result of {@link TokenizationResource.updateYield}. */
|
|
614
|
+
interface UpdateYieldResult {
|
|
615
|
+
/** Annual rate before the update, as a percentage. */
|
|
616
|
+
currentRate: number;
|
|
617
|
+
/** Annual rate after the update, as a percentage. */
|
|
618
|
+
newRate: number;
|
|
619
|
+
txHash: string;
|
|
620
|
+
}
|
|
577
621
|
interface DistributeYieldParams {
|
|
578
622
|
tokenId: string;
|
|
579
|
-
chainId:
|
|
580
|
-
/** Amount to fund the distribution, in fiat major units. */
|
|
623
|
+
chainId: TokenChainId;
|
|
624
|
+
/** Amount to fund the distribution, in fiat major units. A whole number, at least `1`. */
|
|
581
625
|
fundAmount: number;
|
|
582
|
-
payoutToken?:
|
|
583
|
-
/** Seconds after which unclaimed funds may be reclaimed. */
|
|
584
|
-
reclaimAfter
|
|
585
|
-
|
|
626
|
+
payoutToken?: YieldPayoutToken;
|
|
627
|
+
/** Seconds after which unclaimed funds may be reclaimed. A whole number, at least `1`. */
|
|
628
|
+
reclaimAfter: number;
|
|
629
|
+
/** Push the payout to investors instead of letting them claim it. */
|
|
630
|
+
pushYield?: boolean;
|
|
631
|
+
/** Note recorded with the distribution. */
|
|
632
|
+
memo: string;
|
|
586
633
|
}
|
|
587
634
|
interface PayCouponParams {
|
|
588
635
|
tokenId: string;
|
|
589
|
-
chainId:
|
|
590
|
-
payoutToken?:
|
|
636
|
+
chainId: TokenChainId;
|
|
637
|
+
payoutToken?: YieldPayoutToken;
|
|
591
638
|
/** Push the coupon to investors instead of letting them claim it. */
|
|
592
|
-
pushYield
|
|
593
|
-
|
|
594
|
-
|
|
639
|
+
pushYield: boolean;
|
|
640
|
+
/** Seconds after which unclaimed funds may be reclaimed. At least `1`. */
|
|
641
|
+
reclaimAfter: number;
|
|
642
|
+
/** Note recorded with the coupon payment. */
|
|
643
|
+
memo: string;
|
|
595
644
|
}
|
|
596
645
|
interface ClaimYieldParams {
|
|
597
646
|
tokenId: string;
|
|
598
|
-
chainId:
|
|
599
|
-
/** HD address index of the claiming investor. */
|
|
647
|
+
chainId: TokenChainId;
|
|
648
|
+
/** HD address index of the claiming investor. At least `1`. */
|
|
600
649
|
investorAddressIndex: number;
|
|
601
|
-
/** Distribution snapshot to claim against. */
|
|
650
|
+
/** Distribution snapshot to claim against. At least `1`. */
|
|
602
651
|
snapshotId: number;
|
|
603
652
|
}
|
|
604
653
|
interface RedeemPrincipalParams {
|
|
605
654
|
tokenId: string;
|
|
606
|
-
chainId:
|
|
607
|
-
|
|
608
|
-
|
|
655
|
+
chainId: TokenChainId;
|
|
656
|
+
}
|
|
657
|
+
/** Result of {@link TokenizationResource.redeemPrincipal} — one transaction per redemption payout. */
|
|
658
|
+
interface RedeemPrincipalResult {
|
|
659
|
+
tokenId: string;
|
|
660
|
+
operationRef: string;
|
|
661
|
+
transactionIds: string[];
|
|
662
|
+
txHashes: string[];
|
|
663
|
+
}
|
|
664
|
+
interface ReclaimUnclaimedYieldParams {
|
|
665
|
+
tokenId: string;
|
|
666
|
+
chainId: TokenChainId;
|
|
667
|
+
/** Distribution snapshot to reclaim unclaimed funds from. A whole number, at least `1`. */
|
|
668
|
+
snapshotId: number;
|
|
609
669
|
}
|
|
610
|
-
/** Result of
|
|
670
|
+
/** Result of {@link TokenizationResource.reclaimUnclaimedYield}. */
|
|
671
|
+
interface ReclaimUnclaimedYieldResult {
|
|
672
|
+
tokenId: string;
|
|
673
|
+
/** Snapshot id, as a numeric string. */
|
|
674
|
+
snapshotId: string;
|
|
675
|
+
/** Amount reclaimed, as a decimal string. */
|
|
676
|
+
reclaimed: string;
|
|
677
|
+
operationRef: string;
|
|
678
|
+
txHash: string;
|
|
679
|
+
}
|
|
680
|
+
/** Result of {@link TokenizationResource.claimYield}. */
|
|
611
681
|
interface YieldTxResult {
|
|
612
682
|
txHash: string;
|
|
613
683
|
}
|
|
614
|
-
/** Result of
|
|
684
|
+
/** Result of {@link TokenizationResource.distributeYield} / {@link TokenizationResource.payCoupon}. */
|
|
615
685
|
interface YieldOperationResult {
|
|
686
|
+
tokenId: string;
|
|
616
687
|
operationRef: string;
|
|
688
|
+
transactionId: string;
|
|
617
689
|
txHash: string;
|
|
618
690
|
}
|
|
619
691
|
|
|
620
692
|
/**
|
|
621
693
|
* The Tokenization service — issues and manages tokenized real-world assets: deployment,
|
|
622
694
|
* mint/burn/transfer, wallet whitelisting, holder balances, and the yield lifecycle
|
|
623
|
-
* (rate updates, coupon payments, claims,
|
|
624
|
-
* tokens.
|
|
695
|
+
* (rate updates, coupon payments, claims, principal redemption, and reclaiming unclaimed
|
|
696
|
+
* payouts) for `YIELD_BEARING` tokens.
|
|
625
697
|
*/
|
|
626
698
|
declare class TokenizationResource extends APIResource {
|
|
627
699
|
/**
|
|
@@ -630,7 +702,7 @@ declare class TokenizationResource extends APIResource {
|
|
|
630
702
|
* {@link getToken} until `status` is `ACTIVE`. Supply `yieldParams` for a
|
|
631
703
|
* `YIELD_BEARING` token.
|
|
632
704
|
*/
|
|
633
|
-
createToken(params: CreateTokenParams, overrides?:
|
|
705
|
+
createToken(params: CreateTokenParams, overrides?: IdempotentRequestOverrides): Promise<TokenDeploymentResult>;
|
|
634
706
|
/**
|
|
635
707
|
* Returns a paginated list of tokens for the calling project.
|
|
636
708
|
*
|
|
@@ -643,29 +715,42 @@ declare class TokenizationResource extends APIResource {
|
|
|
643
715
|
/** Fetches a single token by id, including its per-chain deployment details. */
|
|
644
716
|
getToken(id: string, overrides?: RequestOverrides): Promise<TokenDetail>;
|
|
645
717
|
/** Mints new units of a token to a recipient address. */
|
|
646
|
-
mintToken(params: MintTokenParams, overrides?:
|
|
718
|
+
mintToken(params: MintTokenParams, overrides?: IdempotentRequestOverrides): Promise<TokenOperationResult>;
|
|
647
719
|
/** Burns units of a token from a holder address. */
|
|
648
|
-
burnToken(params: BurnTokenParams, overrides?:
|
|
720
|
+
burnToken(params: BurnTokenParams, overrides?: IdempotentRequestOverrides): Promise<TokenOperationResult>;
|
|
649
721
|
/** Transfers token units between holder addresses. */
|
|
650
|
-
transferToken(params: TransferTokenParams, overrides?:
|
|
722
|
+
transferToken(params: TransferTokenParams, overrides?: IdempotentRequestOverrides): Promise<TokenTransferResult>;
|
|
723
|
+
/**
|
|
724
|
+
* Force-transfers token units out of a holder's address without the holder's signature
|
|
725
|
+
* (issuer/admin compliance action, e.g. recovery or court order). An `Idempotency-Key` is
|
|
726
|
+
* generated per call unless you pass your own.
|
|
727
|
+
*/
|
|
728
|
+
forcedTransfer(params: ForcedTransferTokenParams, overrides?: IdempotentRequestOverrides): Promise<TokenOperationResult>;
|
|
651
729
|
/** Registers (whitelists) a wallet address so it can hold a given token. */
|
|
652
|
-
registerWallet(params: RegisterTokenWalletParams, overrides?:
|
|
730
|
+
registerWallet(params: RegisterTokenWalletParams, overrides?: IdempotentRequestOverrides): Promise<RegisterTokenWalletResult>;
|
|
653
731
|
/** Returns the paginated list of holder wallet addresses and balances for a token on a chain. */
|
|
654
732
|
getTokenHolders(params: GetTokenHoldersParams, overrides?: RequestOverrides): Promise<Page<TokenHolder>>;
|
|
733
|
+
/** Returns a single wallet's balance of a token on a chain. */
|
|
734
|
+
getWalletBalance(params: GetWalletBalanceParams, overrides?: RequestOverrides): Promise<TokenWalletBalance>;
|
|
655
735
|
/** Fetches a single token transaction by its reference. */
|
|
656
736
|
getTokenTransaction(ref: string, overrides?: RequestOverrides): Promise<TokenTransactionRecord>;
|
|
657
737
|
/** Returns token transactions, optionally filtered by token. */
|
|
658
738
|
listTokenTransactions(params?: ListTokenTransactionsParams, overrides?: RequestOverrides): Promise<Page<TokenTransactionRecord>>;
|
|
659
739
|
/** Updates the annual yield rate for a yield-bearing token. */
|
|
660
|
-
updateYield(params: UpdateTokenYieldParams, overrides?: RequestOverrides): Promise<
|
|
740
|
+
updateYield(params: UpdateTokenYieldParams, overrides?: RequestOverrides): Promise<UpdateYieldResult>;
|
|
661
741
|
/** Funds and distributes a yield payout to holders. Unclaimed funds may be reclaimed after `reclaimAfter`. */
|
|
662
|
-
distributeYield(params: DistributeYieldParams, overrides?:
|
|
742
|
+
distributeYield(params: DistributeYieldParams, overrides?: IdempotentRequestOverrides): Promise<YieldOperationResult>;
|
|
663
743
|
/** Pays the scheduled coupon for a yield-bearing token. Set `pushYield` to push funds rather than let investors claim. */
|
|
664
|
-
payCoupon(params: PayCouponParams, overrides?:
|
|
744
|
+
payCoupon(params: PayCouponParams, overrides?: IdempotentRequestOverrides): Promise<YieldOperationResult>;
|
|
665
745
|
/** Claims an investor's yield for a given distribution snapshot. */
|
|
666
|
-
claimYield(params: ClaimYieldParams, overrides?:
|
|
667
|
-
/** Redeems principal to holders at maturity.
|
|
668
|
-
redeemPrincipal(params: RedeemPrincipalParams, overrides?:
|
|
746
|
+
claimYield(params: ClaimYieldParams, overrides?: IdempotentRequestOverrides): Promise<YieldTxResult>;
|
|
747
|
+
/** Redeems principal to holders at maturity. */
|
|
748
|
+
redeemPrincipal(params: RedeemPrincipalParams, overrides?: IdempotentRequestOverrides): Promise<RedeemPrincipalResult>;
|
|
749
|
+
/**
|
|
750
|
+
* Returns a snapshot's unclaimed yield to the issuer once its `reclaimAfter` window has
|
|
751
|
+
* passed. An `Idempotency-Key` is generated per call unless you pass your own.
|
|
752
|
+
*/
|
|
753
|
+
reclaimUnclaimedYield(params: ReclaimUnclaimedYieldParams, overrides?: IdempotentRequestOverrides): Promise<ReclaimUnclaimedYieldResult>;
|
|
669
754
|
}
|
|
670
755
|
|
|
671
756
|
type SubscriptionStatus = LooseUnion<"active" | "paused" | "deleted">;
|
|
@@ -920,4 +1005,4 @@ declare function verifyIndexerWebhookSignature(options: VerifyIndexerWebhookOpti
|
|
|
920
1005
|
/** Generates a UUIDv4 suitable for use as an `Idempotency-Key` header value. */
|
|
921
1006
|
declare function generateIdempotencyKey(): string;
|
|
922
1007
|
|
|
923
|
-
export { AuthenticationError, BadRequestError, type BurnTokenParams, type Chain, type ChainType, type ClaimYieldParams, ConflictError, type CreateSubscriptionParams, type CreateTokenParams, type DeactivateWalletParams, type DistributeYieldParams, type EventCatalogEntry, type EventFamily, type EventKind, type FlatPaginatedResponse, type GenerateWalletsParams, type GeneratedWallet, type GetTokenHoldersParams, type GetTransactionHistoryParams, type GetWalletByAddressIndexParams, type GetWalletByAddressParams, type GetWalletCountParams, type HdEnabledStatus, type HttpMethod, type IdempotentRequestOverrides, IndexerResource, type IndexerSubscription, type IndexerSubscriptionWithSecret, InfraAPIError, InfraAuthTokenError, InfraClient, type InfraClientOptions, InfraConnectionError, InfraConnectionTimeoutError, InfraError, type InitiateTransferParams, InternalServerError, type ListEventCatalogParams, type ListSubscriptionsParams, type ListTokenTransactionsParams, type ListTokensParams, type ListWalletsParams, type LooseUnion, type MetaPaginatedResponse, type MintTokenParams, type Network, NotFoundError, type OffsetPaginatedResponse, Page, type PayCouponParams, PaymentRequiredError, PermissionDeniedError, type QueryValue, RateLimitError, type RedeemPrincipalParams, type RegisterTokenWalletParams, type RegisterTokenWalletResult, type RequestOptions, type RequestOverrides, ServiceUnavailableError, type SignTransactionParams, type SignTransactionRequest, type SignedTransactionResult, type SubscriptionStatus, type SupportedChain, type TokenChainDeployment, type TokenDeploymentResult, type TokenDetail, type TokenHolder, type TokenOperationResult, type TokenStatus, type TokenSummary, type TokenTransactionRecord, type TokenTransactionStatus, type TokenTransactionType, type TokenTransferResult, type TokenType, TokenizationResource, type TransactionStatus, type TransferTokenParams, UnknownAPIError, UnprocessableEntityError, type UpdateSubscriptionParams, type UpdateTokenYieldParams, type VerifyIndexerWebhookOptions, type VerifyWalletWebhookOptions, type Wallet, type WalletBalance, type WalletCount, WalletResource, type WalletTransaction, WebhookSignatureVerificationError, type YieldOperationResult, type YieldParams, type YieldTxResult, generateIdempotencyKey, verifyIndexerWebhookSignature, verifyWalletWebhookSignature };
|
|
1008
|
+
export { type AssetClass, AuthenticationError, BadRequestError, type BurnTokenParams, type Chain, type ChainType, type ClaimYieldParams, ConflictError, type CreateSubscriptionParams, type CreateTokenParams, type DeactivateWalletParams, type DistributeYieldParams, type EventCatalogEntry, type EventFamily, type EventKind, type FlatPaginatedResponse, type ForcedTransferTokenParams, type GenerateWalletsParams, type GeneratedWallet, type GetTokenHoldersParams, type GetTransactionHistoryParams, type GetWalletBalanceParams, type GetWalletByAddressIndexParams, type GetWalletByAddressParams, type GetWalletCountParams, type HdEnabledStatus, type HttpMethod, type IdempotentRequestOverrides, IndexerResource, type IndexerSubscription, type IndexerSubscriptionWithSecret, InfraAPIError, InfraAuthTokenError, InfraClient, type InfraClientOptions, InfraConnectionError, InfraConnectionTimeoutError, InfraError, type InitiateTransferParams, InternalServerError, type ListEventCatalogParams, type ListSubscriptionsParams, type ListTokenTransactionsParams, type ListTokensParams, type ListWalletsParams, type LooseUnion, type MetaPaginatedResponse, type MintTokenParams, type Network, NotFoundError, type OffsetPaginatedResponse, Page, type PayCouponParams, PaymentRequiredError, PermissionDeniedError, type QueryValue, RateLimitError, type ReclaimUnclaimedYieldParams, type ReclaimUnclaimedYieldResult, type RedeemPrincipalParams, type RedeemPrincipalResult, type RegisterTokenWalletParams, type RegisterTokenWalletResult, type RequestOptions, type RequestOverrides, ServiceUnavailableError, type SignTransactionParams, type SignTransactionRequest, type SignedTransactionResult, type SubscriptionStatus, type SupportedChain, type TokenChainDeployment, type TokenChainId, type TokenDeploymentResult, type TokenDetail, type TokenHolder, type TokenOperationResult, type TokenStatus, type TokenSummary, type TokenTransactionRecord, type TokenTransactionStatus, type TokenTransactionType, type TokenTransferResult, type TokenType, type TokenWalletBalance, TokenizationResource, type TransactionStatus, type TransferTokenParams, UnknownAPIError, UnprocessableEntityError, type UpdateSubscriptionParams, type UpdateTokenYieldParams, type UpdateYieldResult, type VerifyIndexerWebhookOptions, type VerifyWalletWebhookOptions, type Wallet, type WalletBalance, type WalletCount, WalletResource, type WalletTransaction, WebhookSignatureVerificationError, type YieldDayCount, type YieldOperationResult, type YieldParams, type YieldPayoutToken, type YieldTxResult, generateIdempotencyKey, verifyIndexerWebhookSignature, verifyWalletWebhookSignature };
|
package/dist/index.js
CHANGED
|
@@ -570,11 +570,13 @@ var TokenizationResource = class extends APIResource {
|
|
|
570
570
|
* `YIELD_BEARING` token.
|
|
571
571
|
*/
|
|
572
572
|
async createToken(params, overrides = {}) {
|
|
573
|
+
const { idempotencyKey, ...rest } = overrides;
|
|
573
574
|
return this.client.request({
|
|
574
575
|
method: "POST",
|
|
575
576
|
path: "/v1/tokens",
|
|
576
577
|
body: params,
|
|
577
|
-
|
|
578
|
+
idempotencyKey: idempotencyKey ?? generateIdempotencyKey(),
|
|
579
|
+
...rest
|
|
578
580
|
});
|
|
579
581
|
}
|
|
580
582
|
/**
|
|
@@ -604,38 +606,61 @@ var TokenizationResource = class extends APIResource {
|
|
|
604
606
|
}
|
|
605
607
|
/** Mints new units of a token to a recipient address. */
|
|
606
608
|
async mintToken(params, overrides = {}) {
|
|
609
|
+
const { idempotencyKey, ...rest } = overrides;
|
|
607
610
|
return this.client.request({
|
|
608
611
|
method: "POST",
|
|
609
612
|
path: "/v1/tokens/mint",
|
|
610
613
|
body: params,
|
|
611
|
-
|
|
614
|
+
idempotencyKey: idempotencyKey ?? generateIdempotencyKey(),
|
|
615
|
+
...rest
|
|
612
616
|
});
|
|
613
617
|
}
|
|
614
618
|
/** Burns units of a token from a holder address. */
|
|
615
619
|
async burnToken(params, overrides = {}) {
|
|
620
|
+
const { idempotencyKey, ...rest } = overrides;
|
|
616
621
|
return this.client.request({
|
|
617
622
|
method: "POST",
|
|
618
623
|
path: "/v1/tokens/burn",
|
|
619
624
|
body: params,
|
|
620
|
-
|
|
625
|
+
idempotencyKey: idempotencyKey ?? generateIdempotencyKey(),
|
|
626
|
+
...rest
|
|
621
627
|
});
|
|
622
628
|
}
|
|
623
629
|
/** Transfers token units between holder addresses. */
|
|
624
630
|
async transferToken(params, overrides = {}) {
|
|
631
|
+
const { idempotencyKey, ...rest } = overrides;
|
|
625
632
|
return this.client.request({
|
|
626
633
|
method: "POST",
|
|
627
634
|
path: "/v1/tokens/transfer",
|
|
628
635
|
body: params,
|
|
629
|
-
|
|
636
|
+
idempotencyKey: idempotencyKey ?? generateIdempotencyKey(),
|
|
637
|
+
...rest
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Force-transfers token units out of a holder's address without the holder's signature
|
|
642
|
+
* (issuer/admin compliance action, e.g. recovery or court order). An `Idempotency-Key` is
|
|
643
|
+
* generated per call unless you pass your own.
|
|
644
|
+
*/
|
|
645
|
+
async forcedTransfer(params, overrides = {}) {
|
|
646
|
+
const { idempotencyKey, ...rest } = overrides;
|
|
647
|
+
return this.client.request({
|
|
648
|
+
method: "POST",
|
|
649
|
+
path: "/v1/tokens/forced-transfer",
|
|
650
|
+
body: params,
|
|
651
|
+
idempotencyKey: idempotencyKey ?? generateIdempotencyKey(),
|
|
652
|
+
...rest
|
|
630
653
|
});
|
|
631
654
|
}
|
|
632
655
|
/** Registers (whitelists) a wallet address so it can hold a given token. */
|
|
633
656
|
async registerWallet(params, overrides = {}) {
|
|
657
|
+
const { idempotencyKey, ...rest } = overrides;
|
|
634
658
|
return this.client.request({
|
|
635
659
|
method: "POST",
|
|
636
660
|
path: "/v1/tokens/register-wallet",
|
|
637
661
|
body: params,
|
|
638
|
-
|
|
662
|
+
idempotencyKey: idempotencyKey ?? generateIdempotencyKey(),
|
|
663
|
+
...rest
|
|
639
664
|
});
|
|
640
665
|
}
|
|
641
666
|
/** Returns the paginated list of holder wallet addresses and balances for a token on a chain. */
|
|
@@ -648,6 +673,15 @@ var TokenizationResource = class extends APIResource {
|
|
|
648
673
|
}).then((raw) => pageFromFlatResponse(raw, fetchPage));
|
|
649
674
|
return fetchPage({ page: params.page, pageSize: params.pageSize });
|
|
650
675
|
}
|
|
676
|
+
/** Returns a single wallet's balance of a token on a chain. */
|
|
677
|
+
async getWalletBalance(params, overrides = {}) {
|
|
678
|
+
return this.client.request({
|
|
679
|
+
method: "GET",
|
|
680
|
+
path: "/v1/tokens/balance",
|
|
681
|
+
query: { ...params },
|
|
682
|
+
...overrides
|
|
683
|
+
});
|
|
684
|
+
}
|
|
651
685
|
/** Fetches a single token transaction by its reference. */
|
|
652
686
|
async getTokenTransaction(ref, overrides = {}) {
|
|
653
687
|
return this.client.request({
|
|
@@ -677,38 +711,60 @@ var TokenizationResource = class extends APIResource {
|
|
|
677
711
|
}
|
|
678
712
|
/** Funds and distributes a yield payout to holders. Unclaimed funds may be reclaimed after `reclaimAfter`. */
|
|
679
713
|
async distributeYield(params, overrides = {}) {
|
|
714
|
+
const { idempotencyKey, ...rest } = overrides;
|
|
680
715
|
return this.client.request({
|
|
681
716
|
method: "POST",
|
|
682
717
|
path: "/v1/tokens/yield/distribute",
|
|
683
718
|
body: params,
|
|
684
|
-
|
|
719
|
+
idempotencyKey: idempotencyKey ?? generateIdempotencyKey(),
|
|
720
|
+
...rest
|
|
685
721
|
});
|
|
686
722
|
}
|
|
687
723
|
/** Pays the scheduled coupon for a yield-bearing token. Set `pushYield` to push funds rather than let investors claim. */
|
|
688
724
|
async payCoupon(params, overrides = {}) {
|
|
725
|
+
const { idempotencyKey, ...rest } = overrides;
|
|
689
726
|
return this.client.request({
|
|
690
727
|
method: "POST",
|
|
691
728
|
path: "/v1/tokens/yield/pay-coupon",
|
|
692
729
|
body: params,
|
|
693
|
-
|
|
730
|
+
idempotencyKey: idempotencyKey ?? generateIdempotencyKey(),
|
|
731
|
+
...rest
|
|
694
732
|
});
|
|
695
733
|
}
|
|
696
734
|
/** Claims an investor's yield for a given distribution snapshot. */
|
|
697
735
|
async claimYield(params, overrides = {}) {
|
|
736
|
+
const { idempotencyKey, ...rest } = overrides;
|
|
698
737
|
return this.client.request({
|
|
699
738
|
method: "POST",
|
|
700
739
|
path: "/v1/tokens/yield/claim",
|
|
701
740
|
body: params,
|
|
702
|
-
|
|
741
|
+
idempotencyKey: idempotencyKey ?? generateIdempotencyKey(),
|
|
742
|
+
...rest
|
|
703
743
|
});
|
|
704
744
|
}
|
|
705
|
-
/** Redeems principal to holders at maturity.
|
|
745
|
+
/** Redeems principal to holders at maturity. */
|
|
706
746
|
async redeemPrincipal(params, overrides = {}) {
|
|
747
|
+
const { idempotencyKey, ...rest } = overrides;
|
|
707
748
|
return this.client.request({
|
|
708
749
|
method: "POST",
|
|
709
750
|
path: "/v1/tokens/yield/redeem",
|
|
710
751
|
body: params,
|
|
711
|
-
|
|
752
|
+
idempotencyKey: idempotencyKey ?? generateIdempotencyKey(),
|
|
753
|
+
...rest
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* Returns a snapshot's unclaimed yield to the issuer once its `reclaimAfter` window has
|
|
758
|
+
* passed. An `Idempotency-Key` is generated per call unless you pass your own.
|
|
759
|
+
*/
|
|
760
|
+
async reclaimUnclaimedYield(params, overrides = {}) {
|
|
761
|
+
const { idempotencyKey, ...rest } = overrides;
|
|
762
|
+
return this.client.request({
|
|
763
|
+
method: "POST",
|
|
764
|
+
path: "/v1/tokens/yield/reclaim",
|
|
765
|
+
body: params,
|
|
766
|
+
idempotencyKey: idempotencyKey ?? generateIdempotencyKey(),
|
|
767
|
+
...rest
|
|
712
768
|
});
|
|
713
769
|
}
|
|
714
770
|
};
|