Skip to content

Commit

Permalink
Merge pull request #2 from consensys-vertical-apps/MMI-adds-custodian…
Browse files Browse the repository at this point in the history
…_sign_and_custodian_signTypedData

custodian_sign and custodian_signTypedData
  • Loading branch information
zone-live authored Oct 11, 2023
2 parents d251c71 + 8e69bb2 commit 769f5cc
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 87 deletions.
5 changes: 5 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# All of these are defaults except singleQuote and endOfLine, but we specify them
# for explicitness
endOfLine: auto
singleQuote: true
trailingComma: all
268 changes: 181 additions & 87 deletions src/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,23 +148,22 @@
"summary": "Requests that the custodian calculate Ethereum specific signature prefixed with \"\\x19Ethereum Signed Message:\\n\" + len(message)",
"params": [
{
"name": "address",
"name": "SignedMessageParameters",
"required": true,
"schema": {
"$ref": "#/components/schemas/address"
"$ref": "#/components/schemas/SignedMessageParameters"
}
},
{
"name": "message",
"name": "SignedMessageMetadata",
"required": true,
"schema": {
"title": "message",
"$ref": "#/components/schemas/bytes"
"$ref": "#/components/schemas/SignedMessageMetadata"
}
}
],
"result": {
"name": "Signed Message ID",
"name": "SignedMessage ID",
"schema": {
"title": "signedMessageId",
"type": "string"
Expand All @@ -175,13 +174,19 @@
"name": "Signing the string 'hello world'",
"params": [
{
"name": "custodianSignExampleAddress",
"value": "0xb2c77973279baaaf48c295145802695631d50c01"
"name": "custodianSignExampleAddressAndPayload",
"value": {
"address": "0xb2c77973279baaaf48c295145802695631d50c01",
"payload": "0x48656c6c6f20776f726c64"
}
},
{
"name": "custodianSignExampleMessage",
"value": "0x48656c6c6f20776f726c64",
"description": "Hello world"
"name": "custodianSignExampleMetadata",
"value": {
"chainId": "0x4",
"originUrl": "https://www.example.com",
"note": "personal_sign message"
}
}
],
"result": {
Expand All @@ -196,24 +201,17 @@
"summary": "Requests that the custodian perform a signature according to EIP-712",
"params": [
{
"name": "address",
"required": true,
"schema": {
"$ref": "#/components/schemas/address"
}
},
{
"name": "payload",
"name": "SignedTypedDataParameters",
"required": true,
"schema": {
"$ref": "#/components/schemas/TypedData"
"$ref": "#/components/schemas/SignedTypedDataParameters"
}
},
{
"name": "encodingVersion",
"name": "SignedTypedDataMetadata",
"required": true,
"schema": {
"$ref": "#/components/schemas/EIP712EncodingVersion"
"$ref": "#/components/schemas/SignedTypedDataMetadata"
}
}
],
Expand All @@ -230,78 +228,82 @@
"params": [
{
"name": "custodianSignTypedDataExampleAddress",
"value": "0xb2c77973279baaaf48c295145802695631d50c01"
},
{
"name": "custodianSignTypedDataExamplePayload",
"value": {
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "version",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"Person": [
{
"name": "name",
"type": "string"
},
{
"name": "wallet",
"type": "address"
}
],
"Mail": [
{
"name": "from",
"type": "Person"
"address": "0xb2c77973279baaaf48c295145802695631d50c01",
"payload": {
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "version",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"Person": [
{
"name": "name",
"type": "string"
},
{
"name": "wallet",
"type": "address"
}
],
"Mail": [
{
"name": "from",
"type": "Person"
},
{
"name": "to",
"type": "Person"
},
{
"name": "contents",
"type": "string"
}
]
},
"primaryType": "Mail",
"domain": {
"name": "Ether Mail",
"version": "1",
"chainId": 1,
"verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"
},
"message": {
"from": {
"name": "Cow",
"wallet": "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"
},
{
"name": "to",
"type": "Person"
"to": {
"name": "Bob",
"wallet": "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"
},
{
"name": "contents",
"type": "string"
}
]
},
"primaryType": "Mail",
"domain": {
"name": "Ether Mail",
"version": "1",
"chainId": 1,
"verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"
"contents": "Hello, Bob!"
}
},
"message": {
"from": {
"name": "Cow",
"wallet": "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"
},
"to": {
"name": "Bob",
"wallet": "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"
},
"contents": "Hello, Bob!"
}
"version": "v4"
}
},
{
"name": "custodianSignTypedDataExampleEncodingVersion",
"value": "v4"
"name": "custodianSignTypedDataExampleMetadata",
"value": {
"chainId": "0x4",
"originUrl": "https://www.example.com",
"note": "Signed typed data"
}
}
],
"result": {
Expand Down Expand Up @@ -544,6 +546,98 @@
],
"components": {
"schemas": {
"SignedMessageParameters": {
"title": "Signed Message object",
"type": "object",
"allOf": [
{
"required": ["address", "payload"],
"properties": {
"address": {
"title": "From address",
"$ref": "#/components/schemas/address"
},
"payload": {
"title": "Message payload",
"$ref": "#/components/schemas/bytes"
}
}
}
]
},
"SignedMessageMetadata": {
"title": "Signed Message Metadata",
"type": "object",
"allOf": [
{
"required": ["chainId", "originUrl"],
"properties": {
"chainId": {
"title": "Chain ID",
"$ref": "#/components/schemas/uint"
},
"originUrl": {
"title": "Origin URL",
"description": "The web page/dapp where the transaction originated",
"$ref": "#/components/schemas/uri"
},
"note": {
"title": "Note",
"description": "A note to be attached to the transaction which can be specified by the user",
"type": "string"
}
}
}
]
},
"SignedTypedDataParameters": {
"title": "Signed Typed Data object",
"type": "object",
"allOf": [
{
"required": ["address", "payload", "version"],
"properties": {
"address": {
"title": "From address",
"$ref": "#/components/schemas/address"
},
"payload": {
"title": "Message payload",
"$ref": "#/components/schemas/bytes"
},
"version": {
"title": "Message payload",
"$ref": "#/components/schemas/EIP712EncodingVersion"
}
}
}
]
},
"SignedTypedDataMetadata": {
"title": "Signed Typed Data Metadata",
"type": "object",
"allOf": [
{
"required": ["chainId", "originUrl"],
"properties": {
"chainId": {
"title": "Chain ID",
"$ref": "#/components/schemas/uint"
},
"originUrl": {
"title": "Origin URL",
"description": "The web page/dapp where the transaction originated",
"$ref": "#/components/schemas/uri"
},
"note": {
"title": "Note",
"description": "A note to be attached to the transaction which can be specified by the user",
"type": "string"
}
}
}
]
},
"address": {
"title": "hex encoded address",
"type": "string",
Expand Down

0 comments on commit 769f5cc

Please sign in to comment.