TrustSDK works by calling deeplinks between apps, this document describes URL formats for each command. TrustSDK is highly customizable, clients and wallets can adapt the URLs to their own needs.
All commands follow the URL format below:
[scheme] is the wallet's deeplink scheme. Default to
[command] is the command to be executed
[params] is the command parameters encoded as url query items.
[id] is the unique command id. The value is later used to resolve the callback for the command. Can be any incrementing integer.
[app] callback URL scheme.
[callback]callback path. Default to
Sign command is used to sign and broadcast transactions leveraging wallet core protobuf models (encoded in base64).
coin: BIP44 coin code
data: wallet core protobuf model binary encoded in base64
send: flag that indicates if the wallet should broadcast the transaction. Valid values:
meta: transaction metadata. This attribute is optional and encoded as a dictionary. Check how it's encoded in Dictionary Encoding.
meta.__name: transaction metadata type. Valid values:
meta.name: dapp name
meta.url: dap url encoded
coin: BIP44 coin code
data: transaction signed as base64 or the transaction hash if
coins: BIP44 code array encoded as URL params. Check how it's encoded in Dictionary Encoding.
accounts: Public addresses joined by
Command may fail for any reason. To handle command failure, TrustSDK has some predefined errors handled automatically:
not_initialized: The SDK war not itialized properly
coin_not_supported: coin is not supported for the command
invalid_response: the response from wallet was in a invalid format
rejected_by_user: the command was rejected by the user
sign_error: sign failed
unknown: unknown error
error: error type
message: error message (optional).
Some URLs may contain a multi-level dictionary structure encoded as query parameters. TrustSDK create a list of query parameters by joining the dictionary keys with a
. separator. If the structure is an array, the key is a integer starting with 0. Take the data structure below:
["key1": "value1""key2": ["subkey1": "value2""subkey2": "value3"],"key3": ["value4","value5"]]
Will be encoded as: