This is a brief workflow of creating a Pawn Plan. A Pawn is a shorthand name for "NFT Loans" on the Cyan Dapp.

To add the Cyan's Pawn feature to your application, follow these few steps.

  1. Pricer Step 1
  2. Pricer Step 2
  3. Get Approval
  4. Create Pawn plans
  5. Make a payment

1. Pricer Step 1

The Pawn Pricer takes a currency address and an array of NFT items as input, and returns a set of potential loan options.

📘

Pricer Step 1

For further details and implementation specifics, please refer to Pricer Step 1.

2. Pricer Step 2

After the user selects a loan option from the first step, they should pass the chosen option to Pricer Step 2 to obtain the necessary data for creating a Pawn Plan.

📘

Pricer Step 2

For further details and implementation specifics, please refer to Pricer Step 2.

3. Get Approval

Before creating a Pawn Plan, getting Approval is required. This is done by calling the getApproval method.

const approval = await cyan.getApproval(
	'0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d', // Collection address
	'3758', // Token ID
  1, // Item Type
);

🚧

Terms & Conditions

When your users initiate a deal on Cyan, they automatically agree to the Terms & Conditions of Cyan. We have an optional signable step you may elect to implement on your front end to make it clear to the user what happens if they miss a payment.

4. Create Pawn Plans

Finally, to create a Pawn plan, call the createPawns method with returned data from the second step of the pricer.

const plans = [...]; // Array of the successfully priced plans from step 2
const result = await cyan.createPawns(plans);

5. Make a payment

To make the next payment in a created Pawn Plan, please follow the steps in Plans.