Itheum / sdk-mx-data-nft

TypeScript/JavaScript SDK for Itheum's Data NFT Technology on MultiversX Blockchain
https://itheum.github.io/sdk-mx-data-nft/
GNU General Public License v3.0
458 stars 3 forks source link

Update mint method & Implement bond contract #99

Closed bucurdavid closed 6 months ago

bucurdavid commented 6 months ago

Currently there are some methods that are not implemented and all methods should be implemented, based on the endpoints in the contract. e.g Contract endpoint

#[endpoint(setWithdrawPenalty)]
    fn set_withdraw_penalty(&self, penalty: u64) {
    }

e.g SDK Transaction method builder

setWithdrawPenalty(senderAddress: IAddress, penalty: number) {
    throw new Error('Not implemented');
  }

should be

setWithdrawPenalty(senderAddress: IAddress, penalty: number) {
const tx = new Transaction({
      value: 0,
      data: new ContractCallPayloadBuilder()
          .setFunction('setWithdrawPenalty')
        .addArg(new U64Value(penalty))
        .build(),
      receiver: this.contract.getAddress(),
      sender: senderAddress,
      gasLimit: 20_000_000,
      chainID: this.chainID
    });
    return tx; 
 }

CC: @911-Benedek-RobertGeorge

damienen commented 6 months ago

Done. Closing