@xyo-network/core 2.20.43 → 2.20.44
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/cjs/BoundWitness/Builder/Builder.d.ts +22 -22
- package/dist/cjs/BoundWitness/Builder/Builder.js +67 -67
- package/dist/cjs/BoundWitness/Builder/index.d.ts +1 -1
- package/dist/cjs/BoundWitness/Builder/index.js +4 -4
- package/dist/cjs/BoundWitness/Validator/BodyValidator.d.ts +18 -18
- package/dist/cjs/BoundWitness/Validator/BodyValidator.js +90 -90
- package/dist/cjs/BoundWitness/Validator/MetaValidator.d.ts +14 -14
- package/dist/cjs/BoundWitness/Validator/MetaValidator.js +69 -69
- package/dist/cjs/BoundWitness/Validator/Validator.d.ts +12 -12
- package/dist/cjs/BoundWitness/Validator/Validator.js +45 -45
- package/dist/cjs/BoundWitness/Validator/index.d.ts +3 -3
- package/dist/cjs/BoundWitness/Validator/index.js +6 -6
- package/dist/cjs/BoundWitness/Validator/ip-regex.d.ts +9 -9
- package/dist/cjs/BoundWitness/Validator/ip-regex.js +19 -19
- package/dist/cjs/BoundWitness/Validator/is-ip.d.ts +4 -4
- package/dist/cjs/BoundWitness/Validator/is-ip.js +20 -20
- package/dist/cjs/BoundWitness/Wrapper/Wrapper.d.ts +13 -13
- package/dist/cjs/BoundWitness/Wrapper/Wrapper.js +29 -29
- package/dist/cjs/BoundWitness/Wrapper/index.d.ts +1 -1
- package/dist/cjs/BoundWitness/Wrapper/index.js +4 -4
- package/dist/cjs/BoundWitness/index.d.ts +4 -4
- package/dist/cjs/BoundWitness/index.js +7 -7
- package/dist/cjs/BoundWitness/models/Body/XyoBoundWitnessBody.d.ts +11 -11
- package/dist/cjs/BoundWitness/models/Body/XyoBoundWitnessBody.js +2 -2
- package/dist/cjs/BoundWitness/models/Body/XyoBoundWitnessBodySchema.d.ts +37 -37
- package/dist/cjs/BoundWitness/models/Body/XyoBoundWitnessBodySchema.js +19 -19
- package/dist/cjs/BoundWitness/models/Body/index.d.ts +2 -2
- package/dist/cjs/BoundWitness/models/Body/index.js +5 -5
- package/dist/cjs/BoundWitness/models/Meta/XyoBoundWitnessMeta.d.ts +13 -13
- package/dist/cjs/BoundWitness/models/Meta/XyoBoundWitnessMeta.js +2 -2
- package/dist/cjs/BoundWitness/models/Meta/XyoBoundWitnessMetaSchema.d.ts +85 -85
- package/dist/cjs/BoundWitness/models/Meta/XyoBoundWitnessMetaSchema.js +27 -27
- package/dist/cjs/BoundWitness/models/Meta/index.d.ts +2 -2
- package/dist/cjs/BoundWitness/models/Meta/index.js +5 -5
- package/dist/cjs/BoundWitness/models/WithXyoBoundWitnessMeta.d.ts +4 -4
- package/dist/cjs/BoundWitness/models/WithXyoBoundWitnessMeta.js +2 -2
- package/dist/cjs/BoundWitness/models/XyoBoundWitness.d.ts +5 -5
- package/dist/cjs/BoundWitness/models/XyoBoundWitness.js +2 -2
- package/dist/cjs/BoundWitness/models/XyoBoundWitnessSchema.d.ts +75 -75
- package/dist/cjs/BoundWitness/models/XyoBoundWitnessSchema.js +16 -16
- package/dist/cjs/BoundWitness/models/index.d.ts +5 -5
- package/dist/cjs/BoundWitness/models/index.js +8 -8
- package/dist/cjs/Hasher/XyoAbstractHasher.d.ts +11 -11
- package/dist/cjs/Hasher/XyoAbstractHasher.js +33 -33
- package/dist/cjs/Hasher/XyoHasher.d.ts +6 -6
- package/dist/cjs/Hasher/XyoHasher.js +14 -14
- package/dist/cjs/Hasher/index.d.ts +5 -5
- package/dist/cjs/Hasher/index.js +8 -8
- package/dist/cjs/Hasher/removeEmptyFields.d.ts +1 -1
- package/dist/cjs/Hasher/removeEmptyFields.js +19 -19
- package/dist/cjs/Hasher/removeFields.d.ts +6 -6
- package/dist/cjs/Hasher/removeFields.js +28 -28
- package/dist/cjs/Hasher/sortFields.d.ts +1 -1
- package/dist/cjs/Hasher/sortFields.js +26 -26
- package/dist/cjs/Huri/Huri.d.ts +26 -26
- package/dist/cjs/Huri/Huri.js +100 -100
- package/dist/cjs/Huri/index.d.ts +1 -1
- package/dist/cjs/Huri/index.js +4 -4
- package/dist/cjs/Payload/Builder/Builder.d.ts +14 -14
- package/dist/cjs/Payload/Builder/Builder.js +30 -30
- package/dist/cjs/Payload/Builder/index.d.ts +1 -1
- package/dist/cjs/Payload/Builder/index.js +4 -4
- package/dist/cjs/Payload/Validator/BodyValidator.d.ts +11 -11
- package/dist/cjs/Payload/Validator/BodyValidator.js +30 -30
- package/dist/cjs/Payload/Validator/MetaValidator.d.ts +9 -9
- package/dist/cjs/Payload/Validator/MetaValidator.js +36 -36
- package/dist/cjs/Payload/Validator/Validator.d.ts +11 -11
- package/dist/cjs/Payload/Validator/Validator.js +18 -18
- package/dist/cjs/Payload/Validator/index.d.ts +3 -3
- package/dist/cjs/Payload/Validator/index.js +6 -6
- package/dist/cjs/Payload/Wrapper/Validator.d.ts +9 -9
- package/dist/cjs/Payload/Wrapper/Validator.js +18 -18
- package/dist/cjs/Payload/Wrapper/Wrapper.d.ts +9 -9
- package/dist/cjs/Payload/Wrapper/Wrapper.js +20 -20
- package/dist/cjs/Payload/Wrapper/index.d.ts +2 -2
- package/dist/cjs/Payload/Wrapper/index.js +5 -5
- package/dist/cjs/Payload/index.d.ts +4 -4
- package/dist/cjs/Payload/index.js +7 -7
- package/dist/cjs/Payload/models/Body.d.ts +6 -6
- package/dist/cjs/Payload/models/Body.js +2 -2
- package/dist/cjs/Payload/models/Meta.d.ts +10 -10
- package/dist/cjs/Payload/models/Meta.js +2 -2
- package/dist/cjs/Payload/models/WithXyoPayloadMeta.d.ts +4 -4
- package/dist/cjs/Payload/models/WithXyoPayloadMeta.js +2 -2
- package/dist/cjs/Payload/models/XyoPayload.d.ts +4 -4
- package/dist/cjs/Payload/models/XyoPayload.js +2 -2
- package/dist/cjs/Payload/models/index.d.ts +4 -4
- package/dist/cjs/Payload/models/index.js +7 -7
- package/dist/cjs/Query/QueryPayload.d.ts +11 -11
- package/dist/cjs/Query/QueryPayload.js +2 -2
- package/dist/cjs/Query/index.d.ts +1 -1
- package/dist/cjs/Query/index.js +4 -4
- package/dist/cjs/Schema/Payload.d.ts +10 -10
- package/dist/cjs/Schema/Payload.js +2 -2
- package/dist/cjs/Schema/index.d.ts +1 -1
- package/dist/cjs/Schema/index.js +4 -4
- package/dist/cjs/SchemaNameValidator.d.ts +73 -73
- package/dist/cjs/SchemaNameValidator.js +134 -134
- package/dist/cjs/Test/index.d.ts +2 -2
- package/dist/cjs/Test/index.js +5 -5
- package/dist/cjs/Test/testBoundWitness.d.ts +3 -3
- package/dist/cjs/Test/testBoundWitness.js +16 -16
- package/dist/cjs/Test/testPayload.d.ts +4 -4
- package/dist/cjs/Test/testPayload.js +18 -18
- package/dist/cjs/Wallet/Account/Account.d.ts +36 -36
- package/dist/cjs/Wallet/Account/Account.js +78 -78
- package/dist/cjs/Wallet/Account/Key/Data/AbstractData.d.ts +12 -12
- package/dist/cjs/Wallet/Account/Key/Data/AbstractData.js +15 -15
- package/dist/cjs/Wallet/Account/Key/Data/Data.d.ts +15 -15
- package/dist/cjs/Wallet/Account/Key/Data/Data.js +39 -39
- package/dist/cjs/Wallet/Account/Key/Data/XyoDataLike.d.ts +4 -4
- package/dist/cjs/Wallet/Account/Key/Data/XyoDataLike.js +2 -2
- package/dist/cjs/Wallet/Account/Key/Data/index.d.ts +4 -4
- package/dist/cjs/Wallet/Account/Key/Data/index.js +7 -7
- package/dist/cjs/Wallet/Account/Key/Data/toUint8Array.d.ts +3 -3
- package/dist/cjs/Wallet/Account/Key/Data/toUint8Array.js +32 -32
- package/dist/cjs/Wallet/Account/Key/XyoAddressValue.d.ts +11 -11
- package/dist/cjs/Wallet/Account/Key/XyoAddressValue.js +48 -48
- package/dist/cjs/Wallet/Account/Key/XyoEllipticKey.d.ts +5 -5
- package/dist/cjs/Wallet/Account/Key/XyoEllipticKey.js +12 -12
- package/dist/cjs/Wallet/Account/Key/XyoKeyPair.d.ts +10 -10
- package/dist/cjs/Wallet/Account/Key/XyoKeyPair.js +22 -22
- package/dist/cjs/Wallet/Account/Key/XyoPrivateKey.d.ts +14 -14
- package/dist/cjs/Wallet/Account/Key/XyoPrivateKey.js +55 -55
- package/dist/cjs/Wallet/Account/Key/XyoPublicKey.d.ts +10 -10
- package/dist/cjs/Wallet/Account/Key/XyoPublicKey.js +21 -21
- package/dist/cjs/Wallet/Account/Key/index.d.ts +5 -5
- package/dist/cjs/Wallet/Account/Key/index.js +8 -8
- package/dist/cjs/Wallet/Account/index.d.ts +2 -2
- package/dist/cjs/Wallet/Account/index.js +5 -5
- package/dist/cjs/Wallet/Base/Base.d.ts +8 -8
- package/dist/cjs/Wallet/Base/Base.js +36 -36
- package/dist/cjs/Wallet/Base/Words.d.ts +2 -2
- package/dist/cjs/Wallet/Base/Words.js +2643 -2643
- package/dist/cjs/Wallet/Base/WordsPayload.d.ts +4 -4
- package/dist/cjs/Wallet/Base/WordsPayload.js +2 -2
- package/dist/cjs/Wallet/Base/index.d.ts +1 -1
- package/dist/cjs/Wallet/Base/index.js +4 -4
- package/dist/cjs/Wallet/index.d.ts +2 -2
- package/dist/cjs/Wallet/index.js +5 -5
- package/dist/cjs/Witness/LegacyWitness.d.ts +14 -14
- package/dist/cjs/Witness/LegacyWitness.js +27 -27
- package/dist/cjs/Witness/QueryWitness.d.ts +9 -9
- package/dist/cjs/Witness/QueryWitness.js +24 -24
- package/dist/cjs/Witness/Witness.d.ts +5 -5
- package/dist/cjs/Witness/Witness.js +6 -6
- package/dist/cjs/Witness/index.d.ts +3 -3
- package/dist/cjs/Witness/index.js +6 -6
- package/dist/cjs/browser/core/Wallet/Web.d.ts +5 -5
- package/dist/cjs/browser/core/Wallet/Web.js +14 -14
- package/dist/cjs/browser/core/Wallet/index.d.ts +1 -1
- package/dist/cjs/browser/core/Wallet/index.js +4 -4
- package/dist/cjs/browser/core/index.d.ts +1 -1
- package/dist/cjs/browser/core/index.js +4 -4
- package/dist/cjs/browser/index.d.ts +1 -1
- package/dist/cjs/browser/index.js +4 -4
- package/dist/cjs/browserIndex.d.ts +2 -2
- package/dist/cjs/browserIndex.js +5 -5
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/lib/dns/DnsRecordType.d.ts +14 -14
- package/dist/cjs/lib/dns/DnsRecordType.js +18 -18
- package/dist/cjs/lib/dns/DnsReturnCode.d.ts +13 -13
- package/dist/cjs/lib/dns/DnsReturnCode.js +17 -17
- package/dist/cjs/lib/dns/GoogleDnsResult.d.ts +16 -16
- package/dist/cjs/lib/dns/GoogleDnsResult.js +2 -2
- package/dist/cjs/lib/dns/GoogleDnsResultAnswer.d.ts +7 -7
- package/dist/cjs/lib/dns/GoogleDnsResultAnswer.js +2 -2
- package/dist/cjs/lib/dns/GoogleDnsResultQuestion.d.ts +10 -10
- package/dist/cjs/lib/dns/GoogleDnsResultQuestion.js +2 -2
- package/dist/cjs/lib/dns/domainExists.d.ts +7 -7
- package/dist/cjs/lib/dns/domainExists.js +18 -18
- package/dist/cjs/lib/dns/domainResolve.d.ts +8 -8
- package/dist/cjs/lib/dns/domainResolve.js +18 -18
- package/dist/cjs/lib/dns/googleDnsOverHttps.d.ts +4 -4
- package/dist/cjs/lib/dns/googleDnsOverHttps.js +10 -10
- package/dist/cjs/lib/dns/index.d.ts +8 -8
- package/dist/cjs/lib/dns/index.js +11 -11
- package/dist/cjs/lib/dumpErrors.d.ts +2 -2
- package/dist/cjs/lib/dumpErrors.js +9 -9
- package/dist/cjs/lib/exists.d.ts +1 -1
- package/dist/cjs/lib/exists.js +7 -7
- package/dist/cjs/lib/index.d.ts +4 -4
- package/dist/cjs/lib/index.js +7 -7
- package/dist/cjs/lib/isBrowser.d.ts +1 -1
- package/dist/cjs/lib/isBrowser.js +7 -7
- package/dist/cjs/lib/isXyoPayloadOfSchemaType.d.ts +6 -6
- package/dist/cjs/lib/isXyoPayloadOfSchemaType.js +9 -9
- package/dist/cjs/lib/typeOf/TypeOfTypes.d.ts +1 -1
- package/dist/cjs/lib/typeOf/TypeOfTypes.js +2 -2
- package/dist/cjs/lib/typeOf/ifDefined.d.ts +1 -1
- package/dist/cjs/lib/typeOf/ifDefined.js +15 -15
- package/dist/cjs/lib/typeOf/ifTypeOf.d.ts +2 -2
- package/dist/cjs/lib/typeOf/ifTypeOf.js +11 -11
- package/dist/cjs/lib/typeOf/index.d.ts +5 -5
- package/dist/cjs/lib/typeOf/index.js +8 -8
- package/dist/cjs/lib/typeOf/typeOf.d.ts +2 -2
- package/dist/cjs/lib/typeOf/typeOf.js +7 -7
- package/dist/cjs/lib/typeOf/validateType.d.ts +2 -2
- package/dist/cjs/lib/typeOf/validateType.js +17 -17
- package/dist/cjs/models/WithStringIndex.d.ts +1 -1
- package/dist/cjs/models/WithStringIndex.js +2 -2
- package/dist/cjs/models/index.d.ts +1 -1
- package/dist/cjs/models/index.js +4 -4
- package/dist/cjs/nodeIndex.d.ts +1 -1
- package/dist/cjs/nodeIndex.js +4 -4
- package/dist/cjs/shared.d.ts +11 -11
- package/dist/cjs/shared.js +14 -14
- package/dist/esm/BoundWitness/Builder/Builder.d.ts +22 -22
- package/dist/esm/BoundWitness/Builder/Builder.js +65 -65
- package/dist/esm/BoundWitness/Builder/index.d.ts +1 -1
- package/dist/esm/BoundWitness/Builder/index.js +1 -1
- package/dist/esm/BoundWitness/Validator/BodyValidator.d.ts +18 -18
- package/dist/esm/BoundWitness/Validator/BodyValidator.js +85 -85
- package/dist/esm/BoundWitness/Validator/MetaValidator.d.ts +14 -14
- package/dist/esm/BoundWitness/Validator/MetaValidator.js +65 -65
- package/dist/esm/BoundWitness/Validator/Validator.d.ts +12 -12
- package/dist/esm/BoundWitness/Validator/Validator.js +40 -40
- package/dist/esm/BoundWitness/Validator/index.d.ts +3 -3
- package/dist/esm/BoundWitness/Validator/index.js +3 -3
- package/dist/esm/BoundWitness/Validator/ip-regex.d.ts +9 -9
- package/dist/esm/BoundWitness/Validator/ip-regex.js +15 -15
- package/dist/esm/BoundWitness/Validator/is-ip.d.ts +4 -4
- package/dist/esm/BoundWitness/Validator/is-ip.js +13 -13
- package/dist/esm/BoundWitness/Wrapper/Wrapper.d.ts +13 -13
- package/dist/esm/BoundWitness/Wrapper/Wrapper.js +23 -23
- package/dist/esm/BoundWitness/Wrapper/index.d.ts +1 -1
- package/dist/esm/BoundWitness/Wrapper/index.js +1 -1
- package/dist/esm/BoundWitness/index.d.ts +4 -4
- package/dist/esm/BoundWitness/index.js +4 -4
- package/dist/esm/BoundWitness/models/Body/XyoBoundWitnessBody.d.ts +11 -11
- package/dist/esm/BoundWitness/models/Body/XyoBoundWitnessBody.js +1 -1
- package/dist/esm/BoundWitness/models/Body/XyoBoundWitnessBodySchema.d.ts +37 -37
- package/dist/esm/BoundWitness/models/Body/XyoBoundWitnessBodySchema.js +16 -16
- package/dist/esm/BoundWitness/models/Body/index.d.ts +2 -2
- package/dist/esm/BoundWitness/models/Body/index.js +2 -2
- package/dist/esm/BoundWitness/models/Meta/XyoBoundWitnessMeta.d.ts +13 -13
- package/dist/esm/BoundWitness/models/Meta/XyoBoundWitnessMeta.js +1 -1
- package/dist/esm/BoundWitness/models/Meta/XyoBoundWitnessMetaSchema.d.ts +85 -85
- package/dist/esm/BoundWitness/models/Meta/XyoBoundWitnessMetaSchema.js +22 -22
- package/dist/esm/BoundWitness/models/Meta/index.d.ts +2 -2
- package/dist/esm/BoundWitness/models/Meta/index.js +2 -2
- package/dist/esm/BoundWitness/models/WithXyoBoundWitnessMeta.d.ts +4 -4
- package/dist/esm/BoundWitness/models/WithXyoBoundWitnessMeta.js +1 -1
- package/dist/esm/BoundWitness/models/XyoBoundWitness.d.ts +5 -5
- package/dist/esm/BoundWitness/models/XyoBoundWitness.js +1 -1
- package/dist/esm/BoundWitness/models/XyoBoundWitnessSchema.d.ts +75 -75
- package/dist/esm/BoundWitness/models/XyoBoundWitnessSchema.js +20 -20
- package/dist/esm/BoundWitness/models/index.d.ts +5 -5
- package/dist/esm/BoundWitness/models/index.js +5 -5
- package/dist/esm/Hasher/XyoAbstractHasher.d.ts +11 -11
- package/dist/esm/Hasher/XyoAbstractHasher.js +28 -28
- package/dist/esm/Hasher/XyoHasher.d.ts +6 -6
- package/dist/esm/Hasher/XyoHasher.js +10 -10
- package/dist/esm/Hasher/index.d.ts +5 -5
- package/dist/esm/Hasher/index.js +5 -5
- package/dist/esm/Hasher/removeEmptyFields.d.ts +1 -1
- package/dist/esm/Hasher/removeEmptyFields.js +15 -15
- package/dist/esm/Hasher/removeFields.d.ts +6 -6
- package/dist/esm/Hasher/removeFields.js +21 -21
- package/dist/esm/Hasher/sortFields.d.ts +1 -1
- package/dist/esm/Hasher/sortFields.js +22 -22
- package/dist/esm/Huri/Huri.d.ts +26 -26
- package/dist/esm/Huri/Huri.js +89 -89
- package/dist/esm/Huri/index.d.ts +1 -1
- package/dist/esm/Huri/index.js +1 -1
- package/dist/esm/Payload/Builder/Builder.d.ts +14 -14
- package/dist/esm/Payload/Builder/Builder.js +29 -29
- package/dist/esm/Payload/Builder/index.d.ts +1 -1
- package/dist/esm/Payload/Builder/index.js +1 -1
- package/dist/esm/Payload/Validator/BodyValidator.d.ts +11 -11
- package/dist/esm/Payload/Validator/BodyValidator.js +26 -26
- package/dist/esm/Payload/Validator/MetaValidator.d.ts +9 -9
- package/dist/esm/Payload/Validator/MetaValidator.js +33 -33
- package/dist/esm/Payload/Validator/Validator.d.ts +11 -11
- package/dist/esm/Payload/Validator/Validator.js +15 -15
- package/dist/esm/Payload/Validator/index.d.ts +3 -3
- package/dist/esm/Payload/Validator/index.js +3 -3
- package/dist/esm/Payload/Wrapper/Validator.d.ts +9 -9
- package/dist/esm/Payload/Wrapper/Validator.js +14 -14
- package/dist/esm/Payload/Wrapper/Wrapper.d.ts +9 -9
- package/dist/esm/Payload/Wrapper/Wrapper.js +16 -16
- package/dist/esm/Payload/Wrapper/index.d.ts +2 -2
- package/dist/esm/Payload/Wrapper/index.js +2 -2
- package/dist/esm/Payload/index.d.ts +4 -4
- package/dist/esm/Payload/index.js +4 -4
- package/dist/esm/Payload/models/Body.d.ts +6 -6
- package/dist/esm/Payload/models/Body.js +1 -1
- package/dist/esm/Payload/models/Meta.d.ts +10 -10
- package/dist/esm/Payload/models/Meta.js +1 -1
- package/dist/esm/Payload/models/WithXyoPayloadMeta.d.ts +4 -4
- package/dist/esm/Payload/models/WithXyoPayloadMeta.js +1 -1
- package/dist/esm/Payload/models/XyoPayload.d.ts +4 -4
- package/dist/esm/Payload/models/XyoPayload.js +1 -1
- package/dist/esm/Payload/models/index.d.ts +4 -4
- package/dist/esm/Payload/models/index.js +4 -4
- package/dist/esm/Query/QueryPayload.d.ts +11 -11
- package/dist/esm/Query/QueryPayload.js +1 -1
- package/dist/esm/Query/index.d.ts +1 -1
- package/dist/esm/Query/index.js +1 -1
- package/dist/esm/Schema/Payload.d.ts +10 -10
- package/dist/esm/Schema/Payload.js +1 -1
- package/dist/esm/Schema/index.d.ts +1 -1
- package/dist/esm/Schema/index.js +1 -1
- package/dist/esm/SchemaNameValidator.d.ts +73 -73
- package/dist/esm/SchemaNameValidator.js +116 -116
- package/dist/esm/Test/index.d.ts +2 -2
- package/dist/esm/Test/index.js +2 -2
- package/dist/esm/Test/testBoundWitness.d.ts +3 -3
- package/dist/esm/Test/testBoundWitness.js +13 -13
- package/dist/esm/Test/testPayload.d.ts +4 -4
- package/dist/esm/Test/testPayload.js +14 -14
- package/dist/esm/Wallet/Account/Account.d.ts +36 -36
- package/dist/esm/Wallet/Account/Account.js +70 -70
- package/dist/esm/Wallet/Account/Key/Data/AbstractData.d.ts +12 -12
- package/dist/esm/Wallet/Account/Key/Data/AbstractData.js +11 -11
- package/dist/esm/Wallet/Account/Key/Data/Data.d.ts +15 -15
- package/dist/esm/Wallet/Account/Key/Data/Data.js +34 -34
- package/dist/esm/Wallet/Account/Key/Data/XyoDataLike.d.ts +4 -4
- package/dist/esm/Wallet/Account/Key/Data/XyoDataLike.js +1 -1
- package/dist/esm/Wallet/Account/Key/Data/index.d.ts +4 -4
- package/dist/esm/Wallet/Account/Key/Data/index.js +4 -4
- package/dist/esm/Wallet/Account/Key/Data/toUint8Array.d.ts +3 -3
- package/dist/esm/Wallet/Account/Key/Data/toUint8Array.js +30 -30
- package/dist/esm/Wallet/Account/Key/XyoAddressValue.d.ts +11 -11
- package/dist/esm/Wallet/Account/Key/XyoAddressValue.js +44 -44
- package/dist/esm/Wallet/Account/Key/XyoEllipticKey.d.ts +5 -5
- package/dist/esm/Wallet/Account/Key/XyoEllipticKey.js +7 -7
- package/dist/esm/Wallet/Account/Key/XyoKeyPair.d.ts +10 -10
- package/dist/esm/Wallet/Account/Key/XyoKeyPair.js +17 -17
- package/dist/esm/Wallet/Account/Key/XyoPrivateKey.d.ts +14 -14
- package/dist/esm/Wallet/Account/Key/XyoPrivateKey.js +49 -49
- package/dist/esm/Wallet/Account/Key/XyoPublicKey.d.ts +10 -10
- package/dist/esm/Wallet/Account/Key/XyoPublicKey.js +17 -17
- package/dist/esm/Wallet/Account/Key/index.d.ts +5 -5
- package/dist/esm/Wallet/Account/Key/index.js +5 -5
- package/dist/esm/Wallet/Account/index.d.ts +2 -2
- package/dist/esm/Wallet/Account/index.js +2 -2
- package/dist/esm/Wallet/Base/Base.d.ts +8 -8
- package/dist/esm/Wallet/Base/Base.js +29 -29
- package/dist/esm/Wallet/Base/Words.d.ts +2 -2
- package/dist/esm/Wallet/Base/Words.js +2640 -2640
- package/dist/esm/Wallet/Base/WordsPayload.d.ts +4 -4
- package/dist/esm/Wallet/Base/WordsPayload.js +1 -1
- package/dist/esm/Wallet/Base/index.d.ts +1 -1
- package/dist/esm/Wallet/Base/index.js +1 -1
- package/dist/esm/Wallet/index.d.ts +2 -2
- package/dist/esm/Wallet/index.js +2 -2
- package/dist/esm/Witness/LegacyWitness.d.ts +14 -14
- package/dist/esm/Witness/LegacyWitness.js +18 -18
- package/dist/esm/Witness/QueryWitness.d.ts +9 -9
- package/dist/esm/Witness/QueryWitness.js +16 -16
- package/dist/esm/Witness/Witness.d.ts +5 -5
- package/dist/esm/Witness/Witness.js +2 -2
- package/dist/esm/Witness/index.d.ts +3 -3
- package/dist/esm/Witness/index.js +3 -3
- package/dist/esm/browser/core/Wallet/Web.d.ts +5 -5
- package/dist/esm/browser/core/Wallet/Web.js +10 -10
- package/dist/esm/browser/core/Wallet/index.d.ts +1 -1
- package/dist/esm/browser/core/Wallet/index.js +1 -1
- package/dist/esm/browser/core/index.d.ts +1 -1
- package/dist/esm/browser/core/index.js +1 -1
- package/dist/esm/browser/index.d.ts +1 -1
- package/dist/esm/browser/index.js +1 -1
- package/dist/esm/browserIndex.d.ts +2 -2
- package/dist/esm/browserIndex.js +2 -2
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/lib/dns/DnsRecordType.d.ts +14 -14
- package/dist/esm/lib/dns/DnsRecordType.js +15 -15
- package/dist/esm/lib/dns/DnsReturnCode.d.ts +13 -13
- package/dist/esm/lib/dns/DnsReturnCode.js +14 -14
- package/dist/esm/lib/dns/GoogleDnsResult.d.ts +16 -16
- package/dist/esm/lib/dns/GoogleDnsResult.js +1 -1
- package/dist/esm/lib/dns/GoogleDnsResultAnswer.d.ts +7 -7
- package/dist/esm/lib/dns/GoogleDnsResultAnswer.js +1 -1
- package/dist/esm/lib/dns/GoogleDnsResultQuestion.d.ts +10 -10
- package/dist/esm/lib/dns/GoogleDnsResultQuestion.js +1 -1
- package/dist/esm/lib/dns/domainExists.d.ts +7 -7
- package/dist/esm/lib/dns/domainExists.js +14 -14
- package/dist/esm/lib/dns/domainResolve.d.ts +8 -8
- package/dist/esm/lib/dns/domainResolve.js +14 -14
- package/dist/esm/lib/dns/googleDnsOverHttps.d.ts +4 -4
- package/dist/esm/lib/dns/googleDnsOverHttps.js +6 -6
- package/dist/esm/lib/dns/index.d.ts +8 -8
- package/dist/esm/lib/dns/index.js +8 -8
- package/dist/esm/lib/dumpErrors.d.ts +2 -2
- package/dist/esm/lib/dumpErrors.js +6 -6
- package/dist/esm/lib/exists.d.ts +1 -1
- package/dist/esm/lib/exists.js +3 -3
- package/dist/esm/lib/index.d.ts +4 -4
- package/dist/esm/lib/index.js +4 -4
- package/dist/esm/lib/isBrowser.d.ts +1 -1
- package/dist/esm/lib/isBrowser.js +3 -3
- package/dist/esm/lib/isXyoPayloadOfSchemaType.d.ts +6 -6
- package/dist/esm/lib/isXyoPayloadOfSchemaType.js +5 -5
- package/dist/esm/lib/typeOf/TypeOfTypes.d.ts +1 -1
- package/dist/esm/lib/typeOf/TypeOfTypes.js +1 -1
- package/dist/esm/lib/typeOf/ifDefined.d.ts +1 -1
- package/dist/esm/lib/typeOf/ifDefined.js +11 -11
- package/dist/esm/lib/typeOf/ifTypeOf.d.ts +2 -2
- package/dist/esm/lib/typeOf/ifTypeOf.js +7 -7
- package/dist/esm/lib/typeOf/index.d.ts +5 -5
- package/dist/esm/lib/typeOf/index.js +5 -5
- package/dist/esm/lib/typeOf/typeOf.d.ts +2 -2
- package/dist/esm/lib/typeOf/typeOf.js +3 -3
- package/dist/esm/lib/typeOf/validateType.d.ts +2 -2
- package/dist/esm/lib/typeOf/validateType.js +13 -13
- package/dist/esm/models/WithStringIndex.d.ts +1 -1
- package/dist/esm/models/WithStringIndex.js +1 -1
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/models/index.js +1 -1
- package/dist/esm/nodeIndex.d.ts +1 -1
- package/dist/esm/nodeIndex.js +1 -1
- package/dist/esm/shared.d.ts +11 -11
- package/dist/esm/shared.js +11 -11
- package/package.json +3 -3
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { assertEx, Buffer } from '@xylabs/sdk-js';
|
|
2
|
-
import { sortFields, XyoHasher } from '../../Hasher';
|
|
3
|
-
export class XyoBoundWitnessBuilder {
|
|
4
|
-
constructor(config = { inlinePayloads: false }) {
|
|
5
|
-
this.config = config;
|
|
6
|
-
this._accounts = [];
|
|
7
|
-
this._payload_schemas = [];
|
|
8
|
-
this._payloads = [];
|
|
9
|
-
}
|
|
10
|
-
get _payload_hashes() {
|
|
11
|
-
return this._payloads.map((payload) => {
|
|
12
|
-
return new XyoHasher(payload).hash;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
witness(account) {
|
|
16
|
-
this._accounts?.push(account);
|
|
17
|
-
return this;
|
|
18
|
-
}
|
|
19
|
-
payloads(payloads) {
|
|
20
|
-
payloads.forEach((payload) => {
|
|
21
|
-
if (payload !== null) {
|
|
22
|
-
this.payload(payload);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
return this;
|
|
26
|
-
}
|
|
27
|
-
payload(payload) {
|
|
28
|
-
if (payload) {
|
|
29
|
-
this._payload_schemas.push(payload.schema);
|
|
30
|
-
this._payloads.push(assertEx(sortFields(payload)));
|
|
31
|
-
}
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
hashableFields() {
|
|
35
|
-
const addresses = this._accounts.map((account) => account.addressValue.hex);
|
|
36
|
-
const previous_hashes = this._accounts.map((account) => account.previousHash?.hex ?? null);
|
|
37
|
-
return {
|
|
38
|
-
addresses: assertEx(addresses, 'Missing addresses'),
|
|
39
|
-
payload_hashes: assertEx(this._payload_hashes, 'Missing payload_hashes'),
|
|
40
|
-
payload_schemas: assertEx(this._payload_schemas, 'Missing payload_schemas'),
|
|
41
|
-
previous_hashes,
|
|
42
|
-
schema: 'network.xyo.boundwitness',
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
signatures(_hash) {
|
|
46
|
-
return this._accounts.map((account) => Buffer.from(account.sign(Buffer.from(_hash, 'hex'))).toString('hex'));
|
|
47
|
-
}
|
|
48
|
-
inlinePayloads() {
|
|
49
|
-
return this._payloads.map((payload, index) => {
|
|
50
|
-
return {
|
|
51
|
-
...payload,
|
|
52
|
-
schema: this._payload_schemas[index],
|
|
53
|
-
};
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
build() {
|
|
57
|
-
const hashableFields = this.hashableFields();
|
|
58
|
-
const _hash = new XyoHasher(hashableFields).hash;
|
|
59
|
-
const ret = { ...hashableFields, _client: 'js', _hash, _signatures: this.signatures(_hash), _timestamp: Date.now() };
|
|
60
|
-
if (this.config.inlinePayloads) {
|
|
61
|
-
ret._payloads = this.inlinePayloads();
|
|
62
|
-
}
|
|
63
|
-
return ret;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
import { assertEx, Buffer } from '@xylabs/sdk-js';
|
|
2
|
+
import { sortFields, XyoHasher } from '../../Hasher';
|
|
3
|
+
export class XyoBoundWitnessBuilder {
|
|
4
|
+
constructor(config = { inlinePayloads: false }) {
|
|
5
|
+
this.config = config;
|
|
6
|
+
this._accounts = [];
|
|
7
|
+
this._payload_schemas = [];
|
|
8
|
+
this._payloads = [];
|
|
9
|
+
}
|
|
10
|
+
get _payload_hashes() {
|
|
11
|
+
return this._payloads.map((payload) => {
|
|
12
|
+
return new XyoHasher(payload).hash;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
witness(account) {
|
|
16
|
+
this._accounts?.push(account);
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
payloads(payloads) {
|
|
20
|
+
payloads.forEach((payload) => {
|
|
21
|
+
if (payload !== null) {
|
|
22
|
+
this.payload(payload);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
payload(payload) {
|
|
28
|
+
if (payload) {
|
|
29
|
+
this._payload_schemas.push(payload.schema);
|
|
30
|
+
this._payloads.push(assertEx(sortFields(payload)));
|
|
31
|
+
}
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
hashableFields() {
|
|
35
|
+
const addresses = this._accounts.map((account) => account.addressValue.hex);
|
|
36
|
+
const previous_hashes = this._accounts.map((account) => account.previousHash?.hex ?? null);
|
|
37
|
+
return {
|
|
38
|
+
addresses: assertEx(addresses, 'Missing addresses'),
|
|
39
|
+
payload_hashes: assertEx(this._payload_hashes, 'Missing payload_hashes'),
|
|
40
|
+
payload_schemas: assertEx(this._payload_schemas, 'Missing payload_schemas'),
|
|
41
|
+
previous_hashes,
|
|
42
|
+
schema: 'network.xyo.boundwitness',
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
signatures(_hash) {
|
|
46
|
+
return this._accounts.map((account) => Buffer.from(account.sign(Buffer.from(_hash, 'hex'))).toString('hex'));
|
|
47
|
+
}
|
|
48
|
+
inlinePayloads() {
|
|
49
|
+
return this._payloads.map((payload, index) => {
|
|
50
|
+
return {
|
|
51
|
+
...payload,
|
|
52
|
+
schema: this._payload_schemas[index],
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
build() {
|
|
57
|
+
const hashableFields = this.hashableFields();
|
|
58
|
+
const _hash = new XyoHasher(hashableFields).hash;
|
|
59
|
+
const ret = { ...hashableFields, _client: 'js', _hash, _signatures: this.signatures(_hash), _timestamp: Date.now() };
|
|
60
|
+
if (this.config.inlinePayloads) {
|
|
61
|
+
ret._payloads = this.inlinePayloads();
|
|
62
|
+
}
|
|
63
|
+
return ret;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
66
|
//# sourceMappingURL=Builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './Builder';
|
|
1
|
+
export * from './Builder';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Builder';
|
|
1
|
+
export * from './Builder';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { XyoPayload } from '../../Payload';
|
|
2
|
-
import { XyoBoundWitnessBody } from '../models';
|
|
3
|
-
declare class XyoBoundWitnessBodyValidator {
|
|
4
|
-
private body;
|
|
5
|
-
private payloads?;
|
|
6
|
-
constructor(body: XyoBoundWitnessBody, payloads?: XyoPayload[]);
|
|
7
|
-
addressesUniqueness(): Error[];
|
|
8
|
-
addresses(): Error[];
|
|
9
|
-
private validateArrayLength;
|
|
10
|
-
validatePayloadHashesLength(): Error[];
|
|
11
|
-
validateArrayLengths(): Error[];
|
|
12
|
-
payloadHashes(): Error[];
|
|
13
|
-
payloadSchemas(): Error[];
|
|
14
|
-
previousHashes(): Error[];
|
|
15
|
-
schmea(): Error[];
|
|
16
|
-
all(): Error[];
|
|
17
|
-
}
|
|
18
|
-
export { XyoBoundWitnessBodyValidator };
|
|
1
|
+
import { XyoPayload } from '../../Payload';
|
|
2
|
+
import { XyoBoundWitnessBody } from '../models';
|
|
3
|
+
declare class XyoBoundWitnessBodyValidator {
|
|
4
|
+
private body;
|
|
5
|
+
private payloads?;
|
|
6
|
+
constructor(body: XyoBoundWitnessBody, payloads?: XyoPayload[]);
|
|
7
|
+
addressesUniqueness(): Error[];
|
|
8
|
+
addresses(): Error[];
|
|
9
|
+
private validateArrayLength;
|
|
10
|
+
validatePayloadHashesLength(): Error[];
|
|
11
|
+
validateArrayLengths(): Error[];
|
|
12
|
+
payloadHashes(): Error[];
|
|
13
|
+
payloadSchemas(): Error[];
|
|
14
|
+
previousHashes(): Error[];
|
|
15
|
+
schmea(): Error[];
|
|
16
|
+
all(): Error[];
|
|
17
|
+
}
|
|
18
|
+
export { XyoBoundWitnessBodyValidator };
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import uniq from 'lodash/uniq';
|
|
2
|
-
import { XyoHasher } from '../../Hasher';
|
|
3
|
-
import { validateType } from '../../lib';
|
|
4
|
-
import { XyoSchemaNameValidator } from '../../SchemaNameValidator';
|
|
5
|
-
class XyoBoundWitnessBodyValidator {
|
|
6
|
-
constructor(body, payloads) {
|
|
7
|
-
this.body = body;
|
|
8
|
-
this.payloads = payloads;
|
|
9
|
-
}
|
|
10
|
-
addressesUniqueness() {
|
|
11
|
-
const errors = [];
|
|
12
|
-
const { addresses } = this.body;
|
|
13
|
-
const uniqAddresses = uniq(addresses);
|
|
14
|
-
if (addresses?.length !== uniqAddresses?.length)
|
|
15
|
-
errors.push(new Error('addresses must be unique'));
|
|
16
|
-
return errors;
|
|
17
|
-
}
|
|
18
|
-
addresses() {
|
|
19
|
-
const errors = [];
|
|
20
|
-
const { addresses } = this.body;
|
|
21
|
-
if (!addresses?.length)
|
|
22
|
-
errors.push(new Error('addresses missing [at least one address required]'));
|
|
23
|
-
errors.push(...this.addressesUniqueness());
|
|
24
|
-
return errors;
|
|
25
|
-
}
|
|
26
|
-
validateArrayLength(fieldName, compareArrayName) {
|
|
27
|
-
const errors = [];
|
|
28
|
-
const [array, arrayErrors] = validateType('array', this.body[fieldName], true);
|
|
29
|
-
const [compareArray, compareArrayErrors] = validateType('array', this.body[compareArrayName], true);
|
|
30
|
-
if (array?.length !== compareArray?.length) {
|
|
31
|
-
errors.push(new Error(`${fieldName}/${compareArrayName} count mismatch [${array?.length} !== ${compareArray?.length}]`));
|
|
32
|
-
}
|
|
33
|
-
return [...arrayErrors, ...compareArrayErrors, ...errors];
|
|
34
|
-
}
|
|
35
|
-
validatePayloadHashesLength() {
|
|
36
|
-
const errors = [];
|
|
37
|
-
errors.push(...this.validateArrayLength('payload_hashes', 'payload_schemas'));
|
|
38
|
-
return errors;
|
|
39
|
-
}
|
|
40
|
-
validateArrayLengths() {
|
|
41
|
-
const errors = [];
|
|
42
|
-
errors.push(...this.validatePayloadHashesLength());
|
|
43
|
-
return errors;
|
|
44
|
-
}
|
|
45
|
-
payloadHashes() {
|
|
46
|
-
const errors = [];
|
|
47
|
-
const passedHashes = this.body.payload_hashes;
|
|
48
|
-
this.payloads?.forEach((payload, index) => {
|
|
49
|
-
const calcHash = new XyoHasher(payload).hash;
|
|
50
|
-
const passedHash = passedHashes[index];
|
|
51
|
-
if (calcHash !== passedHash) {
|
|
52
|
-
errors.push(new Error(`hash mismatch [${calcHash} !== ${passedHash}]`));
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
return errors;
|
|
56
|
-
}
|
|
57
|
-
payloadSchemas() {
|
|
58
|
-
const errors = [];
|
|
59
|
-
const schemaValidators = this.body.payload_schemas.map((schema) => {
|
|
60
|
-
return new XyoSchemaNameValidator(schema);
|
|
61
|
-
});
|
|
62
|
-
schemaValidators.forEach((validator) => {
|
|
63
|
-
errors.push(...validator.all());
|
|
64
|
-
});
|
|
65
|
-
return errors;
|
|
66
|
-
}
|
|
67
|
-
previousHashes() {
|
|
68
|
-
const errors = [];
|
|
69
|
-
return errors;
|
|
70
|
-
}
|
|
71
|
-
schmea() {
|
|
72
|
-
const errors = [];
|
|
73
|
-
const expectedSchema = 'network.xyo.boundwitness';
|
|
74
|
-
if (this.body.schema !== expectedSchema) {
|
|
75
|
-
errors.push(new Error(`invalid schema [${expectedSchema} !== ${this.body.schema}]`));
|
|
76
|
-
}
|
|
77
|
-
return errors;
|
|
78
|
-
}
|
|
79
|
-
all() {
|
|
80
|
-
const errors = [];
|
|
81
|
-
errors.push(...this.addresses(), ...this.validateArrayLengths(), ...this.payloadHashes(), ...this.payloadSchemas(), ...this.previousHashes(), ...this.schmea());
|
|
82
|
-
return errors;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
export { XyoBoundWitnessBodyValidator };
|
|
1
|
+
import uniq from 'lodash/uniq';
|
|
2
|
+
import { XyoHasher } from '../../Hasher';
|
|
3
|
+
import { validateType } from '../../lib';
|
|
4
|
+
import { XyoSchemaNameValidator } from '../../SchemaNameValidator';
|
|
5
|
+
class XyoBoundWitnessBodyValidator {
|
|
6
|
+
constructor(body, payloads) {
|
|
7
|
+
this.body = body;
|
|
8
|
+
this.payloads = payloads;
|
|
9
|
+
}
|
|
10
|
+
addressesUniqueness() {
|
|
11
|
+
const errors = [];
|
|
12
|
+
const { addresses } = this.body;
|
|
13
|
+
const uniqAddresses = uniq(addresses);
|
|
14
|
+
if (addresses?.length !== uniqAddresses?.length)
|
|
15
|
+
errors.push(new Error('addresses must be unique'));
|
|
16
|
+
return errors;
|
|
17
|
+
}
|
|
18
|
+
addresses() {
|
|
19
|
+
const errors = [];
|
|
20
|
+
const { addresses } = this.body;
|
|
21
|
+
if (!addresses?.length)
|
|
22
|
+
errors.push(new Error('addresses missing [at least one address required]'));
|
|
23
|
+
errors.push(...this.addressesUniqueness());
|
|
24
|
+
return errors;
|
|
25
|
+
}
|
|
26
|
+
validateArrayLength(fieldName, compareArrayName) {
|
|
27
|
+
const errors = [];
|
|
28
|
+
const [array, arrayErrors] = validateType('array', this.body[fieldName], true);
|
|
29
|
+
const [compareArray, compareArrayErrors] = validateType('array', this.body[compareArrayName], true);
|
|
30
|
+
if (array?.length !== compareArray?.length) {
|
|
31
|
+
errors.push(new Error(`${fieldName}/${compareArrayName} count mismatch [${array?.length} !== ${compareArray?.length}]`));
|
|
32
|
+
}
|
|
33
|
+
return [...arrayErrors, ...compareArrayErrors, ...errors];
|
|
34
|
+
}
|
|
35
|
+
validatePayloadHashesLength() {
|
|
36
|
+
const errors = [];
|
|
37
|
+
errors.push(...this.validateArrayLength('payload_hashes', 'payload_schemas'));
|
|
38
|
+
return errors;
|
|
39
|
+
}
|
|
40
|
+
validateArrayLengths() {
|
|
41
|
+
const errors = [];
|
|
42
|
+
errors.push(...this.validatePayloadHashesLength());
|
|
43
|
+
return errors;
|
|
44
|
+
}
|
|
45
|
+
payloadHashes() {
|
|
46
|
+
const errors = [];
|
|
47
|
+
const passedHashes = this.body.payload_hashes;
|
|
48
|
+
this.payloads?.forEach((payload, index) => {
|
|
49
|
+
const calcHash = new XyoHasher(payload).hash;
|
|
50
|
+
const passedHash = passedHashes[index];
|
|
51
|
+
if (calcHash !== passedHash) {
|
|
52
|
+
errors.push(new Error(`hash mismatch [${calcHash} !== ${passedHash}]`));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return errors;
|
|
56
|
+
}
|
|
57
|
+
payloadSchemas() {
|
|
58
|
+
const errors = [];
|
|
59
|
+
const schemaValidators = this.body.payload_schemas.map((schema) => {
|
|
60
|
+
return new XyoSchemaNameValidator(schema);
|
|
61
|
+
});
|
|
62
|
+
schemaValidators.forEach((validator) => {
|
|
63
|
+
errors.push(...validator.all());
|
|
64
|
+
});
|
|
65
|
+
return errors;
|
|
66
|
+
}
|
|
67
|
+
previousHashes() {
|
|
68
|
+
const errors = [];
|
|
69
|
+
return errors;
|
|
70
|
+
}
|
|
71
|
+
schmea() {
|
|
72
|
+
const errors = [];
|
|
73
|
+
const expectedSchema = 'network.xyo.boundwitness';
|
|
74
|
+
if (this.body.schema !== expectedSchema) {
|
|
75
|
+
errors.push(new Error(`invalid schema [${expectedSchema} !== ${this.body.schema}]`));
|
|
76
|
+
}
|
|
77
|
+
return errors;
|
|
78
|
+
}
|
|
79
|
+
all() {
|
|
80
|
+
const errors = [];
|
|
81
|
+
errors.push(...this.addresses(), ...this.validateArrayLengths(), ...this.payloadHashes(), ...this.payloadSchemas(), ...this.previousHashes(), ...this.schmea());
|
|
82
|
+
return errors;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export { XyoBoundWitnessBodyValidator };
|
|
86
86
|
//# sourceMappingURL=BodyValidator.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { XyoBoundWitness } from '../models';
|
|
2
|
-
export declare class XyoBoundWitnessMetaValidator {
|
|
3
|
-
private bw;
|
|
4
|
-
constructor(bw: XyoBoundWitness);
|
|
5
|
-
client(): Error[];
|
|
6
|
-
hash(): Error[];
|
|
7
|
-
payloads(): Error[];
|
|
8
|
-
signatures(): Error[];
|
|
9
|
-
timestamp(): Error[];
|
|
10
|
-
sourceIp(): Error[];
|
|
11
|
-
userAgent(): Error[];
|
|
12
|
-
all(): Error[];
|
|
13
|
-
meta(): Error[];
|
|
14
|
-
}
|
|
1
|
+
import { XyoBoundWitness } from '../models';
|
|
2
|
+
export declare class XyoBoundWitnessMetaValidator {
|
|
3
|
+
private bw;
|
|
4
|
+
constructor(bw: XyoBoundWitness);
|
|
5
|
+
client(): Error[];
|
|
6
|
+
hash(): Error[];
|
|
7
|
+
payloads(): Error[];
|
|
8
|
+
signatures(): Error[];
|
|
9
|
+
timestamp(): Error[];
|
|
10
|
+
sourceIp(): Error[];
|
|
11
|
+
userAgent(): Error[];
|
|
12
|
+
all(): Error[];
|
|
13
|
+
meta(): Error[];
|
|
14
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { XyoHasher } from '../../Hasher';
|
|
2
|
-
import { isIP } from './is-ip';
|
|
3
|
-
const MIN_ALLOWED_TIMESTAMP = 1609459200000;
|
|
4
|
-
const MAX_ALLOWED_TIMESTAMP = 4102444800000;
|
|
5
|
-
export class XyoBoundWitnessMetaValidator {
|
|
6
|
-
constructor(bw) {
|
|
7
|
-
this.bw = bw;
|
|
8
|
-
}
|
|
9
|
-
client() {
|
|
10
|
-
const errors = [];
|
|
11
|
-
return errors;
|
|
12
|
-
}
|
|
13
|
-
hash() {
|
|
14
|
-
const errors = [];
|
|
15
|
-
const hasher = new XyoHasher(this.bw);
|
|
16
|
-
const bodyHash = hasher.hash;
|
|
17
|
-
if (bodyHash !== this.bw._hash)
|
|
18
|
-
errors.push(new Error(`Body hash mismatch: [calculated: ${bodyHash}] [found: ${this.bw._hash}] [sortedStringify: ${hasher.stringified}]`));
|
|
19
|
-
return errors;
|
|
20
|
-
}
|
|
21
|
-
payloads() {
|
|
22
|
-
const errors = [];
|
|
23
|
-
return errors;
|
|
24
|
-
}
|
|
25
|
-
signatures() {
|
|
26
|
-
const errors = [];
|
|
27
|
-
return errors;
|
|
28
|
-
}
|
|
29
|
-
timestamp() {
|
|
30
|
-
const errors = [];
|
|
31
|
-
const { _timestamp } = this.bw;
|
|
32
|
-
if (_timestamp === undefined)
|
|
33
|
-
errors.push(new Error('Missing _timestamp'));
|
|
34
|
-
else if (_timestamp < MIN_ALLOWED_TIMESTAMP)
|
|
35
|
-
errors.push(new Error('_timestamp is before year 2021'));
|
|
36
|
-
else if (_timestamp > MAX_ALLOWED_TIMESTAMP)
|
|
37
|
-
errors.push(new Error('_timestamp is after year 2100'));
|
|
38
|
-
return errors;
|
|
39
|
-
}
|
|
40
|
-
sourceIp() {
|
|
41
|
-
const errors = [];
|
|
42
|
-
const { _source_ip } = this.bw;
|
|
43
|
-
if (_source_ip && !isIP(_source_ip)) {
|
|
44
|
-
errors.push(new Error(`_source_ip invalid format [${_source_ip}]`));
|
|
45
|
-
}
|
|
46
|
-
return errors;
|
|
47
|
-
}
|
|
48
|
-
userAgent() {
|
|
49
|
-
const errors = [];
|
|
50
|
-
const { _user_agent } = this.bw;
|
|
51
|
-
if (!_user_agent)
|
|
52
|
-
errors.push(new Error('_user_agent missing'));
|
|
53
|
-
return errors;
|
|
54
|
-
}
|
|
55
|
-
all() {
|
|
56
|
-
const errors = [];
|
|
57
|
-
errors.push(...this.client(), ...this.hash(), ...this.payloads(), ...this.signatures());
|
|
58
|
-
return errors;
|
|
59
|
-
}
|
|
60
|
-
meta() {
|
|
61
|
-
const errors = [];
|
|
62
|
-
errors.push(...this.timestamp(), ...this.sourceIp(), ...this.userAgent());
|
|
63
|
-
return errors;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
import { XyoHasher } from '../../Hasher';
|
|
2
|
+
import { isIP } from './is-ip';
|
|
3
|
+
const MIN_ALLOWED_TIMESTAMP = 1609459200000;
|
|
4
|
+
const MAX_ALLOWED_TIMESTAMP = 4102444800000;
|
|
5
|
+
export class XyoBoundWitnessMetaValidator {
|
|
6
|
+
constructor(bw) {
|
|
7
|
+
this.bw = bw;
|
|
8
|
+
}
|
|
9
|
+
client() {
|
|
10
|
+
const errors = [];
|
|
11
|
+
return errors;
|
|
12
|
+
}
|
|
13
|
+
hash() {
|
|
14
|
+
const errors = [];
|
|
15
|
+
const hasher = new XyoHasher(this.bw);
|
|
16
|
+
const bodyHash = hasher.hash;
|
|
17
|
+
if (bodyHash !== this.bw._hash)
|
|
18
|
+
errors.push(new Error(`Body hash mismatch: [calculated: ${bodyHash}] [found: ${this.bw._hash}] [sortedStringify: ${hasher.stringified}]`));
|
|
19
|
+
return errors;
|
|
20
|
+
}
|
|
21
|
+
payloads() {
|
|
22
|
+
const errors = [];
|
|
23
|
+
return errors;
|
|
24
|
+
}
|
|
25
|
+
signatures() {
|
|
26
|
+
const errors = [];
|
|
27
|
+
return errors;
|
|
28
|
+
}
|
|
29
|
+
timestamp() {
|
|
30
|
+
const errors = [];
|
|
31
|
+
const { _timestamp } = this.bw;
|
|
32
|
+
if (_timestamp === undefined)
|
|
33
|
+
errors.push(new Error('Missing _timestamp'));
|
|
34
|
+
else if (_timestamp < MIN_ALLOWED_TIMESTAMP)
|
|
35
|
+
errors.push(new Error('_timestamp is before year 2021'));
|
|
36
|
+
else if (_timestamp > MAX_ALLOWED_TIMESTAMP)
|
|
37
|
+
errors.push(new Error('_timestamp is after year 2100'));
|
|
38
|
+
return errors;
|
|
39
|
+
}
|
|
40
|
+
sourceIp() {
|
|
41
|
+
const errors = [];
|
|
42
|
+
const { _source_ip } = this.bw;
|
|
43
|
+
if (_source_ip && !isIP(_source_ip)) {
|
|
44
|
+
errors.push(new Error(`_source_ip invalid format [${_source_ip}]`));
|
|
45
|
+
}
|
|
46
|
+
return errors;
|
|
47
|
+
}
|
|
48
|
+
userAgent() {
|
|
49
|
+
const errors = [];
|
|
50
|
+
const { _user_agent } = this.bw;
|
|
51
|
+
if (!_user_agent)
|
|
52
|
+
errors.push(new Error('_user_agent missing'));
|
|
53
|
+
return errors;
|
|
54
|
+
}
|
|
55
|
+
all() {
|
|
56
|
+
const errors = [];
|
|
57
|
+
errors.push(...this.client(), ...this.hash(), ...this.payloads(), ...this.signatures());
|
|
58
|
+
return errors;
|
|
59
|
+
}
|
|
60
|
+
meta() {
|
|
61
|
+
const errors = [];
|
|
62
|
+
errors.push(...this.timestamp(), ...this.sourceIp(), ...this.userAgent());
|
|
63
|
+
return errors;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
66
|
//# sourceMappingURL=MetaValidator.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { XyoBoundWitness } from '../models';
|
|
2
|
-
import { XyoBoundWitnessBodyValidator } from './BodyValidator';
|
|
3
|
-
import { XyoBoundWitnessMetaValidator } from './MetaValidator';
|
|
4
|
-
declare class XyoBoundWitnessValidator {
|
|
5
|
-
private bw;
|
|
6
|
-
body: XyoBoundWitnessBodyValidator;
|
|
7
|
-
meta: XyoBoundWitnessMetaValidator;
|
|
8
|
-
constructor(bw: XyoBoundWitness);
|
|
9
|
-
signatures(): Error[];
|
|
10
|
-
all(): Error[];
|
|
11
|
-
}
|
|
12
|
-
export { XyoBoundWitnessValidator };
|
|
1
|
+
import { XyoBoundWitness } from '../models';
|
|
2
|
+
import { XyoBoundWitnessBodyValidator } from './BodyValidator';
|
|
3
|
+
import { XyoBoundWitnessMetaValidator } from './MetaValidator';
|
|
4
|
+
declare class XyoBoundWitnessValidator {
|
|
5
|
+
private bw;
|
|
6
|
+
body: XyoBoundWitnessBodyValidator;
|
|
7
|
+
meta: XyoBoundWitnessMetaValidator;
|
|
8
|
+
constructor(bw: XyoBoundWitness);
|
|
9
|
+
signatures(): Error[];
|
|
10
|
+
all(): Error[];
|
|
11
|
+
}
|
|
12
|
+
export { XyoBoundWitnessValidator };
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { assertEx } from '@xylabs/sdk-js';
|
|
2
|
-
import { XyoAddressValue } from '../../Wallet';
|
|
3
|
-
import { XyoBoundWitnessBodyValidator } from './BodyValidator';
|
|
4
|
-
import { XyoBoundWitnessMetaValidator } from './MetaValidator';
|
|
5
|
-
const validateArraysSameLength = (a, b, message = 'Array length mismatch') => {
|
|
6
|
-
return a.length != b.length ? [Error(`${message} []`)] : [];
|
|
7
|
-
};
|
|
8
|
-
const validateSignature = (hash, address, signature) => {
|
|
9
|
-
if (!signature) {
|
|
10
|
-
return [Error(`Missing signature [${address}]`)];
|
|
11
|
-
}
|
|
12
|
-
if (!new XyoAddressValue(address).verify(hash, signature)) {
|
|
13
|
-
return [Error(`Invalid signature [${address}] [${signature}]`)];
|
|
14
|
-
}
|
|
15
|
-
return [];
|
|
16
|
-
};
|
|
17
|
-
class XyoBoundWitnessValidator {
|
|
18
|
-
constructor(bw) {
|
|
19
|
-
this.bw = bw;
|
|
20
|
-
this.body = new XyoBoundWitnessBodyValidator(bw, bw._payloads);
|
|
21
|
-
this.meta = new XyoBoundWitnessMetaValidator(bw);
|
|
22
|
-
}
|
|
23
|
-
signatures() {
|
|
24
|
-
const hash = assertEx(this.bw._hash, 'Missing _hash');
|
|
25
|
-
return [
|
|
26
|
-
...validateArraysSameLength(this.bw._signatures ?? [], this.bw.addresses, 'Length mismatch: address/_signature'),
|
|
27
|
-
...this.bw.addresses.reduce((errors, address, index) => {
|
|
28
|
-
errors.push(...validateSignature(hash, address, this.bw._signatures?.[index]));
|
|
29
|
-
return errors;
|
|
30
|
-
}, []),
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
all() {
|
|
34
|
-
const errors = [];
|
|
35
|
-
errors.push(...this.meta.all(), ...this.body.all());
|
|
36
|
-
errors.push(...this.signatures());
|
|
37
|
-
return errors;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export { XyoBoundWitnessValidator };
|
|
1
|
+
import { assertEx } from '@xylabs/sdk-js';
|
|
2
|
+
import { XyoAddressValue } from '../../Wallet';
|
|
3
|
+
import { XyoBoundWitnessBodyValidator } from './BodyValidator';
|
|
4
|
+
import { XyoBoundWitnessMetaValidator } from './MetaValidator';
|
|
5
|
+
const validateArraysSameLength = (a, b, message = 'Array length mismatch') => {
|
|
6
|
+
return a.length != b.length ? [Error(`${message} []`)] : [];
|
|
7
|
+
};
|
|
8
|
+
const validateSignature = (hash, address, signature) => {
|
|
9
|
+
if (!signature) {
|
|
10
|
+
return [Error(`Missing signature [${address}]`)];
|
|
11
|
+
}
|
|
12
|
+
if (!new XyoAddressValue(address).verify(hash, signature)) {
|
|
13
|
+
return [Error(`Invalid signature [${address}] [${signature}]`)];
|
|
14
|
+
}
|
|
15
|
+
return [];
|
|
16
|
+
};
|
|
17
|
+
class XyoBoundWitnessValidator {
|
|
18
|
+
constructor(bw) {
|
|
19
|
+
this.bw = bw;
|
|
20
|
+
this.body = new XyoBoundWitnessBodyValidator(bw, bw._payloads);
|
|
21
|
+
this.meta = new XyoBoundWitnessMetaValidator(bw);
|
|
22
|
+
}
|
|
23
|
+
signatures() {
|
|
24
|
+
const hash = assertEx(this.bw._hash, 'Missing _hash');
|
|
25
|
+
return [
|
|
26
|
+
...validateArraysSameLength(this.bw._signatures ?? [], this.bw.addresses, 'Length mismatch: address/_signature'),
|
|
27
|
+
...this.bw.addresses.reduce((errors, address, index) => {
|
|
28
|
+
errors.push(...validateSignature(hash, address, this.bw._signatures?.[index]));
|
|
29
|
+
return errors;
|
|
30
|
+
}, []),
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
all() {
|
|
34
|
+
const errors = [];
|
|
35
|
+
errors.push(...this.meta.all(), ...this.body.all());
|
|
36
|
+
errors.push(...this.signatures());
|
|
37
|
+
return errors;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export { XyoBoundWitnessValidator };
|
|
41
41
|
//# sourceMappingURL=Validator.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './BodyValidator';
|
|
2
|
-
export * from './MetaValidator';
|
|
3
|
-
export * from './Validator';
|
|
1
|
+
export * from './BodyValidator';
|
|
2
|
+
export * from './MetaValidator';
|
|
3
|
+
export * from './Validator';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './BodyValidator';
|
|
2
|
-
export * from './MetaValidator';
|
|
3
|
-
export * from './Validator';
|
|
1
|
+
export * from './BodyValidator';
|
|
2
|
+
export * from './MetaValidator';
|
|
3
|
+
export * from './Validator';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export interface Options {
|
|
2
|
-
readonly exact?: boolean;
|
|
3
|
-
readonly includeBoundaries?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare const ipRegex: {
|
|
6
|
-
(options: Options): RegExp;
|
|
7
|
-
v4(options: Options): RegExp;
|
|
8
|
-
v6(options: Options): RegExp;
|
|
9
|
-
};
|
|
1
|
+
export interface Options {
|
|
2
|
+
readonly exact?: boolean;
|
|
3
|
+
readonly includeBoundaries?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const ipRegex: {
|
|
6
|
+
(options: Options): RegExp;
|
|
7
|
+
v4(options: Options): RegExp;
|
|
8
|
+
v6(options: Options): RegExp;
|
|
9
|
+
};
|