Skip to content

Commit

Permalink
Updated code to reflect Offering spec changes
Browse files Browse the repository at this point in the history
  • Loading branch information
thehenrytsai committed Jul 18, 2024
1 parent 8ea160c commit f467d54
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
3 changes: 3 additions & 0 deletions packages/protocol/src/dev-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ export class DevTools {
]
}
}]
},
cancellation : {
enabled : true
}
}
}
Expand Down
27 changes: 23 additions & 4 deletions packages/protocol/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@ export type OfferingMetadata = ResourceMetadata & { kind: 'offering' }
export type OfferingData = {
/** Brief description of what is being offered. */
description: string
/** Number of _payout_ currency units for one _payin_ currency unit (i.e 290000 USD for 1 BTC) */
payoutUnitsPerPayinUnit: string
/** Details about the currency that the PFI is selling. */
payout: PayoutDetails
/** Details about the currency that the PFI is buying in exchange for payout currency. */
payin: PayinDetails
/** Details about the currency that the PFI is selling. */
payout: PayoutDetails
/** Number of _payout_ currency units for one _payin_ currency unit (i.e 290000 USD for 1 BTC) */
payoutUnitsPerPayinUnit: string
/** Articulates the claim(s) required when submitting an RFQ for this offering. */
requiredClaims?: PresentationDefinitionV2
/** Details about PFI's cancellation policy */
cancellation: CancelationDetails
}

/**
Expand Down Expand Up @@ -159,6 +161,19 @@ export type PayoutMethod = {

}

/**
* Cancellation details for the Offering.
* @beta
*/
export type CancelationDetails = {
/** Whether cancellation is enabled for this offering. */
enabled: boolean
/** A human-readable description of the terms of cancellation in plaintext. */
terms?: string
/** A link to a page that describes the terms of cancellation. */
termsUrl?: string
}

/**
* Balance's metadata
* @beta
Expand Down Expand Up @@ -412,6 +427,10 @@ export type OrderStatusData = {
detail?: string
}

/**
* Valid order status values.
* @beta
*/
export enum OrderStatusEnum {
PayinPending = 'PAYIN_PENDING',
PayinInitiated = 'PAYIN_INITIATED',
Expand Down

0 comments on commit f467d54

Please sign in to comment.