Skip to content

Commit 0e88d07

Browse files
authored
docs: use PaymentRequest export in examples (#555)
* docs: use PaymentRequest export in examples * docs: add payment request changeset
1 parent 8da60b5 commit 0e88d07

2 files changed

Lines changed: 15 additions & 10 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'mppx': patch
3+
---
4+
5+
Corrected PaymentRequest documentation examples to use the exported namespace name.

src/PaymentRequest.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import type * as z from './zod.js'
99
*
1010
* @example
1111
* ```ts
12-
* import { Request } from 'mppx'
12+
* import { PaymentRequest } from 'mppx'
1313
*
14-
* const request: Request.Request = {
14+
* const request: PaymentRequest.Request = {
1515
* amount: '1000000',
1616
* currency: '0x20c0000000000000000000000000000000000001',
1717
* recipient: '0x742d35Cc6634C0532925a3b844Bc9e7595f8fE00',
@@ -29,9 +29,9 @@ export type Request<request extends Record<string, unknown> = Record<string, unk
2929
*
3030
* @example
3131
* ```ts
32-
* import { Request } from 'mppx'
32+
* import { PaymentRequest } from 'mppx'
3333
*
34-
* const request = Request.deserialize(serialized)
34+
* const request = PaymentRequest.deserialize(serialized)
3535
* ```
3636
*/
3737
export function deserialize(encoded: string): Request {
@@ -47,9 +47,9 @@ export function deserialize(encoded: string): Request {
4747
*
4848
* @example
4949
* ```ts
50-
* import { Request } from 'mppx'
50+
* import { PaymentRequest } from 'mppx'
5151
*
52-
* const request = Request.from({
52+
* const request = PaymentRequest.from({
5353
* amount: '1000000',
5454
* currency: '0x20c0000000000000000000000000000000000001',
5555
* recipient: '0x742d35Cc6634C0532925a3b844Bc9e7595f8fE00',
@@ -69,10 +69,10 @@ export function from<const request extends Request>(request: request): request {
6969
*
7070
* @example
7171
* ```ts
72-
* import { Request } from 'mppx'
72+
* import { PaymentRequest } from 'mppx'
7373
* import { Methods } from 'mppx/tempo'
7474
*
75-
* const request = Request.fromMethod(Methods.charge, {
75+
* const request = PaymentRequest.fromMethod(Methods.charge, {
7676
* amount: '1000000',
7777
* currency: '0x20c0000000000000000000000000000000000001',
7878
* recipient: '0x742d35Cc6634C0532925a3b844Bc9e7595f8fE00',
@@ -96,9 +96,9 @@ export function fromMethod<const method extends Method.Method>(
9696
*
9797
* @example
9898
* ```ts
99-
* import { Request } from 'mppx'
99+
* import { PaymentRequest } from 'mppx'
100100
*
101-
* const serialized = Request.serialize(request)
101+
* const serialized = PaymentRequest.serialize(request)
102102
* // => "eyJhbW91bnQiOiIxMDAwMDAwIiwiY3VycmVuY3kiOiIweC4uLiJ9"
103103
* ```
104104
*/

0 commit comments

Comments
 (0)