gondi 0.48.0 → 0.49.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/dist/index.mjs +50 -50
- package/dist/index.mjs.map +4 -4
- package/dist/src/clients/contracts/MslV5.d.ts +3 -1
- package/dist/src/clients/contracts/MslV6.d.ts +2 -1
- package/dist/src/gondi.d.ts +8 -2
- package/dist/src/index.d.ts +1 -0
- package/dist/src/utils/delegation.d.ts +21 -0
- package/dist/tests/utils/gondiStub.d.ts +36 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { LoanV5, OfferV5, RenegotiationV5, SignableRepaymentDataV5 } from '../..
|
|
|
3
3
|
import { Wallet } from '../../clients/contracts';
|
|
4
4
|
import { multiSourceLoanABI as multiSourceLoanABIV5 } from '../../generated/blockchain/v5';
|
|
5
5
|
import { EmitLoanArgs } from '../../gondi';
|
|
6
|
+
import { LoanDelegation } from '../../utils/delegation';
|
|
6
7
|
import { BaseContract } from './BaseContract';
|
|
7
8
|
import { MslV6 } from './MslV6';
|
|
8
9
|
type RepayArgs = {
|
|
@@ -205,8 +206,9 @@ export declare class MslV5 extends BaseContract<typeof multiSourceLoanABIV5> {
|
|
|
205
206
|
offerId: string;
|
|
206
207
|
}>;
|
|
207
208
|
}>;
|
|
209
|
+
/** This version's `revokeDelegate` takes no rights, so each delegate is revoked once. */
|
|
208
210
|
revokeDelegationsAndEmitLoan({ delegations, emit, }: {
|
|
209
|
-
delegations:
|
|
211
|
+
delegations: readonly LoanDelegation[];
|
|
210
212
|
emit: EmitLoanArgs;
|
|
211
213
|
}): Promise<{
|
|
212
214
|
txHash: `0x${string}`;
|
|
@@ -5,6 +5,7 @@ import { multiSourceLoanAbi as multiSourceLoanAbiV6 } from '../../generated/bloc
|
|
|
5
5
|
import { multiSourceLoanAbi as multiSourceLoanAbiV7 } from '../../generated/blockchain/v7';
|
|
6
6
|
import { multiSourceLoanAbi as multiSourceLoanAbiV8 } from '../../generated/blockchain/v8';
|
|
7
7
|
import { EmitLoanArgs } from '../../gondi';
|
|
8
|
+
import { LoanDelegation } from '../../utils/delegation';
|
|
8
9
|
import { LoanToMslLoanType } from '../../utils/loan';
|
|
9
10
|
import { BaseContract } from './BaseContract';
|
|
10
11
|
type RepayArgs = {
|
|
@@ -9250,7 +9251,7 @@ export declare class MslV6 extends BaseContract<typeof multiSourceLoanAbiV6 | ty
|
|
|
9250
9251
|
}>;
|
|
9251
9252
|
}>;
|
|
9252
9253
|
revokeDelegationsAndEmitLoan({ delegations, emit, }: {
|
|
9253
|
-
delegations:
|
|
9254
|
+
delegations: readonly LoanDelegation[];
|
|
9254
9255
|
emit: EmitLoanArgs;
|
|
9255
9256
|
}): Promise<{
|
|
9256
9257
|
txHash: `0x${string}`;
|
package/dist/src/gondi.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import * as model from './model';
|
|
|
10
10
|
import { NftStandard } from './model';
|
|
11
11
|
import { BuyWithLoanInput, BuyWithLoanQuote } from './utils/buyWithLoan';
|
|
12
12
|
import { CreditPurchaseInput, CreditPurchaseQuote } from './utils/creditPurchase';
|
|
13
|
+
import { LoanDelegation } from './utils/delegation';
|
|
13
14
|
import { LoanToMslLoanType } from './utils/loan';
|
|
14
15
|
import { OptionalNullable } from './utils/types';
|
|
15
16
|
/** An offer any NFT of a set, a collection or the NFTs carrying some traits, can borrow against. */
|
|
@@ -2915,10 +2916,15 @@ export declare class Gondi {
|
|
|
2915
2916
|
}>;
|
|
2916
2917
|
/**
|
|
2917
2918
|
* RevokeDelegationsAndEmitLoan should be used when token has been delegated without being revoked,
|
|
2918
|
-
* and a new loan wants to be emitted, erasing the delegations provided as argument
|
|
2919
|
+
* and a new loan wants to be emitted, erasing the delegations provided as argument in the same
|
|
2920
|
+
* transaction as the emit.
|
|
2921
|
+
*
|
|
2922
|
+
* @param delegations The token's delegations, as the API's `Delegation.delegateTo` and
|
|
2923
|
+
* `Delegation.rights` report them: each `{ to, rights }` is revoked with every rights value it
|
|
2924
|
+
* lists, and a bare address with the full-rights `zeroHash`.
|
|
2919
2925
|
*/
|
|
2920
2926
|
revokeDelegationsAndEmitLoan({ delegations, emit, }: {
|
|
2921
|
-
delegations:
|
|
2927
|
+
delegations: readonly LoanDelegation[];
|
|
2922
2928
|
emit: Parameters<Gondi['emitLoan']>[0];
|
|
2923
2929
|
}): Promise<{
|
|
2924
2930
|
txHash: `0x${string}`;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export type { OnStepChange } from './gondi';
|
|
|
5
5
|
export type { CreditPurchaseInput, CreditPurchaseQuote } from './utils/creditPurchase';
|
|
6
6
|
export type { CrossCurrencyRenegotiationInput, CrossCurrencyRenegotiationQuote, } from './clients/contracts/CrossCurrencyRenegotiation';
|
|
7
7
|
export type * as Types from './model';
|
|
8
|
+
export type { LoanDelegation } from './utils/delegation';
|
|
8
9
|
export { FULFILLED, REJECTED } from './utils/promises';
|
|
9
10
|
export type { BuyWithLoanInput, BuyWithLoanQuote } from './utils/buyWithLoan';
|
|
10
11
|
export type { LoanOfferPublicationInput } from './generated/graphql';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Address, Hash } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* A delegation the loan contract holds for a token: its delegate and every rights value enabled
|
|
4
|
+
* for it, as the API's `Delegation.delegateTo` and `Delegation.rights` report them. A bare address
|
|
5
|
+
* stands for the delegate's full-rights (`zeroHash`) delegation.
|
|
6
|
+
*/
|
|
7
|
+
export type LoanDelegation = Address | {
|
|
8
|
+
to: Address;
|
|
9
|
+
rights: readonly Hash[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* One `revokeDelegate` call per (delegate, rights) pair of `delegations`.
|
|
13
|
+
*
|
|
14
|
+
* IMPLEMENTATION NOTE: the delegate.xyz registry keys each delegation by its rights, so a
|
|
15
|
+
* revocation names the exact value it removes, and revoking one that was never enabled is a no-op
|
|
16
|
+
* (https://docs.delegate.xyz/technical-documentation/delegate-registry/idelegateregistry.sol).
|
|
17
|
+
*/
|
|
18
|
+
export declare const delegationRevocations: (delegations: readonly LoanDelegation[]) => {
|
|
19
|
+
to: `0x${string}`;
|
|
20
|
+
rights: `0x${string}`;
|
|
21
|
+
}[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const SINGLE_NFT_OFFER_HASH: {
|
|
2
|
+
offer: {
|
|
3
|
+
offerHash: "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
4
|
+
offerId: bigint;
|
|
5
|
+
validators: never[];
|
|
6
|
+
fee: bigint;
|
|
7
|
+
collateralAddress: "0x0000000000000000000000000000000000000000";
|
|
8
|
+
nft: {
|
|
9
|
+
tokenId: bigint;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const RENEGOTIATION_OFFER_HASH: {
|
|
14
|
+
offer: {
|
|
15
|
+
renegotiationId: bigint;
|
|
16
|
+
offerHash: "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
17
|
+
loanId: bigint;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const RENEGOTIATION: {
|
|
21
|
+
loanId: string;
|
|
22
|
+
principalAmount: bigint;
|
|
23
|
+
feeAmount: bigint;
|
|
24
|
+
aprBps: bigint;
|
|
25
|
+
duration: bigint;
|
|
26
|
+
expirationTime: bigint;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Builds a `Gondi` without running its constructor: empty pending-publication
|
|
30
|
+
* maps, a zero-address account and wallet, plus the test's own `contracts` and
|
|
31
|
+
* `apiClient` stubs.
|
|
32
|
+
*/
|
|
33
|
+
export declare const gondiWith: (overrides: {
|
|
34
|
+
contracts: object;
|
|
35
|
+
apiClient: object;
|
|
36
|
+
}) => any;
|