@xyo-network/core 2.20.44 → 2.20.47
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 +29 -26
- package/dist/cjs/Huri/Huri.js +110 -100
- package/dist/cjs/Huri/Huri.js.map +1 -1
- 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 +12 -9
- package/dist/cjs/Payload/Wrapper/Wrapper.js +30 -20
- package/dist/cjs/Payload/Wrapper/Wrapper.js.map +1 -1
- 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 +19 -14
- package/dist/cjs/Witness/LegacyWitness.js +31 -27
- package/dist/cjs/Witness/LegacyWitness.js.map +1 -1
- 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/docs.json +1 -23434
- 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 +29 -26
- package/dist/esm/Huri/Huri.js +98 -89
- package/dist/esm/Huri/Huri.js.map +1 -1
- 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 +12 -9
- package/dist/esm/Payload/Wrapper/Wrapper.js +23 -16
- package/dist/esm/Payload/Wrapper/Wrapper.js.map +1 -1
- 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 +19 -14
- package/dist/esm/Witness/LegacyWitness.js +21 -18
- package/dist/esm/Witness/LegacyWitness.js.map +1 -1
- 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 +4 -14
- package/src/Huri/Huri.spec.ts +0 -1
- package/src/Huri/Huri.ts +15 -4
- package/src/Payload/Wrapper/Wrapper.ts +9 -0
- package/src/Witness/LegacyWitness.ts +8 -2
- package/src/Witness/Witness.spec.ts +2 -2
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
import { domainExists } from './lib';
|
|
2
|
-
/**
|
|
3
|
-
* Validates a XYO schema structure and existence
|
|
4
|
-
*/
|
|
5
|
-
export class XyoSchemaNameValidator {
|
|
6
|
-
constructor(schema) {
|
|
7
|
-
this.schema = schema;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* The schema converted into a string array split on '.'
|
|
11
|
-
*
|
|
12
|
-
* @returns string[]
|
|
13
|
-
*/
|
|
14
|
-
get parts() {
|
|
15
|
-
this._parts = this._parts ?? this.schema?.split('.');
|
|
16
|
-
return this._parts;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Levels in the schema
|
|
20
|
-
*
|
|
21
|
-
* @returns number
|
|
22
|
-
*/
|
|
23
|
-
get levels() {
|
|
24
|
-
return this.parts?.length;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Checks whether the schema is all lowercase
|
|
28
|
-
*
|
|
29
|
-
* @returns boolean
|
|
30
|
-
*/
|
|
31
|
-
get isLowercase() {
|
|
32
|
-
return this.schema === this.schema?.toLowerCase();
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* Get a domain for the schema at a certain level
|
|
37
|
-
*
|
|
38
|
-
* @param level - Zero based level to check
|
|
39
|
-
* @returns string
|
|
40
|
-
*/
|
|
41
|
-
domainLevel(level) {
|
|
42
|
-
return this.parts
|
|
43
|
-
?.slice(0, level + 1)
|
|
44
|
-
.reverse()
|
|
45
|
-
.join('.');
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* The rootDomain is the first two levels of the schema, in reverse order
|
|
49
|
-
* This can be used to determine who 'owns' that schema, based on domain
|
|
50
|
-
* registration
|
|
51
|
-
*
|
|
52
|
-
* @returns string
|
|
53
|
-
*/
|
|
54
|
-
get rootDomain() {
|
|
55
|
-
this._rootDomain = this._rootDomain ?? this.domainLevel(1);
|
|
56
|
-
return this._rootDomain;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Checks if the root domain validates via DNS resolution
|
|
60
|
-
*
|
|
61
|
-
* @returns boolean
|
|
62
|
-
*/
|
|
63
|
-
async rootDomainExists() {
|
|
64
|
-
return await domainExists(this.rootDomain);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Determines how many levels of the schema's reverse domain
|
|
68
|
-
* pass DNS resolution
|
|
69
|
-
*
|
|
70
|
-
* @returns number (0 if none exist)
|
|
71
|
-
*/
|
|
72
|
-
async domainExistanceDepth() {
|
|
73
|
-
const levels = this.levels ?? 0;
|
|
74
|
-
let level = 0;
|
|
75
|
-
while (level < levels) {
|
|
76
|
-
if (!(await domainExists(this.domainLevel(level)))) {
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
level += 1;
|
|
80
|
-
}
|
|
81
|
-
return level;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Run all the validations
|
|
85
|
-
* @param checkExistance - boolean
|
|
86
|
-
* @returns Error[]
|
|
87
|
-
*/
|
|
88
|
-
async allDynamic() {
|
|
89
|
-
const errors = [];
|
|
90
|
-
if ((this.schema?.length ?? 0) === 0)
|
|
91
|
-
errors.push(Error('schema missing'));
|
|
92
|
-
else if (!(await this.rootDomainExists()))
|
|
93
|
-
errors.push(Error(`schema root domain must exist [${this.rootDomain}]`));
|
|
94
|
-
return errors;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Run all static validations
|
|
98
|
-
* @returns Error[]
|
|
99
|
-
*/
|
|
100
|
-
all() {
|
|
101
|
-
const errors = [];
|
|
102
|
-
if ((this.schema?.length ?? 0) === 0)
|
|
103
|
-
errors.push(Error('schema missing'));
|
|
104
|
-
else if ((this.levels ?? 0) < 3)
|
|
105
|
-
errors.push(Error(`schema levels < 3 [${this.levels}, ${this.schema}]`));
|
|
106
|
-
else if (!this.isLowercase)
|
|
107
|
-
errors.push(Error(`schema not lowercase [${this.schema}]`));
|
|
108
|
-
return errors;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
/** @deprectated use XyoSchemaNameValidator instead */
|
|
112
|
-
export class SchemaValidator extends XyoSchemaNameValidator {
|
|
113
|
-
}
|
|
114
|
-
/** @deprectated use XyoSchemaNameValidator instead */
|
|
115
|
-
export class XyoSchemaValidator extends XyoSchemaNameValidator {
|
|
116
|
-
}
|
|
1
|
+
import { domainExists } from './lib';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a XYO schema structure and existence
|
|
4
|
+
*/
|
|
5
|
+
export class XyoSchemaNameValidator {
|
|
6
|
+
constructor(schema) {
|
|
7
|
+
this.schema = schema;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The schema converted into a string array split on '.'
|
|
11
|
+
*
|
|
12
|
+
* @returns string[]
|
|
13
|
+
*/
|
|
14
|
+
get parts() {
|
|
15
|
+
this._parts = this._parts ?? this.schema?.split('.');
|
|
16
|
+
return this._parts;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Levels in the schema
|
|
20
|
+
*
|
|
21
|
+
* @returns number
|
|
22
|
+
*/
|
|
23
|
+
get levels() {
|
|
24
|
+
return this.parts?.length;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Checks whether the schema is all lowercase
|
|
28
|
+
*
|
|
29
|
+
* @returns boolean
|
|
30
|
+
*/
|
|
31
|
+
get isLowercase() {
|
|
32
|
+
return this.schema === this.schema?.toLowerCase();
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* Get a domain for the schema at a certain level
|
|
37
|
+
*
|
|
38
|
+
* @param level - Zero based level to check
|
|
39
|
+
* @returns string
|
|
40
|
+
*/
|
|
41
|
+
domainLevel(level) {
|
|
42
|
+
return this.parts
|
|
43
|
+
?.slice(0, level + 1)
|
|
44
|
+
.reverse()
|
|
45
|
+
.join('.');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The rootDomain is the first two levels of the schema, in reverse order
|
|
49
|
+
* This can be used to determine who 'owns' that schema, based on domain
|
|
50
|
+
* registration
|
|
51
|
+
*
|
|
52
|
+
* @returns string
|
|
53
|
+
*/
|
|
54
|
+
get rootDomain() {
|
|
55
|
+
this._rootDomain = this._rootDomain ?? this.domainLevel(1);
|
|
56
|
+
return this._rootDomain;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Checks if the root domain validates via DNS resolution
|
|
60
|
+
*
|
|
61
|
+
* @returns boolean
|
|
62
|
+
*/
|
|
63
|
+
async rootDomainExists() {
|
|
64
|
+
return await domainExists(this.rootDomain);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Determines how many levels of the schema's reverse domain
|
|
68
|
+
* pass DNS resolution
|
|
69
|
+
*
|
|
70
|
+
* @returns number (0 if none exist)
|
|
71
|
+
*/
|
|
72
|
+
async domainExistanceDepth() {
|
|
73
|
+
const levels = this.levels ?? 0;
|
|
74
|
+
let level = 0;
|
|
75
|
+
while (level < levels) {
|
|
76
|
+
if (!(await domainExists(this.domainLevel(level)))) {
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
level += 1;
|
|
80
|
+
}
|
|
81
|
+
return level;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Run all the validations
|
|
85
|
+
* @param checkExistance - boolean
|
|
86
|
+
* @returns Error[]
|
|
87
|
+
*/
|
|
88
|
+
async allDynamic() {
|
|
89
|
+
const errors = [];
|
|
90
|
+
if ((this.schema?.length ?? 0) === 0)
|
|
91
|
+
errors.push(Error('schema missing'));
|
|
92
|
+
else if (!(await this.rootDomainExists()))
|
|
93
|
+
errors.push(Error(`schema root domain must exist [${this.rootDomain}]`));
|
|
94
|
+
return errors;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Run all static validations
|
|
98
|
+
* @returns Error[]
|
|
99
|
+
*/
|
|
100
|
+
all() {
|
|
101
|
+
const errors = [];
|
|
102
|
+
if ((this.schema?.length ?? 0) === 0)
|
|
103
|
+
errors.push(Error('schema missing'));
|
|
104
|
+
else if ((this.levels ?? 0) < 3)
|
|
105
|
+
errors.push(Error(`schema levels < 3 [${this.levels}, ${this.schema}]`));
|
|
106
|
+
else if (!this.isLowercase)
|
|
107
|
+
errors.push(Error(`schema not lowercase [${this.schema}]`));
|
|
108
|
+
return errors;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/** @deprectated use XyoSchemaNameValidator instead */
|
|
112
|
+
export class SchemaValidator extends XyoSchemaNameValidator {
|
|
113
|
+
}
|
|
114
|
+
/** @deprectated use XyoSchemaNameValidator instead */
|
|
115
|
+
export class XyoSchemaValidator extends XyoSchemaNameValidator {
|
|
116
|
+
}
|
|
117
117
|
//# sourceMappingURL=SchemaNameValidator.js.map
|
package/dist/esm/Test/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './testBoundWitness';
|
|
2
|
-
export * from './testPayload';
|
|
1
|
+
export * from './testBoundWitness';
|
|
2
|
+
export * from './testPayload';
|
package/dist/esm/Test/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './testBoundWitness';
|
|
2
|
-
export * from './testPayload';
|
|
1
|
+
export * from './testBoundWitness';
|
|
2
|
+
export * from './testPayload';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { XyoBoundWitness } from '../BoundWitness';
|
|
2
|
-
declare const testBoundWitness: XyoBoundWitness;
|
|
3
|
-
export { testBoundWitness };
|
|
1
|
+
import { XyoBoundWitness } from '../BoundWitness';
|
|
2
|
+
declare const testBoundWitness: XyoBoundWitness;
|
|
3
|
+
export { testBoundWitness };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const testBoundWitness = {
|
|
2
|
-
_archive: 'temp',
|
|
3
|
-
_client: 'js',
|
|
4
|
-
_hash: 'b0ffb9ebf872dc316b7be48327256c5316f7cb84d7c706861b18b86af1942dea',
|
|
5
|
-
_signatures: ['95100e5fd2012b958e96895870cfac5353c3a33a19314cfd1304ef7d01d052ec2a3ef80d6449cf88d463027fe0d868ed8cfb8b7323d37e93a08570233eea0b17'],
|
|
6
|
-
_timestamp: 1650067385598,
|
|
7
|
-
addresses: ['5346a2ce56ec4177b67092bda710e150ba6fa046'],
|
|
8
|
-
payload_hashes: ['20e14207f952a09f767ff614a648546c037fe524ace0bfe55db31f818aff1f1c'],
|
|
9
|
-
payload_schemas: ['network.xyo.test'],
|
|
10
|
-
previous_hashes: [null],
|
|
11
|
-
schema: 'network.xyo.boundwitness',
|
|
12
|
-
};
|
|
13
|
-
export { testBoundWitness };
|
|
1
|
+
const testBoundWitness = {
|
|
2
|
+
_archive: 'temp',
|
|
3
|
+
_client: 'js',
|
|
4
|
+
_hash: 'b0ffb9ebf872dc316b7be48327256c5316f7cb84d7c706861b18b86af1942dea',
|
|
5
|
+
_signatures: ['95100e5fd2012b958e96895870cfac5353c3a33a19314cfd1304ef7d01d052ec2a3ef80d6449cf88d463027fe0d868ed8cfb8b7323d37e93a08570233eea0b17'],
|
|
6
|
+
_timestamp: 1650067385598,
|
|
7
|
+
addresses: ['5346a2ce56ec4177b67092bda710e150ba6fa046'],
|
|
8
|
+
payload_hashes: ['20e14207f952a09f767ff614a648546c037fe524ace0bfe55db31f818aff1f1c'],
|
|
9
|
+
payload_schemas: ['network.xyo.test'],
|
|
10
|
+
previous_hashes: [null],
|
|
11
|
+
schema: 'network.xyo.boundwitness',
|
|
12
|
+
};
|
|
13
|
+
export { testBoundWitness };
|
|
14
14
|
//# sourceMappingURL=testBoundWitness.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { XyoPayload } from '../Payload';
|
|
2
|
-
declare const testSchema = "network.xyo.test";
|
|
3
|
-
declare const testPayload: XyoPayload;
|
|
4
|
-
export { testPayload, testSchema };
|
|
1
|
+
import { XyoPayload } from '../Payload';
|
|
2
|
+
declare const testSchema = "network.xyo.test";
|
|
3
|
+
declare const testPayload: XyoPayload;
|
|
4
|
+
export { testPayload, testSchema };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const testSchema = 'network.xyo.test';
|
|
2
|
-
const testPayload = {
|
|
3
|
-
_archive: 'test',
|
|
4
|
-
_hash: '20e14207f952a09f767ff614a648546c037fe524ace0bfe55db31f818aff1f1c',
|
|
5
|
-
_timestamp: 1609459255555,
|
|
6
|
-
numberField: 1,
|
|
7
|
-
objectField: {
|
|
8
|
-
numberField: 1,
|
|
9
|
-
stringField: 'stringValue',
|
|
10
|
-
},
|
|
11
|
-
schema: testSchema,
|
|
12
|
-
stringField: 'stringValue',
|
|
13
|
-
};
|
|
14
|
-
export { testPayload, testSchema };
|
|
1
|
+
const testSchema = 'network.xyo.test';
|
|
2
|
+
const testPayload = {
|
|
3
|
+
_archive: 'test',
|
|
4
|
+
_hash: '20e14207f952a09f767ff614a648546c037fe524ace0bfe55db31f818aff1f1c',
|
|
5
|
+
_timestamp: 1609459255555,
|
|
6
|
+
numberField: 1,
|
|
7
|
+
objectField: {
|
|
8
|
+
numberField: 1,
|
|
9
|
+
stringField: 'stringValue',
|
|
10
|
+
},
|
|
11
|
+
schema: testSchema,
|
|
12
|
+
stringField: 'stringValue',
|
|
13
|
+
};
|
|
14
|
+
export { testPayload, testSchema };
|
|
15
15
|
//# sourceMappingURL=testPayload.js.map
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { XyoData, XyoDataLike, XyoKeyPair, XyoPublicKey } from './Key';
|
|
2
|
-
export declare const ethMessagePrefix = "\u0019Ethereum Signed Message:\n";
|
|
3
|
-
export interface XyoAccountConfig {
|
|
4
|
-
privateKey?: XyoDataLike;
|
|
5
|
-
phrase?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare class XyoAccount extends XyoKeyPair {
|
|
8
|
-
private _isXyoWallet;
|
|
9
|
-
private _previousHash?;
|
|
10
|
-
constructor({ privateKey, phrase }?: XyoAccountConfig);
|
|
11
|
-
/** @deprecated use addressValue instead */
|
|
12
|
-
get address(): string;
|
|
13
|
-
get addressValue(): import("./Key").XyoAddressValue;
|
|
14
|
-
get previousHash(): XyoData | undefined;
|
|
15
|
-
/** @deprecated use private instead */
|
|
16
|
-
get privateKey(): import("./Key").XyoPrivateKey;
|
|
17
|
-
/** @deprecated use public instead */
|
|
18
|
-
get publicKey(): XyoPublicKey;
|
|
19
|
-
sign(hash: Uint8Array | string): Uint8Array;
|
|
20
|
-
verify(msg: Uint8Array | string, signature: Uint8Array | string): boolean;
|
|
21
|
-
static fromPhrase(phrase: string): XyoAccount;
|
|
22
|
-
static fromPrivateKey(key: Uint8Array | string): XyoAccount;
|
|
23
|
-
static random(): XyoAccount;
|
|
24
|
-
static isXyoWallet(value: unknown): boolean;
|
|
25
|
-
}
|
|
26
|
-
/** @deprecated use XyoWallet instead */
|
|
27
|
-
export declare class XyoAddress extends XyoAccount {
|
|
28
|
-
get previousHashString(): string | undefined;
|
|
29
|
-
static fromPhrase(phrase: string): XyoAccount;
|
|
30
|
-
static fromPrivateKey(key: Uint8Array | string): XyoAccount;
|
|
31
|
-
static random(): XyoAccount;
|
|
32
|
-
static verifyAddress(msg: Uint8Array | string, signature: Uint8Array | string, address: XyoDataLike): boolean;
|
|
33
|
-
}
|
|
34
|
-
/** @deprecated use XyoAccount instead */
|
|
35
|
-
export declare class XyoWallet extends XyoAccount {
|
|
36
|
-
}
|
|
1
|
+
import { XyoData, XyoDataLike, XyoKeyPair, XyoPublicKey } from './Key';
|
|
2
|
+
export declare const ethMessagePrefix = "\u0019Ethereum Signed Message:\n";
|
|
3
|
+
export interface XyoAccountConfig {
|
|
4
|
+
privateKey?: XyoDataLike;
|
|
5
|
+
phrase?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class XyoAccount extends XyoKeyPair {
|
|
8
|
+
private _isXyoWallet;
|
|
9
|
+
private _previousHash?;
|
|
10
|
+
constructor({ privateKey, phrase }?: XyoAccountConfig);
|
|
11
|
+
/** @deprecated use addressValue instead */
|
|
12
|
+
get address(): string;
|
|
13
|
+
get addressValue(): import("./Key").XyoAddressValue;
|
|
14
|
+
get previousHash(): XyoData | undefined;
|
|
15
|
+
/** @deprecated use private instead */
|
|
16
|
+
get privateKey(): import("./Key").XyoPrivateKey;
|
|
17
|
+
/** @deprecated use public instead */
|
|
18
|
+
get publicKey(): XyoPublicKey;
|
|
19
|
+
sign(hash: Uint8Array | string): Uint8Array;
|
|
20
|
+
verify(msg: Uint8Array | string, signature: Uint8Array | string): boolean;
|
|
21
|
+
static fromPhrase(phrase: string): XyoAccount;
|
|
22
|
+
static fromPrivateKey(key: Uint8Array | string): XyoAccount;
|
|
23
|
+
static random(): XyoAccount;
|
|
24
|
+
static isXyoWallet(value: unknown): boolean;
|
|
25
|
+
}
|
|
26
|
+
/** @deprecated use XyoWallet instead */
|
|
27
|
+
export declare class XyoAddress extends XyoAccount {
|
|
28
|
+
get previousHashString(): string | undefined;
|
|
29
|
+
static fromPhrase(phrase: string): XyoAccount;
|
|
30
|
+
static fromPrivateKey(key: Uint8Array | string): XyoAccount;
|
|
31
|
+
static random(): XyoAccount;
|
|
32
|
+
static verifyAddress(msg: Uint8Array | string, signature: Uint8Array | string, address: XyoDataLike): boolean;
|
|
33
|
+
}
|
|
34
|
+
/** @deprecated use XyoAccount instead */
|
|
35
|
+
export declare class XyoWallet extends XyoAccount {
|
|
36
|
+
}
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import shajs from 'sha.js';
|
|
2
|
-
import { toUint8Array, XyoData, XyoKeyPair, XyoPublicKey } from './Key';
|
|
3
|
-
export const ethMessagePrefix = '\x19Ethereum Signed Message:\n';
|
|
4
|
-
export class XyoAccount extends XyoKeyPair {
|
|
5
|
-
constructor({ privateKey, phrase } = {}) {
|
|
6
|
-
const privateKeyToUse = privateKey ? toUint8Array(privateKey) : phrase ? toUint8Array(shajs('sha256').update(phrase).digest('hex')) : undefined;
|
|
7
|
-
super(privateKeyToUse);
|
|
8
|
-
this._isXyoWallet = true;
|
|
9
|
-
}
|
|
10
|
-
/** @deprecated use addressValue instead */
|
|
11
|
-
get address() {
|
|
12
|
-
return this.public.address.hex;
|
|
13
|
-
}
|
|
14
|
-
get addressValue() {
|
|
15
|
-
return this.public.address;
|
|
16
|
-
}
|
|
17
|
-
get previousHash() {
|
|
18
|
-
return this._previousHash;
|
|
19
|
-
}
|
|
20
|
-
/** @deprecated use private instead */
|
|
21
|
-
get privateKey() {
|
|
22
|
-
return this.private;
|
|
23
|
-
}
|
|
24
|
-
/** @deprecated use public instead */
|
|
25
|
-
get publicKey() {
|
|
26
|
-
return this.public;
|
|
27
|
-
}
|
|
28
|
-
sign(hash) {
|
|
29
|
-
this._previousHash = new XyoData(32, hash);
|
|
30
|
-
return this.private.sign(hash);
|
|
31
|
-
}
|
|
32
|
-
verify(msg, signature) {
|
|
33
|
-
return this.public.address.verify(msg, signature);
|
|
34
|
-
}
|
|
35
|
-
static fromPhrase(phrase) {
|
|
36
|
-
const privateKey = shajs('sha256').update(phrase).digest('hex');
|
|
37
|
-
return XyoAccount.fromPrivateKey(privateKey);
|
|
38
|
-
}
|
|
39
|
-
static fromPrivateKey(key) {
|
|
40
|
-
const privateKey = toUint8Array(key);
|
|
41
|
-
return new XyoAccount({ privateKey });
|
|
42
|
-
}
|
|
43
|
-
static random() {
|
|
44
|
-
return new XyoAccount();
|
|
45
|
-
}
|
|
46
|
-
static isXyoWallet(value) {
|
|
47
|
-
return value._isXyoWallet;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
/** @deprecated use XyoWallet instead */
|
|
51
|
-
export class XyoAddress extends XyoAccount {
|
|
52
|
-
get previousHashString() {
|
|
53
|
-
return this.previousHash?.hex;
|
|
54
|
-
}
|
|
55
|
-
static fromPhrase(phrase) {
|
|
56
|
-
return XyoAccount.fromPhrase(phrase);
|
|
57
|
-
}
|
|
58
|
-
static fromPrivateKey(key) {
|
|
59
|
-
return XyoAccount.fromPrivateKey(key);
|
|
60
|
-
}
|
|
61
|
-
static random() {
|
|
62
|
-
return XyoAccount.random();
|
|
63
|
-
}
|
|
64
|
-
static verifyAddress(msg, signature, address) {
|
|
65
|
-
return new XyoPublicKey(address).verify(msg, signature);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
/** @deprecated use XyoAccount instead */
|
|
69
|
-
export class XyoWallet extends XyoAccount {
|
|
70
|
-
}
|
|
1
|
+
import shajs from 'sha.js';
|
|
2
|
+
import { toUint8Array, XyoData, XyoKeyPair, XyoPublicKey } from './Key';
|
|
3
|
+
export const ethMessagePrefix = '\x19Ethereum Signed Message:\n';
|
|
4
|
+
export class XyoAccount extends XyoKeyPair {
|
|
5
|
+
constructor({ privateKey, phrase } = {}) {
|
|
6
|
+
const privateKeyToUse = privateKey ? toUint8Array(privateKey) : phrase ? toUint8Array(shajs('sha256').update(phrase).digest('hex')) : undefined;
|
|
7
|
+
super(privateKeyToUse);
|
|
8
|
+
this._isXyoWallet = true;
|
|
9
|
+
}
|
|
10
|
+
/** @deprecated use addressValue instead */
|
|
11
|
+
get address() {
|
|
12
|
+
return this.public.address.hex;
|
|
13
|
+
}
|
|
14
|
+
get addressValue() {
|
|
15
|
+
return this.public.address;
|
|
16
|
+
}
|
|
17
|
+
get previousHash() {
|
|
18
|
+
return this._previousHash;
|
|
19
|
+
}
|
|
20
|
+
/** @deprecated use private instead */
|
|
21
|
+
get privateKey() {
|
|
22
|
+
return this.private;
|
|
23
|
+
}
|
|
24
|
+
/** @deprecated use public instead */
|
|
25
|
+
get publicKey() {
|
|
26
|
+
return this.public;
|
|
27
|
+
}
|
|
28
|
+
sign(hash) {
|
|
29
|
+
this._previousHash = new XyoData(32, hash);
|
|
30
|
+
return this.private.sign(hash);
|
|
31
|
+
}
|
|
32
|
+
verify(msg, signature) {
|
|
33
|
+
return this.public.address.verify(msg, signature);
|
|
34
|
+
}
|
|
35
|
+
static fromPhrase(phrase) {
|
|
36
|
+
const privateKey = shajs('sha256').update(phrase).digest('hex');
|
|
37
|
+
return XyoAccount.fromPrivateKey(privateKey);
|
|
38
|
+
}
|
|
39
|
+
static fromPrivateKey(key) {
|
|
40
|
+
const privateKey = toUint8Array(key);
|
|
41
|
+
return new XyoAccount({ privateKey });
|
|
42
|
+
}
|
|
43
|
+
static random() {
|
|
44
|
+
return new XyoAccount();
|
|
45
|
+
}
|
|
46
|
+
static isXyoWallet(value) {
|
|
47
|
+
return value._isXyoWallet;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** @deprecated use XyoWallet instead */
|
|
51
|
+
export class XyoAddress extends XyoAccount {
|
|
52
|
+
get previousHashString() {
|
|
53
|
+
return this.previousHash?.hex;
|
|
54
|
+
}
|
|
55
|
+
static fromPhrase(phrase) {
|
|
56
|
+
return XyoAccount.fromPhrase(phrase);
|
|
57
|
+
}
|
|
58
|
+
static fromPrivateKey(key) {
|
|
59
|
+
return XyoAccount.fromPrivateKey(key);
|
|
60
|
+
}
|
|
61
|
+
static random() {
|
|
62
|
+
return XyoAccount.random();
|
|
63
|
+
}
|
|
64
|
+
static verifyAddress(msg, signature, address) {
|
|
65
|
+
return new XyoPublicKey(address).verify(msg, signature);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/** @deprecated use XyoAccount instead */
|
|
69
|
+
export class XyoWallet extends XyoAccount {
|
|
70
|
+
}
|
|
71
71
|
//# sourceMappingURL=Account.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/// <reference types="bn.js" />
|
|
2
|
-
import { BigNumber, Buffer } from '@xylabs/sdk-js';
|
|
3
|
-
export declare abstract class XyoAbstractData {
|
|
4
|
-
private _isXyoData;
|
|
5
|
-
abstract get hex(): string;
|
|
6
|
-
abstract get buffer(): Buffer;
|
|
7
|
-
abstract get bn(): BigNumber;
|
|
8
|
-
abstract get bytes(): Uint8Array;
|
|
9
|
-
abstract get keccak256(): Buffer;
|
|
10
|
-
get length(): number;
|
|
11
|
-
static isXyoData(value: unknown): boolean;
|
|
12
|
-
}
|
|
1
|
+
/// <reference types="bn.js" />
|
|
2
|
+
import { BigNumber, Buffer } from '@xylabs/sdk-js';
|
|
3
|
+
export declare abstract class XyoAbstractData {
|
|
4
|
+
private _isXyoData;
|
|
5
|
+
abstract get hex(): string;
|
|
6
|
+
abstract get buffer(): Buffer;
|
|
7
|
+
abstract get bn(): BigNumber;
|
|
8
|
+
abstract get bytes(): Uint8Array;
|
|
9
|
+
abstract get keccak256(): Buffer;
|
|
10
|
+
get length(): number;
|
|
11
|
+
static isXyoData(value: unknown): boolean;
|
|
12
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export class XyoAbstractData {
|
|
2
|
-
constructor() {
|
|
3
|
-
this._isXyoData = true;
|
|
4
|
-
}
|
|
5
|
-
get length() {
|
|
6
|
-
return this.bytes.length;
|
|
7
|
-
}
|
|
8
|
-
static isXyoData(value) {
|
|
9
|
-
return value._isXyoData;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
export class XyoAbstractData {
|
|
2
|
+
constructor() {
|
|
3
|
+
this._isXyoData = true;
|
|
4
|
+
}
|
|
5
|
+
get length() {
|
|
6
|
+
return this.bytes.length;
|
|
7
|
+
}
|
|
8
|
+
static isXyoData(value) {
|
|
9
|
+
return value._isXyoData;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
12
|
//# sourceMappingURL=AbstractData.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/// <reference types="bn.js" />
|
|
2
|
-
import { BigNumber, Buffer } from '@xylabs/sdk-js';
|
|
3
|
-
import { XyoAbstractData } from './AbstractData';
|
|
4
|
-
import { XyoDataLike } from './XyoDataLike';
|
|
5
|
-
export declare class XyoData extends XyoAbstractData {
|
|
6
|
-
private _bytes?;
|
|
7
|
-
private _length;
|
|
8
|
-
constructor(length: number, bytes?: XyoDataLike);
|
|
9
|
-
private checkLength;
|
|
10
|
-
get hex(): string;
|
|
11
|
-
get buffer(): Buffer;
|
|
12
|
-
get bn(): BigNumber;
|
|
13
|
-
get bytes(): Uint8Array;
|
|
14
|
-
get keccak256(): Buffer;
|
|
15
|
-
}
|
|
1
|
+
/// <reference types="bn.js" />
|
|
2
|
+
import { BigNumber, Buffer } from '@xylabs/sdk-js';
|
|
3
|
+
import { XyoAbstractData } from './AbstractData';
|
|
4
|
+
import { XyoDataLike } from './XyoDataLike';
|
|
5
|
+
export declare class XyoData extends XyoAbstractData {
|
|
6
|
+
private _bytes?;
|
|
7
|
+
private _length;
|
|
8
|
+
constructor(length: number, bytes?: XyoDataLike);
|
|
9
|
+
private checkLength;
|
|
10
|
+
get hex(): string;
|
|
11
|
+
get buffer(): Buffer;
|
|
12
|
+
get bn(): BigNumber;
|
|
13
|
+
get bytes(): Uint8Array;
|
|
14
|
+
get keccak256(): Buffer;
|
|
15
|
+
}
|