Namespace

token

bridge.token

ERC20/ERC721 related interactions.

View Source useArbTokenBridge.ts, line 14

Methods

# static add(contractAddress, type) → {Promise}

Add token to state (to track balances, deposit, withdraw, etc.)
Parameters:
Name Type Description
contractAddress string ERC20 or ERC721 contract address
type TokenType

View Source useArbTokenBridge.ts, line 682

Promise: contract address
Promise

# static approve(contractAddress) → {Promise}

Approve spending token for current contract
Parameters:
Name Type Description
contractAddress string ERC20 or ERC721 contract address

View Source useArbTokenBridge.ts, line 441

Promise: includes ContractReceipt and ContractTransaction
Promise

# static deposit(contractAddress, amountOrTokenId) → {Promise}

Deposit ERC20 or ERC721 from L1 onto Arbitrum chain
Parameters:
Name Type Description
contractAddress string ERC20 or ERC721 contract address
amountOrTokenId string Ammount to deposit for ERC20 or token to deposit for ERC721

View Source useArbTokenBridge.ts, line 498

Promise: ContractReceipt
Promise

# static updateBalances(typeopt) → {ContractStorage.<BridgeBalance>}

updates balances.erc20 and balances.erc721 objects
Parameters:
Name Type Attributes Description
type TokenType <optional>
updates only specified type if included

View Source useArbTokenBridge.ts, line 352

ContractStorage.<BridgeBalance>

# static withdraw(contractAddress, amountOrTokenId) → {Promise}

Initiate withdrawal ERC20 or ERC721 token from Arbitrum chain to L1
Parameters:
Name Type Description
contractAddress string ERC20 or ERC721 contract address
amountOrTokenId string Ammount to withdraw for ERC20 or token to withdraw for ERC721

View Source useArbTokenBridge.ts, line 545

Promise: ContractReceipt
Promise

# static withdrawLockBox(contractAddress, tokenIdopt) → {Promise}

Transfers token from lockbox to L1 address.
Parameters:
Name Type Attributes Description
contractAddress string ERC20 or ERC721 contract address
tokenId string <optional>
NFT ID to transfer (for ERC20, transfers full balance)

View Source useArbTokenBridge.ts, line 601

Promise: ContractReceipt
Promise