Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions api-specs/openrpc-dapp-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"params": [
{
"name": "params",
"required": true,
"schema": {
"title": "signMessageParams",
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/SignMessageRequest"
Expand Down Expand Up @@ -186,6 +187,16 @@
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/TxChangedEvent"
}
}
},
{
"name": "messageSignature",
"params": [],
"result": {
"name": "result",
"schema": {
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/MessageSignatureEvent"
}
}
}
],
"components": {
Expand Down Expand Up @@ -404,6 +415,11 @@
"type": "string",
"description": "The unique identifier of the command associated with the transaction."
},
"MessageId": {
"title": "MessageId",
"type": "string",
"description": "The unique identifier of the message associated with the message to be signed."
},
"TxChangedPendingEvent": {
"title": "TxChangedPendingEvent",
"description": "Event emitted when a transaction is pending.",
Expand Down Expand Up @@ -542,6 +558,80 @@
}
]
},
"MessageSignaturePendingEvent": {
"title": "MessageSignaturePendingEvent",
"description": "Event emitted when a message signature is requested.",
"type": "object",
"additionalProperties": false,
"properties": {
"status": {
"title": "statusPending",
"type": "string",
"enum": ["pending"],
"description": "The status of the message signature."
},
"messageId": {
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/MessageId"
}
},
"required": ["status", "messageId"]
},
"MessageSignatureSignedEvent": {
"title": "MessageSignatureSignedEvent",
"description": "Event emitted when a message signature is completed.",
"type": "object",
"additionalProperties": false,
"properties": {
"status": {
"title": "statusSigned",
"type": "string",
"enum": ["signed"],
"description": "The status of the message signature."
},
"messageId": {
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/MessageId"
},
"signature": {
"title": "signature",
"type": "string",
"description": "The signature of the message."
}
},
"required": ["status", "messageId", "signature"]
},
"MessageSignatureFailedEvent": {
"title": "MessageSignatureFailedEvent",
"description": "Event emitted when a message signature has failed.",
"type": "object",
"additionalProperties": false,
"properties": {
"status": {
"title": "statusFailed",
"type": "string",
"enum": ["failed"],
"description": "The status of the message signature."
},
"messageId": {
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/MessageId"
}
},
"required": ["status", "messageId"]
},
"MessageSignatureEvent": {
"title": "MessageSignatureEvent",
"description": "Event emitted when a message signature is requested or completed.",
"oneOf": [
{
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/MessageSignaturePendingEvent"
},
{
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/MessageSignatureSignedEvent"
},
{
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/MessageSignatureFailedEvent"
}
]
},
"ConnectResult": {
"title": "ConnectResult",
"type": "object",
Expand Down
26 changes: 24 additions & 2 deletions api-specs/openrpc-dapp-remote-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"params": [
{
"name": "params",
"required": true,
"schema": {
"title": "signMessageParams",
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/SignMessageRequest"
Expand All @@ -102,10 +103,21 @@
"result": {
"name": "result",
"schema": {
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/SignMessageResult"
"title": "signMessageResult",
"type": "object",
"additionalProperties": false,
"properties": {
"messageId": {
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/MessageId"
},
"userUrl": {
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/UserUrl"
}
},
"required": ["messageId", "userUrl"]
}
},
"description": "Signs a message."
"description": "Requests a message signature. The wallet will prompt the user for confirmation."
},
{
"name": "ledgerApi",
Expand Down Expand Up @@ -187,6 +199,16 @@
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/TxChangedEvent"
}
}
},
{
"name": "messageSignature",
"params": [],
"result": {
"name": "result",
"schema": {
"$ref": "api-specs/openrpc-dapp-api.json#/components/schemas/MessageSignatureEvent"
}
}
}
],
"components": {
Expand Down
56 changes: 54 additions & 2 deletions api-specs/openrpc-signing-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,54 @@
},
"description": "Uses the Wallet Provider to sign a transaction. This will likely be an asynchronous operation."
},
{
"name": "signMessage",
"params": [
{
"name": "params",
"schema": {
"title": "SignMessageParams",
"type": "object",
"additionalProperties": false,
"properties": {
"message": {
"title": "message",
"type": "string",
"description": "Arbitrary UTF-8 message to sign."
},
"keyIdentifier": {
"$ref": "#/components/schemas/KeyIdentifier",
"description": "Identifier for the key to use for signing. At least one of publicKey or id must be provided."
}
},
"required": ["message"]
}
}
],
"result": {
"name": "result",
"schema": {
"title": "SignMessageResult",
"oneOf": [
{
"$ref": "#/components/schemas/Error"
},
{
"type": "object",
"title": "SignatureResult",
"additionalProperties": false,
"properties": {
"signature": {
"$ref": "#/components/schemas/Signature"
}
},
"required": ["signature"]
}
]
}
},
"description": "Signs an arbitrary UTF-8 message with the wallet's private key (Ed25519). The message bytes are signed as-is; callers are expected to embed any application-level domain separation (e.g. EIP-4361 / SIWX text) in the message itself."
},
{
"name": "getTransaction",
"description": "Get the status of a single transaction by its ID.",
Expand Down Expand Up @@ -413,8 +461,7 @@
"description": "Status of the transaction signing process."
},
"signature": {
"title": "signature",
"type": "string",
"$ref": "#/components/schemas/Signature",
"description": "Signature of the transaction if it was signed."
},
"publicKey": {
Expand All @@ -430,6 +477,11 @@
}
},
"required": ["txId", "status"]
},
"Signature": {
"title": "signature",
"type": "string",
"description": "Base64-encoded Ed25519 signature."
}
}
}
Expand Down
Loading
Loading