CrabblePitch / crabble-ui

Web UI for Crabble Protocol
0 stars 2 forks source link

Borrow - AdHoc #2

Closed anilhelvaci closed 9 months ago

anilhelvaci commented 10 months ago

We need another dialog to let the borrowers do an adHoc borrowing. This dialog should open when the borrower clicks a rental that is on the Catalog page. Here's the required spendAction data:

const spendAction = {
        method: 'executeOffer',
        offer: {
            id: 'borrow-ad-hoc',
            invitationSpec: {
                source: 'agoricContract',
                instancePath: ['Crabble'],
                callPipe: [
                    ['getRentalByHandle', [rentalHandles[0]]], // Borrower wants to rent the first rental
                    ['makeBuyOutInvitation']
                ]
            },
            proposal: {
                give: {
                    Collateral: collateralAmount,
                    RentalFee: rentalFeeAmount
                },
                want: {
                    Utility: utilityAmount,
                }
            },
            offerArgs: {
                rentingDuration: config.rentingDuration,
            }
        },
    };
anilhelvaci commented 10 months ago

Name of the related wireframe in balsamic: Borrow - AdHoc cc @GrigoriGrigoryanBytepitch