Is your feature request related to a problem? Please describe.
The current version for callContractMethod allows only SIGNA to be sent. If calls depend on sent tokens, this method cannot be used yet. Allowing token transfers to contract in combination with methods would simplify the usage
Describe the solution you'd like
Add optional assetId and quantity for as calling parameters
Describe alternatives you've considered
Current way to do is like this:
// generate the arguments string
const methodCall = generateMethodCall({
methodHash: "99",
methodArgs: [airdropTokenId],
});
// mount as attachment
const attachment = new AttachmentMessage({
message: methodCall,
messageIsText: false,
});
// use transferAsset method
const { unsignedTransactionBytes } = await ledger.asset.transferAsset({
assetId: contractData.getPledgeTokenId(),
quantity: quantity.getAtomic(),
recipientId: this.contractId,
amountPlanck: contractData.getActivationAmount().getPlanck(),
feePlanck: fees.cheap.toString(10),
senderPublicKey: this.getAccount().getPublicKey(),
attachment,
});
desired would be:
const { unsignedTransactionBytes } =
await ledger.contract.callContractMethod({
methodHash: "99",
methodArgs: [],
contractId: this.contractId,
assetId: contractData.getPledgeTokenId(),
assetQuantity: quantity.getAtomic(),
amountPlanck: contractData.getActivationAmount().getPlanck(),
feePlanck: fees.cheap.toString(10),
senderPublicKey: this.getAccount().getPublicKey(),
});
Is your feature request related to a problem? Please describe.
The current version for
callContractMethodallows only SIGNA to be sent. If calls depend on sent tokens, this method cannot be used yet. Allowing token transfers to contract in combination with methods would simplify the usageDescribe the solution you'd like
Add optional
assetIdandquantityfor as calling parametersDescribe alternatives you've considered
Current way to do is like this:
desired would be: