generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding orderinstructions message description (#355)
* adding orderinstructions message description to readme. updated quote and message schema. added orderinstructions schema. * fixing parse-quote.json test vector. added parse orderinstructions test vector * Apply suggestions from code review Co-authored-by: Kendall Weihe <kendallweihe@gmail.com> --------- Co-authored-by: Kendall Weihe <kendallweihe@gmail.com>
- Loading branch information
1 parent
e7de163
commit 47db162
Showing
6 changed files
with
122 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://tbdex.dev/orderinstructions.schema.json", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"payin": { | ||
"$ref": "#/definitions/PaymentInstruction" | ||
}, | ||
"payout": { | ||
"$ref": "#/definitions/PaymentInstruction" | ||
} | ||
}, | ||
"definitions": { | ||
"PaymentInstruction": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"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" | ||
} | ||
} | ||
} | ||
}, | ||
"required": ["payin", "payout"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
hosted/test-vectors/protocol/vectors/parse-orderinstructions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"description": "OrderInstructions parses from string", | ||
"input": "{\"metadata\":{\"from\":\"did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6IlJnenp4VEhEWkhua2l1dXg5RWE0YktZS0ttSzR5QkRYRnlSSGUtLVQ2Y2sifQ\",\"to\":\"did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6IndiTTc4VzAtcXhtM0wxOWZfMkYtZ1FWOUhWNkEtcERwOVJyWUtNN0NCZTgifQ\",\"kind\":\"orderinstructions\",\"id\":\"orderinstructions_01j3ers909e91v1m52p1pg4dwt\",\"exchangeId\":\"rfq_01j3ers909e91a1e1cafmj9b9z\",\"createdAt\":\"2024-07-23T03:05:00Z\",\"protocol\":\"1.0\"},\"data\":{\"payin\":{\"link\":\"http://example.com/payin/123\",\"instruction\":\"deducted from stored balance\"},\"payout\":{\"link\":\"http://example.com/payout/123\",\"instruction\":\"sent to your bank account\"}},\"signature\":\"eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKcmRIa2lPaUpQUzFBaUxDSmpjbllpT2lKRlpESTFOVEU1SWl3aWVDSTZJbEpuZW5wNFZFaEVXa2h1YTJsMWRYZzVSV0UwWWt0WlMwdHRTelI1UWtSWVJubFNTR1V0TFZRMlkyc2lmUSMwIn0..FIa-a_6a_eKEuM6gAcWp9VPKge_x1UFnPhoT6fdsq0MxgYBRlPPs1fzNqaKD7U_M4icjZ2x4lWR10GLkBy-gCA\"}", | ||
"output": { | ||
"metadata": { | ||
"from": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6IlJnenp4VEhEWkhua2l1dXg5RWE0YktZS0ttSzR5QkRYRnlSSGUtLVQ2Y2sifQ", | ||
"to": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6IndiTTc4VzAtcXhtM0wxOWZfMkYtZ1FWOUhWNkEtcERwOVJyWUtNN0NCZTgifQ", | ||
"kind": "orderinstructions", | ||
"id": "orderinstructions_01j3ers909e91v1m52p1pg4dwt", | ||
"exchangeId": "rfq_01j3ers909e91a1e1cafmj9b9z", | ||
"createdAt": "2024-07-23T03:05:00Z", | ||
"protocol": "1.0" | ||
}, | ||
"data": { | ||
"payin": { | ||
"link": "http://example.com/payin/123", | ||
"instruction": "deducted from stored balance" | ||
}, | ||
"payout": { | ||
"link": "http://example.com/payout/123", | ||
"instruction": "sent to your bank account" | ||
} | ||
}, | ||
"signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKcmRIa2lPaUpQUzFBaUxDSmpjbllpT2lKRlpESTFOVEU1SWl3aWVDSTZJbEpuZW5wNFZFaEVXa2h1YTJsMWRYZzVSV0UwWWt0WlMwdHRTelI1UWtSWVJubFNTR1V0TFZRMlkyc2lmUSMwIn0..FIa-a_6a_eKEuM6gAcWp9VPKge_x1UFnPhoT6fdsq0MxgYBRlPPs1fzNqaKD7U_M4icjZ2x4lWR10GLkBy-gCA" | ||
}, | ||
"error": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,33 @@ | ||
{ | ||
"description": "Quote parses from string", | ||
"input": "{\"metadata\": {\"from\": \"did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6Im83eG85MkxXOWNiZGUtOWRMZUE1ZFhDVjBneUdWVnVtb0xfZVlmVFhtWGsifQ\",\"to\": \"did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6Ii12V195SDFMMWkzUW5vVlNGcXNrMDRGWGd4YVhhRGtHOEV1cF96MmxtWlUifQ\",\"kind\": \"quote\",\"id\": \"quote_01j2f22daeefet5g9ynxg5stm3\",\"exchangeId\": \"rfq_01j2f22daeefeaaqbp61thnxpb\",\"createdAt\": \"2024-07-10T19:31:34Z\",\"protocol\": \"1.0\"},\"data\": {\"expiresAt\": \"2024-07-10T19:31:34Z\",\"payoutUnitsPerPayinUnit\": \"16.665\",\"payin\": {\"currencyCode\": \"USD\",\"subtotal\": \"10\",\"fee\": \"0\",\"total\": \"10\",\"paymentInstruction\": {\"instruction\": \"use link provided\"}},\"payout\": {\"currencyCode\": \"MXN\",\"subtotal\": \"500\",\"fee\": \"0\",\"total\": \"500\",\"paymentInstruction\": {\"instruction\": \"SPEI transfer\"}}},\"signature\": \"eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKcmRIa2lPaUpQUzFBaUxDSmpjbllpT2lKRlpESTFOVEU1SWl3aWVDSTZJbTgzZUc4NU1reFhPV05pWkdVdE9XUk1aVUUxWkZoRFZqQm5lVWRXVm5WdGIweGZaVmxtVkZodFdHc2lmUSMwIn0..SYMZMQwrThsrNHXxHnXoiozCyvtePVOy3kHzQ0Pj3LYYf0h-l6PC2GLblWEtGVJrz27Ct_VdqUnOvm7nF6NLAA\"}", | ||
"input": "{\"metadata\":{\"from\":\"did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6ImdJVUR0dFBhaDFhaGxSVnA5dnhpNkFsTVZtWDBEcGF4Y0hlbWU0TE1jRGMifQ\",\"to\":\"did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6Im8yek5wb284bFVhbGVfZXcwcE9la09maWdic3IwM1F2VUNCNkxwVkZXblUifQ\",\"kind\":\"quote\",\"id\":\"quote_01j3ern5tcf6zs8frq64wtbe2b\",\"exchangeId\":\"rfq_01j3ern5tcf6z81ch2e6tm1sws\",\"createdAt\":\"2024-07-23T03:02:45Z\",\"protocol\":\"1.0\"},\"data\":{\"expiresAt\":\"2024-07-23T03:02:45Z\",\"payoutUnitsPerPayinUnit\":\"16.665\",\"payin\":{\"currencyCode\":\"USD\",\"subtotal\":\"10\",\"fee\":\"0.1\",\"total\":\"10.1\"},\"payout\":{\"currencyCode\":\"MXN\",\"subtotal\":\"500\",\"fee\":\"0\",\"total\":\"500\"}},\"signature\":\"eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKcmRIa2lPaUpQUzFBaUxDSmpjbllpT2lKRlpESTFOVEU1SWl3aWVDSTZJbWRKVlVSMGRGQmhhREZoYUd4U1ZuQTVkbmhwTmtGc1RWWnRXREJFY0dGNFkwaGxiV1UwVEUxalJHTWlmUSMwIn0..ceuURLX2zdrAoUHlsQ6jfgWj4ika0oq4uxxJ7w_y7vUK5sizV0AzqMEmit469MjT5-cjCJe6oXzES3pqgnHvAQ\"}", | ||
"output": { | ||
"metadata": { | ||
"from": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6Im83eG85MkxXOWNiZGUtOWRMZUE1ZFhDVjBneUdWVnVtb0xfZVlmVFhtWGsifQ", | ||
"to": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6Ii12V195SDFMMWkzUW5vVlNGcXNrMDRGWGd4YVhhRGtHOEV1cF96MmxtWlUifQ", | ||
"from": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6ImdJVUR0dFBhaDFhaGxSVnA5dnhpNkFsTVZtWDBEcGF4Y0hlbWU0TE1jRGMifQ", | ||
"to": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6Im8yek5wb284bFVhbGVfZXcwcE9la09maWdic3IwM1F2VUNCNkxwVkZXblUifQ", | ||
"kind": "quote", | ||
"id": "quote_01j2f22daeefet5g9ynxg5stm3", | ||
"exchangeId": "rfq_01j2f22daeefeaaqbp61thnxpb", | ||
"createdAt": "2024-07-10T19:31:34Z", | ||
"id": "quote_01j3ern5tcf6zs8frq64wtbe2b", | ||
"exchangeId": "rfq_01j3ern5tcf6z81ch2e6tm1sws", | ||
"createdAt": "2024-07-23T03:02:45Z", | ||
"protocol": "1.0" | ||
}, | ||
"data": { | ||
"expiresAt": "2024-07-10T19:31:34Z", | ||
"expiresAt": "2024-07-23T03:02:45Z", | ||
"payoutUnitsPerPayinUnit": "16.665", | ||
"payin": { | ||
"currencyCode": "USD", | ||
"subtotal": "10", | ||
"fee": "0", | ||
"total": "10", | ||
"paymentInstruction": { | ||
"instruction": "use link provided" | ||
} | ||
"fee": "0.1", | ||
"total": "10.1" | ||
}, | ||
"payout": { | ||
"currencyCode": "MXN", | ||
"subtotal": "500", | ||
"fee": "0", | ||
"total": "500", | ||
"paymentInstruction": { | ||
"instruction": "SPEI transfer" | ||
} | ||
"total": "500" | ||
} | ||
}, | ||
"signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKcmRIa2lPaUpQUzFBaUxDSmpjbllpT2lKRlpESTFOVEU1SWl3aWVDSTZJbTgzZUc4NU1reFhPV05pWkdVdE9XUk1aVUUxWkZoRFZqQm5lVWRXVm5WdGIweGZaVmxtVkZodFdHc2lmUSMwIn0..SYMZMQwrThsrNHXxHnXoiozCyvtePVOy3kHzQ0Pj3LYYf0h-l6PC2GLblWEtGVJrz27Ct_VdqUnOvm7nF6NLAA" | ||
"signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKcmRIa2lPaUpQUzFBaUxDSmpjbllpT2lKRlpESTFOVEU1SWl3aWVDSTZJbWRKVlVSMGRGQmhhREZoYUd4U1ZuQTVkbmhwTmtGc1RWWnRXREJFY0dGNFkwaGxiV1UwVEUxalJHTWlmUSMwIn0..ceuURLX2zdrAoUHlsQ6jfgWj4ika0oq4uxxJ7w_y7vUK5sizV0AzqMEmit469MjT5-cjCJe6oXzES3pqgnHvAQ" | ||
}, | ||
"error": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters