updateSetting

Create an unsigned transaction to update the consumeUserResourcePercent parameter of a smart contract

Usage

visionWeb.transactionBuilder.updateSetting(
  contractAddress,
  consumeUserResourcePercent,
  ownerAddress,
  options
);

Parameters

ParameterDescriptionTypeDefault
contractAddressSmart Contract address.string-
consumeUserResourcePercentThe percentage of smart contract execution fee paid for by smart contract user. Also known as User Pay Ratio.number-
ownerAddressSmart contract creator's address.stringLogin accoutn address
optionsDescriptions are belowobject.-

options parameters

ParameterDescriptionTypeDefault
permissionIdPermission id for multi-signature use.number-

Returns

Object.

Example

visionWeb.transactionBuilder.updateSetting("46f151d2b560d0f0a983cdbfc85fff392bb8874258",20);
> {
  result: { result: true },
  transaction: {
    visible: false,
    txID: '14cf36a1d5ac266381077badbbd5c2f236e85ff3747d668bed8a6ac3162a031f',
    raw_data: {
      contract: [Array],
      ref_block_bytes: 'e410',
      ref_block_hash: '69d60a0a02794def',
      expiration: 1608476262000,
      fee_limit: 20000000,
      timestamp: 1608476203137
    },
    raw_data_hex: '0a02e410220869d60a0a02794def40f0fc9f85e82e5a8e01081f1289010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412540a1541401a8da8a7fc86f0087f8c62e630d10df10a963b121541e032de6da4f2afa69ddcc4ada40f782c7b0f019e22242e1a7d4d00000000000000000000000000000000000000000000000000000000000000647081b19c85e82e900180dac409'
  }
}