Skip to content

Commit e557219

Browse files
committed
Adding the currency selection step to the docs
1 parent 9ee068a commit e557219

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

v2/specification.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# JSON Payment Protocol Specification V2
22

3-
Revision 0.7
3+
Revision 0.1
44

55
## Application Logic
66

@@ -10,6 +10,7 @@ Revision 0.7
1010
4. (Server) Verifies invoice exists and is still accepting payments, responds with payment request
1111
5. (Client) Validates payment request hash
1212
6. (Client) Validates payment request signature
13+
7. (Client) Selects a currency from the list of payment options
1314
7. (Client) Generates a payment to match conditions on payment request
1415
8. (Client) Submits proposed unsigned transaction and size of signed transaction to server
1516
9. (Server) Validates invoice exists and is still accepting payments
@@ -58,7 +59,16 @@ Each payment option includes
5859
* `instructions` - An array of instructions for this currency
5960
* `tokenInformation` - An optional object that includes currency specific information. If this isn't present, then we're using the chain's native currency
6061

62+
#### Payment Request Types
6163
```typescript
64+
interface PaymentRequest {
65+
time: Date;
66+
expires: Date;
67+
memo: string;
68+
paymentUrl: string;
69+
paymentId: string;
70+
paymentOptions: Array<CurrencyInstruction<BtcInstruction> | CurrencyInstruction<EthInstruction>>;
71+
}
6272

6373
type CurrencyInstruction<T> = {
6474
chain: string;
@@ -71,7 +81,6 @@ type CurrencyInstruction<T> = {
7181
}
7282
};
7383

74-
7584
interface BtcInstruction {
7685
requiredFeePerByte: number;
7786
outputs: Array<{ amount: number; address: string }>;

0 commit comments

Comments
 (0)