Version: Next

Class: SafeRelayProvider

"providers/SafeRelayProvider".SafeRelayProvider

Hierarchy#

Constructors#

constructor#

+ new SafeRelayProvider(ApiUrl: string, WsApiUrl: string): SafeRelayProvider

Inherited from Provider.constructor

Defined in src/providers/Provider.ts:9

Parameters:#

NameType
ApiUrlstring
WsApiUrlstring

Returns: SafeRelayProvider

Properties#

ApiUrl#

ApiUrl: string

Overrides Provider.ApiUrl

Defined in src/providers/SafeRelayProvider.ts:15


WsApiUrl#

WsApiUrl: string

Overrides Provider.WsApiUrl

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:#

NameTypeDescription
endpointstringWebsocket stream endpoint to connect to.
functionNamestringFunction to call on connection.
argsobjectFunction 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:#

NameTypeDescription
endpointstringEndpoint to fetch.
options?objectOptional fetch options.

Returns: Promise<T>


getBalance#

getBalance(address: string): Promise<Amount>

Defined in src/providers/SafeRelayProvider.ts:137

Returns balance of given address.

Parameters:#

NameTypeDescription
addressstringAddress 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:#

NameTypeDescription
addressstringAddress 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:#

NameTypeDescription
metaTransactionSafeMetaTransactionMeta 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:#

NameType
safeAddressstring
transactionHashstring

Returns: Promise<TransactionStatusObject>


getSafeNonce#

getSafeNonce(safeAddress: string): Promise<number>

Defined in src/providers/SafeRelayProvider.ts:39

Parameters:#

NameType
safeAddressstring

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:#

NameType
endpointstring

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:#

NameType
endpointstring
dataany

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:#

NameTypeDescription
signedMetaTransactionSafeMetaTransactionSigned 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