diff --git a/schemas/taip-0/AddAgent.json b/schemas/taip-0/AddAgent.json new file mode 100644 index 0000000..34b63b8 --- /dev/null +++ b/schemas/taip-0/AddAgent.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://tap.rspv/schemas/AddAgent.json", + "title": "AddAgent", + "description": "Represents the request of an agent to add an agent", + "type": "object", + "required": [], + "properties": { + "transactionId": { + "description": "An identitifer for the transaction", + "type": "string" + }, + "agent": { + "$ref": "https://tap.rspv/schemas/Agent.json" + } + } +} diff --git a/schemas/taip-0/Agent.json b/schemas/taip-0/Agent.json new file mode 100644 index 0000000..4937851 --- /dev/null +++ b/schemas/taip-0/Agent.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://tap.rspv/schemas/Agent.json", + "title": "Agent", + "description": "A transaction agent", + "type": "object", + "required": ["@id", "policies"], + "properties": { + "@id": { + "$ref": "https://tap.rspv/schemas/DID.json" + }, + "policies": { + "description": "An array of policies", + "type": "array" + } + } +} diff --git a/schemas/taip-0/Caip19.json b/schemas/taip-0/Caip19.json new file mode 100644 index 0000000..5a3e653 --- /dev/null +++ b/schemas/taip-0/Caip19.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://tap.rspv/schemas/Caip19.json", + "title": "CAIP19", + "description": "A CAIP 19 asset representation. See: https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-19.md", + "type": "string", + "pattern": "^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}/[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}(/[-.%a-zA-Z0-9]{1,78})?$", + "examples": [ + "eip155:1/slip44:60", + "bip122:000000000019d6689c085ae165831e93/slip44:0" + ] +} diff --git a/schemas/taip-0/DID.json b/schemas/taip-0/DID.json new file mode 100644 index 0000000..14ea3f0 --- /dev/null +++ b/schemas/taip-0/DID.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://tap.rspv/schemas/DID.json", + "title": "DID", + "description": "A decentralized identity", + "type": "string", + "pattern": "^did:[a-zA-Z0-9]*:.*$" +} diff --git a/schemas/taip-0/DepositRequest.json b/schemas/taip-0/DepositRequest.json new file mode 100644 index 0000000..eb99a9c --- /dev/null +++ b/schemas/taip-0/DepositRequest.json @@ -0,0 +1,66 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://tap.rspv/schemas/DepositRequest.json", + "title": "DepositRequest", + "description": "A deposit request", + "type": "object", + "required": [ + "transactionId", + "amount", + "asset", + "originators", + "beneficiaries", + "agents", + "settlementInfo" + ], + "properties": { + "transactionId": { + "description": "An identitifer for the transaction", + "type": "string" + }, + "amount": { + "description": "Amount for the transaction", + "type": "string", + "pattern": "[0-9]+" + }, + "asset": { + "$ref": "https://tap.rspv/schemas/Caip19.json" + }, + "originators": { + "description": "An ordered array of originator DIDs", + "type": "array", + "items": { + "type": "object", + "required": ["@id"], + "properties": { + "@id": { + "$ref": "https://tap.rspv/schemas/DID.json" + } + } + } + }, + "beneficiaries": { + "description": "An ordered array of beneficiary DIDs", + "type": "array", + "items": { + "type": "object", + "required": ["@id"], + "properties": { + "@id": { + "$ref": "https://tap.rspv/schemas/DID.json" + } + } + } + }, + "agents": { + "description": "An ordered array of participant agents in a transaction", + "type": "array", + "items": { + "$ref": "https://tap.rspv/schemas/Agent.json" + } + }, + "settlementInfo": { + "$ref": "https://tap.rspv/schemas/SettlementInfo.json" + } + } +} diff --git a/schemas/taip-0/Resolution.json b/schemas/taip-0/Resolution.json new file mode 100644 index 0000000..866fefb --- /dev/null +++ b/schemas/taip-0/Resolution.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://tap.rspv/schemas/Resolution.json", + "title": "Resolution", + "description": "A resolution of a transaction by an agent", + "type": "object", + "required": ["did", "resolution"], + "properties": { + "did": { + "$ref": "https://tap.rspv/schemas/DID.json" + }, + "resolution": { + "description": "Resolution for the transaction", + "type": "string", + "enum": ["APPROVE", "REJECT", "NON_APPLICABLE"] + } + } +} diff --git a/schemas/taip-0/SettlementInfo.json b/schemas/taip-0/SettlementInfo.json new file mode 100644 index 0000000..76fc8fb --- /dev/null +++ b/schemas/taip-0/SettlementInfo.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://tap.rspv/schemas/SettlementInfo.json", + "title": "Settlement Info", + "description": "Transaction settlement information", + "type": "object", + "properties": { + "originatorAddress": { + "description": "The crypto address of the originator", + "type": "string" + }, + "beneficiaryAddress": { + "description": "The crypto address of the beneficiary", + "type": "string" + }, + "txHash": { + "description": "The transaction hash", + "type": "string" + } + } +} diff --git a/schemas/taip-0/UpdateResolution.json b/schemas/taip-0/UpdateResolution.json new file mode 100644 index 0000000..f0d8169 --- /dev/null +++ b/schemas/taip-0/UpdateResolution.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://tap.rspv/schemas/UpdateResolution.json", + "title": "UpdateResolution", + "description": "Represents the request of an agent to signal the approval or rejection of a transaction", + "type": "object", + "required": ["transactionId", "resolution"], + "properties": { + "transactionId": { + "description": "An identitifer for the transaction", + "type": "string" + }, + "resolution": { + "$ref": "https://tap.rspv/schemas/Resolution.json" + } + } +} diff --git a/schemas/taip-0/UpdateSettlementInfo.json b/schemas/taip-0/UpdateSettlementInfo.json new file mode 100644 index 0000000..06d9e10 --- /dev/null +++ b/schemas/taip-0/UpdateSettlementInfo.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://tap.rspv/schemas/UpdateResolution.json", + "title": "UpdateResolution", + "description": "Represents the request of an agent to signal the approval or rejection of a transaction", + "type": "object", + "required": ["transactionId", "resolution"], + "properties": { + "transactionId": { + "description": "An identitifer for the transaction", + "type": "string" + }, + "settlementInfo": { + "$ref": "https://tap.rspv/schemas/SettlementInfo.json" + } + } +}