gondi 0.46.0 → 0.48.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.
@@ -51,16 +51,33 @@ interface GondiProps {
51
51
  */
52
52
  skipFlaggedNftCheck?: boolean;
53
53
  }
54
- type Step = {
55
- type: 'signature';
56
- primaryType: string;
57
- status: 'waiting' | 'success';
58
- } | {
54
+ /** Fields every transaction step carries, whatever its status. */
55
+ type TransactionStepBase = {
59
56
  type: 'transaction';
60
- status: 'waiting' | 'broadcasted' | 'success';
61
57
  to: Address;
62
58
  functionNameOrSelector: string;
59
+ /** Chain the wallet used to submit this transaction. */
60
+ chainId?: number;
61
+ };
62
+ /** A transaction step; narrowing on `status` tells which hashes it carries. */
63
+ type TransactionStep = TransactionStepBase & ({
64
+ status: 'waiting';
65
+ } | {
66
+ status: 'broadcasted';
67
+ /** Hash the wallet broadcast. */
68
+ transactionHash: Hash;
63
69
  } | {
70
+ status: 'success';
71
+ /** Hash of the mined receipt: a replacement's when the provider reports one. */
72
+ transactionHash: Hash;
73
+ /** Hash the wallet broadcast; equals `transactionHash` unless it was replaced. */
74
+ originalTransactionHash: Hash;
75
+ });
76
+ type Step = {
77
+ type: 'signature';
78
+ primaryType: string;
79
+ status: 'waiting' | 'success';
80
+ } | TransactionStep | {
64
81
  type: 'api';
65
82
  status: 'waiting' | 'success';
66
83
  mutationName: string;
@@ -743,6 +760,10 @@ export declare class Gondi {
743
760
  * @param props.publication Optional unsigned admission metadata. Previews before
744
761
  * signing and throws the backend rejection reason. Identical retries after failed
745
762
  * saves reuse both signatures; a successful save clears the pending payloads.
763
+ * @param props.private Shows the offer only to the loan's borrower and to the lender.
764
+ * The API accepts it only for a principal worth at least the private minimum in USD
765
+ * ($50k). It is not part of the signed struct. With `withFallbackOffer`, the fallback
766
+ * is signed for `props.borrowerAddress`, the loan's borrower, so it stays private too.
746
767
  */
747
768
  makeRefinanceOffer({ renegotiation, contractAddress, publication, ...props }: MakeRefinanceOfferProps): Promise<{
748
769
  id: string;
@@ -761,6 +782,7 @@ export declare class Gondi {
761
782
  offerHash: import("./generated/graphql").Scalars["Hash"];
762
783
  feeAmount: import("./generated/graphql").Scalars["BigInt"];
763
784
  isAddNewTranche?: import("./generated/graphql").InputMaybe<import("./generated/graphql").Scalars["Boolean"]> | undefined;
785
+ private?: import("./generated/graphql").Scalars["Boolean"] | undefined;
764
786
  signature: import("./blockchain").Signature;
765
787
  } | {
766
788
  offerHash: `0x${string}`;
@@ -3789,18 +3811,31 @@ type MakeRefinanceOfferProps = {
3789
3811
  principalAddress?: never;
3790
3812
  nftId?: never;
3791
3813
  maxSeniorRepayment?: never;
3814
+ private?: boolean;
3792
3815
  } | {
3793
3816
  skipSignature: true;
3794
3817
  withFallbackOffer?: never;
3795
3818
  principalAddress?: never;
3796
3819
  nftId?: never;
3797
3820
  maxSeniorRepayment?: never;
3821
+ private?: boolean;
3798
3822
  } | {
3799
3823
  skipSignature?: never;
3800
3824
  withFallbackOffer: true;
3801
3825
  principalAddress: Address;
3802
3826
  nftId: number;
3803
3827
  maxSeniorRepayment?: bigint;
3828
+ private?: false;
3829
+ borrowerAddress?: never;
3830
+ } | {
3831
+ skipSignature?: never;
3832
+ withFallbackOffer: true;
3833
+ principalAddress: Address;
3834
+ nftId: number;
3835
+ maxSeniorRepayment?: bigint;
3836
+ private: true;
3837
+ /** The loan's borrower: the private fallback is signed for this address only. */
3838
+ borrowerAddress: Address;
3804
3839
  });
3805
3840
  export type CreateVaultNfts = {
3806
3841
  collection: Address;
@@ -22,6 +22,7 @@ export declare const renegotiationToMslRenegotiation: (renegotiation: model.Rene
22
22
  offerHash: import("../generated/graphql").Scalars["Hash"];
23
23
  feeAmount: import("../generated/graphql").Scalars["BigInt"];
24
24
  isAddNewTranche?: import("../generated/graphql").InputMaybe<import("../generated/graphql").Scalars["Boolean"]> | undefined;
25
+ private?: import("../generated/graphql").Scalars["Boolean"] | undefined;
25
26
  signature: import("../blockchain").Signature;
26
27
  };
27
28
  export type LoanToMslLoanType = Optional<LoanV4, 'nftCollateralAddress'> | Optional<LoanV5, 'nftCollateralAddress'> | Optional<LoanV6, 'nftCollateralAddress'>;