Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "smartcontract/nativevm/authContractTxBuilder"

Index

Variables

Const AUTH_CONTRACT

AUTH_CONTRACT: "0000000000000000000000000000000000000006" = "0000000000000000000000000000000000000006"

Address of auth contract.

Const contractAddress

contractAddress: Address = new Address(AUTH_CONTRACT)

Functions

makeAssignFuncsToRoleTx

  • makeAssignFuncsToRoleTx(contractAddr: Address, adminOntId: string, role: string, funcNames: string[], keyNo: number, payer: Address, gasPrice: string, gasLimit: string): Transaction
  • assign functions to role. must be called by contract's admin

    Parameters

    • contractAddr: Address

      target contract's address

    • adminOntId: string

      admin's ONT ID.This id must be registered.

    • role: string

      role name

    • funcNames: string[]

      array of function name

    • keyNo: number

      publicKey's id, use the pk to varify tx

    • payer: Address

      Address to pay for the gas.

    • gasPrice: string

      Gas price

    • gasLimit: string

      Gas limit

    Returns Transaction

makeAssignOntIdsToRoleTx

  • makeAssignOntIdsToRoleTx(contractAddr: Address, adminOntId: string, role: string, ontIds: string[], keyNo: number, payer: Address, gasPrice: string, gasLimit: string): Transaction
  • assign role to ONT IDs. must be called by contract's admin

    Parameters

    • contractAddr: Address

      target contract's address

    • adminOntId: string

      admin's ONT ID.This id must be registered.

    • role: string

      role's name

    • ontIds: string[]

      array of ONT ID

    • keyNo: number

      admin's pk id.use to varify tx.

    • payer: Address

      Address to pay for the gas.

    • gasPrice: string

      Gas price

    • gasLimit: string

      Gas limit

    Returns Transaction

makeDelegateRoleTx

  • makeDelegateRoleTx(contractAddr: Address, from: string, to: string, role: string, period: number, level?: number, keyNo: number, payer: Address, gasPrice: string, gasLimit: string): Transaction
  • delegate role to others. Can't delegate repeatedly。

    Parameters

    • contractAddr: Address

      target contract's address

    • from: string

      ONT ID of user that wants to delegate role.This id must be registered.

    • to: string

      ONT ID of user that will receive role.This id must be registered.

    • role: string

      role name

    • period: number

      time of delegate period in second

    • Default value level: number = 1

      = 1 for now.

    • keyNo: number

      The number of user's publick in the DDO.

    • payer: Address

      Address to pay for the gas.

    • gasPrice: string

      Gas price

    • gasLimit: string

      Gas limit

    Returns Transaction

makeInitContractAdminTx

  • makeInitContractAdminTx(adminOntId: string, payer: Address, gasPrice: string, gasLimit: string): Transaction

makeTransferAuthTx

  • makeTransferAuthTx(contractAddr: Address, newAdminOntid: string, keyNo: number, payer: Address, gasPrice: string, gasLimit: string): Transaction
  • Transfer the authority to new admin

    Parameters

    • contractAddr: Address

      Uer's contract address

    • newAdminOntid: string

      New admin's ONT ID. This id must be registered.

    • keyNo: number

      Original admin's public key id. Use this pk to varify tx.

    • payer: Address

      Address to pay for the gas.

    • gasPrice: string

      Gas price

    • gasLimit: string

      Gas limit

    Returns Transaction

makeVerifyTokenTx

  • makeVerifyTokenTx(contractAddr: Address, callerOntId: string, funcName: string, keyNo: number, payer: Address, gasPrice: string, gasLimit: string): Transaction
  • verify the user's token of target contract

    Parameters

    • contractAddr: Address

      user's target contract address

    • callerOntId: string

      caller's ONT ID.This id must be registered.

    • funcName: string

      the function to call

    • keyNo: number

      publicKey's id, use this pk to varify tx

    • payer: Address

      Address to pay for the gas.

    • gasPrice: string

      Gas price

    • gasLimit: string

      Gas limit

    Returns Transaction

makeWithdrawRoleTx

  • makeWithdrawRoleTx(contractAddr: Address, initiator: string, delegate: string, role: string, keyNo: number, payer: Address, gasPrice: string, gasLimit: string): Transaction
  • role's owner can withdraw the delegate in advance

    Parameters

    • contractAddr: Address

      target contract's address

    • initiator: string

      ONT ID of role's owner.This id must be registered.

    • delegate: string

      ONT ID of role's agent.This id must be registered.

    • role: string

      role's name

    • keyNo: number

      The number of user's public key in the DDO

    • payer: Address

      Address to pay for the gas.

    • gasPrice: string

      Gas price

    • gasLimit: string

      Gas limit

    Returns Transaction

Generated using TypeDoc