infra-sdk-typescript 0.2.0 → 0.4.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 +6 -4
- package/dist/index.cjs +50 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +221 -59
- package/dist/index.d.ts +221 -59
- package/dist/index.js +50 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -352,46 +352,61 @@ declare class WalletResource extends APIResource {
|
|
|
352
352
|
|
|
353
353
|
type TokenType = "ASSET" | "YIELD_BEARING";
|
|
354
354
|
type TokenStatus = LooseUnion<"PENDING" | "ACTIVE" | "PAUSED" | "RETIRED">;
|
|
355
|
-
type TokenTransactionType = LooseUnion<"MINT" | "BURN" | "TRANSFER" | "DEPLOY" | "REDEEM" | "SNAPSHOT">;
|
|
355
|
+
type TokenTransactionType = LooseUnion<"MINT" | "BURN" | "TRANSFER" | "DEPLOY" | "REDEEM" | "SNAPSHOT" | "FORCED_TRANSFER">;
|
|
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,8 +491,8 @@ interface MintTokenParams {
|
|
|
476
491
|
}
|
|
477
492
|
interface TransferTokenParams {
|
|
478
493
|
tokenId: string;
|
|
479
|
-
chainId:
|
|
480
|
-
/** HD address index of the sending holder wallet. */
|
|
494
|
+
chainId: TokenChainId;
|
|
495
|
+
/** HD address index of the sending holder wallet. Must be greater than `0`. */
|
|
481
496
|
fromAddressIndex: number;
|
|
482
497
|
toAddress: string;
|
|
483
498
|
/** Amount to transfer, in token units. */
|
|
@@ -486,9 +501,10 @@ interface TransferTokenParams {
|
|
|
486
501
|
}
|
|
487
502
|
interface ForcedTransferTokenParams {
|
|
488
503
|
tokenId: string;
|
|
489
|
-
chainId:
|
|
490
|
-
/** Holder address to move tokens out of. */
|
|
504
|
+
chainId: TokenChainId;
|
|
505
|
+
/** Holder address to move tokens out of. Must be a valid EVM address. */
|
|
491
506
|
fromAddress: string;
|
|
507
|
+
/** Must be a valid EVM address. */
|
|
492
508
|
toAddress: string;
|
|
493
509
|
/** Amount to transfer, in token units. */
|
|
494
510
|
amount: number;
|
|
@@ -517,7 +533,7 @@ interface TokenTransferResult {
|
|
|
517
533
|
}
|
|
518
534
|
interface RegisterTokenWalletParams {
|
|
519
535
|
tokenId: string;
|
|
520
|
-
chainId:
|
|
536
|
+
chainId: TokenChainId;
|
|
521
537
|
walletAddress: string;
|
|
522
538
|
}
|
|
523
539
|
interface RegisterTokenWalletResult {
|
|
@@ -527,7 +543,7 @@ interface RegisterTokenWalletResult {
|
|
|
527
543
|
}
|
|
528
544
|
interface GetTokenHoldersParams {
|
|
529
545
|
tokenId: string;
|
|
530
|
-
chainId?:
|
|
546
|
+
chainId?: TokenChainId;
|
|
531
547
|
page?: number;
|
|
532
548
|
pageSize?: number;
|
|
533
549
|
}
|
|
@@ -538,7 +554,7 @@ interface TokenHolder {
|
|
|
538
554
|
}
|
|
539
555
|
interface GetWalletBalanceParams {
|
|
540
556
|
tokenId: string;
|
|
541
|
-
chainId:
|
|
557
|
+
chainId: TokenChainId;
|
|
542
558
|
walletAddress: string;
|
|
543
559
|
}
|
|
544
560
|
/** A single wallet's balance of a token, returned by {@link TokenizationResource.getWalletBalance}. */
|
|
@@ -550,10 +566,12 @@ interface TokenWalletBalance {
|
|
|
550
566
|
/** Balance in token units, as a decimal string. */
|
|
551
567
|
balance: string;
|
|
552
568
|
decimals: number;
|
|
569
|
+
/** The wallet's cNGN (payout token) balance, as a decimal string. Coupons, yield and principal are paid in cNGN. */
|
|
570
|
+
cNgnBalance: string;
|
|
553
571
|
}
|
|
554
572
|
interface ListTokenTransactionsParams {
|
|
555
573
|
tokenId?: string;
|
|
556
|
-
chainId?:
|
|
574
|
+
chainId?: TokenChainId;
|
|
557
575
|
page?: number;
|
|
558
576
|
pageSize?: number;
|
|
559
577
|
type?: TokenTransactionType;
|
|
@@ -584,62 +602,179 @@ interface TokenTransactionRecord {
|
|
|
584
602
|
memo?: string;
|
|
585
603
|
createdAt?: string;
|
|
586
604
|
confirmedAt?: string;
|
|
605
|
+
/** Distribution snapshot id, set on `SNAPSHOT` transactions. */
|
|
606
|
+
snapshotId?: number;
|
|
587
607
|
}
|
|
588
608
|
interface UpdateTokenYieldParams {
|
|
589
609
|
/** Yield-bearing token id. */
|
|
590
610
|
tokenId: string;
|
|
591
|
-
chainId:
|
|
592
|
-
/** New annual yield rate, as a percentage. */
|
|
611
|
+
chainId: TokenChainId;
|
|
612
|
+
/** New annual yield rate, as a percentage. Same limits as {@link YieldParams.annualRate}. */
|
|
593
613
|
annualRate: number;
|
|
594
614
|
}
|
|
615
|
+
/** Result of {@link TokenizationResource.updateYield}. */
|
|
616
|
+
interface UpdateYieldResult {
|
|
617
|
+
/** Annual rate before the update, as a percentage. */
|
|
618
|
+
currentRate: number;
|
|
619
|
+
/** Annual rate after the update, as a percentage. */
|
|
620
|
+
newRate: number;
|
|
621
|
+
operationRef: string;
|
|
622
|
+
txHash: string;
|
|
623
|
+
}
|
|
595
624
|
interface DistributeYieldParams {
|
|
596
625
|
tokenId: string;
|
|
597
|
-
chainId:
|
|
598
|
-
/** Amount to fund the distribution, in fiat major units. */
|
|
626
|
+
chainId: TokenChainId;
|
|
627
|
+
/** Amount to fund the distribution, in fiat major units. A whole number, at least `1`. */
|
|
599
628
|
fundAmount: number;
|
|
600
|
-
payoutToken?:
|
|
601
|
-
/** Seconds after which unclaimed funds may be reclaimed. */
|
|
602
|
-
reclaimAfter
|
|
603
|
-
|
|
629
|
+
payoutToken?: YieldPayoutToken;
|
|
630
|
+
/** Seconds after which unclaimed funds may be reclaimed. A whole number, at least `1`. */
|
|
631
|
+
reclaimAfter: number;
|
|
632
|
+
/** Push the payout to investors instead of letting them claim it. */
|
|
633
|
+
pushYield?: boolean;
|
|
634
|
+
/** Note recorded with the distribution. */
|
|
635
|
+
memo: string;
|
|
604
636
|
}
|
|
605
637
|
interface PayCouponParams {
|
|
606
638
|
tokenId: string;
|
|
607
|
-
chainId:
|
|
608
|
-
payoutToken?:
|
|
639
|
+
chainId: TokenChainId;
|
|
640
|
+
payoutToken?: YieldPayoutToken;
|
|
609
641
|
/** Push the coupon to investors instead of letting them claim it. */
|
|
610
|
-
pushYield
|
|
611
|
-
|
|
612
|
-
|
|
642
|
+
pushYield: boolean;
|
|
643
|
+
/** Seconds after which unclaimed funds may be reclaimed. At least `1`. */
|
|
644
|
+
reclaimAfter: number;
|
|
645
|
+
/** Note recorded with the coupon payment. */
|
|
646
|
+
memo: string;
|
|
613
647
|
}
|
|
614
648
|
interface ClaimYieldParams {
|
|
615
649
|
tokenId: string;
|
|
616
|
-
chainId:
|
|
617
|
-
/** HD address index of the claiming investor. */
|
|
650
|
+
chainId: TokenChainId;
|
|
651
|
+
/** HD address index of the claiming investor. At least `1`. */
|
|
618
652
|
investorAddressIndex: number;
|
|
619
|
-
/** Distribution snapshot to claim against. */
|
|
653
|
+
/** Distribution snapshot to claim against. At least `1`. */
|
|
620
654
|
snapshotId: number;
|
|
621
655
|
}
|
|
622
656
|
interface RedeemPrincipalParams {
|
|
657
|
+
tokenId: string;
|
|
658
|
+
chainId: TokenChainId;
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Why a holder was left out of a redemption. Their principal is still owed once the cause is resolved.
|
|
662
|
+
*
|
|
663
|
+
* - `NOT_VERIFIED` — not KYC-verified in the token's identity registry.
|
|
664
|
+
* - `FROZEN` — the wallet is frozen.
|
|
665
|
+
* - `NOT_ALLOWLISTED` — removed from the compliance allowlist.
|
|
666
|
+
* - `SKIPPED_BY_CONTRACT` — eligible when read, but the contract skipped it when the batch executed
|
|
667
|
+
* (e.g. it became ineligible in between).
|
|
668
|
+
*/
|
|
669
|
+
type RedemptionSkipReason = LooseUnion<"NOT_VERIFIED" | "FROZEN" | "NOT_ALLOWLISTED" | "SKIPPED_BY_CONTRACT">;
|
|
670
|
+
/** A holder {@link TokenizationResource.redeemPrincipal} did not redeem. */
|
|
671
|
+
interface RedemptionSkippedHolder {
|
|
672
|
+
address: string;
|
|
673
|
+
/** Unredeemed balance in the token's smallest unit, as an integer string. */
|
|
674
|
+
balance: string;
|
|
675
|
+
reasons: RedemptionSkipReason[];
|
|
676
|
+
}
|
|
677
|
+
/** Result of {@link TokenizationResource.redeemPrincipal}. */
|
|
678
|
+
interface RedeemPrincipalResult {
|
|
679
|
+
tokenId: string;
|
|
680
|
+
operationRef: string;
|
|
681
|
+
/** Transaction records created by this run: the issuer-token burn (if any), then one per redemption batch. */
|
|
682
|
+
transactionIds: string[];
|
|
683
|
+
/** Hashes in send order: the burn, each batch, then the seal that marks the principal repaid (if one was needed). */
|
|
684
|
+
txHashes: string[];
|
|
685
|
+
/** Holders actually paid, from the contract's `PrincipalRedeemed` events. */
|
|
686
|
+
redeemedHolders: number;
|
|
687
|
+
/** Principal actually paid, in cNGN base units (6 decimals), as an integer string. */
|
|
688
|
+
paidPrincipal: string;
|
|
689
|
+
/** {@link paidPrincipal} as a decimal cNGN string, e.g. `"100000.0"`. */
|
|
690
|
+
paidPrincipalFormatted: string;
|
|
691
|
+
/**
|
|
692
|
+
* Indexes of batches whose receipt couldn't be read. Their transactions landed, but their paid amounts
|
|
693
|
+
* are the pre-transaction estimate rather than the on-chain events.
|
|
694
|
+
*/
|
|
695
|
+
unreconciledBatches: number[];
|
|
696
|
+
/** Holders that were not redeemed, with their balances and why. */
|
|
697
|
+
skipped: RedemptionSkippedHolder[];
|
|
698
|
+
/** Issuer-held (treasury) tokens burned without a payout, or `null` when there were none. Frozen tokens are never burned. */
|
|
699
|
+
treasuryBurned: {
|
|
700
|
+
amount: string;
|
|
701
|
+
txHash: string;
|
|
702
|
+
} | null;
|
|
703
|
+
/** Supply left after the run, in the token's smallest unit, as an integer string. */
|
|
704
|
+
outstandingSupply: string;
|
|
705
|
+
/**
|
|
706
|
+
* `true` once supply is zero and the bond is marked principal-repaid. While `false`, the remaining
|
|
707
|
+
* supply belongs to {@link skipped} holders, frozen issuer tokens or the yield distributor.
|
|
708
|
+
*/
|
|
709
|
+
closed: boolean;
|
|
710
|
+
}
|
|
711
|
+
interface GetNextCouponParams {
|
|
712
|
+
tokenId: string;
|
|
713
|
+
chainId: TokenChainId;
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Where a bond stands on its coupon schedule.
|
|
717
|
+
*
|
|
718
|
+
* - `SCHEDULED` — the next coupon isn't due yet.
|
|
719
|
+
* - `DUE` — the coupon can be paid now with {@link TokenizationResource.payCoupon}.
|
|
720
|
+
* - `GRACE_EXPIRED` — the coupon was missed and its grace period has passed; it is still payable,
|
|
721
|
+
* but anyone can now flag the bond as defaulted.
|
|
722
|
+
* - `DEFAULTED` — the bond is in default; no further coupons can be scheduled.
|
|
723
|
+
* - `NO_MORE_COUPONS` — the schedule has run past maturity; only principal redemption remains.
|
|
724
|
+
* - `CLOSED` — principal has been repaid and the bond is closed.
|
|
725
|
+
*/
|
|
726
|
+
type NextCouponStatus = LooseUnion<"SCHEDULED" | "DUE" | "GRACE_EXPIRED" | "DEFAULTED" | "NO_MORE_COUPONS" | "CLOSED">;
|
|
727
|
+
/** Result of {@link TokenizationResource.getNextCoupon}. Dates are ISO 8601 strings in UTC. */
|
|
728
|
+
interface NextCoupon {
|
|
623
729
|
tokenId: string;
|
|
624
730
|
chainId: string;
|
|
625
|
-
|
|
626
|
-
|
|
731
|
+
status: NextCouponStatus;
|
|
732
|
+
/** When the next coupon falls due. `null` once there are no more coupons (`NO_MORE_COUPONS` or `CLOSED`). */
|
|
733
|
+
nextCouponDate: string | null;
|
|
734
|
+
/** `nextCouponDate` plus the bond's grace period; after this a missed coupon allows a default. `null` with it. */
|
|
735
|
+
graceEndsAt: string | null;
|
|
736
|
+
/** `true` when a coupon can be paid now (`DUE` or `GRACE_EXPIRED`). */
|
|
737
|
+
isDue: boolean;
|
|
738
|
+
/** Seconds between coupons. */
|
|
739
|
+
couponPeriodSeconds: number;
|
|
740
|
+
maturityDate: string;
|
|
741
|
+
/** Coupon paid per whole token, in cNGN, as a decimal string. */
|
|
742
|
+
couponPerToken: string;
|
|
627
743
|
}
|
|
628
|
-
|
|
744
|
+
interface ReclaimUnclaimedYieldParams {
|
|
745
|
+
tokenId: string;
|
|
746
|
+
chainId: TokenChainId;
|
|
747
|
+
/** Distribution snapshot to reclaim unclaimed funds from. A whole number, at least `1`. */
|
|
748
|
+
snapshotId: number;
|
|
749
|
+
}
|
|
750
|
+
/** Result of {@link TokenizationResource.reclaimUnclaimedYield}. */
|
|
751
|
+
interface ReclaimUnclaimedYieldResult {
|
|
752
|
+
tokenId: string;
|
|
753
|
+
/** Snapshot id, as a numeric string. */
|
|
754
|
+
snapshotId: string;
|
|
755
|
+
/** Amount reclaimed, as a decimal string. */
|
|
756
|
+
reclaimed: string;
|
|
757
|
+
operationRef: string;
|
|
758
|
+
txHash: string;
|
|
759
|
+
}
|
|
760
|
+
/** Result of {@link TokenizationResource.claimYield}. */
|
|
629
761
|
interface YieldTxResult {
|
|
762
|
+
operationRef: string;
|
|
630
763
|
txHash: string;
|
|
631
764
|
}
|
|
632
|
-
/** Result of
|
|
765
|
+
/** Result of {@link TokenizationResource.distributeYield} / {@link TokenizationResource.payCoupon}. */
|
|
633
766
|
interface YieldOperationResult {
|
|
767
|
+
tokenId: string;
|
|
634
768
|
operationRef: string;
|
|
769
|
+
transactionId: string;
|
|
635
770
|
txHash: string;
|
|
636
771
|
}
|
|
637
772
|
|
|
638
773
|
/**
|
|
639
774
|
* The Tokenization service — issues and manages tokenized real-world assets: deployment,
|
|
640
775
|
* mint/burn/transfer, wallet whitelisting, holder balances, and the yield lifecycle
|
|
641
|
-
* (rate updates, coupon payments, claims,
|
|
642
|
-
* tokens.
|
|
776
|
+
* (rate updates, coupon payments, claims, principal redemption, and reclaiming unclaimed
|
|
777
|
+
* payouts) for `YIELD_BEARING` tokens.
|
|
643
778
|
*/
|
|
644
779
|
declare class TokenizationResource extends APIResource {
|
|
645
780
|
/**
|
|
@@ -676,22 +811,49 @@ declare class TokenizationResource extends APIResource {
|
|
|
676
811
|
registerWallet(params: RegisterTokenWalletParams, overrides?: IdempotentRequestOverrides): Promise<RegisterTokenWalletResult>;
|
|
677
812
|
/** Returns the paginated list of holder wallet addresses and balances for a token on a chain. */
|
|
678
813
|
getTokenHolders(params: GetTokenHoldersParams, overrides?: RequestOverrides): Promise<Page<TokenHolder>>;
|
|
679
|
-
/** Returns a single wallet's balance of a token on a chain. */
|
|
814
|
+
/** Returns a single wallet's balance of a token on a chain, plus its cNGN (payout token) balance. */
|
|
680
815
|
getWalletBalance(params: GetWalletBalanceParams, overrides?: RequestOverrides): Promise<TokenWalletBalance>;
|
|
681
816
|
/** Fetches a single token transaction by its reference. */
|
|
682
817
|
getTokenTransaction(ref: string, overrides?: RequestOverrides): Promise<TokenTransactionRecord>;
|
|
683
818
|
/** Returns token transactions, optionally filtered by token. */
|
|
684
819
|
listTokenTransactions(params?: ListTokenTransactionsParams, overrides?: RequestOverrides): Promise<Page<TokenTransactionRecord>>;
|
|
685
|
-
/**
|
|
686
|
-
|
|
820
|
+
/**
|
|
821
|
+
* Updates the annual yield rate for a yield-bearing token. An `Idempotency-Key` is generated
|
|
822
|
+
* per call unless you pass your own.
|
|
823
|
+
*/
|
|
824
|
+
updateYield(params: UpdateTokenYieldParams, overrides?: IdempotentRequestOverrides): Promise<UpdateYieldResult>;
|
|
687
825
|
/** Funds and distributes a yield payout to holders. Unclaimed funds may be reclaimed after `reclaimAfter`. */
|
|
688
826
|
distributeYield(params: DistributeYieldParams, overrides?: IdempotentRequestOverrides): Promise<YieldOperationResult>;
|
|
689
827
|
/** Pays the scheduled coupon for a yield-bearing token. Set `pushYield` to push funds rather than let investors claim. */
|
|
690
828
|
payCoupon(params: PayCouponParams, overrides?: IdempotentRequestOverrides): Promise<YieldOperationResult>;
|
|
691
829
|
/** Claims an investor's yield for a given distribution snapshot. */
|
|
692
830
|
claimYield(params: ClaimYieldParams, overrides?: IdempotentRequestOverrides): Promise<YieldTxResult>;
|
|
693
|
-
/**
|
|
694
|
-
|
|
831
|
+
/**
|
|
832
|
+
* Returns the bond's next coupon date and where it stands on its schedule. Whether a coupon is
|
|
833
|
+
* due is decided by the chain's clock, not yours, so check `status` (or `isDue`) rather than
|
|
834
|
+
* comparing `nextCouponDate` with local time. Works for paused tokens too.
|
|
835
|
+
*
|
|
836
|
+
* ```ts
|
|
837
|
+
* const next = await client.tokenization.getNextCoupon({ tokenId, chainId: "84532" });
|
|
838
|
+
* if (next.status === "DUE") await client.tokenization.payCoupon({ tokenId, chainId: "84532", ... });
|
|
839
|
+
* ```
|
|
840
|
+
*/
|
|
841
|
+
getNextCoupon(params: GetNextCouponParams, overrides?: RequestOverrides): Promise<NextCoupon>;
|
|
842
|
+
/**
|
|
843
|
+
* Redeems principal to holders at maturity, paying from the cNGN deposited in the token contract.
|
|
844
|
+
* Issuer-held tokens are burned without a payout so the supply can reach zero and the bond close.
|
|
845
|
+
* Holders that can't be redeemed (frozen, unverified, not allowlisted) are left alone and listed in
|
|
846
|
+
* `skipped`; check `closed` to see whether the bond is done.
|
|
847
|
+
*
|
|
848
|
+
* If a run fails part-way, call it again: holders already redeemed are skipped, so it carries on
|
|
849
|
+
* where it stopped. Reusing the same `idempotencyKey` only replays the earlier response.
|
|
850
|
+
*/
|
|
851
|
+
redeemPrincipal(params: RedeemPrincipalParams, overrides?: IdempotentRequestOverrides): Promise<RedeemPrincipalResult>;
|
|
852
|
+
/**
|
|
853
|
+
* Returns a snapshot's unclaimed yield to the issuer once its `reclaimAfter` window has
|
|
854
|
+
* passed. An `Idempotency-Key` is generated per call unless you pass your own.
|
|
855
|
+
*/
|
|
856
|
+
reclaimUnclaimedYield(params: ReclaimUnclaimedYieldParams, overrides?: IdempotentRequestOverrides): Promise<ReclaimUnclaimedYieldResult>;
|
|
695
857
|
}
|
|
696
858
|
|
|
697
859
|
type SubscriptionStatus = LooseUnion<"active" | "paused" | "deleted">;
|
|
@@ -946,4 +1108,4 @@ declare function verifyIndexerWebhookSignature(options: VerifyIndexerWebhookOpti
|
|
|
946
1108
|
/** Generates a UUIDv4 suitable for use as an `Idempotency-Key` header value. */
|
|
947
1109
|
declare function generateIdempotencyKey(): string;
|
|
948
1110
|
|
|
949
|
-
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 };
|
|
1111
|
+
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 GetNextCouponParams, 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, type NextCoupon, type NextCouponStatus, NotFoundError, type OffsetPaginatedResponse, Page, type PayCouponParams, PaymentRequiredError, PermissionDeniedError, type QueryValue, RateLimitError, type ReclaimUnclaimedYieldParams, type ReclaimUnclaimedYieldResult, type RedeemPrincipalParams, type RedeemPrincipalResult, type RedemptionSkipReason, type RedemptionSkippedHolder, 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 };
|