ApproveErc20
Procedure to approve spending funds on an ERC20 token. If no token address is specified, it defaults to POLY
Type parameters
▪ ReturnType
Hierarchy
Procedure‹ApproveErc20ProcedureArgs›
↳ ApproveErc20
Index
Constructors
constructor
Properties
args
context
type
Methods
addProcedure
addSignatureRequest
addTransaction
prepare
prepareTransactions
Constructors
constructor
+ new ApproveErc20(args
: ApproveErc20ProcedureArgs, context
: Context): ApproveErc20
Inherited from void
Parameters:
Name
Type
args
context
Returns: ApproveErc20
Properties
Protected
args
Protected
args• args: ApproveErc20ProcedureArgs
Inherited from void
Protected
context
Protected
context• context: Context
Inherited from void
type
• type: ProcedureType = ProcedureType.ApproveErc20
Overrides void
Methods
addProcedure
▸ addProcedure<A, R>(Proc
: ProcedureClass‹A, R›): (Anonymous function)
Inherited from void
Appends a Procedure into the TransactionQueue's queue. This defines what will be run by the TransactionQueue when it is started.
Type parameters:
▪ A
▪ R: any
Parameters:
Name
Type
Description
Proc
A Procedure that will be run in the Procedure's TransactionQueue
Returns: (Anonymous function)
whichever value is returned by the Procedure
addSignatureRequest
Inherited from void
Appends a signature request into the TransactionQueue's queue. This defines what will be run by the TransactionQueue when it is started.
Type parameters:
▪ A
Parameters:
Name
Type
Description
request
A signature request that will be run in the Procedure's TransactionQueue
Returns: (Anonymous function)
a PostTransactionResolver that resolves to the signed data
addTransaction
Inherited from void
Appends a method or future method into the TransactionQueue's queue. This defines what will be run by the TransactionQueue when it is started.
Type parameters:
▪ A
▪ R: any[]
▪ V: any
Parameters:
A method (or future method) that will be run in the Procedure's TransactionQueue. A future method is a transaction that doesn't exist at prepare time (for example a transaction on a module that hasn't been attached but will be by the time the previous transactions are run)
▪Default value
__namedParameters: object= {}
Name
Type
Default
fees
-
resolvers
object
([] as unknown) as ResolverArray
tag
-
Returns: (Anonymous function)
a PostTransactionResolver that resolves to the value returned by the resolver function, or undefined if no resolver function was passed
prepare
▸ prepare(): Promise‹TransactionQueue‹Args, ReturnType››
Inherited from void
Mandatory method that builds a list of transactions that will be run
Returns: Promise‹TransactionQueue‹Args, ReturnType››
prepareTransactions
▸ prepareTransactions(): Promise‹void›
Overrides void
Approve spend of an ERC20 token by another wallet. The token in question defaults to POLY if no address is supplied
Note that if the amount has already been approved, the spending approval transaction will not be added to the queue and the procedure will return
Note that the procedure will fail if the owner's token balance is less than the amount being approved. The only exception to this is when approving a POLY spend on a testnet. If that is the case, an extra transaction will be submitted to request the missing amount of tokens from the faucet
Returns: Promise‹void›
Last updated
Was this helpful?