@celo/contractkit › "wrappers/StableTokenWrapper" › StableTokenWrapper
Class: StableTokenWrapper
Stable token with variable supply
Hierarchy
↳ CeloTokenWrapper‹StableToken›
↳ StableTokenWrapper
Index
Constructors
Properties
- allowance
- approve
- balanceOf
- burn
- decimals
- decreaseAllowance
- eventTypes
- events
- increaseAllowance
- methodIds
- mint
- name
- owner
- setInflationParameters
- symbol
- totalSupply
- transfer
- transferFrom
- transferWithComment
- unitsToValue
- valueToUnits
Accessors
Methods
Constructors
constructor
+ new StableTokenWrapper(kit
: ContractKit, contract
: StableToken): StableTokenWrapper
Inherited from BaseWrapper.constructor
Defined in packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:30
Parameters:
Name | Type |
---|---|
kit |
ContractKit |
contract |
StableToken |
Returns: StableTokenWrapper
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 |
balanceOf
• balanceOf: function = proxyCall( this.contract.methods.balanceOf, undefined, valueToBigNumber )
Inherited from Erc20Wrapper.balanceOf
Defined in packages/sdk/contractkit/src/wrappers/Erc20Wrapper.ts:56
Gets the balance of the specified address.
param
The address to query the balance of.
returns
The balance of the specified address.
Type declaration:
▸ (owner
: string): Promise‹BigNumber›
Parameters:
Name | Type |
---|---|
owner |
string |
burn
• burn: function = proxySend(this.kit, this.contract.methods.burn)
Defined in packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:83
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/StableTokenWrapper.ts:81
Decreases the allowance of another user.
param
The address which is being approved to spend StableToken.
param
The decrement of the amount of StableToken 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: StableToken["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/StableTokenWrapper.ts:70
Increases the allowance of another user.
param
The address which is being approved to spend StableToken.
param
The increment of the amount of StableToken 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
mint
• mint: function = proxySend(this.kit, this.contract.methods.mint)
Defined in packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:82
Type declaration:
▸ (...args
: InputArgs): CeloTransactionObject‹Output›
Parameters:
Name | Type |
---|---|
...args |
InputArgs |
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 |
owner
• owner: function = proxyCall(this.contract.methods.owner)
Defined in packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:38
Returns the address of the owner of the contract.
returns
the address of the owner of the contract.
Type declaration:
▸ (...args
: InputArgs): Promise‹Output›
Parameters:
Name | Type |
---|---|
...args |
InputArgs |
setInflationParameters
• setInflationParameters: function = proxySend(this.kit, this.contract.methods.setInflationParameters)
Defined in packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:85
Type declaration:
▸ (...args
: InputArgs): CeloTransactionObject‹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 |
unitsToValue
• unitsToValue: function = proxyCall( this.contract.methods.unitsToValue, tupleParser(valueToString), valueToBigNumber )
Defined in packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:58
Returns the value of a given number of units given the current inflation factor.
param
The units to convert to value.
returns
The value corresponding to units
given the current inflation factor.
Type declaration:
▸ (units
: BigNumber.Value): Promise‹BigNumber›
Parameters:
Name | Type |
---|---|
units |
BigNumber.Value |
valueToUnits
• valueToUnits: function = proxyCall( this.contract.methods.valueToUnits, tupleParser(valueToString), valueToBigNumber )
Defined in packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:47
Returns the units for a given value given the current inflation factor.
param
The value to convert to units.
returns
The units corresponding to value
given the current inflation factor.
dev
We don't compute the updated inflationFactor here because
we assume any function calling this will have updated the inflation factor.
Type declaration:
▸ (value
: BigNumber.Value): Promise‹BigNumber›
Parameters:
Name | Type |
---|---|
value |
BigNumber.Value |
Accessors
address
• get address(): string
Inherited from BaseWrapper.address
Defined in packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:35
Contract address
Returns: string
Methods
getConfig
▸ getConfig(): Promise‹StableTokenConfig›
Defined in packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:104
Returns current configuration parameters.
Returns: Promise‹StableTokenConfig›
getHumanReadableConfig
▸ getHumanReadableConfig(): Promise‹object›
Defined in packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:123
dev
Returns human readable configuration of the stabletoken contract
Returns: Promise‹object›
StableTokenConfig object
getInflationParameters
▸ getInflationParameters(): Promise‹InflationParameters›
Defined in packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:91
Querying the inflation parameters.
Returns: Promise‹InflationParameters›
Inflation rate, inflation factor, inflation update period and the last time factor was updated.
getPastEvents
▸ getPastEvents(event
: Events‹StableToken›, 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‹StableToken› |
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››