@xyo-network/payment-payload-plugins 3.2.0-rc.1 → 3.2.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neutral/Billing/Address/Address.d.ts +46 -4
- package/dist/neutral/Billing/Address/Address.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts +44 -4
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts +40 -4
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts +44 -4
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Payload.d.ts +101 -1
- package/dist/neutral/Discount/Payload/Coupon/Payload.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/types/Condition.d.ts +63 -15
- package/dist/neutral/Discount/Payload/Coupon/types/Condition.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Discount.d.ts +7 -3
- package/dist/neutral/Discount/Payload/Discount.d.ts.map +1 -1
- package/dist/neutral/Escrow/Terms/Terms.d.ts +28 -4
- package/dist/neutral/Escrow/Terms/Terms.d.ts.map +1 -1
- package/dist/neutral/Escrow/util/secret/createEscrowIntent.d.ts +33 -12
- package/dist/neutral/Escrow/util/secret/createEscrowIntent.d.ts.map +1 -1
- package/dist/neutral/Escrow/util/secret/updateEscrowTermsWithSecret.d.ts +33 -12
- package/dist/neutral/Escrow/util/secret/updateEscrowTermsWithSecret.d.ts.map +1 -1
- package/dist/neutral/Payment/Instrument/Card/Payload.d.ts +22 -4
- package/dist/neutral/Payment/Instrument/Card/Payload.d.ts.map +1 -1
- package/dist/neutral/index.mjs +29 -4
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +22 -21
- package/src/Discount/Payload/Coupon/Coupons/FixedAmount.ts +6 -3
- package/src/Discount/Payload/Coupon/Coupons/FixedPercentage.ts +6 -3
- package/src/Discount/Payload/Coupon/Coupons/FixedPrice.ts +6 -3
- package/src/Discount/Payload/Coupon/Payload.ts +4 -0
- package/src/Discount/Payload/Coupon/types/Condition.ts +4 -1
- package/src/Discount/Payload/Discount.ts +2 -2
- package/src/Escrow/util/appraisal/getAppraisalsByAsset.ts +3 -3
- package/src/Escrow/util/secret/createEscrowIntent.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PayloadWithOptionalSources } from '@xyo-network/payload-model'
|
|
2
2
|
import {
|
|
3
3
|
isPayloadOfSchemaType,
|
|
4
4
|
isPayloadOfSchemaTypeWithSources,
|
|
@@ -14,7 +14,7 @@ export interface DiscountFields extends AmountFields { }
|
|
|
14
14
|
/**
|
|
15
15
|
* The result of a discount
|
|
16
16
|
*/
|
|
17
|
-
export type Discount =
|
|
17
|
+
export type Discount = PayloadWithOptionalSources<DiscountFields, DiscountSchema>
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Identity function for determining if an object is an Discount
|
|
@@ -16,12 +16,12 @@ export const getAppraisalsByAsset = (terms: EscrowTerms, dictionary: Record<Hash
|
|
|
16
16
|
const appraisals = Object.values(dictionary).filter(isHashLeaseEstimateWithSources) as unknown as WithSources<HashLeaseEstimate>[]
|
|
17
17
|
const appraisalsByAsset: Record<Hash, WithSources<HashLeaseEstimate>[]> = {}
|
|
18
18
|
for (const estimate of appraisals) {
|
|
19
|
-
const { sources } = estimate
|
|
20
|
-
if (sources === undefined || sources.length === 0) {
|
|
19
|
+
const { $sources } = estimate
|
|
20
|
+
if ($sources === undefined || $sources.length === 0) {
|
|
21
21
|
continue
|
|
22
22
|
}
|
|
23
23
|
for (const asset of assets) {
|
|
24
|
-
if (sources.includes(asset)) {
|
|
24
|
+
if ($sources.includes(asset)) {
|
|
25
25
|
if (!appraisalsByAsset[asset]) appraisalsByAsset[asset] = []
|
|
26
26
|
appraisalsByAsset[asset].push(estimate)
|
|
27
27
|
}
|
|
@@ -12,6 +12,6 @@ import type { EscrowTerms } from '../../Terms/index.ts'
|
|
|
12
12
|
* @returns The escrow intent
|
|
13
13
|
*/
|
|
14
14
|
export const createEscrowIntentWithSecret = async (terms: EscrowTerms, secret: IdPayload, account: AccountInstance) => {
|
|
15
|
-
const result = await new BoundWitnessBuilder(
|
|
15
|
+
const result = await new BoundWitnessBuilder().signers([account]).payloads([terms, secret]).build()
|
|
16
16
|
return result
|
|
17
17
|
}
|