export type Signature = {
data: object
signature: { v: number; r: string; s: string; deadline: number }
}
/* data object
interface SignBuyNow {
asset: SignAsset;
assetLtv: BigInt;
assetLiquidationThreshold: BigInt;
from: string;
to: string;
data: string;
value: BigInt;
marketAdapter: string;
marketApproval: string;
marketPrice: BigInt;
underlyingAsset: string;
nonce: BigInt;
deadline: BigInt;
}
interface SignLoanConfig {
loanId: string;
aggLoanPrice: BigInt;
aggLtv: BigInt;
aggLiquidationThreshold: BigInt;
totalAssets: BigInt;
nonce: BigInt;
deadline: BigInt;
}
*/
export type ClientOptions = {
network?: Chain
}
export type Chain = 'mainnet' | 'sepolia' | 'localhost'
export const buy = async (
amount: string,
signature: Signature,
options?: ClientOptions
)
const result = await buy(amount, signature, options?);