Class: SafeRelayProvider
"providers/SafeRelayProvider".SafeRelayProvider
#
Hierarchy↳ SafeRelayProvider
#
Constructors#
constructor+ new SafeRelayProvider(ApiUrl
: string, WsApiUrl
: string): SafeRelayProvider
Inherited from Provider.constructor
Defined in src/providers/Provider.ts:9
#
Parameters:Name | Type |
---|---|
ApiUrl | string |
WsApiUrl | string |
Returns: SafeRelayProvider
#
Properties#
ApiUrl• ApiUrl: string
Defined in src/providers/SafeRelayProvider.ts:15
#
WsApiUrl• WsApiUrl: string
Defined in src/providers/SafeRelayProvider.ts:16
#
Methods#
createWebsocketStreamâ–¸ createWebsocketStream(endpoint
: string, functionName
: string, args
: object, reconnectingOptions?
: ReconnectingWSOptions): Observable<any>
Inherited from Provider.createWebsocketStream
Defined in src/providers/Provider.ts:45
Creates a websocket stream connection to the server.
#
Parameters:Name | Type | Description |
---|---|---|
endpoint | string | Websocket stream endpoint to connect to. |
functionName | string | Function to call on connection. |
args | object | Function arguments. |
reconnectingOptions? | ReconnectingWSOptions | - |
Returns: Observable<any>
#
fetchEndpointâ–¸ fetchEndpoint<T>(endpoint
: string, options?
: object): Promise<T>
Overrides Provider.fetchEndpoint
Defined in src/providers/SafeRelayProvider.ts:32
Returns a JSON response from the REST API of the server.
We overload this method since the safe relay server from gnosis doesn't like urls with a trimmed slash at the end.
#
Type parameters:Name |
---|
T |
#
Parameters:Name | Type | Description |
---|---|---|
endpoint | string | Endpoint to fetch. |
options? | object | Optional fetch options. |
Returns: Promise<T>
#
getBalanceâ–¸ getBalance(address
: string): Promise<Amount>
Defined in src/providers/SafeRelayProvider.ts:137
Returns balance of given address.
#
Parameters:Name | Type | Description |
---|---|---|
address | string | Address to determine balance for. |
Returns: Promise<Amount>
#
getIdentityImplementationAddressâ–¸ getIdentityImplementationAddress(address
: string): Promise<string>
Defined in src/providers/SafeRelayProvider.ts:102
Returns implementation address of identity with given address
#
Parameters:Name | Type | Description |
---|---|---|
address | string | Address of identity |
Returns: Promise<string>
the implementation address currently in use by the given identity
#
getMetaTxFeesâ–¸ getMetaTxFees(metaTransaction
: SafeMetaTransaction): Promise<SafeTransactionFees>
Defined in src/providers/SafeRelayProvider.ts:55
Returns the fees the provider would be willing to pay for the transaction
#
Parameters:Name | Type | Description |
---|---|---|
metaTransaction | SafeMetaTransaction | Meta transaction to be relayed |
Returns: Promise<SafeTransactionFees>
The fees value and currency network of fees for given meta transaction
#
getMetaTxStatusâ–¸ getMetaTxStatus(safeAddress
: string, transactionHash
: string): Promise<TransactionStatusObject>
Defined in src/providers/SafeRelayProvider.ts:109
#
Parameters:Name | Type |
---|---|
safeAddress | string |
transactionHash | string |
Returns: Promise<TransactionStatusObject>
#
getSafeNonceâ–¸ getSafeNonce(safeAddress
: string): Promise<number>
Defined in src/providers/SafeRelayProvider.ts:39
#
Parameters:Name | Type |
---|---|
safeAddress | string |
Returns: Promise<number>
#
getVersionâ–¸ getVersion(): Promise<string>
Inherited from Provider.getVersion
Defined in src/providers/Provider.ts:64
Returns the version of the currently configured provider server.
Returns: Promise<string>
Version of relay in the format <name>/vX.X.X
.
#
plainFetchâ–¸ plainFetch(endpoint
: string): Promise<Response>
Defined in src/providers/SafeRelayProvider.ts:18
#
Parameters:Name | Type |
---|---|
endpoint | string |
Returns: Promise<Response>
#
postToEndpointâ–¸ postToEndpoint<T>(endpoint
: string, data
: any): Promise<T>
Inherited from Provider.postToEndpoint
Defined in src/providers/Provider.ts:29
#
Type parameters:Name |
---|
T |
#
Parameters:Name | Type |
---|---|
endpoint | string |
data | any |
Returns: Promise<T>
#
sendSignedMetaTransactionâ–¸ sendSignedMetaTransaction(signedMetaTransaction
: SafeMetaTransaction): Promise<any>
Defined in src/providers/SafeRelayProvider.ts:86
Send the given signed meta-transaction to a relay server to execute it on the
blockchain and returns a Promise
with the transaction hash.
#
Parameters:Name | Type | Description |
---|---|---|
signedMetaTransaction | SafeMetaTransaction | Signed meta-transaction to be sent to the relay server |
Returns: Promise<any>
The hash of the transaction sent by the relay server, not to be confused with the hash of the meta-transaction