Implementation of the Ethereum TBTC v2 token handle.
See
for reference.
-
EthersContractHandle
<TBTCTypechain
>↳
EthereumTBTCToken
- buildBridgeRequestRedemptionData
- buildRequestRedemptionData
- getAddress
- getChainIdentifier
- getEvents
- requestRedemption
- totalSupply
• new EthereumTBTCToken(config
, deploymentType?
): EthereumTBTCToken
Name | Type | Default value |
---|---|---|
config |
EthereumContractConfig |
undefined |
deploymentType |
"local" | "goerli" | "sepolia" | "mainnet" |
"local" |
EthersContractHandle<TBTCTypechain>.constructor
src/lib/ethereum/tbtc-token.ts:27
• Protected
Readonly
_deployedAtBlockNumber: number
Number of a block within which the contract was deployed. Value is read from the contract deployment artifact. It can be overwritten by setting a EthersContractConfig.deployedAtBlockNumber property.
EthersContractHandle._deployedAtBlockNumber
src/lib/ethereum/adapter.ts:80
• Protected
Readonly
_instance: TBTC
Ethers instance of the deployed contract.
EthersContractHandle._instance
src/lib/ethereum/adapter.ts:74
• Protected
Readonly
_totalRetryAttempts: number
Number of retries for ethereum requests.
EthersContractHandle._totalRetryAttempts
src/lib/ethereum/adapter.ts:84
▸ buildBridgeRequestRedemptionData(walletPublicKey
, mainUtxo
, redeemerOutputScript
): Object
Name | Type |
---|---|
walletPublicKey |
Hex |
mainUtxo |
BitcoinUtxo |
redeemerOutputScript |
Hex |
Object
Name | Type |
---|---|
mainUtxo |
{ txHash : string ; txOutputIndex : number = mainUtxo.outputIndex; txOutputValue : BigNumber = mainUtxo.value } |
mainUtxo.txHash |
string |
mainUtxo.txOutputIndex |
number |
mainUtxo.txOutputValue |
BigNumber |
prefixedRawRedeemerOutputScript |
string |
walletPublicKeyHash |
string |
src/lib/ethereum/tbtc-token.ts:139
▸ buildRequestRedemptionData(redeemer
, walletPublicKey
, mainUtxo
, redeemerOutputScript
): Hex
Name | Type |
---|---|
redeemer |
EthereumAddress |
walletPublicKey |
Hex |
mainUtxo |
BitcoinUtxo |
redeemerOutputScript |
Hex |
src/lib/ethereum/tbtc-token.ts:108
▸ getAddress(): EthereumAddress
Get address of the contract instance.
Address of this contract instance.
EthersContractHandle.getAddress
src/lib/ethereum/adapter.ts:112
▸ getChainIdentifier(): ChainIdentifier
See
src/lib/ethereum/tbtc-token.ts:57
▸ getEvents(eventName
, options?
, ...filterArgs
): Promise
<Event
[]>
Get events emitted by the Ethereum contract.
It starts searching from provided block number. If the GetEvents.Options#fromBlock
option is missing it looks for a contract's defined property
_deployedAtBlockNumber. If the property is missing starts searching
from block 0
.
Name | Type | Description |
---|---|---|
eventName |
string |
Name of the event. |
options? |
Options |
Options for events fetching. |
...filterArgs |
unknown [] |
Arguments for events filtering. |
Promise
<Event
[]>
Array of found events.
EthersContractHandle.getEvents
src/lib/ethereum/adapter.ts:127
▸ requestRedemption(walletPublicKey
, mainUtxo
, redeemerOutputScript
, amount
): Promise
<Hex
>
Name | Type |
---|---|
walletPublicKey |
Hex |
mainUtxo |
BitcoinUtxo |
redeemerOutputScript |
Hex |
amount |
BigNumber |
Promise
<Hex
>
See
src/lib/ethereum/tbtc-token.ts:75
▸ totalSupply(blockNumber?
): Promise
<BigNumber
>
Name | Type |
---|---|
blockNumber? |
number |
Promise
<BigNumber
>
See