Borrowing Assets

import { UnlockdSDK } from '@unlockd/sdk';

const unlockd = new UnlockdSDK();

async function borrowAssets() {
  try {
    const token = await unlockd.authenticate();
    const amount = 1000000000000000000; // 1 ETH in wei
    const assets = [
      {
        collection: '0x1234567890123456789012345678901234567890',
        tokenId: '1',
      },
    ];
    const signature = {
      v: 28,
      r: '0x1234567890123456789012345678901234567890123456789012345678901234',
      s: '0x1234567890123456789012345678901234567890123456789012345678901234',
      deadline: 1649327432,
    };
    const result = await unlockd.action.borrow(token, amount, assets, signature);
    console.log('Borrow successful:', result);
  } catch (error) {
    console.error('Error:', error);
  }
}

borrowAssets();

Last updated