@xyo-network/payment-payload-plugins 2.91.6 → 2.91.8

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.
Files changed (100) hide show
  1. package/dist/browser/Escrow/Terms.d.cts +15 -0
  2. package/dist/browser/Escrow/Terms.d.cts.map +1 -1
  3. package/dist/browser/Escrow/Terms.d.mts +15 -0
  4. package/dist/browser/Escrow/Terms.d.mts.map +1 -1
  5. package/dist/browser/Escrow/Terms.d.ts +15 -0
  6. package/dist/browser/Escrow/Terms.d.ts.map +1 -1
  7. package/dist/browser/Escrow/validators/escrow/index.d.cts +1 -0
  8. package/dist/browser/Escrow/validators/escrow/index.d.cts.map +1 -1
  9. package/dist/browser/Escrow/validators/escrow/index.d.mts +1 -0
  10. package/dist/browser/Escrow/validators/escrow/index.d.mts.map +1 -1
  11. package/dist/browser/Escrow/validators/escrow/index.d.ts +1 -0
  12. package/dist/browser/Escrow/validators/escrow/index.d.ts.map +1 -1
  13. package/dist/browser/Escrow/validators/escrow/sellerSecret.d.cts +21 -0
  14. package/dist/browser/Escrow/validators/escrow/sellerSecret.d.cts.map +1 -0
  15. package/dist/browser/Escrow/validators/escrow/sellerSecret.d.mts +21 -0
  16. package/dist/browser/Escrow/validators/escrow/sellerSecret.d.mts.map +1 -0
  17. package/dist/browser/Escrow/validators/escrow/sellerSecret.d.ts +21 -0
  18. package/dist/browser/Escrow/validators/escrow/sellerSecret.d.ts.map +1 -0
  19. package/dist/browser/Payment.d.cts +12 -1
  20. package/dist/browser/Payment.d.cts.map +1 -1
  21. package/dist/browser/Payment.d.mts +12 -1
  22. package/dist/browser/Payment.d.mts.map +1 -1
  23. package/dist/browser/Payment.d.ts +12 -1
  24. package/dist/browser/Payment.d.ts.map +1 -1
  25. package/dist/browser/Purchase.d.cts +16 -4
  26. package/dist/browser/Purchase.d.cts.map +1 -1
  27. package/dist/browser/Purchase.d.mts +16 -4
  28. package/dist/browser/Purchase.d.mts.map +1 -1
  29. package/dist/browser/Purchase.d.ts +16 -4
  30. package/dist/browser/Purchase.d.ts.map +1 -1
  31. package/dist/browser/Receipt.d.cts +31 -0
  32. package/dist/browser/Receipt.d.cts.map +1 -0
  33. package/dist/browser/Receipt.d.mts +31 -0
  34. package/dist/browser/Receipt.d.mts.map +1 -0
  35. package/dist/browser/Receipt.d.ts +31 -0
  36. package/dist/browser/Receipt.d.ts.map +1 -0
  37. package/dist/browser/index.cjs +73 -2
  38. package/dist/browser/index.cjs.map +1 -1
  39. package/dist/browser/index.d.cts +1 -0
  40. package/dist/browser/index.d.cts.map +1 -1
  41. package/dist/browser/index.d.mts +1 -0
  42. package/dist/browser/index.d.mts.map +1 -1
  43. package/dist/browser/index.d.ts +1 -0
  44. package/dist/browser/index.d.ts.map +1 -1
  45. package/dist/browser/index.js +85 -2
  46. package/dist/browser/index.js.map +1 -1
  47. package/dist/node/Escrow/Terms.d.cts +15 -0
  48. package/dist/node/Escrow/Terms.d.cts.map +1 -1
  49. package/dist/node/Escrow/Terms.d.mts +15 -0
  50. package/dist/node/Escrow/Terms.d.mts.map +1 -1
  51. package/dist/node/Escrow/Terms.d.ts +15 -0
  52. package/dist/node/Escrow/Terms.d.ts.map +1 -1
  53. package/dist/node/Escrow/validators/escrow/index.d.cts +1 -0
  54. package/dist/node/Escrow/validators/escrow/index.d.cts.map +1 -1
  55. package/dist/node/Escrow/validators/escrow/index.d.mts +1 -0
  56. package/dist/node/Escrow/validators/escrow/index.d.mts.map +1 -1
  57. package/dist/node/Escrow/validators/escrow/index.d.ts +1 -0
  58. package/dist/node/Escrow/validators/escrow/index.d.ts.map +1 -1
  59. package/dist/node/Escrow/validators/escrow/sellerSecret.d.cts +21 -0
  60. package/dist/node/Escrow/validators/escrow/sellerSecret.d.cts.map +1 -0
  61. package/dist/node/Escrow/validators/escrow/sellerSecret.d.mts +21 -0
  62. package/dist/node/Escrow/validators/escrow/sellerSecret.d.mts.map +1 -0
  63. package/dist/node/Escrow/validators/escrow/sellerSecret.d.ts +21 -0
  64. package/dist/node/Escrow/validators/escrow/sellerSecret.d.ts.map +1 -0
  65. package/dist/node/Payment.d.cts +12 -1
  66. package/dist/node/Payment.d.cts.map +1 -1
  67. package/dist/node/Payment.d.mts +12 -1
  68. package/dist/node/Payment.d.mts.map +1 -1
  69. package/dist/node/Payment.d.ts +12 -1
  70. package/dist/node/Payment.d.ts.map +1 -1
  71. package/dist/node/Purchase.d.cts +16 -4
  72. package/dist/node/Purchase.d.cts.map +1 -1
  73. package/dist/node/Purchase.d.mts +16 -4
  74. package/dist/node/Purchase.d.mts.map +1 -1
  75. package/dist/node/Purchase.d.ts +16 -4
  76. package/dist/node/Purchase.d.ts.map +1 -1
  77. package/dist/node/Receipt.d.cts +31 -0
  78. package/dist/node/Receipt.d.cts.map +1 -0
  79. package/dist/node/Receipt.d.mts +31 -0
  80. package/dist/node/Receipt.d.mts.map +1 -0
  81. package/dist/node/Receipt.d.ts +31 -0
  82. package/dist/node/Receipt.d.ts.map +1 -0
  83. package/dist/node/index.cjs +87 -2
  84. package/dist/node/index.cjs.map +1 -1
  85. package/dist/node/index.d.cts +1 -0
  86. package/dist/node/index.d.cts.map +1 -1
  87. package/dist/node/index.d.mts +1 -0
  88. package/dist/node/index.d.mts.map +1 -1
  89. package/dist/node/index.d.ts +1 -0
  90. package/dist/node/index.d.ts.map +1 -1
  91. package/dist/node/index.js +85 -2
  92. package/dist/node/index.js.map +1 -1
  93. package/package.json +10 -10
  94. package/src/Escrow/Terms.ts +14 -1
  95. package/src/Escrow/validators/escrow/index.ts +1 -0
  96. package/src/Escrow/validators/escrow/sellerSecret.ts +75 -0
  97. package/src/Payment.ts +20 -2
  98. package/src/Purchase.ts +25 -5
  99. package/src/Receipt.ts +42 -0
  100. package/src/index.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Escrow/createEscrowIntent.ts","../../src/Escrow/getEscrowSecret.ts","../../src/Escrow/Schema.ts","../../src/Escrow/Terms.ts","../../src/Escrow/validators/common/ModuleInstanceValidators/moduleInstanceValidators.ts","../../src/Escrow/validators/common/TemporalValidators/validateWithinWindow.ts","../../src/Escrow/validators/escrow/agent.ts","../../src/Escrow/validators/escrow/appraisal.ts","../../src/Escrow/validators/escrow/appraisalAuthorities.ts","../../src/Escrow/validators/escrow/assets.ts","../../src/Escrow/validators/escrow/buyer.ts","../../src/Escrow/validators/escrow/buyerSecret.ts","../../src/Escrow/validators/escrow/nbfExp.ts","../../src/Escrow/validators/escrow/paymentAuthorities.ts","../../src/Escrow/validators/escrow/seller.ts","../../src/Payment.ts","../../src/Purchase.ts"],"sourcesContent":["import { AccountInstance } from '@xyo-network/account-model'\nimport { BoundWitnessBuilder } from '@xyo-network/boundwitness-builder'\nimport { IdPayload } from '@xyo-network/id-payload-plugin'\n\nimport { EscrowTerms } from './Terms'\n\n/**\n * Creates an escrow intent\n * @deprecated Use createEscrowIntentWithSecret instead\n * @param terms The payloads describing the terms for the escrow\n * @param account The account to create the escrow intent with\n * @returns The escrow intent\n */\nexport const createEscrowIntent = async (terms: EscrowTerms[], account: AccountInstance) => {\n const result = await new BoundWitnessBuilder({ accounts: [account] }).payloads([...terms]).build()\n return result\n}\n\n/**\n * Creates an escrow intent (for a buyer or seller) using the supplied secret\n * @param terms The payload describing the terms for the escrow\n * @param secret The secret for the escrow principal party to use for the escrow\n * @param account The account to create the escrow intent with\n * @returns The escrow intent\n */\nexport const createEscrowIntentWithSecret = async (terms: EscrowTerms, secret: IdPayload, account: AccountInstance) => {\n const result = await new BoundWitnessBuilder({ accounts: [account] }).payloads([terms, secret]).build()\n return result\n}\n","import { Crypto } from '@xylabs/crypto'\nimport { IdPayload, IdSchema } from '@xyo-network/id-payload-plugin'\n\n/**\n * Returns a cryptographically random secret to use for escrow\n * @returns The escrow secret\n */\nexport const getEscrowSecret = (): IdPayload => {\n return { salt: Crypto.randomUUID(), schema: IdSchema }\n}\n","export type EscrowSchema = 'network.xyo.escrow'\nexport const EscrowSchema: EscrowSchema = 'network.xyo.escrow'\n","import { Address, Hash } from '@xylabs/hex'\nimport { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nimport { EscrowSchema } from './Schema'\n\nexport const EscrowTermsSchema = `${EscrowSchema}.terms` as const\nexport type EscrowTermsSchema = typeof EscrowTermsSchema\n\n// TODO: Include escrow agent in escrow terms\nexport interface EscrowTermsFields {\n /**\n * The trusted estimators for the worth of the things being sold\n */\n appraisalAuthorities: Address[]\n /**\n * The estimated worths of the things being sold\n */\n appraisals: Hash[]\n /**\n * The things being sold\n */\n assets: Hash[]\n /**\n * The buyer\n */\n buyer: Address[]\n /**\n * The buyer\n */\n buyerSecret: Hash\n /**\n * The escrow agent responsible for the escrow\n */\n escrowAgent: Address\n /**\n * The time the escrow expires\n */\n exp: number\n /**\n * The time the escrow starts\n */\n nbf: number\n /**\n * The trusted payment authorities\n */\n paymentAuthorities: Address[]\n /**\n * The seller\n */\n seller: Address[]\n /**\n * The seller\n */\n sellerSecret: Hash\n}\n\n/**\n * The terms of an escrow\n */\nexport type EscrowTerms = Payload<Partial<EscrowTermsFields>, EscrowTermsSchema>\n\nexport const isEscrowTerms = isPayloadOfSchemaType<EscrowTerms>(EscrowTermsSchema)\n","import { ModuleIdentifier } from '@xyo-network/module-model'\n\nimport { EscrowTerms } from '../../../Terms'\nimport { EscrowTermsValueExpression } from '../../types/escrowValidation'\n\n/**\n * Checks if property value of the escrow terms contains one of the valid moduleIdentifiers\n * @param escrowTerms The escrow terms to validate\n * @param propertyExpression The selector to get the property containing the moduleIdentifier(s) from the escrow terms\n * @param moduleIdentifiers The list of allowed moduleIdentifiers\n * @param required Is the property required to be present\n * @returns True if the property value contains one of the valid moduleIdentifiers\n */\nexport const moduleIdentifiersContainsOneOf = (\n escrowTerms: EscrowTerms,\n propertyExpression: EscrowTermsValueExpression<'appraisalAuthorities' | 'buyer' | 'escrowAgent' | 'paymentAuthorities' | 'seller'>,\n moduleIdentifiers: ModuleIdentifier[],\n required: boolean = true,\n) => {\n const termsValue: string | string[] | undefined = propertyExpression(escrowTerms)\n if (termsValue === undefined) {\n return required ? false : true\n } else {\n return Array.isArray(termsValue) ? termsValue.some((address) => moduleIdentifiers.includes(address)) : moduleIdentifiers.includes(termsValue)\n }\n}\n\n/**\n * Checks if property value of the escrow terms contains all of the valid moduleIdentifiers\n * @param escrowTerms The escrow terms to validate\n * @param selector The selector to get the property containing the moduleIdentifier(s) from the escrow terms\n * @param moduleIdentifiers The list of allowed moduleIdentifiers\n * @param required Is the property required to be present\n * @returns True if the property value contains all of the valid moduleIdentifiers\n */\nexport const moduleIdentifiersContainsAllOf = (\n escrowTerms: EscrowTerms,\n selector: EscrowTermsValueExpression<'appraisalAuthorities' | 'buyer' | 'escrowAgent' | 'paymentAuthorities' | 'seller'>,\n moduleIdentifiers: ModuleIdentifier[],\n required: boolean = true,\n) => {\n const termsValue: string | string[] | undefined = selector(escrowTerms)\n if (termsValue === undefined) {\n return required ? false : true\n } else {\n return Array.isArray(termsValue) ? termsValue.every((address) => moduleIdentifiers.includes(address)) : moduleIdentifiers.includes(termsValue)\n }\n}\n","export type Windowed = { exp?: number; nbf?: number }\n\nexport const validateWithinWindow = (value: Windowed, exp: number, nbf: number = Date.now()): boolean => {\n if (value.nbf === undefined || value.nbf > nbf) return false\n if (value.exp === undefined || value.exp < exp) return false\n return true\n}\n","import { ModuleIdentifier } from '@xyo-network/module-model'\n\nimport { EscrowTerms } from '../../Terms'\nimport { moduleIdentifiersContainsOneOf } from '../common'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.escrowAgent'\n\nexport const getEscrowAgentAllowedValidator = (allowedEscrowAgent: ModuleIdentifier): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n const result = moduleIdentifiersContainsOneOf(terms, (t) => t.escrowAgent, [allowedEscrowAgent], true)\n if (!result) {\n console.log(`${name}: Escrow agent not allowed: ${terms.escrowAgent}`)\n }\n return result\n }\n}\n","import { assertEx } from '@xylabs/assert'\nimport { Hash } from '@xylabs/hex'\nimport { BoundWitness, isBoundWitnessWithMeta } from '@xyo-network/boundwitness-model'\nimport { HashLeaseEstimate, isHashLeaseEstimateWithSources } from '@xyo-network/diviner-hash-lease'\nimport { Payload, WithMeta, WithSources } from '@xyo-network/payload-model'\n\nimport { EscrowTerms } from '../../Terms'\nimport { validateWithinWindow } from '../common'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.appraisal'\n\n/**\n * A function that validates the escrow terms for tbe existence of appraisals\n * @returns True if the escrow terms contain appraisals, false otherwise\n */\nexport const appraisalsExistValidator: EscrowTermsValidationFunction = (terms: EscrowTerms) => {\n // Validate we have appraisals\n const appraisals = terms.appraisals\n if (!appraisals || appraisals.length === 0) {\n console.log(`${name}: No appraisals: ${terms.appraisals}`)\n return false\n }\n return true\n}\n\n/**\n * Returns a function that validates the escrow terms for appraisals which are from valid authorities\n * @param dictionary Payload dictionary of the escrow terms\n * @returns A function that validates the escrow terms for appraisals which are from valid authorities\n */\nexport const getAppraisalsFromValidAuthoritiesValidator = (dictionary: Record<Hash, WithMeta<Payload>>): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n const appraisals = assertEx(terms.appraisals, () => `${name}: No appraisals: ${terms.appraisals}`)\n const appraisalAuthorities = assertEx(terms.appraisalAuthorities, () => `${name}: No appraisalAuthorities: ${terms.appraisalAuthorities}`)\n\n // Validate the appraisals are signed by valid appraisal authorities. Validation criteria:\n // - We have a bw for each of the appraisal\n // - The bw is signed by an approved appraisal authority\n const appraisalBWsValid: Record<Hash, WithMeta<BoundWitness>[]> = Object.fromEntries(\n appraisals.map<[Hash, WithMeta<BoundWitness>[]]>((hash) => [hash, []]),\n )\n for (const bw of Object.values(dictionary).filter(isBoundWitnessWithMeta)) {\n for (const appraisal of appraisals) {\n if (bw.payload_hashes.includes(appraisal) && bw.addresses.some((address) => appraisalAuthorities.includes(address))) {\n appraisalBWsValid[appraisal].push(bw)\n }\n }\n }\n for (const [appraisal, bws] of Object.entries(appraisalBWsValid)) {\n if (bws.length === 0) {\n console.log(`${name}: No valid appraisals for ${appraisal}`)\n return false\n }\n }\n return true\n }\n}\n\n/**\n * Returns a function that validates the escrow terms for appraisals which are valid\n * @param dictionary Payload dictionary of the escrow terms\n * @param minimumExp The minium amount of time an estimate needs to be valid\n * for in the future (so as not to expire before the escrow is complete)\n * @returns A function that validates the escrow terms for appraisals which are valid\n */\nexport const getAppraisalsValidValidator = (dictionary: Record<Hash, WithMeta<Payload>>, minimumExp: number): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n // Verify we have an estimate for each of the assets\n const estimatesByAsset = getEstimatesByAsset(terms, dictionary)\n // Validate each of the estimates are valid (time, price, etc)\n const now = Date.now()\n const exp = now + minimumExp\n for (const [asset, estimates] of Object.entries(estimatesByAsset)) {\n for (const estimate of estimates) {\n if (!validateEstimate(estimate, exp)) {\n console.log(`${name}: Invalid estimate for asset ${asset}: ${estimate}`)\n return false\n }\n }\n }\n return true\n }\n}\n\n/**\n * Returns a function that validates the escrow terms to ensure that they contain an appraisal for each asset\n * @param dictionary Payload dictionary of the escrow terms\n * @returns A function that validates the escrow terms for appraisals\n */\nexport const getAppraisalsForAllAssetsValidator = (dictionary: Record<Hash, WithMeta<Payload>>): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n // Verify we have an estimate for each of the assets\n const estimatesByAsset = getEstimatesByAsset(terms, dictionary)\n const assets = assertEx(terms.assets, () => `${name}: No assets: ${terms.assets}`)\n if (Object.keys(estimatesByAsset).length !== assets.length) {\n console.log(`${name}: Missing appraisals for all assets: ${assets}`)\n return false\n }\n return true\n }\n}\n\nconst validateEstimate = (estimate: WithSources<HashLeaseEstimate>, exp: number): boolean => {\n if (!validateWithinWindow(estimate, exp)) return false\n if (estimate.currency !== 'USD') return false\n if (estimate.price <= 0) return false\n return true\n}\n\nconst getEstimatesByAsset = (terms: EscrowTerms, dictionary: Record<Hash, WithMeta<Payload>>): Record<Hash, WithSources<HashLeaseEstimate>[]> => {\n const assets = assertEx(terms.assets, () => `${name}: No assets: ${terms.assets}`)\n const estimates = Object.values(dictionary).filter(isHashLeaseEstimateWithSources) as unknown as WithSources<HashLeaseEstimate>[]\n const estimatesByAsset: Record<Hash, WithSources<HashLeaseEstimate>[]> = {}\n for (const estimate of estimates) {\n const { sources } = estimate\n if (sources === undefined || sources.length === 0) {\n console.log(`${name}: No sources: ${estimate}`)\n continue\n }\n for (const asset of assets) {\n if (sources.includes(asset)) {\n if (!estimatesByAsset[asset]) estimatesByAsset[asset] = []\n estimatesByAsset[asset].push(estimate)\n }\n }\n }\n return estimatesByAsset\n}\n","import { asAddress } from '@xylabs/hex'\nimport { ModuleIdentifier } from '@xyo-network/module-model'\n\nimport { EscrowTerms } from '../../Terms'\nimport { moduleIdentifiersContainsAllOf } from '../common'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.appraisalAuthorities'\n\n/**\n * A function that validates the escrow terms for appraisalAuthorities\n * @returns True if the escrow terms contain appraisalAuthorities, false otherwise\n */\nexport const appraisalAuthoritiesExistValidator: EscrowTermsValidationFunction = (terms: EscrowTerms) => {\n // Validate we have appraisalAuthorities\n const appraisalAuthorities = terms.appraisalAuthorities\n if (!appraisalAuthorities || appraisalAuthorities.length === 0) {\n console.log(`${name}: No appraisalAuthorities: ${terms.appraisalAuthorities}`)\n return false\n }\n // Validate the authorities are addresses\n if (appraisalAuthorities.map((x) => asAddress(x)).length !== appraisalAuthorities.length) {\n console.log(`${name}: Invalid address: ${terms.appraisalAuthorities}`)\n return false\n }\n return true\n}\n\nexport const getAppraisalAuthoritiesAllowedValidator = (allowed: ModuleIdentifier[]): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n const result = moduleIdentifiersContainsAllOf(terms, (t) => t.appraisalAuthorities, allowed, true)\n if (!result) {\n console.log(`${name}: Appraisal authority not allowed: ${terms.appraisalAuthorities}`)\n }\n return result\n }\n}\n","import { EscrowTerms } from '../../Terms'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.assets'\n\n/**\n * Returns a function that validates the escrow terms for assets\n * @returns A function that validates the escrow terms for assets\n */\nexport const assetsExistValidator: EscrowTermsValidationFunction = (terms: EscrowTerms) => {\n // Validate we have assets\n const assets = terms.assets\n if (!assets || assets.length === 0) {\n console.log(`${name}: No assets: ${terms.assets}`)\n return false\n }\n return true\n}\n","import { asAddress } from '@xylabs/hex'\n\nimport { EscrowTerms } from '../../Terms'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.buyer'\n\n/**\n * A function that validates the escrow terms for buyer\n * @returns True if the escrow terms contain buyer, false otherwise\n */\nexport const buyerExistsValidator: EscrowTermsValidationFunction = (terms: EscrowTerms) => {\n // Validate we have buyer\n const buyer = terms.buyer\n if (!buyer || buyer.length === 0) {\n console.log(`${name}: No buyer: ${terms.buyer}`)\n return false\n }\n // Validate the authorities are addresses\n if (buyer.map((x) => asAddress(x)).length !== buyer.length) {\n console.log(`${name}: Invalid address: ${terms.buyer}`)\n return false\n }\n return true\n}\n","import { assertEx } from '@xylabs/assert'\nimport { Hash } from '@xylabs/hex'\nimport { isBoundWitnessWithMeta } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessValidator } from '@xyo-network/boundwitness-validator'\nimport { Payload, WithMeta } from '@xyo-network/payload-model'\n\nimport { EscrowTerms } from '../../Terms'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.buyerSecret'\n\n/**\n * Returns a function that validates the escrow terms for buyerSecret\n * @returns A function that validates the escrow terms for buyerSecret\n */\nexport const buyerSecretExistsValidator: EscrowTermsValidationFunction = (terms: EscrowTerms) => {\n // Validate we have buyerSecret\n const buyerSecret = terms.buyerSecret\n if (!buyerSecret || buyerSecret.length === 0) {\n console.log(`${name}: No buyerSecret: ${terms.buyerSecret}`)\n return false\n }\n return true\n}\n\n/**\n * Returns a function that validates the escrow terms for the existence of the buyerSecret in the dictionary\n * @param dictionary Payload dictionary of the escrow terms\n * @returns A function that validates the escrow terms for the existence of the buyerSecret in the dictionary\n */\nexport const getBuyerSecretSuppliedValidator = (dictionary: Record<Hash, WithMeta<Payload>>): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n const buyerSecret = assertEx(terms.buyerSecret, () => `${name}: No buyerSecret: ${terms.buyerSecret}`)\n if (!dictionary[buyerSecret]) {\n console.log(`${name}: Payload not supplied for buyerSecret: ${buyerSecret}`)\n return false\n }\n return true\n }\n}\n\n/**\n * Returns a function that validates the escrow terms for the existence of the buyerSecret signed by the buyer\n * @param dictionary Payload dictionary of the escrow terms\n * @returns A function that validates the escrow terms for the existence of the buyerSecret signed by the buyer\n */\nexport const getBuyerSecretSignedValidator = (dictionary: Record<Hash, WithMeta<Payload>>): EscrowTermsValidationFunction => {\n return async (terms: EscrowTerms) => {\n const buyer = assertEx(terms.buyer, () => `${name}: No buyer: ${terms.buyer}`)\n const buyerSecret = assertEx(terms.buyerSecret, () => `${name}: No buyerSecret: ${terms.buyerSecret}`)\n // Buyer-signed buyer secrets\n const buyerSecretBWs = Object.values(dictionary)\n // Find all BoundWitnesses\n .filter(isBoundWitnessWithMeta)\n // That contain the buyer secret\n .filter((bw) => bw.payload_hashes.includes(buyerSecret))\n // That are signed by all the buyers\n .filter((bw) => buyer.every((buyerAddress) => bw.addresses.includes(buyerAddress)))\n\n // If there are no buyerSecret BWs, return false\n if (buyerSecretBWs.length === 0) {\n console.log(`${name}: No BoundWitnesses supplied for buyerSecret: ${buyerSecret}`)\n return false\n }\n\n // Ensure each BW supplied for the buyerSecret is valid\n const errors = await Promise.all(buyerSecretBWs.map((bw) => new BoundWitnessValidator(bw).validate()))\n const validBoundWitnesses = errors.every((errors) => errors.length === 0)\n if (!validBoundWitnesses) {\n console.log(`${name}: Invalid BoundWitnesses supplied for buyerSecret: ${buyerSecret}`)\n return false\n }\n return true\n }\n}\n","import { EscrowTerms } from '../../Terms'\nimport { EscrowTermsValidationFunction } from '../types'\n\nexport const getNbfExpValidator = (now: number, minRequiredDuration: number): EscrowTermsValidationFunction => {\n const minExp = now + minRequiredDuration\n return (terms: EscrowTerms) => {\n const { exp, nbf } = terms\n if (nbf === undefined || nbf < now) {\n console.log(`EscrowTerms.nbf: invalid nbf ${terms.nbf}`)\n return false\n }\n if (exp === undefined || exp < minExp || nbf > exp) {\n console.log(`EscrowTerms.exp: invalid exp ${terms.exp}`)\n return false\n }\n return true\n }\n}\n","import { ModuleIdentifier } from '@xyo-network/module-model'\n\nimport { EscrowTerms } from '../../Terms'\nimport { moduleIdentifiersContainsAllOf } from '../common'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.paymentAuthorities'\n\nexport const getPaymentAuthoritiesAllowedValidator = (allowed: ModuleIdentifier[]): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n const result = moduleIdentifiersContainsAllOf(terms, (t) => t.paymentAuthorities, allowed, true)\n if (!result) {\n console.log(`${name}: Payment authority not allowed: ${terms.paymentAuthorities}`)\n }\n return result\n }\n}\n","import { asAddress } from '@xylabs/hex'\n\nimport { EscrowTerms } from '../../Terms'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.seller'\n\n/**\n * A function that validates the escrow terms for seller\n * @returns True if the escrow terms contain seller, false otherwise\n */\nexport const sellerExistsValidator: EscrowTermsValidationFunction = (terms: EscrowTerms) => {\n // Validate we have seller\n const seller = terms.seller\n if (!seller || seller.length === 0) {\n console.log(`${name}: No seller: ${terms.seller}`)\n return false\n }\n // Validate the authorities are addresses\n if (seller.map((x) => asAddress(x)).length !== seller.length) {\n console.log(`${name}: Invalid address: ${terms.seller}`)\n return false\n }\n return true\n}\n","import { isPayloadOfSchemaType, PayloadWithSources } from '@xyo-network/payload-model'\n\nimport { SupportedCurrency } from './Currency'\n\nexport type PaymentSchema = 'network.xyo.payments.payment'\nexport const PaymentSchema: PaymentSchema = 'network.xyo.payments.payment'\n\nexport interface PaymentFields {\n /**\n * The amount paid\n */\n amount: number\n /**\n * The currency of the amount paid\n */\n currency: SupportedCurrency\n}\n\n/**\n * A payment is a record of a payment made\n */\nexport type Payment = PayloadWithSources<PaymentFields, PaymentSchema>\n\nexport const isPayment = isPayloadOfSchemaType<Payment>(PaymentSchema)\n","import { Hash } from '@xylabs/hex'\nimport { PayloadWithSources } from '@xyo-network/payload-model'\n\nexport type PurchaseSchema = 'network.xyo.payments.purchase'\nexport const PurchaseSchema: PurchaseSchema = 'network.xyo.payments.purchase'\n\nexport interface PurchaseFields {\n /**\n * The hashes that were purchased\n */\n hashes: Hash[]\n /**\n * The payments for this purchase. Array to allow for multiple payments\n * for a single quote.\n */\n payments: Hash[]\n}\n\n/**\n * A purchase ties a payment made to a quote\n */\nexport type Purchase = PayloadWithSources<PurchaseFields, PurchaseSchema>\n"],"mappings":";AACA,SAAS,2BAA2B;AAY7B,IAAM,qBAAqB,OAAO,OAAsB,YAA6B;AAC1F,QAAM,SAAS,MAAM,IAAI,oBAAoB,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,EAAE,MAAM;AACjG,SAAO;AACT;AASO,IAAM,+BAA+B,OAAO,OAAoB,QAAmB,YAA6B;AACrH,QAAM,SAAS,MAAM,IAAI,oBAAoB,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,OAAO,MAAM,CAAC,EAAE,MAAM;AACtG,SAAO;AACT;;;AC5BA,SAAS,cAAc;AACvB,SAAoB,gBAAgB;AAM7B,IAAM,kBAAkB,MAAiB;AAC9C,SAAO,EAAE,MAAM,OAAO,WAAW,GAAG,QAAQ,SAAS;AACvD;;;ACRO,IAAM,eAA6B;;;ACA1C,SAAS,6BAAsC;AAIxC,IAAM,oBAAoB,GAAG,YAAY;AAwDzC,IAAM,gBAAgB,sBAAmC,iBAAiB;;;AChD1E,IAAM,iCAAiC,CAC5C,aACA,oBACA,mBACA,WAAoB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,IAAI,GAAGC,KAAI,sBAAsB,MAAM,MAAM,EAAE;AACvD,WAAO;AAAA,EACT;AACA,SAAO;AACT;;;ACxBA,SAAS,yBAAAC,8BAAiD;AAKnD,IAAM,gBAA+B;AAkBrC,IAAM,YAAYA,uBAA+B,aAAa;;;ACnB9D,IAAM,iBAAiC;","names":["name","name","name","asAddress","name","assertEx","isBoundWitnessWithMeta","name","errors","name","asAddress","name","isPayloadOfSchemaType"]}
1
+ {"version":3,"sources":["../../src/Escrow/createEscrowIntent.ts","../../src/Escrow/getEscrowSecret.ts","../../src/Escrow/Schema.ts","../../src/Escrow/Terms.ts","../../src/Escrow/validators/common/ModuleInstanceValidators/moduleInstanceValidators.ts","../../src/Escrow/validators/common/TemporalValidators/validateWithinWindow.ts","../../src/Escrow/validators/escrow/agent.ts","../../src/Escrow/validators/escrow/appraisal.ts","../../src/Escrow/validators/escrow/appraisalAuthorities.ts","../../src/Escrow/validators/escrow/assets.ts","../../src/Escrow/validators/escrow/buyer.ts","../../src/Escrow/validators/escrow/buyerSecret.ts","../../src/Escrow/validators/escrow/nbfExp.ts","../../src/Escrow/validators/escrow/paymentAuthorities.ts","../../src/Escrow/validators/escrow/seller.ts","../../src/Escrow/validators/escrow/sellerSecret.ts","../../src/Payment.ts","../../src/Purchase.ts","../../src/Receipt.ts"],"sourcesContent":["import { AccountInstance } from '@xyo-network/account-model'\nimport { BoundWitnessBuilder } from '@xyo-network/boundwitness-builder'\nimport { IdPayload } from '@xyo-network/id-payload-plugin'\n\nimport { EscrowTerms } from './Terms'\n\n/**\n * Creates an escrow intent\n * @deprecated Use createEscrowIntentWithSecret instead\n * @param terms The payloads describing the terms for the escrow\n * @param account The account to create the escrow intent with\n * @returns The escrow intent\n */\nexport const createEscrowIntent = async (terms: EscrowTerms[], account: AccountInstance) => {\n const result = await new BoundWitnessBuilder({ accounts: [account] }).payloads([...terms]).build()\n return result\n}\n\n/**\n * Creates an escrow intent (for a buyer or seller) using the supplied secret\n * @param terms The payload describing the terms for the escrow\n * @param secret The secret for the escrow principal party to use for the escrow\n * @param account The account to create the escrow intent with\n * @returns The escrow intent\n */\nexport const createEscrowIntentWithSecret = async (terms: EscrowTerms, secret: IdPayload, account: AccountInstance) => {\n const result = await new BoundWitnessBuilder({ accounts: [account] }).payloads([terms, secret]).build()\n return result\n}\n","import { Crypto } from '@xylabs/crypto'\nimport { IdPayload, IdSchema } from '@xyo-network/id-payload-plugin'\n\n/**\n * Returns a cryptographically random secret to use for escrow\n * @returns The escrow secret\n */\nexport const getEscrowSecret = (): IdPayload => {\n return { salt: Crypto.randomUUID(), schema: IdSchema }\n}\n","export type EscrowSchema = 'network.xyo.escrow'\nexport const EscrowSchema: EscrowSchema = 'network.xyo.escrow'\n","import { Address, Hash } from '@xylabs/hex'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources, Payload } from '@xyo-network/payload-model'\n\nimport { EscrowSchema } from './Schema'\n\nexport const EscrowTermsSchema = `${EscrowSchema}.terms` as const\nexport type EscrowTermsSchema = typeof EscrowTermsSchema\n\n// TODO: Include escrow agent in escrow terms\nexport interface EscrowTermsFields {\n /**\n * The trusted estimators for the worth of the things being sold\n */\n appraisalAuthorities: Address[]\n /**\n * The estimated worths of the things being sold\n */\n appraisals: Hash[]\n /**\n * The things being sold\n */\n assets: Hash[]\n /**\n * The buyer\n */\n buyer: Address[]\n /**\n * The buyer\n */\n buyerSecret: Hash\n /**\n * The escrow agent responsible for the escrow\n */\n escrowAgent: Address\n /**\n * The time the escrow expires\n */\n exp: number\n /**\n * The time the escrow starts\n */\n nbf: number\n /**\n * The trusted payment authorities\n */\n paymentAuthorities: Address[]\n /**\n * The seller\n */\n seller: Address[]\n /**\n * The seller\n */\n sellerSecret: Hash\n}\n\n/**\n * The terms of an escrow\n */\nexport type EscrowTerms = Payload<Partial<EscrowTermsFields>, EscrowTermsSchema>\n\n/**\n * Identity function for determining if an object is an EscrowTerms\n */\nexport const isEscrowTerms = isPayloadOfSchemaType<EscrowTerms>(EscrowTermsSchema)\n\n/**\n * Identity function for determining if an object is an EscrowTerms with sources\n */\nexport const isEscrowTermsWithSources = isPayloadOfSchemaTypeWithSources<EscrowTerms>(EscrowTermsSchema)\n\n/**\n * Identity function for determining if an object is an EscrowTerms with meta\n */\nexport const isEscrowTermsWithMeta = isPayloadOfSchemaTypeWithMeta<EscrowTerms>(EscrowTermsSchema)\n","import { ModuleIdentifier } from '@xyo-network/module-model'\n\nimport { EscrowTerms } from '../../../Terms'\nimport { EscrowTermsValueExpression } from '../../types/escrowValidation'\n\n/**\n * Checks if property value of the escrow terms contains one of the valid moduleIdentifiers\n * @param escrowTerms The escrow terms to validate\n * @param propertyExpression The selector to get the property containing the moduleIdentifier(s) from the escrow terms\n * @param moduleIdentifiers The list of allowed moduleIdentifiers\n * @param required Is the property required to be present\n * @returns True if the property value contains one of the valid moduleIdentifiers\n */\nexport const moduleIdentifiersContainsOneOf = (\n escrowTerms: EscrowTerms,\n propertyExpression: EscrowTermsValueExpression<'appraisalAuthorities' | 'buyer' | 'escrowAgent' | 'paymentAuthorities' | 'seller'>,\n moduleIdentifiers: ModuleIdentifier[],\n required: boolean = true,\n) => {\n const termsValue: string | string[] | undefined = propertyExpression(escrowTerms)\n if (termsValue === undefined) {\n return required ? false : true\n } else {\n return Array.isArray(termsValue) ? termsValue.some((address) => moduleIdentifiers.includes(address)) : moduleIdentifiers.includes(termsValue)\n }\n}\n\n/**\n * Checks if property value of the escrow terms contains all of the valid moduleIdentifiers\n * @param escrowTerms The escrow terms to validate\n * @param selector The selector to get the property containing the moduleIdentifier(s) from the escrow terms\n * @param moduleIdentifiers The list of allowed moduleIdentifiers\n * @param required Is the property required to be present\n * @returns True if the property value contains all of the valid moduleIdentifiers\n */\nexport const moduleIdentifiersContainsAllOf = (\n escrowTerms: EscrowTerms,\n selector: EscrowTermsValueExpression<'appraisalAuthorities' | 'buyer' | 'escrowAgent' | 'paymentAuthorities' | 'seller'>,\n moduleIdentifiers: ModuleIdentifier[],\n required: boolean = true,\n) => {\n const termsValue: string | string[] | undefined = selector(escrowTerms)\n if (termsValue === undefined) {\n return required ? false : true\n } else {\n return Array.isArray(termsValue) ? termsValue.every((address) => moduleIdentifiers.includes(address)) : moduleIdentifiers.includes(termsValue)\n }\n}\n","export type Windowed = { exp?: number; nbf?: number }\n\nexport const validateWithinWindow = (value: Windowed, exp: number, nbf: number = Date.now()): boolean => {\n if (value.nbf === undefined || value.nbf > nbf) return false\n if (value.exp === undefined || value.exp < exp) return false\n return true\n}\n","import { ModuleIdentifier } from '@xyo-network/module-model'\n\nimport { EscrowTerms } from '../../Terms'\nimport { moduleIdentifiersContainsOneOf } from '../common'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.escrowAgent'\n\nexport const getEscrowAgentAllowedValidator = (allowedEscrowAgent: ModuleIdentifier): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n const result = moduleIdentifiersContainsOneOf(terms, (t) => t.escrowAgent, [allowedEscrowAgent], true)\n if (!result) {\n console.log(`${name}: Escrow agent not allowed: ${terms.escrowAgent}`)\n }\n return result\n }\n}\n","import { assertEx } from '@xylabs/assert'\nimport { Hash } from '@xylabs/hex'\nimport { BoundWitness, isBoundWitnessWithMeta } from '@xyo-network/boundwitness-model'\nimport { HashLeaseEstimate, isHashLeaseEstimateWithSources } from '@xyo-network/diviner-hash-lease'\nimport { Payload, WithMeta, WithSources } from '@xyo-network/payload-model'\n\nimport { EscrowTerms } from '../../Terms'\nimport { validateWithinWindow } from '../common'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.appraisal'\n\n/**\n * A function that validates the escrow terms for tbe existence of appraisals\n * @returns True if the escrow terms contain appraisals, false otherwise\n */\nexport const appraisalsExistValidator: EscrowTermsValidationFunction = (terms: EscrowTerms) => {\n // Validate we have appraisals\n const appraisals = terms.appraisals\n if (!appraisals || appraisals.length === 0) {\n console.log(`${name}: No appraisals: ${terms.appraisals}`)\n return false\n }\n return true\n}\n\n/**\n * Returns a function that validates the escrow terms for appraisals which are from valid authorities\n * @param dictionary Payload dictionary of the escrow terms\n * @returns A function that validates the escrow terms for appraisals which are from valid authorities\n */\nexport const getAppraisalsFromValidAuthoritiesValidator = (dictionary: Record<Hash, WithMeta<Payload>>): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n const appraisals = assertEx(terms.appraisals, () => `${name}: No appraisals: ${terms.appraisals}`)\n const appraisalAuthorities = assertEx(terms.appraisalAuthorities, () => `${name}: No appraisalAuthorities: ${terms.appraisalAuthorities}`)\n\n // Validate the appraisals are signed by valid appraisal authorities. Validation criteria:\n // - We have a bw for each of the appraisal\n // - The bw is signed by an approved appraisal authority\n const appraisalBWsValid: Record<Hash, WithMeta<BoundWitness>[]> = Object.fromEntries(\n appraisals.map<[Hash, WithMeta<BoundWitness>[]]>((hash) => [hash, []]),\n )\n for (const bw of Object.values(dictionary).filter(isBoundWitnessWithMeta)) {\n for (const appraisal of appraisals) {\n if (bw.payload_hashes.includes(appraisal) && bw.addresses.some((address) => appraisalAuthorities.includes(address))) {\n appraisalBWsValid[appraisal].push(bw)\n }\n }\n }\n for (const [appraisal, bws] of Object.entries(appraisalBWsValid)) {\n if (bws.length === 0) {\n console.log(`${name}: No valid appraisals for ${appraisal}`)\n return false\n }\n }\n return true\n }\n}\n\n/**\n * Returns a function that validates the escrow terms for appraisals which are valid\n * @param dictionary Payload dictionary of the escrow terms\n * @param minimumExp The minium amount of time an estimate needs to be valid\n * for in the future (so as not to expire before the escrow is complete)\n * @returns A function that validates the escrow terms for appraisals which are valid\n */\nexport const getAppraisalsValidValidator = (dictionary: Record<Hash, WithMeta<Payload>>, minimumExp: number): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n // Verify we have an estimate for each of the assets\n const estimatesByAsset = getEstimatesByAsset(terms, dictionary)\n // Validate each of the estimates are valid (time, price, etc)\n const now = Date.now()\n const exp = now + minimumExp\n for (const [asset, estimates] of Object.entries(estimatesByAsset)) {\n for (const estimate of estimates) {\n if (!validateEstimate(estimate, exp)) {\n console.log(`${name}: Invalid estimate for asset ${asset}: ${estimate}`)\n return false\n }\n }\n }\n return true\n }\n}\n\n/**\n * Returns a function that validates the escrow terms to ensure that they contain an appraisal for each asset\n * @param dictionary Payload dictionary of the escrow terms\n * @returns A function that validates the escrow terms for appraisals\n */\nexport const getAppraisalsForAllAssetsValidator = (dictionary: Record<Hash, WithMeta<Payload>>): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n // Verify we have an estimate for each of the assets\n const estimatesByAsset = getEstimatesByAsset(terms, dictionary)\n const assets = assertEx(terms.assets, () => `${name}: No assets: ${terms.assets}`)\n if (Object.keys(estimatesByAsset).length !== assets.length) {\n console.log(`${name}: Missing appraisals for all assets: ${assets}`)\n return false\n }\n return true\n }\n}\n\nconst validateEstimate = (estimate: WithSources<HashLeaseEstimate>, exp: number): boolean => {\n if (!validateWithinWindow(estimate, exp)) return false\n if (estimate.currency !== 'USD') return false\n if (estimate.price <= 0) return false\n return true\n}\n\nconst getEstimatesByAsset = (terms: EscrowTerms, dictionary: Record<Hash, WithMeta<Payload>>): Record<Hash, WithSources<HashLeaseEstimate>[]> => {\n const assets = assertEx(terms.assets, () => `${name}: No assets: ${terms.assets}`)\n const estimates = Object.values(dictionary).filter(isHashLeaseEstimateWithSources) as unknown as WithSources<HashLeaseEstimate>[]\n const estimatesByAsset: Record<Hash, WithSources<HashLeaseEstimate>[]> = {}\n for (const estimate of estimates) {\n const { sources } = estimate\n if (sources === undefined || sources.length === 0) {\n console.log(`${name}: No sources: ${estimate}`)\n continue\n }\n for (const asset of assets) {\n if (sources.includes(asset)) {\n if (!estimatesByAsset[asset]) estimatesByAsset[asset] = []\n estimatesByAsset[asset].push(estimate)\n }\n }\n }\n return estimatesByAsset\n}\n","import { asAddress } from '@xylabs/hex'\nimport { ModuleIdentifier } from '@xyo-network/module-model'\n\nimport { EscrowTerms } from '../../Terms'\nimport { moduleIdentifiersContainsAllOf } from '../common'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.appraisalAuthorities'\n\n/**\n * A function that validates the escrow terms for appraisalAuthorities\n * @returns True if the escrow terms contain appraisalAuthorities, false otherwise\n */\nexport const appraisalAuthoritiesExistValidator: EscrowTermsValidationFunction = (terms: EscrowTerms) => {\n // Validate we have appraisalAuthorities\n const appraisalAuthorities = terms.appraisalAuthorities\n if (!appraisalAuthorities || appraisalAuthorities.length === 0) {\n console.log(`${name}: No appraisalAuthorities: ${terms.appraisalAuthorities}`)\n return false\n }\n // Validate the authorities are addresses\n if (appraisalAuthorities.map((x) => asAddress(x)).length !== appraisalAuthorities.length) {\n console.log(`${name}: Invalid address: ${terms.appraisalAuthorities}`)\n return false\n }\n return true\n}\n\nexport const getAppraisalAuthoritiesAllowedValidator = (allowed: ModuleIdentifier[]): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n const result = moduleIdentifiersContainsAllOf(terms, (t) => t.appraisalAuthorities, allowed, true)\n if (!result) {\n console.log(`${name}: Appraisal authority not allowed: ${terms.appraisalAuthorities}`)\n }\n return result\n }\n}\n","import { EscrowTerms } from '../../Terms'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.assets'\n\n/**\n * Returns a function that validates the escrow terms for assets\n * @returns A function that validates the escrow terms for assets\n */\nexport const assetsExistValidator: EscrowTermsValidationFunction = (terms: EscrowTerms) => {\n // Validate we have assets\n const assets = terms.assets\n if (!assets || assets.length === 0) {\n console.log(`${name}: No assets: ${terms.assets}`)\n return false\n }\n return true\n}\n","import { asAddress } from '@xylabs/hex'\n\nimport { EscrowTerms } from '../../Terms'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.buyer'\n\n/**\n * A function that validates the escrow terms for buyer\n * @returns True if the escrow terms contain buyer, false otherwise\n */\nexport const buyerExistsValidator: EscrowTermsValidationFunction = (terms: EscrowTerms) => {\n // Validate we have buyer\n const buyer = terms.buyer\n if (!buyer || buyer.length === 0) {\n console.log(`${name}: No buyer: ${terms.buyer}`)\n return false\n }\n // Validate the authorities are addresses\n if (buyer.map((x) => asAddress(x)).length !== buyer.length) {\n console.log(`${name}: Invalid address: ${terms.buyer}`)\n return false\n }\n return true\n}\n","import { assertEx } from '@xylabs/assert'\nimport { Hash } from '@xylabs/hex'\nimport { isBoundWitnessWithMeta } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessValidator } from '@xyo-network/boundwitness-validator'\nimport { Payload, WithMeta } from '@xyo-network/payload-model'\n\nimport { EscrowTerms } from '../../Terms'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.buyerSecret'\n\n/**\n * Returns a function that validates the escrow terms for buyerSecret\n * @returns A function that validates the escrow terms for buyerSecret\n */\nexport const buyerSecretExistsValidator: EscrowTermsValidationFunction = (terms: EscrowTerms) => {\n // Validate we have buyerSecret\n const buyerSecret = terms.buyerSecret\n if (!buyerSecret || buyerSecret.length === 0) {\n console.log(`${name}: No buyerSecret: ${terms.buyerSecret}`)\n return false\n }\n return true\n}\n\n/**\n * Returns a function that validates the escrow terms for the existence of the buyerSecret in the dictionary\n * @param dictionary Payload dictionary of the escrow terms\n * @returns A function that validates the escrow terms for the existence of the buyerSecret in the dictionary\n */\nexport const getBuyerSecretSuppliedValidator = (dictionary: Record<Hash, WithMeta<Payload>>): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n const buyerSecret = assertEx(terms.buyerSecret, () => `${name}: No buyerSecret: ${terms.buyerSecret}`)\n if (!dictionary[buyerSecret]) {\n console.log(`${name}: Payload not supplied for buyerSecret: ${buyerSecret}`)\n return false\n }\n return true\n }\n}\n\n/**\n * Returns a function that validates the escrow terms for the existence of the buyerSecret signed by the buyer\n * @param dictionary Payload dictionary of the escrow terms\n * @returns A function that validates the escrow terms for the existence of the buyerSecret signed by the buyer\n */\nexport const getBuyerSecretSignedValidator = (dictionary: Record<Hash, WithMeta<Payload>>): EscrowTermsValidationFunction => {\n return async (terms: EscrowTerms) => {\n const buyer = assertEx(terms.buyer, () => `${name}: No buyer: ${terms.buyer}`)\n const buyerSecret = assertEx(terms.buyerSecret, () => `${name}: No buyerSecret: ${terms.buyerSecret}`)\n // Buyer-signed buyer secrets\n const buyerSecretBWs = Object.values(dictionary)\n // Find all BoundWitnesses\n .filter(isBoundWitnessWithMeta)\n // That contain the buyer secret\n .filter((bw) => bw.payload_hashes.includes(buyerSecret))\n // That are signed by all the buyers\n .filter((bw) => buyer.every((buyerAddress) => bw.addresses.includes(buyerAddress)))\n\n // If there are no buyerSecret BWs, return false\n if (buyerSecretBWs.length === 0) {\n console.log(`${name}: No BoundWitnesses supplied for buyerSecret: ${buyerSecret}`)\n return false\n }\n\n // Ensure each BW supplied for the buyerSecret is valid\n const errors = await Promise.all(buyerSecretBWs.map((bw) => new BoundWitnessValidator(bw).validate()))\n const validBoundWitnesses = errors.every((errors) => errors.length === 0)\n if (!validBoundWitnesses) {\n console.log(`${name}: Invalid BoundWitnesses supplied for buyerSecret: ${buyerSecret}`)\n return false\n }\n return true\n }\n}\n","import { EscrowTerms } from '../../Terms'\nimport { EscrowTermsValidationFunction } from '../types'\n\nexport const getNbfExpValidator = (now: number, minRequiredDuration: number): EscrowTermsValidationFunction => {\n const minExp = now + minRequiredDuration\n return (terms: EscrowTerms) => {\n const { exp, nbf } = terms\n if (nbf === undefined || nbf < now) {\n console.log(`EscrowTerms.nbf: invalid nbf ${terms.nbf}`)\n return false\n }\n if (exp === undefined || exp < minExp || nbf > exp) {\n console.log(`EscrowTerms.exp: invalid exp ${terms.exp}`)\n return false\n }\n return true\n }\n}\n","import { ModuleIdentifier } from '@xyo-network/module-model'\n\nimport { EscrowTerms } from '../../Terms'\nimport { moduleIdentifiersContainsAllOf } from '../common'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.paymentAuthorities'\n\nexport const getPaymentAuthoritiesAllowedValidator = (allowed: ModuleIdentifier[]): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n const result = moduleIdentifiersContainsAllOf(terms, (t) => t.paymentAuthorities, allowed, true)\n if (!result) {\n console.log(`${name}: Payment authority not allowed: ${terms.paymentAuthorities}`)\n }\n return result\n }\n}\n","import { asAddress } from '@xylabs/hex'\n\nimport { EscrowTerms } from '../../Terms'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.seller'\n\n/**\n * A function that validates the escrow terms for seller\n * @returns True if the escrow terms contain seller, false otherwise\n */\nexport const sellerExistsValidator: EscrowTermsValidationFunction = (terms: EscrowTerms) => {\n // Validate we have seller\n const seller = terms.seller\n if (!seller || seller.length === 0) {\n console.log(`${name}: No seller: ${terms.seller}`)\n return false\n }\n // Validate the authorities are addresses\n if (seller.map((x) => asAddress(x)).length !== seller.length) {\n console.log(`${name}: Invalid address: ${terms.seller}`)\n return false\n }\n return true\n}\n","import { assertEx } from '@xylabs/assert'\nimport { Hash } from '@xylabs/hex'\nimport { isBoundWitnessWithMeta } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessValidator } from '@xyo-network/boundwitness-validator'\nimport { Payload, WithMeta } from '@xyo-network/payload-model'\n\nimport { EscrowTerms } from '../../Terms'\nimport { EscrowTermsValidationFunction } from '../types'\n\nconst name = 'EscrowTerms.sellerSecret'\n\n/**\n * Returns a function that validates the escrow terms for sellerSecret\n * @returns A function that validates the escrow terms for sellerSecret\n */\nexport const sellerSecretExistsValidator: EscrowTermsValidationFunction = (terms: EscrowTerms) => {\n // Validate we have sellerSecret\n const sellerSecret = terms.sellerSecret\n if (!sellerSecret || sellerSecret.length === 0) {\n console.log(`${name}: No sellerSecret: ${terms.sellerSecret}`)\n return false\n }\n return true\n}\n\n/**\n * Returns a function that validates the escrow terms for the existence of the sellerSecret in the dictionary\n * @param dictionary Payload dictionary of the escrow terms\n * @returns A function that validates the escrow terms for the existence of the sellerSecret in the dictionary\n */\nexport const getSellerSecretSuppliedValidator = (dictionary: Record<Hash, WithMeta<Payload>>): EscrowTermsValidationFunction => {\n return (terms: EscrowTerms) => {\n const sellerSecret = assertEx(terms.sellerSecret, () => `${name}: No sellerSecret: ${terms.sellerSecret}`)\n if (!dictionary[sellerSecret]) {\n console.log(`${name}: Payload not supplied for sellerSecret: ${sellerSecret}`)\n return false\n }\n return true\n }\n}\n\n/**\n * Returns a function that validates the escrow terms for the existence of the sellerSecret signed by the seller\n * @param dictionary Payload dictionary of the escrow terms\n * @returns A function that validates the escrow terms for the existence of the sellerSecret signed by the seller\n */\nexport const getSellerSecretSignedValidator = (dictionary: Record<Hash, WithMeta<Payload>>): EscrowTermsValidationFunction => {\n return async (terms: EscrowTerms) => {\n const seller = assertEx(terms.seller, () => `${name}: No seller: ${terms.seller}`)\n const sellerSecret = assertEx(terms.sellerSecret, () => `${name}: No sellerSecret: ${terms.sellerSecret}`)\n // Seller-signed seller secrets\n const sellerSecretBWs = Object.values(dictionary)\n // Find all BoundWitnesses\n .filter(isBoundWitnessWithMeta)\n // That contain the seller secret\n .filter((bw) => bw.payload_hashes.includes(sellerSecret))\n // That are signed by all the sellers\n .filter((bw) => seller.every((sellerAddress) => bw.addresses.includes(sellerAddress)))\n\n // If there are no sellerSecret BWs, return false\n if (sellerSecretBWs.length === 0) {\n console.log(`${name}: No BoundWitnesses supplied for sellerSecret: ${sellerSecret}`)\n return false\n }\n\n // Ensure each BW supplied for the sellerSecret is valid\n const errors = await Promise.all(sellerSecretBWs.map((bw) => new BoundWitnessValidator(bw).validate()))\n const validBoundWitnesses = errors.every((errors) => errors.length === 0)\n if (!validBoundWitnesses) {\n console.log(`${name}: Invalid BoundWitnesses supplied for sellerSecret: ${sellerSecret}`)\n return false\n }\n return true\n }\n}\n","import {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithMeta,\n isPayloadOfSchemaTypeWithSources,\n PayloadWithSources,\n} from '@xyo-network/payload-model'\n\nimport { SupportedCurrency } from './Currency'\n\nexport type PaymentSchema = 'network.xyo.payments.payment'\nexport const PaymentSchema: PaymentSchema = 'network.xyo.payments.payment'\n\nexport interface PaymentFields {\n /**\n * The amount paid\n */\n amount: number\n /**\n * The currency of the amount paid\n */\n currency: SupportedCurrency\n}\n\n/**\n * A payment is a record of an amount to be paid\n */\nexport type Payment = PayloadWithSources<PaymentFields, PaymentSchema>\n\n/**\n * Identity function for determine if an object is a Payment\n */\nexport const isPayment = isPayloadOfSchemaType<Payment>(PaymentSchema)\n\n/**\n * Identity function for determine if an object is a Payment with sources\n */\nexport const isPaymentWithSources = isPayloadOfSchemaTypeWithSources<Payment>(PaymentSchema)\n\n/**\n * Identity function for determine if an object is a Payment with meta\n */\nexport const isPaymentWithMeta = isPayloadOfSchemaTypeWithMeta<Payment>(PaymentSchema)\n","import { Hash } from '@xylabs/hex'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithMeta,\n isPayloadOfSchemaTypeWithSources,\n PayloadWithSources,\n} from '@xyo-network/payload-model'\n\nexport type PurchaseSchema = 'network.xyo.payments.purchase'\nexport const PurchaseSchema: PurchaseSchema = 'network.xyo.payments.purchase'\n\nexport interface PurchaseFields {\n /**\n * The things that were purchased\n */\n assets: Hash[]\n /**\n * The receipts for payments for this purchase. Array to allow for multiple payments\n * for a single quote.\n */\n receipts: Hash[]\n}\n\n/**\n * A purchase ties a payment made to a quote\n */\nexport type Purchase = PayloadWithSources<PurchaseFields, PurchaseSchema>\n\n/**\n * Identity function for determine if an object is a Purchase\n */\nexport const isPurchase = isPayloadOfSchemaType<Purchase>(PurchaseSchema)\n\n/**\n * Identity function for determine if an object is a Purchase with sources\n */\nexport const isPurchaseWithSources = isPayloadOfSchemaTypeWithSources<Purchase>(PurchaseSchema)\n\n/**\n * Identity function for determine if an object is a Purchase with meta\n */\nexport const isPurchaseWithMeta = isPayloadOfSchemaTypeWithMeta<Purchase>(PurchaseSchema)\n","import {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithMeta,\n isPayloadOfSchemaTypeWithSources,\n PayloadWithSources,\n} from '@xyo-network/payload-model'\n\nimport { SupportedCurrency } from './Currency'\n\nexport type ReceiptSchema = 'network.xyo.payments.receipt'\nexport const ReceiptSchema: ReceiptSchema = 'network.xyo.payments.receipt'\n\nexport interface ReceiptFields {\n /**\n * The amount paid\n */\n amount: number\n /**\n * The currency of the amount paid\n */\n currency: SupportedCurrency\n}\n\n/**\n * A receipt is a record of a payment made\n */\nexport type Receipt = PayloadWithSources<ReceiptFields, ReceiptSchema>\n\n/**\n * Identity function for determine if an object is a Receipt\n */\nexport const isReceipt = isPayloadOfSchemaType<Receipt>(ReceiptSchema)\n\n/**\n * Identity function for determine if an object is a Receipt with sources\n */\nexport const isReceiptWithSources = isPayloadOfSchemaTypeWithSources<Receipt>(ReceiptSchema)\n\n/**\n * Identity function for determine if an object is a Receipt with meta\n */\nexport const isReceiptWithMeta = isPayloadOfSchemaTypeWithMeta<Receipt>(ReceiptSchema)\n"],"mappings":";AACA,SAAS,2BAA2B;AAY7B,IAAM,qBAAqB,OAAO,OAAsB,YAA6B;AAC1F,QAAM,SAAS,MAAM,IAAI,oBAAoB,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,EAAE,MAAM;AACjG,SAAO;AACT;AASO,IAAM,+BAA+B,OAAO,OAAoB,QAAmB,YAA6B;AACrH,QAAM,SAAS,MAAM,IAAI,oBAAoB,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,OAAO,MAAM,CAAC,EAAE,MAAM;AACtG,SAAO;AACT;;;AC5BA,SAAS,cAAc;AACvB,SAAoB,gBAAgB;AAM7B,IAAM,kBAAkB,MAAiB;AAC9C,SAAO,EAAE,MAAM,OAAO,WAAW,GAAG,QAAQ,SAAS;AACvD;;;ACRO,IAAM,eAA6B;;;ACA1C,SAAS,uBAAuB,+BAA+B,wCAAiD;AAIzG,IAAM,oBAAoB,GAAG,YAAY;AA2Dz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,CAAC,kBAAkB,GAAG,UAAU,SAAS,aAAa,CAAC,CAAC;AAGvF,QAAI,gBAAgB,WAAW,GAAG;AAChC,cAAQ,IAAI,GAAGE,KAAI,kDAAkD,YAAY,EAAE;AACnF,aAAO;AAAA,IACT;AAGA,UAAM,SAAS,MAAM,QAAQ,IAAI,gBAAgB,IAAI,CAAC,OAAO,IAAID,uBAAsB,EAAE,EAAE,SAAS,CAAC,CAAC;AACtG,UAAM,sBAAsB,OAAO,MAAM,CAACE,YAAWA,QAAO,WAAW,CAAC;AACxE,QAAI,CAAC,qBAAqB;AACxB,cAAQ,IAAI,GAAGD,KAAI,uDAAuD,YAAY,EAAE;AACxF,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AACF;;;AC1EA;AAAA,EACE,yBAAAE;AAAA,EACA,iCAAAC;AAAA,EACA,oCAAAC;AAAA,OAEK;AAKA,IAAM,gBAA+B;AAqBrC,IAAM,YAAYF,uBAA+B,aAAa;AAK9D,IAAM,uBAAuBE,kCAA0C,aAAa;AAKpF,IAAM,oBAAoBD,+BAAuC,aAAa;;;ACxCrF;AAAA,EACE,yBAAAE;AAAA,EACA,iCAAAC;AAAA,EACA,oCAAAC;AAAA,OAEK;AAGA,IAAM,iBAAiC;AAsBvC,IAAM,aAAaF,uBAAgC,cAAc;AAKjE,IAAM,wBAAwBE,kCAA2C,cAAc;AAKvF,IAAM,qBAAqBD,+BAAwC,cAAc;;;ACzCxF;AAAA,EACE,yBAAAE;AAAA,EACA,iCAAAC;AAAA,EACA,oCAAAC;AAAA,OAEK;AAKA,IAAM,gBAA+B;AAqBrC,IAAM,YAAYF,uBAA+B,aAAa;AAK9D,IAAM,uBAAuBE,kCAA0C,aAAa;AAKpF,IAAM,oBAAoBD,+BAAuC,aAAa;","names":["name","name","name","asAddress","name","assertEx","isBoundWitnessWithMeta","name","errors","name","asAddress","name","assertEx","isBoundWitnessWithMeta","BoundWitnessValidator","name","errors","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithMeta","isPayloadOfSchemaTypeWithSources"]}
@@ -52,7 +52,22 @@ export interface EscrowTermsFields {
52
52
  * The terms of an escrow
53
53
  */
54
54
  export type EscrowTerms = Payload<Partial<EscrowTermsFields>, EscrowTermsSchema>;
55
+ /**
56
+ * Identity function for determining if an object is an EscrowTerms
57
+ */
55
58
  export declare const isEscrowTerms: (x?: unknown) => x is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Partial<EscrowTermsFields> & {
56
59
  schema: "network.xyo.escrow.terms";
57
60
  };
61
+ /**
62
+ * Identity function for determining if an object is an EscrowTerms with sources
63
+ */
64
+ export declare const isEscrowTermsWithSources: (x?: unknown) => x is import("@xyo-network/payload-model").WithSources<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Partial<EscrowTermsFields> & {
65
+ schema: "network.xyo.escrow.terms";
66
+ }>;
67
+ /**
68
+ * Identity function for determining if an object is an EscrowTerms with meta
69
+ */
70
+ export declare const isEscrowTermsWithMeta: (x?: unknown) => x is import("@xyo-network/payload-model").WithMeta<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Partial<EscrowTermsFields> & {
71
+ schema: "network.xyo.escrow.terms";
72
+ }>;
58
73
  //# sourceMappingURL=Terms.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Terms.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAI3E,eAAO,MAAM,iBAAiB,4BAAmC,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAA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CAAA;IACjB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,kBAAkB,EAAE,OAAO,EAAE,CAAA;IAC7B;;OAEG;IACH,MAAM,EAAE,OAAO,EAAE,CAAA;IACjB;;OAEG;IACH,YAAY,EAAE,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAAA;AAEhF;;GAEG;AACH,eAAO,MAAM,aAAa;;CAAwD,CAAA;AAElF;;GAEG;AACH,eAAO,MAAM,wBAAwB;;EAAmE,CAAA;AAExG;;GAEG;AACH,eAAO,MAAM,qBAAqB;;EAAgE,CAAA"}
@@ -52,7 +52,22 @@ export interface EscrowTermsFields {
52
52
  * The terms of an escrow
53
53
  */
54
54
  export type EscrowTerms = Payload<Partial<EscrowTermsFields>, EscrowTermsSchema>;
55
+ /**
56
+ * Identity function for determining if an object is an EscrowTerms
57
+ */
55
58
  export declare const isEscrowTerms: (x?: unknown) => x is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Partial<EscrowTermsFields> & {
56
59
  schema: "network.xyo.escrow.terms";
57
60
  };
61
+ /**
62
+ * Identity function for determining if an object is an EscrowTerms with sources
63
+ */
64
+ export declare const isEscrowTermsWithSources: (x?: unknown) => x is import("@xyo-network/payload-model").WithSources<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Partial<EscrowTermsFields> & {
65
+ schema: "network.xyo.escrow.terms";
66
+ }>;
67
+ /**
68
+ * Identity function for determining if an object is an EscrowTerms with meta
69
+ */
70
+ export declare const isEscrowTermsWithMeta: (x?: unknown) => x is import("@xyo-network/payload-model").WithMeta<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Partial<EscrowTermsFields> & {
71
+ schema: "network.xyo.escrow.terms";
72
+ }>;
58
73
  //# sourceMappingURL=Terms.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Terms.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAI3E,eAAO,MAAM,iBAAiB,4BAAmC,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAA;AAGxD,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,oBAAoB,EAAE,OAAO,EAAE,CAAA;IAC/B;;OAEG;IACH,UAAU,EAAE,IAAI,EAAE,CAAA;IAClB;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB;;OAEG;IACH,WAAW,EAAE,IAAI,CAAA;IACjB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,kBAAkB,EAAE,OAAO,EAAE,CAAA;IAC7B;;OAEG;IACH,MAAM,EAAE,OAAO,EAAE,CAAA;IACjB;;OAEG;IACH,YAAY,EAAE,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAAA;AAEhF,eAAO,MAAM,aAAa;;CAAwD,CAAA"}
1
+ {"version":3,"file":"Terms.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAA0F,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAI5I,eAAO,MAAM,iBAAiB,4BAAmC,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAA;AAGxD,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,oBAAoB,EAAE,OAAO,EAAE,CAAA;IAC/B;;OAEG;IACH,UAAU,EAAE,IAAI,EAAE,CAAA;IAClB;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB;;OAEG;IACH,WAAW,EAAE,IAAI,CAAA;IACjB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,kBAAkB,EAAE,OAAO,EAAE,CAAA;IAC7B;;OAEG;IACH,MAAM,EAAE,OAAO,EAAE,CAAA;IACjB;;OAEG;IACH,YAAY,EAAE,IAAI,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAAA;AAEhF;;GAEG;AACH,eAAO,MAAM,aAAa;;CAAwD,CAAA;AAElF;;GAEG;AACH,eAAO,MAAM,wBAAwB;;EAAmE,CAAA;AAExG;;GAEG;AACH,eAAO,MAAM,qBAAqB;;EAAgE,CAAA"}
@@ -52,7 +52,22 @@ export interface EscrowTermsFields {
52
52
  * The terms of an escrow
53
53
  */
54
54
  export type EscrowTerms = Payload<Partial<EscrowTermsFields>, EscrowTermsSchema>;
55
+ /**
56
+ * Identity function for determining if an object is an EscrowTerms
57
+ */
55
58
  export declare const isEscrowTerms: (x?: unknown) => x is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Partial<EscrowTermsFields> & {
56
59
  schema: "network.xyo.escrow.terms";
57
60
  };
61
+ /**
62
+ * Identity function for determining if an object is an EscrowTerms with sources
63
+ */
64
+ export declare const isEscrowTermsWithSources: (x?: unknown) => x is import("@xyo-network/payload-model").WithSources<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Partial<EscrowTermsFields> & {
65
+ schema: "network.xyo.escrow.terms";
66
+ }>;
67
+ /**
68
+ * Identity function for determining if an object is an EscrowTerms with meta
69
+ */
70
+ export declare const isEscrowTermsWithMeta: (x?: unknown) => x is import("@xyo-network/payload-model").WithMeta<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Partial<EscrowTermsFields> & {
71
+ schema: "network.xyo.escrow.terms";
72
+ }>;
58
73
  //# sourceMappingURL=Terms.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Terms.d.ts","sourceRoot":"","sources":["../../../src/Escrow/Terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAI3E,eAAO,MAAM,iBAAiB,4BAAmC,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAA;AAGxD,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,oBAAoB,EAAE,OAAO,EAAE,CAAA;IAC/B;;OAEG;IACH,UAAU,EAAE,IAAI,EAAE,CAAA;IAClB;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB;;OAEG;IACH,WAAW,EAAE,IAAI,CAAA;IACjB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,kBAAkB,EAAE,OAAO,EAAE,CAAA;IAC7B;;OAEG;IACH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MAAM,wBAAwB;;EAAmE,CAAA;AAExG;;GAEG;AACH,eAAO,MAAM,qBAAqB;;EAAgE,CAAA"}
@@ -7,4 +7,5 @@ export * from './buyerSecret';
7
7
  export * from './nbfExp';
8
8
  export * from './paymentAuthorities';
9
9
  export * from './seller';
10
+ export * from './sellerSecret';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Escrow/validators/escrow/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,sBAAsB,CAAA;AACpC,cAAc,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Escrow/validators/escrow/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,sBAAsB,CAAA;AACpC,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA"}
@@ -7,4 +7,5 @@ export * from './buyerSecret';
7
7
  export * from './nbfExp';
8
8
  export * from './paymentAuthorities';
9
9
  export * from './seller';
10
+ export * from './sellerSecret';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Escrow/validators/escrow/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,sBAAsB,CAAA;AACpC,cAAc,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Escrow/validators/escrow/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,sBAAsB,CAAA;AACpC,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA"}
@@ -7,4 +7,5 @@ export * from './buyerSecret';
7
7
  export * from './nbfExp';
8
8
  export * from './paymentAuthorities';
9
9
  export * from './seller';
10
+ export * from './sellerSecret';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Escrow/validators/escrow/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,sBAAsB,CAAA;AACpC,cAAc,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Escrow/validators/escrow/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,sBAAsB,CAAA;AACpC,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { Hash } from '@xylabs/hex';
2
+ import { Payload, WithMeta } from '@xyo-network/payload-model';
3
+ import { EscrowTermsValidationFunction } from '../types';
4
+ /**
5
+ * Returns a function that validates the escrow terms for sellerSecret
6
+ * @returns A function that validates the escrow terms for sellerSecret
7
+ */
8
+ export declare const sellerSecretExistsValidator: EscrowTermsValidationFunction;
9
+ /**
10
+ * Returns a function that validates the escrow terms for the existence of the sellerSecret in the dictionary
11
+ * @param dictionary Payload dictionary of the escrow terms
12
+ * @returns A function that validates the escrow terms for the existence of the sellerSecret in the dictionary
13
+ */
14
+ export declare const getSellerSecretSuppliedValidator: (dictionary: Record<Hash, WithMeta<Payload>>) => EscrowTermsValidationFunction;
15
+ /**
16
+ * Returns a function that validates the escrow terms for the existence of the sellerSecret signed by the seller
17
+ * @param dictionary Payload dictionary of the escrow terms
18
+ * @returns A function that validates the escrow terms for the existence of the sellerSecret signed by the seller
19
+ */
20
+ export declare const getSellerSecretSignedValidator: (dictionary: Record<Hash, WithMeta<Payload>>) => EscrowTermsValidationFunction;
21
+ //# sourceMappingURL=sellerSecret.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sellerSecret.d.ts","sourceRoot":"","sources":["../../../../../src/Escrow/validators/escrow/sellerSecret.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAGlC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAG9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAIxD;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,6BAQzC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,eAAgB,OAAO,IAAI,EAAE,SAAS,OAAO,CAAC,CAAC,KAAG,6BAS9F,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,eAAgB,OAAO,IAAI,EAAE,SAAS,OAAO,CAAC,CAAC,KAAG,6BA4B5F,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { Hash } from '@xylabs/hex';
2
+ import { Payload, WithMeta } from '@xyo-network/payload-model';
3
+ import { EscrowTermsValidationFunction } from '../types';
4
+ /**
5
+ * Returns a function that validates the escrow terms for sellerSecret
6
+ * @returns A function that validates the escrow terms for sellerSecret
7
+ */
8
+ export declare const sellerSecretExistsValidator: EscrowTermsValidationFunction;
9
+ /**
10
+ * Returns a function that validates the escrow terms for the existence of the sellerSecret in the dictionary
11
+ * @param dictionary Payload dictionary of the escrow terms
12
+ * @returns A function that validates the escrow terms for the existence of the sellerSecret in the dictionary
13
+ */
14
+ export declare const getSellerSecretSuppliedValidator: (dictionary: Record<Hash, WithMeta<Payload>>) => EscrowTermsValidationFunction;
15
+ /**
16
+ * Returns a function that validates the escrow terms for the existence of the sellerSecret signed by the seller
17
+ * @param dictionary Payload dictionary of the escrow terms
18
+ * @returns A function that validates the escrow terms for the existence of the sellerSecret signed by the seller
19
+ */
20
+ export declare const getSellerSecretSignedValidator: (dictionary: Record<Hash, WithMeta<Payload>>) => EscrowTermsValidationFunction;
21
+ //# sourceMappingURL=sellerSecret.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sellerSecret.d.ts","sourceRoot":"","sources":["../../../../../src/Escrow/validators/escrow/sellerSecret.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAGlC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAG9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAIxD;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,6BAQzC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,eAAgB,OAAO,IAAI,EAAE,SAAS,OAAO,CAAC,CAAC,KAAG,6BAS9F,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,eAAgB,OAAO,IAAI,EAAE,SAAS,OAAO,CAAC,CAAC,KAAG,6BA4B5F,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { Hash } from '@xylabs/hex';
2
+ import { Payload, WithMeta } from '@xyo-network/payload-model';
3
+ import { EscrowTermsValidationFunction } from '../types';
4
+ /**
5
+ * Returns a function that validates the escrow terms for sellerSecret
6
+ * @returns A function that validates the escrow terms for sellerSecret
7
+ */
8
+ export declare const sellerSecretExistsValidator: EscrowTermsValidationFunction;
9
+ /**
10
+ * Returns a function that validates the escrow terms for the existence of the sellerSecret in the dictionary
11
+ * @param dictionary Payload dictionary of the escrow terms
12
+ * @returns A function that validates the escrow terms for the existence of the sellerSecret in the dictionary
13
+ */
14
+ export declare const getSellerSecretSuppliedValidator: (dictionary: Record<Hash, WithMeta<Payload>>) => EscrowTermsValidationFunction;
15
+ /**
16
+ * Returns a function that validates the escrow terms for the existence of the sellerSecret signed by the seller
17
+ * @param dictionary Payload dictionary of the escrow terms
18
+ * @returns A function that validates the escrow terms for the existence of the sellerSecret signed by the seller
19
+ */
20
+ export declare const getSellerSecretSignedValidator: (dictionary: Record<Hash, WithMeta<Payload>>) => EscrowTermsValidationFunction;
21
+ //# sourceMappingURL=sellerSecret.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sellerSecret.d.ts","sourceRoot":"","sources":["../../../../../src/Escrow/validators/escrow/sellerSecret.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAGlC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAG9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAIxD;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,6BAQzC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,eAAgB,OAAO,IAAI,EAAE,SAAS,OAAO,CAAC,CAAC,KAAG,6BAS9F,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,eAAgB,OAAO,IAAI,EAAE,SAAS,OAAO,CAAC,CAAC,KAAG,6BA4B5F,CAAA"}
@@ -13,8 +13,19 @@ export interface PaymentFields {
13
13
  currency: SupportedCurrency;
14
14
  }
15
15
  /**
16
- * A payment is a record of a payment made
16
+ * A payment is a record of an amount to be paid
17
17
  */
18
18
  export type Payment = PayloadWithSources<PaymentFields, PaymentSchema>;
19
+ /**
20
+ * Identity function for determine if an object is a Payment
21
+ */
19
22
  export declare const isPayment: (x?: unknown) => x is Payment;
23
+ /**
24
+ * Identity function for determine if an object is a Payment with sources
25
+ */
26
+ export declare const isPaymentWithSources: (x?: unknown) => x is import("@xyo-network/payload-model").WithSources<Payment>;
27
+ /**
28
+ * Identity function for determine if an object is a Payment with meta
29
+ */
30
+ export declare const isPaymentWithMeta: (x?: unknown) => x is import("@xyo-network/payload-model").WithMeta<Payment>;
20
31
  //# sourceMappingURL=Payment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Payment.d.ts","sourceRoot":"","sources":["../../src/Payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAEtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,MAAM,aAAa,GAAG,8BAA8B,CAAA;AAC1D,eAAO,MAAM,aAAa,EAAE,aAA8C,CAAA;AAE1E,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,kBAAkB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAA;AAEtE,eAAO,MAAM,SAAS,+BAAgD,CAAA"}
1
+ {"version":3,"file":"Payment.d.ts","sourceRoot":"","sources":["../../src/Payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,kBAAkB,EACnB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,MAAM,aAAa,GAAG,8BAA8B,CAAA;AAC1D,eAAO,MAAM,aAAa,EAAE,aAA8C,CAAA;AAE1E,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,kBAAkB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAA;AAEtE;;GAEG;AACH,eAAO,MAAM,SAAS,+BAAgD,CAAA;AAEtE;;GAEG;AACH,eAAO,MAAM,oBAAoB,iFAA2D,CAAA;AAE5F;;GAEG;AACH,eAAO,MAAM,iBAAiB,8EAAwD,CAAA"}
@@ -13,8 +13,19 @@ export interface PaymentFields {
13
13
  currency: SupportedCurrency;
14
14
  }
15
15
  /**
16
- * A payment is a record of a payment made
16
+ * A payment is a record of an amount to be paid
17
17
  */
18
18
  export type Payment = PayloadWithSources<PaymentFields, PaymentSchema>;
19
+ /**
20
+ * Identity function for determine if an object is a Payment
21
+ */
19
22
  export declare const isPayment: (x?: unknown) => x is Payment;
23
+ /**
24
+ * Identity function for determine if an object is a Payment with sources
25
+ */
26
+ export declare const isPaymentWithSources: (x?: unknown) => x is import("@xyo-network/payload-model").WithSources<Payment>;
27
+ /**
28
+ * Identity function for determine if an object is a Payment with meta
29
+ */
30
+ export declare const isPaymentWithMeta: (x?: unknown) => x is import("@xyo-network/payload-model").WithMeta<Payment>;
20
31
  //# sourceMappingURL=Payment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Payment.d.ts","sourceRoot":"","sources":["../../src/Payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAEtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,MAAM,aAAa,GAAG,8BAA8B,CAAA;AAC1D,eAAO,MAAM,aAAa,EAAE,aAA8C,CAAA;AAE1E,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,kBAAkB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAA;AAEtE,eAAO,MAAM,SAAS,+BAAgD,CAAA"}
1
+ {"version":3,"file":"Payment.d.ts","sourceRoot":"","sources":["../../src/Payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,kBAAkB,EACnB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,MAAM,aAAa,GAAG,8BAA8B,CAAA;AAC1D,eAAO,MAAM,aAAa,EAAE,aAA8C,CAAA;AAE1E,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,kBAAkB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAA;AAEtE;;GAEG;AACH,eAAO,MAAM,SAAS,+BAAgD,CAAA;AAEtE;;GAEG;AACH,eAAO,MAAM,oBAAoB,iFAA2D,CAAA;AAE5F;;GAEG;AACH,eAAO,MAAM,iBAAiB,8EAAwD,CAAA"}
@@ -13,8 +13,19 @@ export interface PaymentFields {
13
13
  currency: SupportedCurrency;
14
14
  }
15
15
  /**
16
- * A payment is a record of a payment made
16
+ * A payment is a record of an amount to be paid
17
17
  */
18
18
  export type Payment = PayloadWithSources<PaymentFields, PaymentSchema>;
19
+ /**
20
+ * Identity function for determine if an object is a Payment
21
+ */
19
22
  export declare const isPayment: (x?: unknown) => x is Payment;
23
+ /**
24
+ * Identity function for determine if an object is a Payment with sources
25
+ */
26
+ export declare const isPaymentWithSources: (x?: unknown) => x is import("@xyo-network/payload-model").WithSources<Payment>;
27
+ /**
28
+ * Identity function for determine if an object is a Payment with meta
29
+ */
30
+ export declare const isPaymentWithMeta: (x?: unknown) => x is import("@xyo-network/payload-model").WithMeta<Payment>;
20
31
  //# sourceMappingURL=Payment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Payment.d.ts","sourceRoot":"","sources":["../../src/Payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAEtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,MAAM,aAAa,GAAG,8BAA8B,CAAA;AAC1D,eAAO,MAAM,aAAa,EAAE,aAA8C,CAAA;AAE1E,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,kBAAkB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAA;AAEtE,eAAO,MAAM,SAAS,+BAAgD,CAAA"}
1
+ {"version":3,"file":"Payment.d.ts","sourceRoot":"","sources":["../../src/Payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,kBAAkB,EACnB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,MAAM,aAAa,GAAG,8BAA8B,CAAA;AAC1D,eAAO,MAAM,aAAa,EAAE,aAA8C,CAAA;AAE1E,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,kBAAkB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAA;AAEtE;;GAEG;AACH,eAAO,MAAM,SAAS,+BAAgD,CAAA;AAEtE;;GAEG;AACH,eAAO,MAAM,oBAAoB,iFAA2D,CAAA;AAE5F;;GAEG;AACH,eAAO,MAAM,iBAAiB,8EAAwD,CAAA"}
@@ -4,17 +4,29 @@ export type PurchaseSchema = 'network.xyo.payments.purchase';
4
4
  export declare const PurchaseSchema: PurchaseSchema;
5
5
  export interface PurchaseFields {
6
6
  /**
7
- * The hashes that were purchased
7
+ * The things that were purchased
8
8
  */
9
- hashes: Hash[];
9
+ assets: Hash[];
10
10
  /**
11
- * The payments for this purchase. Array to allow for multiple payments
11
+ * The receipts for payments for this purchase. Array to allow for multiple payments
12
12
  * for a single quote.
13
13
  */
14
- payments: Hash[];
14
+ receipts: Hash[];
15
15
  }
16
16
  /**
17
17
  * A purchase ties a payment made to a quote
18
18
  */
19
19
  export type Purchase = PayloadWithSources<PurchaseFields, PurchaseSchema>;
20
+ /**
21
+ * Identity function for determine if an object is a Purchase
22
+ */
23
+ export declare const isPurchase: (x?: unknown) => x is Purchase;
24
+ /**
25
+ * Identity function for determine if an object is a Purchase with sources
26
+ */
27
+ export declare const isPurchaseWithSources: (x?: unknown) => x is import("@xyo-network/payload-model").WithSources<Purchase>;
28
+ /**
29
+ * Identity function for determine if an object is a Purchase with meta
30
+ */
31
+ export declare const isPurchaseWithMeta: (x?: unknown) => x is import("@xyo-network/payload-model").WithMeta<Purchase>;
20
32
  //# sourceMappingURL=Purchase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Purchase.d.ts","sourceRoot":"","sources":["../../src/Purchase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAE/D,MAAM,MAAM,cAAc,GAAG,+BAA+B,CAAA;AAC5D,eAAO,MAAM,cAAc,EAAE,cAAgD,CAAA;AAE7E,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;;OAGG;IACH,QAAQ,EAAE,IAAI,EAAE,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA"}
1
+ {"version":3,"file":"Purchase.d.ts","sourceRoot":"","sources":["../../src/Purchase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAIL,kBAAkB,EACnB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,MAAM,cAAc,GAAG,+BAA+B,CAAA;AAC5D,eAAO,MAAM,cAAc,EAAE,cAAgD,CAAA;AAE7E,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;;OAGG;IACH,QAAQ,EAAE,IAAI,EAAE,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,UAAU,gCAAkD,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,qBAAqB,kFAA6D,CAAA;AAE/F;;GAEG;AACH,eAAO,MAAM,kBAAkB,+EAA0D,CAAA"}
@@ -4,17 +4,29 @@ export type PurchaseSchema = 'network.xyo.payments.purchase';
4
4
  export declare const PurchaseSchema: PurchaseSchema;
5
5
  export interface PurchaseFields {
6
6
  /**
7
- * The hashes that were purchased
7
+ * The things that were purchased
8
8
  */
9
- hashes: Hash[];
9
+ assets: Hash[];
10
10
  /**
11
- * The payments for this purchase. Array to allow for multiple payments
11
+ * The receipts for payments for this purchase. Array to allow for multiple payments
12
12
  * for a single quote.
13
13
  */
14
- payments: Hash[];
14
+ receipts: Hash[];
15
15
  }
16
16
  /**
17
17
  * A purchase ties a payment made to a quote
18
18
  */
19
19
  export type Purchase = PayloadWithSources<PurchaseFields, PurchaseSchema>;
20
+ /**
21
+ * Identity function for determine if an object is a Purchase
22
+ */
23
+ export declare const isPurchase: (x?: unknown) => x is Purchase;
24
+ /**
25
+ * Identity function for determine if an object is a Purchase with sources
26
+ */
27
+ export declare const isPurchaseWithSources: (x?: unknown) => x is import("@xyo-network/payload-model").WithSources<Purchase>;
28
+ /**
29
+ * Identity function for determine if an object is a Purchase with meta
30
+ */
31
+ export declare const isPurchaseWithMeta: (x?: unknown) => x is import("@xyo-network/payload-model").WithMeta<Purchase>;
20
32
  //# sourceMappingURL=Purchase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Purchase.d.ts","sourceRoot":"","sources":["../../src/Purchase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAE/D,MAAM,MAAM,cAAc,GAAG,+BAA+B,CAAA;AAC5D,eAAO,MAAM,cAAc,EAAE,cAAgD,CAAA;AAE7E,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;;OAGG;IACH,QAAQ,EAAE,IAAI,EAAE,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA"}
1
+ {"version":3,"file":"Purchase.d.ts","sourceRoot":"","sources":["../../src/Purchase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAIL,kBAAkB,EACnB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,MAAM,cAAc,GAAG,+BAA+B,CAAA;AAC5D,eAAO,MAAM,cAAc,EAAE,cAAgD,CAAA;AAE7E,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;;OAGG;IACH,QAAQ,EAAE,IAAI,EAAE,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,UAAU,gCAAkD,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,qBAAqB,kFAA6D,CAAA;AAE/F;;GAEG;AACH,eAAO,MAAM,kBAAkB,+EAA0D,CAAA"}
@@ -4,17 +4,29 @@ export type PurchaseSchema = 'network.xyo.payments.purchase';
4
4
  export declare const PurchaseSchema: PurchaseSchema;
5
5
  export interface PurchaseFields {
6
6
  /**
7
- * The hashes that were purchased
7
+ * The things that were purchased
8
8
  */
9
- hashes: Hash[];
9
+ assets: Hash[];
10
10
  /**
11
- * The payments for this purchase. Array to allow for multiple payments
11
+ * The receipts for payments for this purchase. Array to allow for multiple payments
12
12
  * for a single quote.
13
13
  */
14
- payments: Hash[];
14
+ receipts: Hash[];
15
15
  }
16
16
  /**
17
17
  * A purchase ties a payment made to a quote
18
18
  */
19
19
  export type Purchase = PayloadWithSources<PurchaseFields, PurchaseSchema>;
20
+ /**
21
+ * Identity function for determine if an object is a Purchase
22
+ */
23
+ export declare const isPurchase: (x?: unknown) => x is Purchase;
24
+ /**
25
+ * Identity function for determine if an object is a Purchase with sources
26
+ */
27
+ export declare const isPurchaseWithSources: (x?: unknown) => x is import("@xyo-network/payload-model").WithSources<Purchase>;
28
+ /**
29
+ * Identity function for determine if an object is a Purchase with meta
30
+ */
31
+ export declare const isPurchaseWithMeta: (x?: unknown) => x is import("@xyo-network/payload-model").WithMeta<Purchase>;
20
32
  //# sourceMappingURL=Purchase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Purchase.d.ts","sourceRoot":"","sources":["../../src/Purchase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAE/D,MAAM,MAAM,cAAc,GAAG,+BAA+B,CAAA;AAC5D,eAAO,MAAM,cAAc,EAAE,cAAgD,CAAA;AAE7E,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;;OAGG;IACH,QAAQ,EAAE,IAAI,EAAE,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA"}
1
+ {"version":3,"file":"Purchase.d.ts","sourceRoot":"","sources":["../../src/Purchase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAIL,kBAAkB,EACnB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,MAAM,cAAc,GAAG,+BAA+B,CAAA;AAC5D,eAAO,MAAM,cAAc,EAAE,cAAgD,CAAA;AAE7E,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,IAAI,EAAE,CAAA;IACd;;;OAGG;IACH,QAAQ,EAAE,IAAI,EAAE,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,UAAU,gCAAkD,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,qBAAqB,kFAA6D,CAAA;AAE/F;;GAEG;AACH,eAAO,MAAM,kBAAkB,+EAA0D,CAAA"}