Substrate
Permission Scopes
The following permission scopes are available in the Substrate package.
export enum SubstratePermissionScope {
"transfer" = "transfer",
"sign_payload_json" = "sign_payload_json",
"sign_payload_raw" = "sign_payload_raw",
}
Message Types
The supported message types.
export enum SubstrateMessageType {
"transfer_request" = "transfer_request",
"sign_payload_request" = "sign_payload_request",
}
Messages
Permission Request
This message is used to request permissions to use an account.
export interface SubstratePermissionRequest
extends PermissionRequestV3<"substrate"> {
blockchainData: {
scopes: SubstratePermissionScope[]; // enum
appMetadata: AppMetadata;
network?: {
genesisHash: string; // Wallet shows only those accounts
rpc?: string; // For development nodes?
}[]; // Array to "whitelist" certain networks? (optional)
}
Permission Response
This message is used to share information about an account with a dApp.
export interface SubstratePermissionResponse
extends PermissionResponseV3<"substrate"> {
blockchainData: {
appMetadata: AppMetadata;
scopes: SubstratePermissionScope[]; // enum
accounts: {
accountId: string;
network?: {
genesisHash: string;
rpc?: string;
publicKey: string;
address: string;
}[];
}