@@ -22,7 +22,6 @@ import {
2222 OutgoingPaymentWithSpentAmounts ,
2323 Subject
2424} from '../types'
25- import { v4 as uuid } from 'uuid'
2625import { ResponseValidator , ValidationError } from '@interledger/openapi'
2726import base64url from 'base64url'
2827import { BaseDeps } from '../client'
@@ -60,8 +59,8 @@ export const mockOpenApiResponseValidators = () => ({
6059} )
6160
6261export const mockJwk = ( overrides ?: Partial < JWK > ) : JWK => ( {
63- x : uuid ( ) ,
64- kid : uuid ( ) ,
62+ x : crypto . randomUUID ( ) ,
63+ kid : crypto . randomUUID ( ) ,
6564 alg : 'EdDSA' ,
6665 kty : 'OKP' ,
6766 crv : 'Ed25519' ,
@@ -89,7 +88,7 @@ export const mockWalletAddress = (
8988export const mockIncomingPayment = (
9089 overrides ?: Partial < IncomingPayment >
9190) : IncomingPayment => ( {
92- id : `https://example.com/.well-known/pay/incoming-payments/${ uuid ( ) } ` ,
91+ id : `https://example.com/.well-known/pay/incoming-payments/${ crypto . randomUUID ( ) } ` ,
9392 walletAddress : 'https://example.com/.well-known/pay' ,
9493 completed : false ,
9594 incomingAmount : {
@@ -109,7 +108,7 @@ export const mockIncomingPayment = (
109108export const mockIncomingPaymentWithPaymentMethods = (
110109 overrides ?: Partial < IncomingPaymentWithPaymentMethods >
111110) : IncomingPaymentWithPaymentMethods => ( {
112- id : `https://example.com/.well-known/pay/incoming-payments/${ uuid ( ) } ` ,
111+ id : `https://example.com/.well-known/pay/incoming-payments/${ crypto . randomUUID ( ) } ` ,
113112 walletAddress : 'https://example.com/.well-known/pay' ,
114113 completed : false ,
115114 incomingAmount : {
@@ -171,7 +170,7 @@ export const mockIncomingPaymentPaginationResult = (
171170export const mockOutgoingPayment = (
172171 overrides ?: Partial < OutgoingPayment >
173172) : OutgoingPayment => ( {
174- id : `https://example.com/.well-known/pay/outgoing-payments/${ uuid ( ) } ` ,
173+ id : `https://example.com/.well-known/pay/outgoing-payments/${ crypto . randomUUID ( ) } ` ,
175174 walletAddress : 'https://example.com/.well-known/pay' ,
176175 failed : false ,
177176 debitAmount : {
@@ -189,8 +188,8 @@ export const mockOutgoingPayment = (
189188 assetScale : 2 ,
190189 value : '10'
191190 } ,
192- quoteId : uuid ( ) ,
193- receiver : uuid ( ) ,
191+ quoteId : crypto . randomUUID ( ) ,
192+ receiver : crypto . randomUUID ( ) ,
194193 metadata : { externalRef : 'INV #1' , description : 'some description' } ,
195194 createdAt : new Date ( ) . toISOString ( ) ,
196195 ...overrides
@@ -323,7 +322,7 @@ export const mockGrantRequest = (
323322export const mockContinuationRequest = (
324323 overrides ?: Partial < GrantContinuationRequest >
325324) : GrantContinuationRequest => ( {
326- interact_ref : uuid ( ) ,
325+ interact_ref : crypto . randomUUID ( ) ,
327326 ...overrides
328327} )
329328
@@ -332,7 +331,7 @@ export const mockAccessToken = (
332331) : AccessToken => ( {
333332 access_token : {
334333 value : '99C36C2A4DB5BEBC' ,
335- manage : `http://example.com/token/${ uuid ( ) } ` ,
334+ manage : `http://example.com/token/${ crypto . randomUUID ( ) } ` ,
336335 access : [
337336 {
338337 type : 'incoming-payment' ,
@@ -345,7 +344,7 @@ export const mockAccessToken = (
345344} )
346345
347346export const mockQuote = ( overrides ?: Partial < Quote > ) : Quote => ( {
348- id : `https://example.com/.well-known/pay/quotes/${ uuid ( ) } ` ,
347+ id : `https://example.com/.well-known/pay/quotes/${ crypto . randomUUID ( ) } ` ,
349348 receiver : 'https://example.com/.well-known/peer' ,
350349 walletAddress : 'https://example.com/.well-known/pay' ,
351350 debitAmount : {
0 commit comments