Welcome to Dev3
Search
K

Options

An options object can be passed to an authorize wallet request to set some of the parameters of the authorization flow. In the example above, we've sent the empty configuration, since all the parameters are optional. Options you can configure are all optional and listed below:
1
{
2
wallet_address?: string;
3
redirect_url?: string;
4
arbitrary_data?: Map<string, unknown>;
5
screen_config?: ScreenConfig;
6
message_to_sign?: string;
7
store_indefinitely?: boolean;
8
}

wallet_address

The wallet address, which the user must log in with. If the user connects with another address, the request will be rejected.
If the value is not provided, the user can log in with any wallet address and continue processing the request.
Example value:
1
const options = {
2
// ... rest of the options
3
wallet_address: "0x4Ed918C7800F5dc34d2C774f6EA5fbd15f1a94a7"
4
}

redirect_url

If you want to take over the flow of how the user connects the wallet, you can specify the redirect URL here. Our system expects your redirect URL to contain the ${id} component which is going to be interpolated to the real request ID. This ID is important because your frontend must fetch the request state and also update the status of the request by specifying this ID value. To create your own frontend you'll have to integrate our API and refer to theBroken link.
If the value is not provided, the actionUrl generated by the SDK will be automatically built to redirect the user to our wallet connection screen, and this is the recommended approach.
Example value:
1
const options = {
2
// ... rest of the options
3
redirect_url: "https://your-frontend/wallet-connect/${id}"
4
}

arbitrary_data

Key-value mapping of any data you want to attach to the request. The data will simply be sent back to you upon the successful request completion. Depending on your use-case, you might want to add important info here, related to your existing application parameters.
If the value is not provided, the empty data is sent with the request and received back when the request is processed.
Example value:
1
const data = new Map<string, string>();
2
data['user-id'] = 'my internal user id';
3
4
const options = {
5
// ... rest of the options
6
arbitrary_data: data
7
}

screen_config

Configures the execution screen and sets the text labels your user will see when processing the request. By providing this value, you can communicate with the user more clearly what you're requesting from his side, and this will be shown to the users when you redirect them to the action URL generated by our SDK.
If the value is not provided, the default action messages will be shown when you redirect the user to our action execution screen.
1
const options = {
2
// ... rest of the options
3
screen_config: {
4
before_action_message: "This message will be shown to your user before he executes the request.",
5
after_action_message: "THis message will be shown to your user after he executes the action successfully."
6
}
7
}
You can put anything textual in these parameters, links, thank you messages or whatever else might be useful for your case.

message_to_sign

You can provide your own message data to for user to sign in order to prove the ownership of the wallet. You should leave this empty if you want to authorize the user using our message signing process. We'll generate the message for you and check the signatures before letting you know the user is authorized.

store_indefinitely

Set this value to true if you want the request data to be destroyed once the request has been processed by the user.
If the value is not provided, the default value is false meaning you will always be able to fetch the request data and check the status, even after it was processed.
1
const options = {
2
// ... rest of the options
3
store_indefinitely: true
4
}