Constructor
new BridgeJS(endpoint, pkey)
Parameters:
| Name | Type | Description |
|---|---|---|
endpoint |
string | The Url to the node |
pkey |
string | The private key of the wallet |
Methods
(static) setProvider(endpointopt, pkeyopt)
Initial the SDK
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
endpoint |
string |
<optional> |
https://bridge.tomochain.com
|
The Url to the node |
pkey |
string |
<optional> |
random
|
The private key of the coinbase |
(async) getDepositTransaction(wrap) → {Object}
Get latest deposit transaction
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
wrap |
Object | The wrap information Properties
|
Returns:
Transaction object(inner and outter networks)
- Type
- Object
(async) getTransactions(object) → {Object}
Get depositing and withdrawal transactions filtering by tokenSymbol
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object |
Object | Input object Properties
|
Returns:
Transaction object(inner and outter networks)
- Type
- Object
(async) getUnwrapTransactions(object) → {Object}
Get withdrawal transactions
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
object |
Object | Input object Properties
|
|||||||||
wrap.userAddress |
string | The user address |
Returns:
Transaction object(inner and outter networks)
- Type
- Object
(async) getWithdrawTransaction(unwrap) → {Object}
Get latest withdraw transaction
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
unwrap |
Object | The unwrap information Properties
|
||||||
wrap.userAddress |
string | The user address |
Returns:
Transaction object(inner and outter networks)
- Type
- Object
(async) getWrapTransactions(object) → {Object}
Get depositing transactions
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
object |
Object | Input object Properties
|
|||||||||
wrap.userAddress |
string | The user address |
Returns:
Transaction object(inner and outter networks)
- Type
- Object
(async) unwrap(unwrap)
Unwrap TRC21 TOKEN
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
unwrap |
object | The unwrap information Properties
|
(async) unwrapWatch(object) → {Object}
Watch withdrawal transaction
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
object |
Object | Input object Properties
|
Returns:
Transaction object(inner and outter networks)
- Type
- Object
(async) wrapGetAddress(wrap) → {Object}
Get depositing address
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
wrap |
object | The wrap information Properties
|
Returns:
Depositing information object
- Type
- Object
(async) wrapWatch(object) → {Object}
Watch depositing transaction
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
object |
Object | Input object Properties
|
Returns:
Transaction object(inner and outter networks)
- Type
- Object