Skip to content

Commit

Permalink
feat: optional lockPeriod on sft mint
Browse files Browse the repository at this point in the history
  • Loading branch information
damienen committed Mar 4, 2024
2 parents 107d9b2 + fb9514d commit d69995a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itheum/sdk-mx-data-nft",
"version": "2.7.0-beta.5",
"version": "2.7.0-beta.6",
"description": "SDK for Itheum's Data NFT Technology on MultiversX Blockchain",
"main": "out/index.js",
"types": "out/index.d.js",
Expand Down
7 changes: 6 additions & 1 deletion src/abis/datanftmint.abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"type": "bytes"
},
{
"name": "lock_period",
"name": "lock_period_sec",
"type": "u64"
}
],
Expand Down Expand Up @@ -921,6 +921,11 @@
"name": "price",
"type": "BigUint",
"indexed": true
},
{
"name": "bond_amount",
"type": "BigUint",
"indexed": true
}
]
},
Expand Down
12 changes: 7 additions & 5 deletions src/sft-minter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ export class SftMinter extends Minter {
supply: number,
datasetTitle: string,
datasetDescription: string,
lockPeriod: number,
amountToSend: number,
lockPeriod?: number,
options?: {
imageUrl?: string;
traitsUrl?: string;
Expand Down Expand Up @@ -363,12 +363,14 @@ export class SftMinter extends Minter {
.addArg(new U64Value(royalties))
.addArg(new U64Value(supply))
.addArg(new StringValue(datasetTitle))
.addArg(new StringValue(datasetDescription))
.addArg(new U64Value(lockPeriod))
.build();
.addArg(new StringValue(datasetDescription));

if (lockPeriod) {
data.addArg(new U64Value(lockPeriod));
}

const mintTx = new Transaction({
data,
data: data.build(),
sender: senderAddress,
receiver: this.contract.getAddress(),
gasLimit: 80_000_000,
Expand Down

0 comments on commit d69995a

Please sign in to comment.