Skip to main content

Bid on Auction

You can bid on any auction. The only thing you need is an Auction ID and the funds you want to use for your bid.

To bid on an Auction, you must call bid on dataset(Dataset.AUCTION). bid takes an object of type AuctionBidTangleRequest as parameter.

    const otrBidRequest = otr(otrAddress).dataset(Dataset.AUCTION).bid({
auction: auctionUid,
});

bid returns an oject of type OtrRequest<AuctionBidTangleRequest>.

OTR Request Deep Link

The SDK provides the helper functions getFireflyDeepLink() and getBloomDeepLink() to generate deep links for OTR requests.

With the Deeplink you can then send your bid assets for the auction.

Auction Info

If you are interested in more details about a specific auction, you can check out this how-to.

Full How-To Code

import { Dataset } from '@build-5/interfaces';
import { Build5, SoonaverseOtrAddress, otr } from '@build-5/sdk';

async function main() {
const origin = Build5.TEST;
// @ts-ignore
const otrAddress = SoonaverseOtrAddress[origin];

try {
const auctionUid = 'auction id';
const otrBidRequest = otr(otrAddress).dataset(Dataset.AUCTION).bid({
auction: auctionUid,
});
// Use this deepling to send funds and bid on the auction
console.log(otrBidRequest.getFireflyDeepLink());
} catch (error) {
console.error('Error: ', error);
}
}

main().then(() => process.exit());