From c3e3327335326638c1e9c95d3217a9078295897a Mon Sep 17 00:00:00 2001 From: Diane Huxley Date: Sat, 6 Jan 2024 16:08:09 -0800 Subject: [PATCH] Replace hosted/ with tbdex-interop-suite submodule --- .gitmodules | 3 + hosted/index.html | 60 ---------- hosted/json-schemas/close.schema.json | 11 -- hosted/json-schemas/definitions.json | 11 -- hosted/json-schemas/message.schema.json | 60 ---------- hosted/json-schemas/offering.schema.json | 80 ------------- hosted/json-schemas/order.schema.json | 7 -- hosted/json-schemas/orderstatus.schema.json | 14 --- hosted/json-schemas/quote.schema.json | 65 ----------- hosted/json-schemas/reputation.schema.json | 4 - hosted/json-schemas/resource.schema.json | 45 -------- hosted/json-schemas/rfq.schema.json | 45 -------- hosted/test-vectors/protocol/README.md | 26 ----- .../test-vectors/protocol/package-lock.json | 61 ---------- hosted/test-vectors/protocol/package.json | 8 -- .../test-vectors/protocol/validate-vectors.js | 51 -------- .../test-vectors/protocol/vector.schema.json | 20 ---- .../protocol/vectors/parse-close.json | 19 --- .../protocol/vectors/parse-offering.json | 109 ------------------ .../protocol/vectors/parse-order.json | 17 --- .../protocol/vectors/parse-orderstatus.json | 19 --- .../protocol/vectors/parse-quote.json | 39 ------- .../protocol/vectors/parse-rfq.json | 36 ------ tbdex-interop-suite | 1 + 24 files changed, 4 insertions(+), 807 deletions(-) create mode 100644 .gitmodules delete mode 100644 hosted/index.html delete mode 100644 hosted/json-schemas/close.schema.json delete mode 100644 hosted/json-schemas/definitions.json delete mode 100644 hosted/json-schemas/message.schema.json delete mode 100644 hosted/json-schemas/offering.schema.json delete mode 100644 hosted/json-schemas/order.schema.json delete mode 100644 hosted/json-schemas/orderstatus.schema.json delete mode 100644 hosted/json-schemas/quote.schema.json delete mode 100644 hosted/json-schemas/reputation.schema.json delete mode 100644 hosted/json-schemas/resource.schema.json delete mode 100644 hosted/json-schemas/rfq.schema.json delete mode 100644 hosted/test-vectors/protocol/README.md delete mode 100644 hosted/test-vectors/protocol/package-lock.json delete mode 100644 hosted/test-vectors/protocol/package.json delete mode 100644 hosted/test-vectors/protocol/validate-vectors.js delete mode 100644 hosted/test-vectors/protocol/vector.schema.json delete mode 100644 hosted/test-vectors/protocol/vectors/parse-close.json delete mode 100644 hosted/test-vectors/protocol/vectors/parse-offering.json delete mode 100644 hosted/test-vectors/protocol/vectors/parse-order.json delete mode 100644 hosted/test-vectors/protocol/vectors/parse-orderstatus.json delete mode 100644 hosted/test-vectors/protocol/vectors/parse-quote.json delete mode 100644 hosted/test-vectors/protocol/vectors/parse-rfq.json create mode 160000 tbdex-interop-suite diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..0da3a7b6 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "tbdex-interop-suite"] + path = tbdex-interop-suite + url = git@github.com:TBD54566975/tbdex-interop-suite.git diff --git a/hosted/index.html b/hosted/index.html deleted file mode 100644 index 3a9a09c5..00000000 --- a/hosted/index.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - Tbdex Hosted Resources - - - -
-

JSON Schemas

-
-
-

Resources

- -
- -
-

Messages

- -
- -
-

Shared

- -
- -
-

Test Vectors

-
-

Messages

- -
- -
-

Resources

- -
-
- - - \ No newline at end of file diff --git a/hosted/json-schemas/close.schema.json b/hosted/json-schemas/close.schema.json deleted file mode 100644 index d4577d2b..00000000 --- a/hosted/json-schemas/close.schema.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://tbdex.dev/close.schema.json", - "type": "object", - "additionalProperties": false, - "properties": { - "reason": { - "type": "string" - } - } -} \ No newline at end of file diff --git a/hosted/json-schemas/definitions.json b/hosted/json-schemas/definitions.json deleted file mode 100644 index 7443d2f1..00000000 --- a/hosted/json-schemas/definitions.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://tbdex.dev/definitions.json", - "type": "object", - "definitions": { - "did": { - "type": "string", - "pattern": "^did:([a-z0-9]+):((?:(?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))*:)*((?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))+))((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(#.*)?$" - } - } -} \ No newline at end of file diff --git a/hosted/json-schemas/message.schema.json b/hosted/json-schemas/message.schema.json deleted file mode 100644 index a23a1a3a..00000000 --- a/hosted/json-schemas/message.schema.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://tbdex.dev/message.schema.json", - "definitions": { - "MessageMetadata": { - "type": "object", - "properties": { - "from": { - "$ref": "definitions.json#/definitions/did", - "description": "The sender's DID" - }, - "to": { - "$ref": "https://tbdex.dev/definitions.json#/definitions/did", - "description": "The recipient's DID" - }, - "kind": { - "type": "string", - "enum": ["rfq", "quote", "order", "orderstatus", "close"], - "description": "The message kind (e.g. rfq, quote)" - }, - "id": { - "type": "string", - "description": "The message ID" - }, - "exchangeId": { - "type": "string", - "description": "ID for a 'thread' of messages between Alice <-> PFI. Set by the first message in a thread" - }, - "createdAt": { - "type": "string", - "description": "ISO8601 formatted string representing the timestamp" - } - }, - "required": ["from", "to", "kind", "id", "exchangeId", "createdAt"] - }, - "Private": { - "type": "object", - "description": "An ephemeral JSON object used to transmit sensitive data (e.g. PII)" - } - }, - "type": "object", - "properties": { - "metadata": { - "$ref": "#/definitions/MessageMetadata" - }, - "data": { - "type": "object", - "description": "The actual message content" - }, - "signature": { - "type": "string", - "description": "Signature that verifies the authenticity and integrity of a message" - }, - "private": { - "$ref": "#/definitions/Private" - } - }, - "additionalProperties": false, - "required": ["metadata", "data", "signature"] -} diff --git a/hosted/json-schemas/offering.schema.json b/hosted/json-schemas/offering.schema.json deleted file mode 100644 index 2659967c..00000000 --- a/hosted/json-schemas/offering.schema.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://tbdex.dev/offering.schema.json", - "definitions": { - "CurrencyDetails": { - "type": "object", - "properties": { - "currencyCode": { - "type": "string", - "description": "ISO 3166 currency code string" - }, - "minSubunits": { - "type": "string", - "description": "Minimum amount of currency that can be requested" - }, - "maxSubunits": { - "type": "string", - "description": "Maximum amount of currency that can be requested" - } - }, - "required": ["currencyCode"] - }, - "PaymentMethod": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "description": "The type of payment method. e.g. BITCOIN_ADDRESS, DEBIT_CARD, etc." - }, - "requiredPaymentDetails": { - "type": "object", - "description": "A JSON Schema containing the fields that need to be collected in order to use this payment method" - } - }, - "required": ["kind"] - } - }, - "type": "object", - "properties": { - "description": { - "type": "string", - "description": "Brief description of what is being offered." - }, - "payoutUnitsPerPayinUnit": { - "type": "string", - "description": "Number of payout currency units for one payin currency unit (i.e 290000 USD for 1 BTC)" - }, - "payinCurrency": { - "$ref": "#/definitions/CurrencyDetails" - }, - "payoutCurrency": { - "$ref": "#/definitions/CurrencyDetails" - }, - "payinMethods": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentMethod" - } - }, - "payoutMethods": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentMethod" - } - }, - "requiredClaims": { - "type": "object", - "description": "PresentationDefinition that describes the credential(s) the PFI requires in order to provide a quote." - } - }, - "required": [ - "description", - "payoutUnitsPerPayinUnit", - "payinCurrency", - "payoutCurrency", - "payinMethods", - "payoutMethods", - "requiredClaims" - ] -} diff --git a/hosted/json-schemas/order.schema.json b/hosted/json-schemas/order.schema.json deleted file mode 100644 index 5ace8afb..00000000 --- a/hosted/json-schemas/order.schema.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://tbdex.dev/order.schema.json", - "type": "object", - "additionalProperties": false, - "properties": {} -} \ No newline at end of file diff --git a/hosted/json-schemas/orderstatus.schema.json b/hosted/json-schemas/orderstatus.schema.json deleted file mode 100644 index 9aa20be3..00000000 --- a/hosted/json-schemas/orderstatus.schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://tbdex.dev/orderstatus.schema.json", - "type": "object", - "required": [ - "orderStatus" - ], - "additionalProperties": false, - "properties": { - "orderStatus": { - "type":"string" - } - } -} \ No newline at end of file diff --git a/hosted/json-schemas/quote.schema.json b/hosted/json-schemas/quote.schema.json deleted file mode 100644 index 57ab134a..00000000 --- a/hosted/json-schemas/quote.schema.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://tbdex.dev/quote.schema.json", - "definitions": { - "QuoteDetails": { - "type": "object", - "properties": { - "currencyCode": { - "type": "string", - "description": "ISO 3166 currency code string" - }, - "amountSubunits": { - "type": "string", - "description": "The amount of currency expressed in the smallest respective unit" - }, - "feeSubunits": { - "type": "string", - "description": "The amount paid in fees" - } - }, - "required": ["currencyCode", "amountSubunits"] - }, - "PaymentInstruction": { - "type": "object", - "properties": { - "link": { - "type": "string", - "description": "Link to allow Alice to pay PFI, or be paid by the PFI" - }, - "instruction": { - "type": "string", - "description": "Instruction on how Alice can pay PFI, or how Alice can be paid by the PFI" - } - } - }, - "PaymentInstructions": { - "type": "object", - "properties": { - "payin": { - "$ref": "#/definitions/PaymentInstruction" - }, - "payout": { - "$ref": "#/definitions/PaymentInstruction" - } - } - } - }, - "type": "object", - "properties": { - "expiresAt": { - "type": "string", - "description": "When this quote expires. Expressed as ISO8601" - }, - "payin": { - "$ref": "#/definitions/QuoteDetails" - }, - "payout": { - "$ref": "#/definitions/QuoteDetails" - }, - "paymentInstructions": { - "$ref": "#/definitions/PaymentInstructions" - } - }, - "required": ["expiresAt", "payin", "payout"] -} diff --git a/hosted/json-schemas/reputation.schema.json b/hosted/json-schemas/reputation.schema.json deleted file mode 100644 index 9e08fbfe..00000000 --- a/hosted/json-schemas/reputation.schema.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://tbdex.dev/reputation.schema.json" -} \ No newline at end of file diff --git a/hosted/json-schemas/resource.schema.json b/hosted/json-schemas/resource.schema.json deleted file mode 100644 index 2d90cc41..00000000 --- a/hosted/json-schemas/resource.schema.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://tbdex.dev/resource.schema.json", - "type": "object", - "properties": { - "metadata": { - "type": "object", - "properties": { - "from": { - "$ref": "https://tbdex.dev/definitions.json#/definitions/did", - "description": "The PFI's DID" - }, - "kind": { - "type": "string", - "enum": ["offering"], - "description": "The resource kind (e.g. Offering)" - }, - "id": { - "type": "string", - "description": "The resource id" - }, - "createdAt": { - "type": "string", - "description": "When the resource was created at. Expressed as ISO8601" - }, - "updatedAt": { - "type": "string", - "description": "When the resource was last updated. Expressed as ISO8601" - } - }, - "required": ["from", "kind", "id", "createdAt"], - "description": "The metadata object contains fields about the resource and is present for every tbdex resources of all types." - }, - "data": { - "description": "The actual resource content", - "type": "object" - }, - "signature": { - "type": "string", - "description": "Signature that verifies that authenticity and integrity of a message" - } - }, - "required": ["metadata", "data", "signature"], - "description": "ResourceModel" -} diff --git a/hosted/json-schemas/rfq.schema.json b/hosted/json-schemas/rfq.schema.json deleted file mode 100644 index a8b9cb87..00000000 --- a/hosted/json-schemas/rfq.schema.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://tbdex.dev/rfq.schema.json", - "definitions": { - "SelectedPaymentMethod": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "description": "Type of payment method e.g. BTC_ADDRESS, DEBIT_CARD, MOMO_MPESA" - }, - "paymentDetails": { - "type": "object", - "description": "An object containing the properties defined in the respective Offering's requiredPaymentDetails json schema" - } - }, - "required": ["kind", "paymentDetails"] - } - }, - "type": "object", - "properties": { - "offeringId": { - "type": "string", - "description": "Offering which Alice would like to get a quote for" - }, - "payinSubunits": { - "type": "string", - "description": "Amount of quote currency you want to spend in order to receive base currency" - }, - "claims": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Presentation Submission that fulfills the requirements included in the respective Offering" - }, - "payinMethod": { - "$ref": "#/definitions/SelectedPaymentMethod" - }, - "payoutMethod": { - "$ref": "#/definitions/SelectedPaymentMethod" - } - }, - "required": ["offeringId", "payinSubunits", "claims", "payinMethod", "payoutMethod"] -} diff --git a/hosted/test-vectors/protocol/README.md b/hosted/test-vectors/protocol/README.md deleted file mode 100644 index 6b902add..00000000 --- a/hosted/test-vectors/protocol/README.md +++ /dev/null @@ -1,26 +0,0 @@ -## Protocol Test Vectors -This directory contains test vectors containing a collection of valid and invalid TBDex Messages and Resources. Implementations can use these vectors to ensure that they **accept valid messages** and **reject invalid messages**. - -### Using Test Vectors -Implementations of the TBDex protocol can fetch the vectors using `curl` where `$MY_GIT_REF` is a git ref in the `tbdex` repo. -```sh -curl -L \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ -"https://api.github.com/repos/TBD54566975/tbdex/contents/specs/?ref=$MY_GIT_REF" -``` - -Each vector file must follow the schema in `vectors.json.schema`. -1. `description` : A human readable description of the scenario being tested. -2. `input` : A stringified JSON TBDex object -3. `output` : If the input contains a valid TBDex object: A JSON object of the the expected parsed input. Otherwise, omit. -4. `error` : boolean. True if an error is expected, false if not. - -### Generating Test Vectors -1. Create a new test vector file in `hosted/test-vectors/protocol/vectors` -2. Use an implementation of TBDex that supports the desired scenario to create the `input` and `output` if applicable. Specify the `error` if applicable. -3. Run the test vector compilation script to add your new vector to the master vector file at `hosted/test-vectors/protocol/vectors.json`. - a. Set up with `cd hosted/test-vectors/protocol & npm install`. - b. Run with `npm run validate-vectors`. -4. Test the updated vectors against an implmentation of TBDex either locally or by pushing your branch of `tbdex` and getting the URL of your branch on GH. -5. Once you are confident that your test vector works as desired, open a PR on `tbdex`. \ No newline at end of file diff --git a/hosted/test-vectors/protocol/package-lock.json b/hosted/test-vectors/protocol/package-lock.json deleted file mode 100644 index 3383fc1f..00000000 --- a/hosted/test-vectors/protocol/package-lock.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "protocol", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "ajv": "^8.0.1" - } - }, - "node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dependencies": { - "punycode": "^2.1.0" - } - } - } -} diff --git a/hosted/test-vectors/protocol/package.json b/hosted/test-vectors/protocol/package.json deleted file mode 100644 index b6f988aa..00000000 --- a/hosted/test-vectors/protocol/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scripts": { - "validate-vectors": "node validate-vectors.js" - }, - "dependencies": { - "ajv": "^8.0.1" - } -} \ No newline at end of file diff --git a/hosted/test-vectors/protocol/validate-vectors.js b/hosted/test-vectors/protocol/validate-vectors.js deleted file mode 100644 index 655d09c0..00000000 --- a/hosted/test-vectors/protocol/validate-vectors.js +++ /dev/null @@ -1,51 +0,0 @@ -const fs = require('fs'); -const path = require('path'); -const Ajv = require('ajv'); - -const testVectorsDirectoryPath = path.join(__dirname, 'vectors'); -const schemaFilePath = path.join(__dirname, 'vector.schema.json'); - -function readJsonFile(filePath) { - try { - const fileContent = fs.readFileSync(filePath, 'utf8'); - return JSON.parse(fileContent); - } catch (error) { - console.error(`Error reading JSON file at ${filePath}: ${error.message}`); - return null; - } -} - -function validateTestVectors() { - // Load the JSON schema - const schema = readJsonFile(schemaFilePath); - - if (!schema) { - console.error('Unable to load JSON schema. Exiting.'); - process.exit(1); - } - - const ajv = new Ajv(); - const validate = ajv.compile(schema); - - // Read and validate JSON schema of each test vector file - const success = true - fs.readdirSync(testVectorsDirectoryPath) - .filter(file => file.endsWith('.json')) - .map(file => path.join(testVectorsDirectoryPath, file)) - .map(filePath => { - const testVectorJson = readJsonFile(filePath) - if (!testVectorJson || !validate(testVectorJson)) { - console.error(`Error validating JSON Schema of test vector at path ${filePath}: `, validate.errors) - success = false - } - }) - - if (success) { - console.log('SUCCESS: All test vectors are valid') - } else { - console.log('FAIL: There were errors validating test vectors') - } -} - -// Compile the valid JSON files into an array -validateTestVectors(); diff --git a/hosted/test-vectors/protocol/vector.schema.json b/hosted/test-vectors/protocol/vector.schema.json deleted file mode 100644 index a5f4bfaf..00000000 --- a/hosted/test-vectors/protocol/vector.schema.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "input": { - "type": "string" - }, - "output": { - "type": "object", - "additionalProperties": true - }, - "error": { - "type": "boolean" - } - }, - "required": ["description", "input", "error"] -} \ No newline at end of file diff --git a/hosted/test-vectors/protocol/vectors/parse-close.json b/hosted/test-vectors/protocol/vectors/parse-close.json deleted file mode 100644 index 6a4370aa..00000000 --- a/hosted/test-vectors/protocol/vectors/parse-close.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Close parses from string", - "input": "{\"metadata\":{\"kind\":\"close\",\"to\":\"did:key:zQ3shizfQYEiB8dqac96P6SHYtUCCsY7gSci4Qeaebgsfz1VC\",\"from\":\"did:key:zQ3shhwZ18aebLvYzCDdkkUH78z6RXec843BQc9hybsMRSoxg\",\"id\":\"close_7zzzzzzpvqf2480048h0001jm6\",\"exchangeId\":\"rfq_01hdh7fqvpevq8003pxr001a45\",\"createdAt\":\"2023-10-24T16:15:04.037Z\"},\"data\":{\"reason\":\"test reason\"},\"signature\":\"eyJraWQiOiJkaWQ6a2V5OnpRM3NoaHdaMThhZWJMdll6Q0Rka2tVSDc4ejZSWGVjODQzQlFjOWh5YnNNUlNveGcjelEzc2hod1oxOGFlYkx2WXpDRGRra1VINzh6NlJYZWM4NDNCUWM5aHlic01SU294ZyIsImFsZyI6IkVTMjU2SyJ9..TDtaxXdl1Bljuft8bZlvxTXTK472fKOia12kG_mQA7UhGTVIfwO9cuDCS_86EZHPMhkAvYdOnIiUodouZVba_A\"}", - "output": { - "metadata": { - "kind": "close", - "to": "did:key:zQ3shizfQYEiB8dqac96P6SHYtUCCsY7gSci4Qeaebgsfz1VC", - "from": "did:key:zQ3shhwZ18aebLvYzCDdkkUH78z6RXec843BQc9hybsMRSoxg", - "id": "close_7zzzzzzpvqf2480048h0001jm6", - "exchangeId": "rfq_01hdh7fqvpevq8003pxr001a45", - "createdAt": "2023-10-24T16:15:04.037Z" - }, - "data": { - "reason": "test reason" - }, - "signature": "eyJraWQiOiJkaWQ6a2V5OnpRM3NoaHdaMThhZWJMdll6Q0Rka2tVSDc4ejZSWGVjODQzQlFjOWh5YnNNUlNveGcjelEzc2hod1oxOGFlYkx2WXpDRGRra1VINzh6NlJYZWM4NDNCUWM5aHlic01SU294ZyIsImFsZyI6IkVTMjU2SyJ9..TDtaxXdl1Bljuft8bZlvxTXTK472fKOia12kG_mQA7UhGTVIfwO9cuDCS_86EZHPMhkAvYdOnIiUodouZVba_A" - }, - "error": false -} \ No newline at end of file diff --git a/hosted/test-vectors/protocol/vectors/parse-offering.json b/hosted/test-vectors/protocol/vectors/parse-offering.json deleted file mode 100644 index 89aaf914..00000000 --- a/hosted/test-vectors/protocol/vectors/parse-offering.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "description": "can parse and serialize an Offering", - "input": "{\"metadata\":{\"kind\":\"offering\",\"from\":\"did:key:zQ3shhwZ18aebLvYzCDdkkUH78z6RXec843BQc9hybsMRSoxg\",\"id\":\"offering_01hdh7fyftfkv8002wyr000nj5\",\"createdAt\":\"2023-10-24T16:15:03.662Z\",\"updatedAt\":\"2023-10-24T16:15:03.662Z\"},\"data\":{\"description\":\"A sample offering\",\"payoutUnitsPerPayinUnit\":\"1\",\"payoutCurrency\":{\"currencyCode\":\"USDC\"},\"payinCurrency\":{\"currencyCode\":\"AUD\",\"minSubunits\":\"1\",\"maxSubunits\":\"10000\"},\"payinMethods\":[{\"kind\":\"BTC_ADDRESS\",\"requiredPaymentDetails\":{\"$schema\":\"http://json-schema.org/draft-07/schema\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"phoneNumber\":{\"minLength\":12,\"pattern\":\"^+2547[0-9]{8}$\",\"description\":\"Mobile Money account number of the Recipient\",\"type\":\"string\",\"title\":\"Phone Number\",\"maxLength\":12},\"accountHolderName\":{\"pattern\":\"^[A-Za-zs'-]+$\",\"description\":\"Name of the account holder as it appears on the Mobile Money account\",\"type\":\"string\",\"title\":\"Account Holder Name\",\"maxLength\":32}},\"required\":[\"accountNumber\",\"accountHolderName\"]}}],\"payoutMethods\":[{\"kind\":\"MOMO\",\"requiredPaymentDetails\":{\"$schema\":\"http://json-schema.org/draft-07/schema\",\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"phoneNumber\":{\"minLength\":12,\"pattern\":\"^+2547[0-9]{8}$\",\"description\":\"Mobile Money account number of the Recipient\",\"type\":\"string\",\"title\":\"Phone Number\",\"maxLength\":12},\"accountHolderName\":{\"pattern\":\"^[A-Za-zs'-]+$\",\"description\":\"Name of the account holder as it appears on the Mobile Money account\",\"type\":\"string\",\"title\":\"Account Holder Name\",\"maxLength\":32}},\"required\":[\"accountNumber\",\"accountHolderName\"]}}],\"requiredClaims\":{\"id\":\"test-pd-id\",\"name\":\"simple PD\",\"purpose\":\"pd for testing\",\"input_descriptors\":[{\"id\":\"whatever\",\"purpose\":\"id for testing\",\"constraints\":{\"fields\":[{\"path\":[\"$.credentialSubject.btcAddress\"]}]}}]}},\"signature\":\"eyJraWQiOiJkaWQ6a2V5OnpRM3NoaHdaMThhZWJMdll6Q0Rka2tVSDc4ejZSWGVjODQzQlFjOWh5YnNNUlNveGcjelEzc2hod1oxOGFlYkx2WXpDRGRra1VINzh6NlJYZWM4NDNCUWM5aHlic01SU294ZyIsImFsZyI6IkVTMjU2SyJ9..MyaMT4LZAlkLj4w9LZMqQLsaklhHlsrob60p1XmKMKg249kweyXPGABpEnvKD_65_1s1RjdyKlEotgQT15xAYw\"}", - "output": { - "metadata": { - "kind": "offering", - "from": "did:key:zQ3shhwZ18aebLvYzCDdkkUH78z6RXec843BQc9hybsMRSoxg", - "id": "offering_01hdh7fyftfkv8002wyr000nj5", - "createdAt": "2023-10-24T16:15:03.662Z", - "updatedAt": "2023-10-24T16:15:03.662Z" - }, - "data": { - "description": "A sample offering", - "payoutUnitsPerPayinUnit": "1", - "payoutCurrency": { - "currencyCode": "USDC" - }, - "payinCurrency": { - "currencyCode": "AUD", - "minSubunits": "1", - "maxSubunits": "10000" - }, - "payinMethods": [ - { - "kind": "BTC_ADDRESS", - "requiredPaymentDetails": { - "$schema": "http://json-schema.org/draft-07/schema", - "additionalProperties": false, - "type": "object", - "properties": { - "phoneNumber": { - "minLength": 12, - "pattern": "^+2547[0-9]{8}$", - "description": "Mobile Money account number of the Recipient", - "type": "string", - "title": "Phone Number", - "maxLength": 12 - }, - "accountHolderName": { - "pattern": "^[A-Za-zs'-]+$", - "description": "Name of the account holder as it appears on the Mobile Money account", - "type": "string", - "title": "Account Holder Name", - "maxLength": 32 - } - }, - "required": [ - "accountNumber", - "accountHolderName" - ] - } - } - ], - "payoutMethods": [ - { - "kind": "MOMO", - "requiredPaymentDetails": { - "$schema": "http://json-schema.org/draft-07/schema", - "additionalProperties": false, - "type": "object", - "properties": { - "phoneNumber": { - "minLength": 12, - "pattern": "^+2547[0-9]{8}$", - "description": "Mobile Money account number of the Recipient", - "type": "string", - "title": "Phone Number", - "maxLength": 12 - }, - "accountHolderName": { - "pattern": "^[A-Za-zs'-]+$", - "description": "Name of the account holder as it appears on the Mobile Money account", - "type": "string", - "title": "Account Holder Name", - "maxLength": 32 - } - }, - "required": [ - "accountNumber", - "accountHolderName" - ] - } - } - ], - "requiredClaims": { - "id": "test-pd-id", - "name": "simple PD", - "purpose": "pd for testing", - "input_descriptors": [ - { - "id": "whatever", - "purpose": "id for testing", - "constraints": { - "fields": [ - { - "path": [ - "$.credentialSubject.btcAddress" - ] - } - ] - } - } - ] - } - }, - "signature": "eyJraWQiOiJkaWQ6a2V5OnpRM3NoaHdaMThhZWJMdll6Q0Rka2tVSDc4ejZSWGVjODQzQlFjOWh5YnNNUlNveGcjelEzc2hod1oxOGFlYkx2WXpDRGRra1VINzh6NlJYZWM4NDNCUWM5aHlic01SU294ZyIsImFsZyI6IkVTMjU2SyJ9..MyaMT4LZAlkLj4w9LZMqQLsaklhHlsrob60p1XmKMKg249kweyXPGABpEnvKD_65_1s1RjdyKlEotgQT15xAYw" - }, - "error": false -} \ No newline at end of file diff --git a/hosted/test-vectors/protocol/vectors/parse-order.json b/hosted/test-vectors/protocol/vectors/parse-order.json deleted file mode 100644 index c73fe41a..00000000 --- a/hosted/test-vectors/protocol/vectors/parse-order.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "description": "Order parses from string", - "input": "{\"metadata\":{\"kind\":\"order\",\"to\":\"did:key:zQ3shhwZ18aebLvYzCDdkkUH78z6RXec843BQc9hybsMRSoxg\",\"from\":\"did:key:zQ3shizfQYEiB8dqac96P6SHYtUCCsY7gSci4Qeaebgsfz1VC\",\"id\":\"order_01hdh7fpzjeh980014a8000t9d\",\"exchangeId\":\"rfq_7zzzzzzqvhffw8002vz0000mwp\",\"createdAt\":\"2023-10-24T16:15:04.032Z\"},\"data\":{},\"signature\":\"eyJraWQiOiJkaWQ6a2V5OnpRM3NoaXpmUVlFaUI4ZHFhYzk2UDZTSFl0VUNDc1k3Z1NjaTRRZWFlYmdzZnoxVkMjelEzc2hpemZRWUVpQjhkcWFjOTZQNlNIWXRVQ0NzWTdnU2NpNFFlYWViZ3NmejFWQyIsImFsZyI6IkVTMjU2SyJ9..FLzrqCirBzDFix3AuIpv-1FtGSUNq7v6ckUQjzrGc5JLDSggS8P-MdVJ1gW5SVCusZCRhkjk6UX4qQXSFZ4X8w\"}", - "output": { - "metadata": { - "kind": "order", - "to": "did:key:zQ3shhwZ18aebLvYzCDdkkUH78z6RXec843BQc9hybsMRSoxg", - "from": "did:key:zQ3shizfQYEiB8dqac96P6SHYtUCCsY7gSci4Qeaebgsfz1VC", - "id": "order_01hdh7fpzjeh980014a8000t9d", - "exchangeId": "rfq_7zzzzzzqvhffw8002vz0000mwp", - "createdAt": "2023-10-24T16:15:04.032Z" - }, - "data": {}, - "signature": "eyJraWQiOiJkaWQ6a2V5OnpRM3NoaXpmUVlFaUI4ZHFhYzk2UDZTSFl0VUNDc1k3Z1NjaTRRZWFlYmdzZnoxVkMjelEzc2hpemZRWUVpQjhkcWFjOTZQNlNIWXRVQ0NzWTdnU2NpNFFlYWViZ3NmejFWQyIsImFsZyI6IkVTMjU2SyJ9..FLzrqCirBzDFix3AuIpv-1FtGSUNq7v6ckUQjzrGc5JLDSggS8P-MdVJ1gW5SVCusZCRhkjk6UX4qQXSFZ4X8w" - }, - "error": false -} \ No newline at end of file diff --git a/hosted/test-vectors/protocol/vectors/parse-orderstatus.json b/hosted/test-vectors/protocol/vectors/parse-orderstatus.json deleted file mode 100644 index 47b3f6a0..00000000 --- a/hosted/test-vectors/protocol/vectors/parse-orderstatus.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Order Status parses from string", - "input": "{\"metadata\":{\"kind\":\"orderstatus\",\"to\":\"did:key:zQ3shizfQYEiB8dqac96P6SHYtUCCsY7gSci4Qeaebgsfz1VC\",\"from\":\"did:key:zQ3shhwZ18aebLvYzCDdkkUH78z6RXec843BQc9hybsMRSoxg\",\"id\":\"orderstatus_01hdh7fzvffj3r005wgw000ac4\",\"exchangeId\":\"rfq_01hdh7fqvzesf8002pbr001x7t\",\"createdAt\":\"2023-10-24T16:15:04.034Z\"},\"data\":{\"orderStatus\":\"PENDING\"},\"signature\":\"eyJraWQiOiJkaWQ6a2V5OnpRM3NoaHdaMThhZWJMdll6Q0Rka2tVSDc4ejZSWGVjODQzQlFjOWh5YnNNUlNveGcjelEzc2hod1oxOGFlYkx2WXpDRGRra1VINzh6NlJYZWM4NDNCUWM5aHlic01SU294ZyIsImFsZyI6IkVTMjU2SyJ9..dSZEztUIOWMfb8fLuJSL5A9DblEH7ROszTUztv1b-21dgKEZMCZCAPeju2MEEIObtv7SKvWopenL7IqtP2RpVQ\"}", - "output": { - "metadata": { - "kind": "orderstatus", - "to": "did:key:zQ3shizfQYEiB8dqac96P6SHYtUCCsY7gSci4Qeaebgsfz1VC", - "from": "did:key:zQ3shhwZ18aebLvYzCDdkkUH78z6RXec843BQc9hybsMRSoxg", - "id": "orderstatus_01hdh7fzvffj3r005wgw000ac4", - "exchangeId": "rfq_01hdh7fqvzesf8002pbr001x7t", - "createdAt": "2023-10-24T16:15:04.034Z" - }, - "data": { - "orderStatus": "PENDING" - }, - "signature": "eyJraWQiOiJkaWQ6a2V5OnpRM3NoaHdaMThhZWJMdll6Q0Rka2tVSDc4ejZSWGVjODQzQlFjOWh5YnNNUlNveGcjelEzc2hod1oxOGFlYkx2WXpDRGRra1VINzh6NlJYZWM4NDNCUWM5aHlic01SU294ZyIsImFsZyI6IkVTMjU2SyJ9..dSZEztUIOWMfb8fLuJSL5A9DblEH7ROszTUztv1b-21dgKEZMCZCAPeju2MEEIObtv7SKvWopenL7IqtP2RpVQ" - }, - "error": false -} \ No newline at end of file diff --git a/hosted/test-vectors/protocol/vectors/parse-quote.json b/hosted/test-vectors/protocol/vectors/parse-quote.json deleted file mode 100644 index ce8b0165..00000000 --- a/hosted/test-vectors/protocol/vectors/parse-quote.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "description": "Quote parses from string", - "input": "{\"metadata\":{\"kind\":\"quote\",\"to\":\"did:key:zQ3shizfQYEiB8dqac96P6SHYtUCCsY7gSci4Qeaebgsfz1VC\",\"from\":\"did:key:zQ3shhwZ18aebLvYzCDdkkUH78z6RXec843BQc9hybsMRSoxg\",\"id\":\"quote_7zzzzzzpyrfy2r004fgm0013c7\",\"exchangeId\":\"rfq_7zzzzzzzztfxx8001ff8000ex2\",\"createdAt\":\"2023-10-24T16:15:04.024Z\"},\"data\":{\"expiresAt\":\"2023-10-25T16:15:04.024Z\",\"payin\":{\"currencyCode\":\"AUD\",\"amountSubunits\":\"1000\",\"feeSubunits\":\"1\"},\"payout\":{\"currencyCode\":\"BTC\",\"amountSubunits\":\"12\",\"feeSubunits\":\"2\"},\"paymentInstructions\":{\"payin\":{\"link\":\"https://block.xyz\",\"instruction\":\"payin instruction\"},\"payout\":{\"link\":\"https://block.xyz\",\"instruction\":\"payout instruction\"}}},\"signature\":\"eyJraWQiOiJkaWQ6a2V5OnpRM3NoaHdaMThhZWJMdll6Q0Rka2tVSDc4ejZSWGVjODQzQlFjOWh5YnNNUlNveGcjelEzc2hod1oxOGFlYkx2WXpDRGRra1VINzh6NlJYZWM4NDNCUWM5aHlic01SU294ZyIsImFsZyI6IkVTMjU2SyJ9..B2n8TL3Tk_Bq0uf8l-1IIj_p44fuLghihElbrF493N1b1TqexdHqkhUuevdh5DKsTi3DgiQyHd8Vijwnz6Ap_A\"}", - "output": { - "metadata": { - "kind": "quote", - "to": "did:key:zQ3shizfQYEiB8dqac96P6SHYtUCCsY7gSci4Qeaebgsfz1VC", - "from": "did:key:zQ3shhwZ18aebLvYzCDdkkUH78z6RXec843BQc9hybsMRSoxg", - "id": "quote_7zzzzzzpyrfy2r004fgm0013c7", - "exchangeId": "rfq_7zzzzzzzztfxx8001ff8000ex2", - "createdAt": "2023-10-24T16:15:04.024Z" - }, - "data": { - "expiresAt": "2023-10-25T16:15:04.024Z", - "payin": { - "currencyCode": "AUD", - "amountSubunits": "1000", - "feeSubunits": "1" - }, - "payout": { - "currencyCode": "BTC", - "amountSubunits": "12", - "feeSubunits": "2" - }, - "paymentInstructions": { - "payin": { - "link": "https://block.xyz", - "instruction": "payin instruction" - }, - "payout": { - "link": "https://block.xyz", - "instruction": "payout instruction" - } - } - }, - "signature": "eyJraWQiOiJkaWQ6a2V5OnpRM3NoaHdaMThhZWJMdll6Q0Rka2tVSDc4ejZSWGVjODQzQlFjOWh5YnNNUlNveGcjelEzc2hod1oxOGFlYkx2WXpDRGRra1VINzh6NlJYZWM4NDNCUWM5aHlic01SU294ZyIsImFsZyI6IkVTMjU2SyJ9..B2n8TL3Tk_Bq0uf8l-1IIj_p44fuLghihElbrF493N1b1TqexdHqkhUuevdh5DKsTi3DgiQyHd8Vijwnz6Ap_A" - }, - "error": false -} \ No newline at end of file diff --git a/hosted/test-vectors/protocol/vectors/parse-rfq.json b/hosted/test-vectors/protocol/vectors/parse-rfq.json deleted file mode 100644 index 6f61df3f..00000000 --- a/hosted/test-vectors/protocol/vectors/parse-rfq.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "description": "RFQ parses from string", - "input": "{\"metadata\":{\"kind\":\"rfq\",\"to\":\"did:key:zQ3shhwZ18aebLvYzCDdkkUH78z6RXec843BQc9hybsMRSoxg\",\"from\":\"did:key:zQ3shizfQYEiB8dqac96P6SHYtUCCsY7gSci4Qeaebgsfz1VC\",\"id\":\"rfq_7zzzzzzyzte028007g0g001xdc\",\"exchangeId\":\"rfq_7zzzzzzyzte028007g0g001xdc\",\"createdAt\":\"2023-10-24T16:15:04.010Z\"},\"data\":{\"offeringId\":\"offering_01hdh7fyzzek48003ms0001bv2\",\"payinSubunits\":\"1000\",\"payinMethod\":{\"kind\":\"BTC_ADDRESS\",\"paymentDetails\":{\"address\":\"123456\"}},\"payoutMethod\":{\"kind\":\"MOMO\",\"paymentDetails\":{\"phoneNumber\":\"+254712345678\",\"accountHolderName\":\"Alfred Holder\"}},\"claims\":[\"presentation submission\"]},\"signature\":\"eyJraWQiOiJkaWQ6a2V5OnpRM3NoaXpmUVlFaUI4ZHFhYzk2UDZTSFl0VUNDc1k3Z1NjaTRRZWFlYmdzZnoxVkMjelEzc2hpemZRWUVpQjhkcWFjOTZQNlNIWXRVQ0NzWTdnU2NpNFFlYWViZ3NmejFWQyIsImFsZyI6IkVTMjU2SyJ9..Y9gKs87CGalvHxlChHsL2fx2wtlPbY2-tBDciz7rSKRJkWmeIdyu-7NxwUdVMlQfJ58PTLoYPknXUKL8Hc0v4w\"}", - "output": { - "metadata": { - "kind": "rfq", - "to": "did:key:zQ3shhwZ18aebLvYzCDdkkUH78z6RXec843BQc9hybsMRSoxg", - "from": "did:key:zQ3shizfQYEiB8dqac96P6SHYtUCCsY7gSci4Qeaebgsfz1VC", - "id": "rfq_7zzzzzzyzte028007g0g001xdc", - "exchangeId": "rfq_7zzzzzzyzte028007g0g001xdc", - "createdAt": "2023-10-24T16:15:04.010Z" - }, - "data": { - "offeringId": "offering_01hdh7fyzzek48003ms0001bv2", - "payinSubunits": "1000", - "payinMethod": { - "kind": "BTC_ADDRESS", - "paymentDetails": { - "address": "123456" - } - }, - "payoutMethod": { - "kind": "MOMO", - "paymentDetails": { - "phoneNumber": "+254712345678", - "accountHolderName": "Alfred Holder" - } - }, - "claims": [ - "presentation submission" - ] - }, - "signature": "eyJraWQiOiJkaWQ6a2V5OnpRM3NoaXpmUVlFaUI4ZHFhYzk2UDZTSFl0VUNDc1k3Z1NjaTRRZWFlYmdzZnoxVkMjelEzc2hpemZRWUVpQjhkcWFjOTZQNlNIWXRVQ0NzWTdnU2NpNFFlYWViZ3NmejFWQyIsImFsZyI6IkVTMjU2SyJ9..Y9gKs87CGalvHxlChHsL2fx2wtlPbY2-tBDciz7rSKRJkWmeIdyu-7NxwUdVMlQfJ58PTLoYPknXUKL8Hc0v4w" - }, - "error": false -} \ No newline at end of file diff --git a/tbdex-interop-suite b/tbdex-interop-suite new file mode 160000 index 00000000..51d313c5 --- /dev/null +++ b/tbdex-interop-suite @@ -0,0 +1 @@ +Subproject commit 51d313c5525a37d683353c170ace8dfceada13fc