-
Notifications
You must be signed in to change notification settings - Fork 0
TAIP-0: Schemas for TAIP-0 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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]*:.*$" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've omitted the |
||
"transactionId": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unsure if perhaps this should also be a nested JSON-LD |
||
"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" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might need a
RemoveAgent
(and maybeUpdateAgent
). There was anUpdateAgents
message in the original proposal but I'm concerned that it was overwriting the entire agents array (especially now that it contains policies).@pelle how would we go about ensuring that agents don't overwrite other agents policies? e.g. either using
UpdateAgents
orRemoveAgent
and thenAddAgent
with new policies set?