@celo/contractkit › "wrappers/GoldTokenWrapper" › GoldTokenWrapper
Class: GoldTokenWrapper
ERC-20 contract for Celo native currency.
Hierarchy
↳ CeloTokenWrapper‹GoldToken›
↳ GoldTokenWrapper
Index
Constructors
Properties
- allowance
- approve
- decimals
- decreaseAllowance
- eventTypes
- events
- increaseAllowance
- methodIds
- name
- symbol
- totalSupply
- transfer
- transferFrom
- transferWithComment
Accessors
Methods
Constructors
constructor
+ new GoldTokenWrapper(kit
: ContractKit, contract
: GoldToken): GoldTokenWrapper
Inherited from BaseWrapper.constructor
Defined in packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:30
Parameters:
Name | Type |
---|---|
kit |
ContractKit |
contract |
GoldToken |
Returns: GoldTokenWrapper
Properties
allowance
• allowance: function = proxyCall(this.contract.methods.allowance, undefined, valueToBigNumber)
Inherited from Erc20Wrapper.allowance
Defined in packages/sdk/contractkit/src/wrappers/Erc20Wrapper.ts:18
Querying allowance.
param
Account who has given the allowance.
param
Address of account to whom the allowance was given.
returns
Amount of allowance.
Type declaration:
▸ (...args
: InputArgs): Promise‹Output›
Parameters:
Name | Type |
---|---|
...args |
InputArgs |
approve
• approve: function = proxySend(this.kit, this.contract.methods.approve)
Inherited from Erc20Wrapper.approve
Defined in packages/sdk/contractkit/src/wrappers/Erc20Wrapper.ts:32
Approve a user to transfer the token on behalf of another user.
param
The address which is being approved to spend the token.
param
The amount of the token approved to the spender.
returns
True if the transaction succeeds.
Type declaration:
▸ (...args
: InputArgs): CeloTransactionObject‹Output›
Parameters:
Name | Type |
---|---|
...args |
InputArgs |
decimals
• decimals: function = proxyCall(this.contract.methods.decimals, undefined, valueToInt)
Inherited from CeloTokenWrapper.decimals
Defined in packages/sdk/contractkit/src/wrappers/CeloTokenWrapper.ts:29
Returns the number of decimals used in the token.
returns
Number of decimals.
Type declaration:
▸ (...args
: InputArgs): Promise‹Output›
Parameters:
Name | Type |
---|---|
...args |
InputArgs |
decreaseAllowance
• decreaseAllowance: function = proxySend(this.kit, this.contract.methods.decreaseAllowance)
Defined in packages/sdk/contractkit/src/wrappers/GoldTokenWrapper.ts:37
Decreases the allowance of another user.
param
The address which is being approved to spend CELO.
param
The decrement of the amount of CELO approved to the spender.
returns
true if success.
Type declaration:
▸ (...args
: InputArgs): CeloTransactionObject‹Output›
Parameters:
Name | Type |
---|---|
...args |
InputArgs |
eventTypes
• eventTypes: EventsEnum‹T› = Object.keys(this.events).reduce
Inherited from BaseWrapper.eventTypes
Defined in packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:61
events
• events: GoldToken["events"] = this.contract.events
Inherited from BaseWrapper.events
Defined in packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:59
increaseAllowance
• increaseAllowance: function = proxySend( this.kit, this.contract.methods.increaseAllowance, tupleParser(stringIdentity, valueToString) )
Defined in packages/sdk/contractkit/src/wrappers/GoldTokenWrapper.ts:26
Increases the allowance of another user.
param
The address which is being approved to spend CELO.
param
The increment of the amount of CELO approved to the spender.
returns
true if success.
Type declaration:
▸ (...args
: InputArgs): CeloTransactionObject‹Output›
Parameters:
Name | Type |
---|---|
...args |
InputArgs |
methodIds
• methodIds: Record‹keyof T["methods"], string› = Object.keys(this.contract.methods).reduce
acc[method] =
methodABI === undefined
? '0x'
: this.kit.connection.getAbiCoder().encodeFunctionSignature(methodABI)
return acc
},
{} as any
)
Inherited from BaseWrapper.methodIds
Defined in packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:66
name
• name: function = proxyCall(this.contract.methods.name)
Inherited from CeloTokenWrapper.name
Defined in packages/sdk/contractkit/src/wrappers/CeloTokenWrapper.ts:18
Returns the name of the token.
returns
Name of the token.
Type declaration:
▸ (...args
: InputArgs): Promise‹Output›
Parameters:
Name | Type |
---|---|
...args |
InputArgs |
symbol
• symbol: function = proxyCall(this.contract.methods.symbol)
Inherited from CeloTokenWrapper.symbol
Defined in packages/sdk/contractkit/src/wrappers/CeloTokenWrapper.ts:24
Returns the three letter symbol of the token.
returns
Symbol of the token.
Type declaration:
▸ (...args
: InputArgs): Promise‹Output›
Parameters:
Name | Type |
---|---|
...args |
InputArgs |
totalSupply
• totalSupply: function = proxyCall(this.contract.methods.totalSupply, undefined, valueToBigNumber)
Inherited from Erc20Wrapper.totalSupply
Defined in packages/sdk/contractkit/src/wrappers/Erc20Wrapper.ts:24
Returns the total supply of the token, that is, the amount of tokens currently minted.
returns
Total supply.
Type declaration:
▸ (...args
: InputArgs): Promise‹Output›
Parameters:
Name | Type |
---|---|
...args |
InputArgs |
transfer
• transfer: function = proxySend(this.kit, this.contract.methods.transfer)
Inherited from Erc20Wrapper.transfer
Defined in packages/sdk/contractkit/src/wrappers/Erc20Wrapper.ts:40
Transfers the token from one address to another.
param
The address to transfer the token to.
param
The amount of the token to transfer.
returns
True if the transaction succeeds.
Type declaration:
▸ (...args
: InputArgs): CeloTransactionObject‹Output›
Parameters:
Name | Type |
---|---|
...args |
InputArgs |
transferFrom
• transferFrom: function = proxySend(this.kit, this.contract.methods.transferFrom)
Inherited from Erc20Wrapper.transferFrom
Defined in packages/sdk/contractkit/src/wrappers/Erc20Wrapper.ts:49
Transfers the token from one address to another on behalf of a user.
param
The address to transfer the token from.
param
The address to transfer the token to.
param
The amount of the token to transfer.
returns
True if the transaction succeeds.
Type declaration:
▸ (...args
: InputArgs): CeloTransactionObject‹Output›
Parameters:
Name | Type |
---|---|
...args |
InputArgs |
transferWithComment
• transferWithComment: function = proxySend(this.kit, this.contract.methods.transferWithComment)
Inherited from CeloTokenWrapper.transferWithComment
Defined in packages/sdk/contractkit/src/wrappers/CeloTokenWrapper.ts:38
Transfers the token from one address to another with a comment.
param
The address to transfer the token to.
param
The amount of the token to transfer.
param
The transfer comment
returns
True if the transaction succeeds.
Type declaration:
▸ (...args
: InputArgs): CeloTransactionObject‹Output›
Parameters:
Name | Type |
---|---|
...args |
InputArgs |
Accessors
address
• get address(): string
Inherited from BaseWrapper.address
Defined in packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:35
Contract address
Returns: string
Methods
balanceOf
▸ balanceOf(account
: Address): Promise‹BigNumber‹››
Overrides Erc20Wrapper.balanceOf
Defined in packages/sdk/contractkit/src/wrappers/GoldTokenWrapper.ts:47
Gets the balance of the specified address.
WARNING: The actual call to the Gold contract of the balanceOf:
balanceOf = proxyCall(this.contract.methods.balanceOf, undefined, valueToBigNumber)
has issues with web3. Keep the one calling getBalance
Parameters:
Name | Type |
---|---|
account |
Address |
Returns: Promise‹BigNumber‹››
The balance of the specified address.
getPastEvents
▸ getPastEvents(event
: Events‹GoldToken›, options
: PastEventOptions): Promise‹EventLog[]›
Inherited from BaseWrapper.getPastEvents
Defined in packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:55
Contract getPastEvents
Parameters:
Name | Type |
---|---|
event |
Events‹GoldToken› |
options |
PastEventOptions |
Returns: Promise‹EventLog[]›
version
▸ version(): Promise‹NonNullable‹T["methods"] extends object ? ContractVersion<> : never››
Inherited from BaseWrapper.version
Defined in packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:39
Returns: Promise‹NonNullable‹T["methods"] extends object ? ContractVersion<> : never››