Skip to content

Commit

Permalink
remove amount from Auction bid
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Sramko committed Aug 31, 2021
1 parent f120298 commit e534a0d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tatumio/tatum",
"version": "1.23.3",
"version": "1.23.4",
"description": "Tatum API client allows browsers and Node.js clients to interact with Tatum API.",
"main": "dist/src/index.js",
"repository": "https://github.com/tatumio/tatum-js",
Expand Down
5 changes: 0 additions & 5 deletions src/model/request/InvokeAuctionOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ export class InvokeAuctionOperation extends PrivateKeyOrSignatureId {
@Matches(/^[+]?((\d+(\.\d*)?)|(\.\d+))$/)
public bidValue: string;

@IsOptional()
@IsNumberString()
@Matches(/^[+]?((\d+(\.\d*)?)|(\.\d+))$/)
public amount?: string;

@IsOptional()
@Min(0)
public nonce?: number;
Expand Down
3 changes: 0 additions & 3 deletions src/nft/marketplace/auction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ describe('Auction tests', () => {
bid.contractAddress = '0x57929da44de20959b604238d4d50d15d1a24ea43';
bid.id = tokenId;
bid.bidValue = '0.001015';
bid.amount = '0.001015';
bid.feeCurrency = Currency.CELO;
bid.chain = Currency.CELO;
console.log(await sendAuctionBid(true, bid, 'https://alfajores-forno.celo-testnet.org'));
Expand Down Expand Up @@ -219,7 +218,6 @@ describe('Auction tests', () => {
bid.contractAddress = '0x568bf1e6849e250f4705347a9cff717b5dcfc4ad';
bid.id = tokenId;
bid.bidValue = '0.001015';
bid.amount = '0.001015';
bid.chain = Currency.BSC;
console.log(await sendAuctionBid(true, bid, 'https://data-seed-prebsc-2-s1.binance.org:8545'));

Expand Down Expand Up @@ -304,7 +302,6 @@ describe('Auction tests', () => {
bid.contractAddress = '0x7a2cc5a4788a15d5705b1d31e0ff5cfc4465d073';
bid.id = tokenId;
bid.bidValue = '0.001015';
bid.amount = '0.001015';
bid.chain = Currency.MATIC;
console.log(await sendAuctionBid(true, bid, 'https://rpc-mumbai.maticvigil.com'));

Expand Down
5 changes: 4 additions & 1 deletion src/nft/marketplace/auction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,16 @@ export const prepareAuctionBid = async (testnet: boolean, body: InvokeAuctionOpe
// @ts-ignore
const a = await (new web3.eth.Contract(auction.abi, body.contractAddress)).methods.getAuction(body.id).call();
let decimals = 18;
const b: any = {...body};
if (a[6] !== '0x0000000000000000000000000000000000000000') {
// @ts-ignore
decimals = await getErc20Decimals(testnet, body.chain, a[6], provider);
} else {
b.amount = body.bidValue;
}

const params = [body.id, `0x${new BigNumber(body.bidValue).multipliedBy(new BigNumber(10).pow(decimals)).toString(16)}`,];
return await helperPrepareSCCall(testnet, body, InvokeAuctionOperation, 'bid', params, undefined, provider, auction.abi);
return await helperPrepareSCCall(testnet, b, InvokeAuctionOperation, 'bid', params, undefined, provider, auction.abi);
};

/**
Expand Down

0 comments on commit e534a0d

Please sign in to comment.