@xyo-network/sdk-protocol 7.0.4
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/LICENSE +165 -0
- package/README.md +85 -0
- package/dist/_pkg/account/neutral/Account.d.ts +38 -0
- package/dist/_pkg/account/neutral/Jwt/base64url.d.ts +5 -0
- package/dist/_pkg/account/neutral/Jwt/createJwt.d.ts +3 -0
- package/dist/_pkg/account/neutral/Jwt/decodeJwt.d.ts +3 -0
- package/dist/_pkg/account/neutral/Jwt/digest.d.ts +4 -0
- package/dist/_pkg/account/neutral/Jwt/index.d.ts +6 -0
- package/dist/_pkg/account/neutral/Jwt/verifyJwt.d.ts +3 -0
- package/dist/_pkg/account/neutral/Key/AddressValue.d.ts +11 -0
- package/dist/_pkg/account/neutral/Key/EllipticKey.d.ts +4 -0
- package/dist/_pkg/account/neutral/Key/PrivateKey.d.ts +14 -0
- package/dist/_pkg/account/neutral/Key/PublicKey.d.ts +14 -0
- package/dist/_pkg/account/neutral/Key/index.d.ts +5 -0
- package/dist/_pkg/account/neutral/index.d.ts +6 -0
- package/dist/_pkg/account/neutral/index.mjs +547 -0
- package/dist/_pkg/account/neutral/lib/index.d.ts +2 -0
- package/dist/_pkg/account/neutral/lib/walletPath/combineWalletPaths.d.ts +2 -0
- package/dist/_pkg/account/neutral/lib/walletPath/formatWalletPath.d.ts +2 -0
- package/dist/_pkg/account/neutral/lib/walletPath/index.d.ts +4 -0
- package/dist/_pkg/account/neutral/lib/walletPath/isValidWalletPath.d.ts +3 -0
- package/dist/_pkg/account/neutral/register.d.ts +2 -0
- package/dist/_pkg/account-model/neutral/Account.d.ts +46 -0
- package/dist/_pkg/account-model/neutral/Algorithm.d.ts +5 -0
- package/dist/_pkg/account-model/neutral/Jwt/constants.d.ts +14 -0
- package/dist/_pkg/account-model/neutral/Jwt/index.d.ts +3 -0
- package/dist/_pkg/account-model/neutral/Jwt/types.d.ts +56 -0
- package/dist/_pkg/account-model/neutral/VerifierRegistry.d.ts +6 -0
- package/dist/_pkg/account-model/neutral/addressTo20Bytes.d.ts +2 -0
- package/dist/_pkg/account-model/neutral/index.d.ts +6 -0
- package/dist/_pkg/account-model/neutral/index.mjs +100 -0
- package/dist/_pkg/address/neutral/XyoAddress.d.ts +38 -0
- package/dist/_pkg/address/neutral/XyoLegacyAddress.d.ts +37 -0
- package/dist/_pkg/address/neutral/XyoQuantAddress.d.ts +33 -0
- package/dist/_pkg/address/neutral/index.d.ts +4 -0
- package/dist/_pkg/address/neutral/index.mjs +75 -0
- package/dist/_pkg/api/neutral/Api/Api.d.ts +8 -0
- package/dist/_pkg/api/neutral/Api/index.d.ts +2 -0
- package/dist/_pkg/api/neutral/Base.d.ts +32 -0
- package/dist/_pkg/api/neutral/Simple.d.ts +22 -0
- package/dist/_pkg/api/neutral/WithArchive.d.ts +4 -0
- package/dist/_pkg/api/neutral/index.d.ts +6 -0
- package/dist/_pkg/api/neutral/index.mjs +187 -0
- package/dist/_pkg/api/neutral/models/ArchivePath.d.ts +4 -0
- package/dist/_pkg/api/neutral/models/index.d.ts +2 -0
- package/dist/_pkg/api/neutral/objToQuery.d.ts +2 -0
- package/dist/_pkg/api-models/neutral/Config.d.ts +25 -0
- package/dist/_pkg/api-models/neutral/Envelope.d.ts +15 -0
- package/dist/_pkg/api-models/neutral/Error.d.ts +5 -0
- package/dist/_pkg/api-models/neutral/Reportable.d.ts +8 -0
- package/dist/_pkg/api-models/neutral/Response.d.ts +8 -0
- package/dist/_pkg/api-models/neutral/Warning.d.ts +2 -0
- package/dist/_pkg/api-models/neutral/index.d.ts +7 -0
- package/dist/_pkg/api-models/neutral/index.mjs +1 -0
- package/dist/_pkg/boundwitness/neutral/builder.d.ts +2 -0
- package/dist/_pkg/boundwitness/neutral/builder.mjs +3 -0
- package/dist/_pkg/boundwitness/neutral/index.d.ts +5 -0
- package/dist/_pkg/boundwitness/neutral/index.mjs +6 -0
- package/dist/_pkg/boundwitness/neutral/model.d.ts +2 -0
- package/dist/_pkg/boundwitness/neutral/model.mjs +3 -0
- package/dist/_pkg/boundwitness/neutral/validator.d.ts +2 -0
- package/dist/_pkg/boundwitness/neutral/validator.mjs +3 -0
- package/dist/_pkg/boundwitness/neutral/wrapper.d.ts +2 -0
- package/dist/_pkg/boundwitness/neutral/wrapper.mjs +3 -0
- package/dist/_pkg/boundwitness-builder/neutral/BoundWitnessBuilder.d.ts +48 -0
- package/dist/_pkg/boundwitness-builder/neutral/GeneratedBoundWitnessFields.d.ts +3 -0
- package/dist/_pkg/boundwitness-builder/neutral/Query/QueryBoundWitnessBuilder.d.ts +9 -0
- package/dist/_pkg/boundwitness-builder/neutral/Query/index.d.ts +2 -0
- package/dist/_pkg/boundwitness-builder/neutral/combinationsByBoundwitness.d.ts +10 -0
- package/dist/_pkg/boundwitness-builder/neutral/index.d.ts +5 -0
- package/dist/_pkg/boundwitness-builder/neutral/index.mjs +311 -0
- package/dist/_pkg/boundwitness-builder/neutral/intraBoundwitnessSchemaCombinations.d.ts +11 -0
- package/dist/_pkg/boundwitness-builder/neutral/uniqueAccounts.d.ts +3 -0
- package/dist/_pkg/boundwitness-builder/neutral/uniqueAddresses.d.ts +3 -0
- package/dist/_pkg/boundwitness-model/neutral/BoundWitness/BoundWitness.d.ts +173 -0
- package/dist/_pkg/boundwitness-model/neutral/BoundWitness/BoundWitnessJsonSchema.d.ts +37 -0
- package/dist/_pkg/boundwitness-model/neutral/BoundWitness/BoundWitnessSchema.d.ts +5 -0
- package/dist/_pkg/boundwitness-model/neutral/BoundWitness/HydratedBoundWitness.d.ts +72 -0
- package/dist/_pkg/boundwitness-model/neutral/BoundWitness/Signatures.d.ts +14 -0
- package/dist/_pkg/boundwitness-model/neutral/BoundWitness/SignedBoundWitness.d.ts +44 -0
- package/dist/_pkg/boundwitness-model/neutral/BoundWitness/UnsignedBoundWitness.d.ts +44 -0
- package/dist/_pkg/boundwitness-model/neutral/BoundWitness/index.d.ts +8 -0
- package/dist/_pkg/boundwitness-model/neutral/QueryBoundWitness.d.ts +150 -0
- package/dist/_pkg/boundwitness-model/neutral/index.d.ts +3 -0
- package/dist/_pkg/boundwitness-model/neutral/index.mjs +131 -0
- package/dist/_pkg/boundwitness-validator/neutral/Validator.d.ts +17 -0
- package/dist/_pkg/boundwitness-validator/neutral/index.d.ts +3 -0
- package/dist/_pkg/boundwitness-validator/neutral/index.mjs +177 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/addresses/addressesContains.d.ts +10 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/addresses/addressesContainsAll.d.ts +10 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/addresses/addressesContainsAny.d.ts +12 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/addresses/index.d.ts +4 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/index.d.ts +4 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/payloadHashes/index.d.ts +4 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/payloadHashes/payloadHashesContains.d.ts +10 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/payloadHashes/payloadHashesContainsAll.d.ts +10 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/payloadHashes/payloadHashesContainsAny.d.ts +12 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/payloadSchemas/index.d.ts +4 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/payloadSchemas/payloadSchemasContains.d.ts +10 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/payloadSchemas/payloadSchemasContainsAll.d.ts +10 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/payloadSchemas/payloadSchemasContainsAny.d.ts +12 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/util/BoundWitnessArrayProperty.d.ts +10 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/util/boundWitnessArrayPropertyContains.d.ts +11 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/util/boundWitnessArrayPropertyContainsAll.d.ts +11 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/util/boundWitnessArrayPropertyContainsAny.d.ts +13 -0
- package/dist/_pkg/boundwitness-validator/neutral/lib/util/index.d.ts +4 -0
- package/dist/_pkg/boundwitness-wrapper/neutral/BoundWitnessWrapper.d.ts +60 -0
- package/dist/_pkg/boundwitness-wrapper/neutral/QueryBoundWitnessWrapper.d.ts +14 -0
- package/dist/_pkg/boundwitness-wrapper/neutral/SchemaType.d.ts +6 -0
- package/dist/_pkg/boundwitness-wrapper/neutral/index.d.ts +4 -0
- package/dist/_pkg/boundwitness-wrapper/neutral/index.mjs +281 -0
- package/dist/_pkg/config-payload-plugin/neutral/Payload.d.ts +44 -0
- package/dist/_pkg/config-payload-plugin/neutral/Plugin.d.ts +7 -0
- package/dist/_pkg/config-payload-plugin/neutral/Schema.d.ts +5 -0
- package/dist/_pkg/config-payload-plugin/neutral/Template.d.ts +3 -0
- package/dist/_pkg/config-payload-plugin/neutral/index.d.ts +5 -0
- package/dist/_pkg/config-payload-plugin/neutral/index.mjs +44 -0
- package/dist/_pkg/core/neutral/index.d.ts +6 -0
- package/dist/_pkg/core/neutral/index.mjs +7 -0
- package/dist/_pkg/core-payload-plugins/neutral/index.d.ts +11 -0
- package/dist/_pkg/core-payload-plugins/neutral/index.mjs +26 -0
- package/dist/_pkg/crypto/neutral/account-model.d.ts +2 -0
- package/dist/_pkg/crypto/neutral/account-model.mjs +3 -0
- package/dist/_pkg/crypto/neutral/account.d.ts +2 -0
- package/dist/_pkg/crypto/neutral/account.mjs +3 -0
- package/dist/_pkg/crypto/neutral/index.d.ts +10 -0
- package/dist/_pkg/crypto/neutral/index.mjs +11 -0
- package/dist/_pkg/crypto/neutral/key-model.d.ts +2 -0
- package/dist/_pkg/crypto/neutral/key-model.mjs +3 -0
- package/dist/_pkg/crypto/neutral/wallet-model.d.ts +2 -0
- package/dist/_pkg/crypto/neutral/wallet-model.mjs +3 -0
- package/dist/_pkg/crypto/neutral/wallet.d.ts +2 -0
- package/dist/_pkg/crypto/neutral/wallet.mjs +3 -0
- package/dist/_pkg/data/neutral/AbstractData.d.ts +16 -0
- package/dist/_pkg/data/neutral/Data.d.ts +13 -0
- package/dist/_pkg/data/neutral/index.d.ts +3 -0
- package/dist/_pkg/data/neutral/index.mjs +53 -0
- package/dist/_pkg/dns/neutral/DnsRecordType.d.ts +16 -0
- package/dist/_pkg/dns/neutral/DnsReturnCode.d.ts +14 -0
- package/dist/_pkg/dns/neutral/GoogleDnsResult.d.ts +17 -0
- package/dist/_pkg/dns/neutral/GoogleDnsResultAnswer.d.ts +8 -0
- package/dist/_pkg/dns/neutral/GoogleDnsResultQuestion.d.ts +11 -0
- package/dist/_pkg/dns/neutral/domainExists.d.ts +8 -0
- package/dist/_pkg/dns/neutral/domainResolve.d.ts +9 -0
- package/dist/_pkg/dns/neutral/googleDnsOverHttps.d.ts +5 -0
- package/dist/_pkg/dns/neutral/index.d.ts +9 -0
- package/dist/_pkg/dns/neutral/index.mjs +61 -0
- package/dist/_pkg/domain-payload-plugin/neutral/DomainConfigPayload.d.ts +219 -0
- package/dist/_pkg/domain-payload-plugin/neutral/DomainConfigPlugin.d.ts +33 -0
- package/dist/_pkg/domain-payload-plugin/neutral/DomainConfigSchema.d.ts +5 -0
- package/dist/_pkg/domain-payload-plugin/neutral/DomainConfigTemplate.d.ts +3 -0
- package/dist/_pkg/domain-payload-plugin/neutral/Payload.d.ts +282 -0
- package/dist/_pkg/domain-payload-plugin/neutral/Plugin.d.ts +33 -0
- package/dist/_pkg/domain-payload-plugin/neutral/Resolution/DomainSchemaResolver.d.ts +45 -0
- package/dist/_pkg/domain-payload-plugin/neutral/Resolution/SchemaResolution.d.ts +27 -0
- package/dist/_pkg/domain-payload-plugin/neutral/Resolution/XyoDnsRecords.d.ts +27 -0
- package/dist/_pkg/domain-payload-plugin/neutral/Resolution/index.d.ts +4 -0
- package/dist/_pkg/domain-payload-plugin/neutral/Schema.d.ts +5 -0
- package/dist/_pkg/domain-payload-plugin/neutral/Template.d.ts +3 -0
- package/dist/_pkg/domain-payload-plugin/neutral/Wrapper.d.ts +278 -0
- package/dist/_pkg/domain-payload-plugin/neutral/index.d.ts +11 -0
- package/dist/_pkg/domain-payload-plugin/neutral/index.mjs +485 -0
- package/dist/_pkg/elliptic/neutral/Elliptic.d.ts +15 -0
- package/dist/_pkg/elliptic/neutral/index.d.ts +2 -0
- package/dist/_pkg/elliptic/neutral/index.mjs +89 -0
- package/dist/_pkg/hash/browser/BrowserObjectHasher.d.ts +9 -0
- package/dist/_pkg/hash/browser/NodeObjectHasher.d.ts +6 -0
- package/dist/_pkg/hash/browser/ObjectHasher.d.ts +69 -0
- package/dist/_pkg/hash/browser/createBrowserWorker.d.ts +3 -0
- package/dist/_pkg/hash/browser/createNodeWorker.d.ts +3 -0
- package/dist/_pkg/hash/browser/hasEmptyFields.d.ts +3 -0
- package/dist/_pkg/hash/browser/index-browser.d.ts +4 -0
- package/dist/_pkg/hash/browser/index-browser.mjs +289 -0
- package/dist/_pkg/hash/browser/index.d.ts +5 -0
- package/dist/_pkg/hash/browser/removeEmptyFields.d.ts +3 -0
- package/dist/_pkg/hash/browser/sortFields.d.ts +3 -0
- package/dist/_pkg/hash/browser/worker/index.d.ts +3 -0
- package/dist/_pkg/hash/browser/worker/subtleHash-bundle.mjs +257 -0
- package/dist/_pkg/hash/browser/worker/subtleHash.d.ts +2 -0
- package/dist/_pkg/hash/browser/worker/subtleHashNode.d.ts +2 -0
- package/dist/_pkg/hash/browser/worker/wasmHash-bundle.mjs +1678 -0
- package/dist/_pkg/hash/browser/worker/wasmHash.d.ts +2 -0
- package/dist/_pkg/hash/browser/worker/wasmHashNode.d.ts +2 -0
- package/dist/_pkg/hash/neutral/BrowserObjectHasher.d.ts +9 -0
- package/dist/_pkg/hash/neutral/NodeObjectHasher.d.ts +6 -0
- package/dist/_pkg/hash/neutral/ObjectHasher.d.ts +69 -0
- package/dist/_pkg/hash/neutral/createBrowserWorker.d.ts +3 -0
- package/dist/_pkg/hash/neutral/createNodeWorker.d.ts +3 -0
- package/dist/_pkg/hash/neutral/hasEmptyFields.d.ts +3 -0
- package/dist/_pkg/hash/neutral/index-browser.d.ts +4 -0
- package/dist/_pkg/hash/neutral/index-browser.mjs +289 -0
- package/dist/_pkg/hash/neutral/index.d.ts +5 -0
- package/dist/_pkg/hash/neutral/removeEmptyFields.d.ts +3 -0
- package/dist/_pkg/hash/neutral/sortFields.d.ts +3 -0
- package/dist/_pkg/hash/neutral/worker/index.d.ts +3 -0
- package/dist/_pkg/hash/neutral/worker/subtleHash.d.ts +2 -0
- package/dist/_pkg/hash/neutral/worker/subtleHashNode.d.ts +2 -0
- package/dist/_pkg/hash/neutral/worker/wasmHash.d.ts +2 -0
- package/dist/_pkg/hash/neutral/worker/wasmHashNode.d.ts +2 -0
- package/dist/_pkg/hash/node/BrowserObjectHasher.d.ts +9 -0
- package/dist/_pkg/hash/node/NodeObjectHasher.d.ts +6 -0
- package/dist/_pkg/hash/node/ObjectHasher.d.ts +69 -0
- package/dist/_pkg/hash/node/createBrowserWorker.d.ts +3 -0
- package/dist/_pkg/hash/node/createNodeWorker.d.ts +3 -0
- package/dist/_pkg/hash/node/hasEmptyFields.d.ts +3 -0
- package/dist/_pkg/hash/node/index-browser.d.ts +4 -0
- package/dist/_pkg/hash/node/index.d.ts +5 -0
- package/dist/_pkg/hash/node/index.mjs +279 -0
- package/dist/_pkg/hash/node/removeEmptyFields.d.ts +3 -0
- package/dist/_pkg/hash/node/sortFields.d.ts +3 -0
- package/dist/_pkg/hash/node/worker/index.d.ts +3 -0
- package/dist/_pkg/hash/node/worker/subtleHash.d.ts +2 -0
- package/dist/_pkg/hash/node/worker/subtleHashNode.d.ts +2 -0
- package/dist/_pkg/hash/node/worker/wasmHash.d.ts +2 -0
- package/dist/_pkg/hash/node/worker/wasmHashNode.d.ts +2 -0
- package/dist/_pkg/huri/neutral/Huri.d.ts +33 -0
- package/dist/_pkg/huri/neutral/index.d.ts +2 -0
- package/dist/_pkg/huri/neutral/index.mjs +118 -0
- package/dist/_pkg/id-payload-plugin/neutral/Payload.d.ts +86 -0
- package/dist/_pkg/id-payload-plugin/neutral/Plugin.d.ts +7 -0
- package/dist/_pkg/id-payload-plugin/neutral/Schema.d.ts +5 -0
- package/dist/_pkg/id-payload-plugin/neutral/Template.d.ts +3 -0
- package/dist/_pkg/id-payload-plugin/neutral/index.d.ts +5 -0
- package/dist/_pkg/id-payload-plugin/neutral/index.mjs +48 -0
- package/dist/_pkg/key-model/neutral/Key/AddressValue.d.ts +10 -0
- package/dist/_pkg/key-model/neutral/Key/EllipticKey.d.ts +4 -0
- package/dist/_pkg/key-model/neutral/Key/PrivateKey.d.ts +15 -0
- package/dist/_pkg/key-model/neutral/Key/PublicKey.d.ts +11 -0
- package/dist/_pkg/key-model/neutral/Key/index.d.ts +4 -0
- package/dist/_pkg/key-model/neutral/index.d.ts +2 -0
- package/dist/_pkg/key-model/neutral/index.mjs +1 -0
- package/dist/_pkg/manifest/neutral/index.d.ts +2 -0
- package/dist/_pkg/manifest/neutral/index.mjs +3 -0
- package/dist/_pkg/manifest-model/neutral/Manifest.d.ts +4 -0
- package/dist/_pkg/manifest-model/neutral/Manifest.zod.d.ts +2619 -0
- package/dist/_pkg/manifest-model/neutral/Payload.d.ts +2 -0
- package/dist/_pkg/manifest-model/neutral/Payload.zod.d.ts +1591 -0
- package/dist/_pkg/manifest-model/neutral/index.d.ts +3 -0
- package/dist/_pkg/manifest-model/neutral/index.mjs +193 -0
- package/dist/_pkg/metamask-connector/browser/MetaMaskConnector.d.ts +38 -0
- package/dist/_pkg/metamask-connector/browser/index.d.ts +2 -0
- package/dist/_pkg/metamask-connector/browser/index.mjs +114 -0
- package/dist/_pkg/network/neutral/NetworkNodePayload.d.ts +79 -0
- package/dist/_pkg/network/neutral/NetworkNodePayloadWrapper.d.ts +17 -0
- package/dist/_pkg/network/neutral/NetworkPayload.d.ts +119 -0
- package/dist/_pkg/network/neutral/NetworkPayloadWrapper.d.ts +63 -0
- package/dist/_pkg/network/neutral/index.d.ts +8 -0
- package/dist/_pkg/network/neutral/index.mjs +211 -0
- package/dist/_pkg/network/neutral/knownArchivists.d.ts +3 -0
- package/dist/_pkg/network/neutral/knownDiviners.d.ts +3 -0
- package/dist/_pkg/network/neutral/knownNetworks.d.ts +3 -0
- package/dist/_pkg/payload/neutral/builder.d.ts +2 -0
- package/dist/_pkg/payload/neutral/builder.mjs +3 -0
- package/dist/_pkg/payload/neutral/index.d.ts +6 -0
- package/dist/_pkg/payload/neutral/index.mjs +7 -0
- package/dist/_pkg/payload/neutral/model.d.ts +2 -0
- package/dist/_pkg/payload/neutral/model.mjs +3 -0
- package/dist/_pkg/payload/neutral/validator.d.ts +2 -0
- package/dist/_pkg/payload/neutral/validator.mjs +3 -0
- package/dist/_pkg/payload/neutral/wrapper.d.ts +2 -0
- package/dist/_pkg/payload/neutral/wrapper.mjs +3 -0
- package/dist/_pkg/payload-builder/neutral/Builder.d.ts +70 -0
- package/dist/_pkg/payload-builder/neutral/Options.d.ts +7 -0
- package/dist/_pkg/payload-builder/neutral/index.d.ts +3 -0
- package/dist/_pkg/payload-builder/neutral/index.mjs +218 -0
- package/dist/_pkg/payload-model/neutral/Error.d.ts +65 -0
- package/dist/_pkg/payload-model/neutral/Payload.d.ts +35 -0
- package/dist/_pkg/payload-model/neutral/PayloadBundle.d.ts +72 -0
- package/dist/_pkg/payload-model/neutral/PayloadFindFilter.d.ts +6 -0
- package/dist/_pkg/payload-model/neutral/PayloadHashMap.d.ts +7 -0
- package/dist/_pkg/payload-model/neutral/PayloadSet/PayloadSetPayload.d.ts +54 -0
- package/dist/_pkg/payload-model/neutral/PayloadSet/PayloadSetSchema.d.ts +5 -0
- package/dist/_pkg/payload-model/neutral/PayloadSet/index.d.ts +3 -0
- package/dist/_pkg/payload-model/neutral/PayloadValidationFunction.d.ts +14 -0
- package/dist/_pkg/payload-model/neutral/PayloadValueExpression.d.ts +38 -0
- package/dist/_pkg/payload-model/neutral/PayloadZod.d.ts +173 -0
- package/dist/_pkg/payload-model/neutral/Query.d.ts +21 -0
- package/dist/_pkg/payload-model/neutral/Schema.d.ts +38 -0
- package/dist/_pkg/payload-model/neutral/StorageMeta/DataHash.d.ts +24 -0
- package/dist/_pkg/payload-model/neutral/StorageMeta/Hash.d.ts +25 -0
- package/dist/_pkg/payload-model/neutral/StorageMeta/Sequence.d.ts +11 -0
- package/dist/_pkg/payload-model/neutral/StorageMeta/index.d.ts +3 -0
- package/dist/_pkg/payload-model/neutral/StorageMeta/sequence/Comparer.d.ts +7 -0
- package/dist/_pkg/payload-model/neutral/StorageMeta/sequence/Parser.d.ts +31 -0
- package/dist/_pkg/payload-model/neutral/StorageMeta/sequence/Sequence.d.ts +80 -0
- package/dist/_pkg/payload-model/neutral/StorageMeta/sequence/SequenceZod.d.ts +9 -0
- package/dist/_pkg/payload-model/neutral/StorageMeta/sequence/index.d.ts +5 -0
- package/dist/_pkg/payload-model/neutral/Timestamp.d.ts +8 -0
- package/dist/_pkg/payload-model/neutral/index.d.ts +16 -0
- package/dist/_pkg/payload-model/neutral/index.mjs +452 -0
- package/dist/_pkg/payload-model/neutral/isPayloadOfSchemaType.d.ts +5 -0
- package/dist/_pkg/payload-model/neutral/isPayloadOfZodType.d.ts +12 -0
- package/dist/_pkg/payload-plugin/neutral/Plugin.d.ts +19 -0
- package/dist/_pkg/payload-plugin/neutral/Resolver.d.ts +26 -0
- package/dist/_pkg/payload-plugin/neutral/createPlugin.d.ts +5 -0
- package/dist/_pkg/payload-plugin/neutral/index.d.ts +4 -0
- package/dist/_pkg/payload-plugin/neutral/index.mjs +67 -0
- package/dist/_pkg/payload-validator/neutral/Validator.d.ts +18 -0
- package/dist/_pkg/payload-validator/neutral/index.d.ts +2 -0
- package/dist/_pkg/payload-validator/neutral/index.mjs +40 -0
- package/dist/_pkg/payload-wrapper/neutral/PayloadDataWrapper.d.ts +18 -0
- package/dist/_pkg/payload-wrapper/neutral/PayloadWrapper.d.ts +6 -0
- package/dist/_pkg/payload-wrapper/neutral/PayloadWrapperBase.d.ts +23 -0
- package/dist/_pkg/payload-wrapper/neutral/SchemaType.d.ts +6 -0
- package/dist/_pkg/payload-wrapper/neutral/index.d.ts +4 -0
- package/dist/_pkg/payload-wrapper/neutral/index.mjs +157 -0
- package/dist/_pkg/pqc/neutral/MlDsa.d.ts +20 -0
- package/dist/_pkg/pqc/neutral/index.d.ts +2 -0
- package/dist/_pkg/pqc/neutral/index.mjs +47 -0
- package/dist/_pkg/previous-hash-store/neutral/index.d.ts +4 -0
- package/dist/_pkg/previous-hash-store/neutral/index.mjs +5 -0
- package/dist/_pkg/previous-hash-store-indexeddb/neutral/IndexedDbPreviousHashStore.d.ts +27 -0
- package/dist/_pkg/previous-hash-store-indexeddb/neutral/index.d.ts +2 -0
- package/dist/_pkg/previous-hash-store-indexeddb/neutral/index.mjs +42 -0
- package/dist/_pkg/previous-hash-store-model/neutral/PreviousHashStore.d.ts +8 -0
- package/dist/_pkg/previous-hash-store-model/neutral/index.d.ts +2 -0
- package/dist/_pkg/previous-hash-store-model/neutral/index.mjs +1 -0
- package/dist/_pkg/previous-hash-store-storage/neutral/NamespacedStorage.d.ts +10 -0
- package/dist/_pkg/previous-hash-store-storage/neutral/StoragePreviousHashStore.d.ts +24 -0
- package/dist/_pkg/previous-hash-store-storage/neutral/index.d.ts +3 -0
- package/dist/_pkg/previous-hash-store-storage/neutral/index.mjs +104 -0
- package/dist/_pkg/protocol/neutral/index.d.ts +5 -0
- package/dist/_pkg/protocol/neutral/index.mjs +6 -0
- package/dist/_pkg/quadkey/neutral/Quadkey.d.ts +65 -0
- package/dist/_pkg/quadkey/neutral/RelativeDirectionConstantLookup.d.ts +2 -0
- package/dist/_pkg/quadkey/neutral/index.d.ts +2 -0
- package/dist/_pkg/quadkey/neutral/index.mjs +281 -0
- package/dist/_pkg/quant-account/neutral/QuantAccount.d.ts +34 -0
- package/dist/_pkg/quant-account/neutral/index.d.ts +3 -0
- package/dist/_pkg/quant-account/neutral/index.mjs +173 -0
- package/dist/_pkg/quant-account/neutral/register.d.ts +2 -0
- package/dist/_pkg/query-payload-plugin/neutral/Payload.d.ts +43 -0
- package/dist/_pkg/query-payload-plugin/neutral/Plugin.d.ts +7 -0
- package/dist/_pkg/query-payload-plugin/neutral/Schema.d.ts +5 -0
- package/dist/_pkg/query-payload-plugin/neutral/Template.d.ts +3 -0
- package/dist/_pkg/query-payload-plugin/neutral/index.d.ts +5 -0
- package/dist/_pkg/query-payload-plugin/neutral/index.mjs +44 -0
- package/dist/_pkg/schema-cache/neutral/Debounce.d.ts +5 -0
- package/dist/_pkg/schema-cache/neutral/SchemaCache.d.ts +43 -0
- package/dist/_pkg/schema-cache/neutral/SchemaNameToValidatorMap.d.ts +12 -0
- package/dist/_pkg/schema-cache/neutral/TtlLruCache.d.ts +13 -0
- package/dist/_pkg/schema-cache/neutral/index.d.ts +5 -0
- package/dist/_pkg/schema-cache/neutral/index.mjs +178 -0
- package/dist/_pkg/schema-name-validator/neutral/SchemaNameValidator.d.ts +43 -0
- package/dist/_pkg/schema-name-validator/neutral/index.d.ts +2 -0
- package/dist/_pkg/schema-name-validator/neutral/index.mjs +69 -0
- package/dist/_pkg/schema-payload-plugin/neutral/Payload.d.ts +96 -0
- package/dist/_pkg/schema-payload-plugin/neutral/Plugin.d.ts +13 -0
- package/dist/_pkg/schema-payload-plugin/neutral/Schema.d.ts +5 -0
- package/dist/_pkg/schema-payload-plugin/neutral/Template.d.ts +3 -0
- package/dist/_pkg/schema-payload-plugin/neutral/index.d.ts +5 -0
- package/dist/_pkg/schema-payload-plugin/neutral/index.mjs +60 -0
- package/dist/_pkg/sdk-utils/neutral/api.d.ts +5 -0
- package/dist/_pkg/sdk-utils/neutral/api.mjs +6 -0
- package/dist/_pkg/sdk-utils/neutral/index.d.ts +9 -0
- package/dist/_pkg/sdk-utils/neutral/index.mjs +10 -0
- package/dist/_pkg/sdk-utils/neutral/integrations.d.ts +3 -0
- package/dist/_pkg/sdk-utils/neutral/integrations.mjs +4 -0
- package/dist/_pkg/sdk-utils/neutral/plugins.d.ts +2 -0
- package/dist/_pkg/sdk-utils/neutral/plugins.mjs +3 -0
- package/dist/_pkg/sdk-utils/neutral/validation.d.ts +2 -0
- package/dist/_pkg/sdk-utils/neutral/validation.mjs +3 -0
- package/dist/_pkg/value-payload-plugin/neutral/Payload.d.ts +46 -0
- package/dist/_pkg/value-payload-plugin/neutral/Plugin.d.ts +3 -0
- package/dist/_pkg/value-payload-plugin/neutral/Schema.d.ts +5 -0
- package/dist/_pkg/value-payload-plugin/neutral/Template.d.ts +3 -0
- package/dist/_pkg/value-payload-plugin/neutral/index.d.ts +5 -0
- package/dist/_pkg/value-payload-plugin/neutral/index.mjs +44 -0
- package/dist/_pkg/wallet/neutral/HDWallet.d.ts +38 -0
- package/dist/_pkg/wallet/neutral/index.d.ts +2 -0
- package/dist/_pkg/wallet/neutral/index.mjs +157 -0
- package/dist/_pkg/wallet-model/neutral/Mnemonic.d.ts +27 -0
- package/dist/_pkg/wallet-model/neutral/Wallet.d.ts +26 -0
- package/dist/_pkg/wallet-model/neutral/Wordlist.d.ts +24 -0
- package/dist/_pkg/wallet-model/neutral/index.d.ts +2 -0
- package/dist/_pkg/wallet-model/neutral/index.mjs +1 -0
- package/dist/_pkg/wasm/neutral/WasmSupport.d.ts +110 -0
- package/dist/_pkg/wasm/neutral/index.d.ts +2 -0
- package/dist/_pkg/wasm/neutral/index.mjs +178 -0
- package/dist/_pkg/wasm/neutral/wasmFeatureDetect.d.ts +16 -0
- package/dist/neutral/core-payload-plugins.d.ts +1 -0
- package/dist/neutral/core-payload-plugins.mjs +1 -0
- package/dist/neutral/index.d.ts +4 -0
- package/dist/neutral/index.mjs +4 -0
- package/dist/neutral/manifest.d.ts +1 -0
- package/dist/neutral/manifest.mjs +1 -0
- package/dist/neutral/protocol.d.ts +1 -0
- package/dist/neutral/protocol.mjs +1 -0
- package/dist/neutral/sdk-utils.d.ts +1 -0
- package/dist/neutral/sdk-utils.mjs +1 -0
- package/package.json +113 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// src/Payload.ts
|
|
2
|
+
import {
|
|
3
|
+
zodAsFactory,
|
|
4
|
+
zodIsFactory,
|
|
5
|
+
zodToFactory
|
|
6
|
+
} from "@xylabs/sdk";
|
|
7
|
+
import { isPayloadOfSchemaTypeWithSources, PayloadZodOfSchema } from "../../payload-model/neutral/index.mjs";
|
|
8
|
+
import * as z from "zod/mini";
|
|
9
|
+
|
|
10
|
+
// src/Schema.ts
|
|
11
|
+
import { asSchema } from "../../payload-model/neutral/index.mjs";
|
|
12
|
+
var SchemaSchema = asSchema("network.xyo.schema", true);
|
|
13
|
+
|
|
14
|
+
// src/Payload.ts
|
|
15
|
+
var optionalStringZod = z.optional(z.string());
|
|
16
|
+
var schemaDefinitionZod = z.looseObject({ $id: optionalStringZod });
|
|
17
|
+
var SchemaPayloadZod = z.extend(PayloadZodOfSchema(SchemaSchema), {
|
|
18
|
+
/** The schema definition body (JSON Schema); `$id`, when present, identifies the schema */
|
|
19
|
+
definition: schemaDefinitionZod,
|
|
20
|
+
/** The schema this schema extends (if any) */
|
|
21
|
+
extends: z.optional(z.string()),
|
|
22
|
+
/** @deprecated use definition.$id instead */
|
|
23
|
+
name: z.optional(z.string()),
|
|
24
|
+
/** The version of the schema major * 1,000,000 + minor * 1,000 + patch */
|
|
25
|
+
version: z.optional(z.number())
|
|
26
|
+
});
|
|
27
|
+
var isSchemaPayload = zodIsFactory(SchemaPayloadZod);
|
|
28
|
+
var asSchemaPayload = zodAsFactory(SchemaPayloadZod, "asSchemaPayload");
|
|
29
|
+
var toSchemaPayload = zodToFactory(SchemaPayloadZod, "toSchemaPayload");
|
|
30
|
+
var isSchemaPayloadWithSources = isPayloadOfSchemaTypeWithSources(SchemaSchema);
|
|
31
|
+
|
|
32
|
+
// src/Plugin.ts
|
|
33
|
+
import { createPayloadPlugin } from "../../payload-plugin/neutral/index.mjs";
|
|
34
|
+
|
|
35
|
+
// src/Template.ts
|
|
36
|
+
var schemaPayloadTemplate = () => ({
|
|
37
|
+
definition: {
|
|
38
|
+
$id: "",
|
|
39
|
+
$schema: "http://json-schema.org/draft-07/schema#"
|
|
40
|
+
},
|
|
41
|
+
schema: SchemaSchema
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// src/Plugin.ts
|
|
45
|
+
var SchemaPayloadPlugin = () => createPayloadPlugin({
|
|
46
|
+
schema: SchemaSchema,
|
|
47
|
+
template: schemaPayloadTemplate
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
SchemaPayloadPlugin,
|
|
51
|
+
SchemaPayloadZod,
|
|
52
|
+
SchemaSchema,
|
|
53
|
+
asSchemaPayload,
|
|
54
|
+
SchemaPayloadPlugin as default,
|
|
55
|
+
isSchemaPayload,
|
|
56
|
+
isSchemaPayloadWithSources,
|
|
57
|
+
schemaPayloadTemplate,
|
|
58
|
+
toSchemaPayload
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from '../../api/neutral/index.ts';
|
|
2
|
+
export * from '../../api-models/neutral/index.ts';
|
|
3
|
+
export * from '../../dns/neutral/index.ts';
|
|
4
|
+
export * from '../../metamask-connector/browser/index.ts';
|
|
5
|
+
export * from '../../network/neutral/index.ts';
|
|
6
|
+
export * from '../../payload-plugin/neutral/index.ts';
|
|
7
|
+
export * from '../../quadkey/neutral/index.ts';
|
|
8
|
+
export * from '../../schema-cache/neutral/index.ts';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
export * from "../../api/neutral/index.mjs";
|
|
3
|
+
export * from "../../api-models/neutral/index.mjs";
|
|
4
|
+
export * from "../../dns/neutral/index.mjs";
|
|
5
|
+
export * from "../../metamask-connector/browser/index.mjs";
|
|
6
|
+
export * from "../../network/neutral/index.mjs";
|
|
7
|
+
export * from "../../payload-plugin/neutral/index.mjs";
|
|
8
|
+
export * from "../../quadkey/neutral/index.mjs";
|
|
9
|
+
export * from "../../schema-cache/neutral/index.mjs";
|
|
10
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { JsonValue } from '@xylabs/sdk';
|
|
2
|
+
import * as z from 'zod/mini';
|
|
3
|
+
export declare const ValuePayloadZod: z.ZodMiniObject<{
|
|
4
|
+
schema: z.ZodMiniLiteral<"network.xyo.value" & {
|
|
5
|
+
readonly __schema: true;
|
|
6
|
+
}>;
|
|
7
|
+
value: z.ZodMiniCustom<unknown, unknown>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type Value<T extends JsonValue = JsonValue> = z.infer<typeof ValuePayloadZod> & {
|
|
10
|
+
value: T;
|
|
11
|
+
};
|
|
12
|
+
export declare const isValuePayload: <T>(value: T) => value is T & {
|
|
13
|
+
schema: "network.xyo.value" & {
|
|
14
|
+
readonly __schema: true;
|
|
15
|
+
};
|
|
16
|
+
value: unknown;
|
|
17
|
+
};
|
|
18
|
+
export declare const asValuePayload: {
|
|
19
|
+
<T>(value: T): (T & {
|
|
20
|
+
schema: "network.xyo.value" & {
|
|
21
|
+
readonly __schema: true;
|
|
22
|
+
};
|
|
23
|
+
value: unknown;
|
|
24
|
+
}) | undefined;
|
|
25
|
+
<T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & {
|
|
26
|
+
schema: "network.xyo.value" & {
|
|
27
|
+
readonly __schema: true;
|
|
28
|
+
};
|
|
29
|
+
value: unknown;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export declare const toValuePayload: {
|
|
33
|
+
<T>(value: T): (T & {
|
|
34
|
+
schema: "network.xyo.value" & {
|
|
35
|
+
readonly __schema: true;
|
|
36
|
+
};
|
|
37
|
+
value: unknown;
|
|
38
|
+
}) | undefined;
|
|
39
|
+
<T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & {
|
|
40
|
+
schema: "network.xyo.value" & {
|
|
41
|
+
readonly __schema: true;
|
|
42
|
+
};
|
|
43
|
+
value: unknown;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=Payload.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// src/Payload.ts
|
|
2
|
+
import {
|
|
3
|
+
zodAsFactory,
|
|
4
|
+
zodIsFactory,
|
|
5
|
+
zodToFactory
|
|
6
|
+
} from "@xylabs/sdk";
|
|
7
|
+
import { PayloadZodOfSchema } from "../../payload-model/neutral/index.mjs";
|
|
8
|
+
import * as z from "zod/mini";
|
|
9
|
+
|
|
10
|
+
// src/Schema.ts
|
|
11
|
+
import { asSchema } from "../../payload-model/neutral/index.mjs";
|
|
12
|
+
var ValueSchema = asSchema("network.xyo.value", true);
|
|
13
|
+
|
|
14
|
+
// src/Payload.ts
|
|
15
|
+
var ValuePayloadZod = z.extend(PayloadZodOfSchema(ValueSchema), { value: z.custom() });
|
|
16
|
+
var isValuePayload = zodIsFactory(ValuePayloadZod);
|
|
17
|
+
var asValuePayload = zodAsFactory(ValuePayloadZod, "asValuePayload");
|
|
18
|
+
var toValuePayload = zodToFactory(ValuePayloadZod, "toValuePayload");
|
|
19
|
+
|
|
20
|
+
// src/Plugin.ts
|
|
21
|
+
import { createPayloadPlugin } from "../../payload-plugin/neutral/index.mjs";
|
|
22
|
+
|
|
23
|
+
// src/Template.ts
|
|
24
|
+
var valuePayloadTemplate = () => ({
|
|
25
|
+
schema: ValueSchema,
|
|
26
|
+
value: null
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// src/Plugin.ts
|
|
30
|
+
var ValuePayloadPlugin = () => createPayloadPlugin({
|
|
31
|
+
schema: ValueSchema,
|
|
32
|
+
template: valuePayloadTemplate
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
ValuePayloadPlugin,
|
|
36
|
+
ValuePayloadZod,
|
|
37
|
+
ValueSchema,
|
|
38
|
+
asValuePayload,
|
|
39
|
+
ValuePayloadPlugin as default,
|
|
40
|
+
isValuePayload,
|
|
41
|
+
toValuePayload,
|
|
42
|
+
valuePayloadTemplate
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Hex } from '@xylabs/sdk';
|
|
2
|
+
import { Account } from '../../account/neutral/index.ts';
|
|
3
|
+
import type { AccountConfig } from '../../account-model/neutral/index.ts';
|
|
4
|
+
import type { XyoAddress } from '../../address/neutral/index.ts';
|
|
5
|
+
import type { PrivateKeyInstance } from '../../key-model/neutral/index.ts';
|
|
6
|
+
import type { WalletInstance } from '../../wallet-model/neutral/index.ts';
|
|
7
|
+
import { HDNodeWallet, Mnemonic } from 'ethers';
|
|
8
|
+
export declare class HDWallet extends Account implements WalletInstance {
|
|
9
|
+
static readonly uniqueName: string;
|
|
10
|
+
protected static _addressMap: Record<XyoAddress, WeakRef<WalletInstance>>;
|
|
11
|
+
protected readonly node: HDNodeWallet;
|
|
12
|
+
neuter: () => HDWallet;
|
|
13
|
+
constructor(key: symbol, node: HDNodeWallet, privateKey: PrivateKeyInstance);
|
|
14
|
+
protected static createFromNodeInternal(node: HDNodeWallet, previousHash?: string): Promise<WalletInstance>;
|
|
15
|
+
protected static getCachedWalletOrCacheNewWallet(createdWallet: WalletInstance): WalletInstance;
|
|
16
|
+
static create(opts?: AccountConfig): Promise<WalletInstance>;
|
|
17
|
+
static createFromNode(node: HDNodeWallet, previousHash?: string): Promise<WalletInstance>;
|
|
18
|
+
static fromExtendedKey(key: string): Promise<WalletInstance>;
|
|
19
|
+
static fromMnemonic(mnemonic: Mnemonic, path?: string): Promise<WalletInstance>;
|
|
20
|
+
static fromPhrase(phrase: string, path?: string): Promise<WalletInstance>;
|
|
21
|
+
static fromSeed(seed: string | ArrayBufferLike): Promise<WalletInstance>;
|
|
22
|
+
static generateMnemonic(wordlist?: string[], strength?: number): string;
|
|
23
|
+
static random(): Promise<WalletInstance>;
|
|
24
|
+
get address(): XyoAddress;
|
|
25
|
+
get addressBytes(): ArrayBufferLike;
|
|
26
|
+
get chainCode(): string;
|
|
27
|
+
get depth(): number;
|
|
28
|
+
get extendedKey(): string;
|
|
29
|
+
get fingerprint(): string;
|
|
30
|
+
get index(): number;
|
|
31
|
+
get mnemonic(): Mnemonic | null;
|
|
32
|
+
get parentFingerprint(): string;
|
|
33
|
+
get path(): string | null;
|
|
34
|
+
get privateKey(): Hex;
|
|
35
|
+
get publicKey(): Hex;
|
|
36
|
+
derivePath(path: string): Promise<WalletInstance>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=HDWallet.d.ts.map
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
5
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
6
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7
|
+
if (decorator = decorators[i])
|
|
8
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9
|
+
if (kind && result) __defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
13
|
+
|
|
14
|
+
// src/HDWallet.ts
|
|
15
|
+
import { generateMnemonic } from "@scure/bip39";
|
|
16
|
+
import { wordlist as englishWordlist } from "@scure/bip39/wordlists/english.js";
|
|
17
|
+
import {
|
|
18
|
+
asAddress,
|
|
19
|
+
assertEx,
|
|
20
|
+
globallyUnique,
|
|
21
|
+
hexFromHexString,
|
|
22
|
+
staticImplements,
|
|
23
|
+
toUint8Array
|
|
24
|
+
} from "@xylabs/sdk";
|
|
25
|
+
import { Account, PrivateKey } from "../../account/neutral/index.mjs";
|
|
26
|
+
import {
|
|
27
|
+
isMnemonicInitializationConfig,
|
|
28
|
+
isPhraseInitializationConfig,
|
|
29
|
+
isPrivateKeyInitializationConfig
|
|
30
|
+
} from "../../account-model/neutral/index.mjs";
|
|
31
|
+
import {
|
|
32
|
+
defaultPath,
|
|
33
|
+
HDNodeWallet,
|
|
34
|
+
Mnemonic
|
|
35
|
+
} from "ethers";
|
|
36
|
+
var HDWallet = class extends Account {
|
|
37
|
+
node;
|
|
38
|
+
neuter = () => {
|
|
39
|
+
this.node.neuter();
|
|
40
|
+
return this;
|
|
41
|
+
};
|
|
42
|
+
constructor(key, node, privateKey) {
|
|
43
|
+
super(key, privateKey);
|
|
44
|
+
this.node = node;
|
|
45
|
+
}
|
|
46
|
+
static async createFromNodeInternal(node, previousHash) {
|
|
47
|
+
const privateKey = toUint8Array(node.privateKey.replace("0x", ""));
|
|
48
|
+
assertEx(privateKey.length === 32, () => `Private key must be 32 bytes [${privateKey?.length}]`);
|
|
49
|
+
const key = await PrivateKey.create(privateKey.buffer);
|
|
50
|
+
const wallet = new HDWallet(super._protectedConstructorKey, node, key);
|
|
51
|
+
const newWallet = await wallet.loadPreviousHash(previousHash);
|
|
52
|
+
return this._addressMap[newWallet.address]?.deref() ?? newWallet;
|
|
53
|
+
}
|
|
54
|
+
static getCachedWalletOrCacheNewWallet(createdWallet) {
|
|
55
|
+
const existingWallet = this._addressMap[createdWallet.address]?.deref();
|
|
56
|
+
if (existingWallet) {
|
|
57
|
+
return existingWallet;
|
|
58
|
+
}
|
|
59
|
+
const ref = new WeakRef(createdWallet);
|
|
60
|
+
this._addressMap[createdWallet.address] = ref;
|
|
61
|
+
return createdWallet;
|
|
62
|
+
}
|
|
63
|
+
static async create(opts) {
|
|
64
|
+
if (isPhraseInitializationConfig(opts)) {
|
|
65
|
+
return await this.fromPhrase(opts.phrase);
|
|
66
|
+
}
|
|
67
|
+
if (isMnemonicInitializationConfig(opts)) {
|
|
68
|
+
return await this.fromPhrase(opts.mnemonic, opts.path);
|
|
69
|
+
}
|
|
70
|
+
if (isPrivateKeyInitializationConfig(opts)) {
|
|
71
|
+
throw new Error("Invalid initialization config. from privateKey not supported. Use Account.fromPrivateKey instead.");
|
|
72
|
+
}
|
|
73
|
+
throw new Error("Invalid initialization config");
|
|
74
|
+
}
|
|
75
|
+
static async createFromNode(node, previousHash) {
|
|
76
|
+
return await this.createFromNodeInternal(node, previousHash);
|
|
77
|
+
}
|
|
78
|
+
static async fromExtendedKey(key) {
|
|
79
|
+
const node = HDNodeWallet.fromExtendedKey(key);
|
|
80
|
+
return await this.createFromNode(node);
|
|
81
|
+
}
|
|
82
|
+
static async fromMnemonic(mnemonic, path = defaultPath) {
|
|
83
|
+
const node = HDNodeWallet.fromMnemonic(mnemonic, path);
|
|
84
|
+
const createdWallet = await this.createFromNodeInternal(node);
|
|
85
|
+
return this.getCachedWalletOrCacheNewWallet(createdWallet);
|
|
86
|
+
}
|
|
87
|
+
static async fromPhrase(phrase, path = defaultPath) {
|
|
88
|
+
return await this.fromMnemonic(Mnemonic.fromPhrase(phrase), path);
|
|
89
|
+
}
|
|
90
|
+
static async fromSeed(seed) {
|
|
91
|
+
const node = HDNodeWallet.fromSeed(toUint8Array(seed));
|
|
92
|
+
const createdWallet = await this.createFromNodeInternal(node);
|
|
93
|
+
return this.getCachedWalletOrCacheNewWallet(createdWallet);
|
|
94
|
+
}
|
|
95
|
+
static generateMnemonic(wordlist = englishWordlist, strength = 256) {
|
|
96
|
+
return generateMnemonic(wordlist, strength);
|
|
97
|
+
}
|
|
98
|
+
static async random() {
|
|
99
|
+
return await this.fromMnemonic(Mnemonic.fromPhrase(this.generateMnemonic()));
|
|
100
|
+
}
|
|
101
|
+
get address() {
|
|
102
|
+
return asAddress(hexFromHexString(this.node.address, { prefix: false }), true);
|
|
103
|
+
}
|
|
104
|
+
get addressBytes() {
|
|
105
|
+
return toUint8Array(this.address, void 0, 16).buffer;
|
|
106
|
+
}
|
|
107
|
+
get chainCode() {
|
|
108
|
+
return this.node.chainCode;
|
|
109
|
+
}
|
|
110
|
+
get depth() {
|
|
111
|
+
return this.node.depth;
|
|
112
|
+
}
|
|
113
|
+
get extendedKey() {
|
|
114
|
+
return this.node.extendedKey;
|
|
115
|
+
}
|
|
116
|
+
get fingerprint() {
|
|
117
|
+
return this.node.fingerprint;
|
|
118
|
+
}
|
|
119
|
+
get index() {
|
|
120
|
+
return this.node.index;
|
|
121
|
+
}
|
|
122
|
+
get mnemonic() {
|
|
123
|
+
return this.node.mnemonic;
|
|
124
|
+
}
|
|
125
|
+
get parentFingerprint() {
|
|
126
|
+
return this.node.parentFingerprint;
|
|
127
|
+
}
|
|
128
|
+
get path() {
|
|
129
|
+
return this.node.path;
|
|
130
|
+
}
|
|
131
|
+
get privateKey() {
|
|
132
|
+
return this.node.privateKey.toLowerCase();
|
|
133
|
+
}
|
|
134
|
+
get publicKey() {
|
|
135
|
+
return this.node.publicKey.toLowerCase();
|
|
136
|
+
}
|
|
137
|
+
async derivePath(path) {
|
|
138
|
+
if (path.startsWith("m/")) {
|
|
139
|
+
const parentPath = this.path;
|
|
140
|
+
if (parentPath !== null && path.startsWith(parentPath)) {
|
|
141
|
+
const childPath = path.slice(parentPath.length + 1);
|
|
142
|
+
return await HDWallet.createFromNode(this.node.derivePath(childPath));
|
|
143
|
+
}
|
|
144
|
+
throw new Error(`Invalid absolute path ${path} for wallet with path ${parentPath}`);
|
|
145
|
+
}
|
|
146
|
+
return await HDWallet.createFromNode(this.node.derivePath(path));
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
__publicField(HDWallet, "uniqueName", globallyUnique("HDWallet", HDWallet, "xyo"));
|
|
150
|
+
__publicField(HDWallet, "_addressMap", {});
|
|
151
|
+
HDWallet = __decorateClass([
|
|
152
|
+
staticImplements()
|
|
153
|
+
], HDWallet);
|
|
154
|
+
export {
|
|
155
|
+
HDWallet
|
|
156
|
+
};
|
|
157
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { WordlistInstance } from './Wordlist.ts';
|
|
2
|
+
export interface MnemonicInstance {
|
|
3
|
+
/**
|
|
4
|
+
* The underlying entropy which the mnemonic encodes.
|
|
5
|
+
*/
|
|
6
|
+
entropy: string;
|
|
7
|
+
/**
|
|
8
|
+
* The password used for this mnemonic. If no password is used this
|
|
9
|
+
* is the empty string (i.e. ``""``) as per the specification.
|
|
10
|
+
*/
|
|
11
|
+
password: string;
|
|
12
|
+
/**
|
|
13
|
+
* The mnemonic phrase of 12, 15, 18, 21 or 24 words.
|
|
14
|
+
*
|
|
15
|
+
* Use the [[wordlist]] ``split`` method to get the individual words.
|
|
16
|
+
*/
|
|
17
|
+
phrase: string;
|
|
18
|
+
/**
|
|
19
|
+
* The wordlist for this mnemonic.
|
|
20
|
+
*/
|
|
21
|
+
wordlist: WordlistInstance;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the seed for the mnemonic.
|
|
24
|
+
*/
|
|
25
|
+
computeSeed(): string;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=Mnemonic.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Hex } from '@xylabs/sdk';
|
|
2
|
+
import type { AccountConfig, AccountInstance, AccountStatic } from '../../account-model/neutral/index.ts';
|
|
3
|
+
import type { MnemonicInstance } from './Mnemonic.ts';
|
|
4
|
+
export interface WalletInstance extends AccountInstance {
|
|
5
|
+
readonly chainCode: string;
|
|
6
|
+
readonly depth: number;
|
|
7
|
+
readonly derivePath: (path: string) => Promise<WalletInstance>;
|
|
8
|
+
readonly extendedKey: string;
|
|
9
|
+
readonly fingerprint: string;
|
|
10
|
+
readonly index: number;
|
|
11
|
+
readonly mnemonic?: MnemonicInstance | null;
|
|
12
|
+
readonly neuter: () => WalletInstance;
|
|
13
|
+
readonly parentFingerprint: string;
|
|
14
|
+
readonly path: string | null;
|
|
15
|
+
readonly privateKey: Hex;
|
|
16
|
+
readonly publicKey: Hex;
|
|
17
|
+
}
|
|
18
|
+
export interface WalletStatic<T extends WalletInstance = WalletInstance> extends Omit<AccountStatic<T>, 'create'> {
|
|
19
|
+
create(config: AccountConfig): Promise<T>;
|
|
20
|
+
fromExtendedKey(key: string): Promise<T>;
|
|
21
|
+
fromMnemonic(mnemonic: MnemonicInstance): Promise<T>;
|
|
22
|
+
fromPhrase(mnemonic: string, path?: string): Promise<T>;
|
|
23
|
+
fromSeed(seed: string | ArrayBufferLike): Promise<T>;
|
|
24
|
+
random(): any;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=Wallet.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface WordlistInstance {
|
|
2
|
+
locale: string;
|
|
3
|
+
/**
|
|
4
|
+
* Maps an 11-bit value into its corresponding word in the list.
|
|
5
|
+
*
|
|
6
|
+
* Sub-classes MUST override this.
|
|
7
|
+
*/
|
|
8
|
+
getWord(index: number): string;
|
|
9
|
+
/**
|
|
10
|
+
* Maps a word to its corresponding 11-bit value.
|
|
11
|
+
*
|
|
12
|
+
* Sub-classes MUST override this.
|
|
13
|
+
*/
|
|
14
|
+
getWordIndex(word: string): number;
|
|
15
|
+
/**
|
|
16
|
+
* Sub-classes may override this to provider a language-specific
|
|
17
|
+
* method for joining %%words%% into a phrase.
|
|
18
|
+
*
|
|
19
|
+
* By default, %%words%% are joined by a single space.
|
|
20
|
+
*/
|
|
21
|
+
join(words: string[]): string;
|
|
22
|
+
split(phrase: string): string[];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=Wordlist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export declare const WasmFeatureDetectors: {
|
|
2
|
+
readonly bigInt: () => Promise<boolean>;
|
|
3
|
+
readonly bulkMemory: () => Promise<boolean>;
|
|
4
|
+
readonly exceptions: () => Promise<boolean>;
|
|
5
|
+
readonly extendedConst: () => Promise<boolean>;
|
|
6
|
+
readonly gc: () => Promise<boolean>;
|
|
7
|
+
readonly memory64: () => Promise<boolean>;
|
|
8
|
+
readonly multiValue: () => Promise<boolean>;
|
|
9
|
+
readonly mutableGlobals: () => Promise<boolean>;
|
|
10
|
+
readonly referenceTypes: () => {
|
|
11
|
+
new (executor: (resolve: (value: boolean | PromiseLike<boolean>) => void, reject: (reason?: any) => void) => void): Promise<boolean>;
|
|
12
|
+
all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;
|
|
13
|
+
all<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]>; }>;
|
|
14
|
+
race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
|
|
15
|
+
race<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
|
|
16
|
+
readonly prototype: Promise<any>;
|
|
17
|
+
reject<T = never>(reason?: any): Promise<T>;
|
|
18
|
+
resolve(): Promise<void>;
|
|
19
|
+
resolve<T>(value: T): Promise<Awaited<T>>;
|
|
20
|
+
resolve<T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
|
|
21
|
+
allSettled<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>>; }>;
|
|
22
|
+
allSettled<T>(values: Iterable<T | PromiseLike<T>>): Promise<PromiseSettledResult<Awaited<T>>[]>;
|
|
23
|
+
any<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
|
|
24
|
+
any<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
|
|
25
|
+
withResolvers<T>(): PromiseWithResolvers<T>;
|
|
26
|
+
try<T, U extends unknown[]>(callbackFn: (...args: U) => T | PromiseLike<T>, ...args: U): Promise<Awaited<T>>;
|
|
27
|
+
readonly [Symbol.species]: PromiseConstructor;
|
|
28
|
+
};
|
|
29
|
+
readonly relaxedSimd: () => Promise<boolean>;
|
|
30
|
+
readonly saturatedFloatToInt: () => Promise<boolean>;
|
|
31
|
+
readonly signExtensions: () => Promise<boolean>;
|
|
32
|
+
readonly simd: () => Promise<boolean>;
|
|
33
|
+
readonly streamingCompilation: () => Promise<boolean>;
|
|
34
|
+
readonly tailCall: () => Promise<boolean>;
|
|
35
|
+
readonly threads: () => Promise<boolean>;
|
|
36
|
+
};
|
|
37
|
+
export type WasmFeature = keyof typeof WasmFeatureDetectors;
|
|
38
|
+
export declare class WasmSupport {
|
|
39
|
+
private _allowWasm;
|
|
40
|
+
private _featureSupport;
|
|
41
|
+
private _forceWasm;
|
|
42
|
+
private _isInitialized;
|
|
43
|
+
private _isWasmFeatureSetSupported;
|
|
44
|
+
protected desiredFeatures: WasmFeature[];
|
|
45
|
+
/**
|
|
46
|
+
* Instance constructor for use where async instantiation
|
|
47
|
+
* is not possible. Where possible, prefer the static
|
|
48
|
+
* create method over use of this constructor directly
|
|
49
|
+
* as no initialization (feature detection) is able to
|
|
50
|
+
* be done here
|
|
51
|
+
* @param desiredFeatures The desired feature set
|
|
52
|
+
*/
|
|
53
|
+
constructor(desiredFeatures: WasmFeature[]);
|
|
54
|
+
/**
|
|
55
|
+
* Static creation & async initialization for use where
|
|
56
|
+
* async instantiation is possible
|
|
57
|
+
* @param desiredFeatures The desired feature set
|
|
58
|
+
* @returns An initialized instance of the class with detection
|
|
59
|
+
* for the desired feature set
|
|
60
|
+
*/
|
|
61
|
+
static create(desiredFeatures: WasmFeature[]): Promise<WasmSupport>;
|
|
62
|
+
/**
|
|
63
|
+
* Is WebAssembly allowed
|
|
64
|
+
*/
|
|
65
|
+
get allowWasm(): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Whether or not to allow WebAssembly usage
|
|
68
|
+
*/
|
|
69
|
+
set allowWasm(v: boolean);
|
|
70
|
+
/**
|
|
71
|
+
* Whether or not WebAssembly should be used based on the desired
|
|
72
|
+
* feature set, initialization state, or force-use settings
|
|
73
|
+
*/
|
|
74
|
+
get canUseWasm(): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Returns a object containing a property for each desired WebAssembly feature
|
|
77
|
+
* with a boolean value indicating whether or not the feature is supported
|
|
78
|
+
*/
|
|
79
|
+
get featureSupport(): Readonly<Partial<Record<WasmFeature, boolean>>>;
|
|
80
|
+
/**
|
|
81
|
+
* Force use of WebAssembly
|
|
82
|
+
*/
|
|
83
|
+
get forceWasm(): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Whether or not to force WebAssembly usage
|
|
86
|
+
*/
|
|
87
|
+
set forceWasm(v: boolean);
|
|
88
|
+
/**
|
|
89
|
+
* Whether or not WebAssembly is supported based
|
|
90
|
+
* on the desired feature set
|
|
91
|
+
*/
|
|
92
|
+
get isDesiredFeatureSetSupported(): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Whether or not WebAssembly detection has been run
|
|
95
|
+
* for the desired feature set
|
|
96
|
+
*/
|
|
97
|
+
get isInitialized(): boolean;
|
|
98
|
+
protected detectDesiredFeatures(): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Checks for specific WebAssembly features
|
|
101
|
+
* @param features The list of features to check for
|
|
102
|
+
* @returns True if all the features are supported, false otherwise
|
|
103
|
+
*/
|
|
104
|
+
featureCheck(features: WasmFeature[]): Promise<boolean>;
|
|
105
|
+
/**
|
|
106
|
+
* Does feature detection for the desired feature set
|
|
107
|
+
*/
|
|
108
|
+
initialize(): Promise<void>;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=WasmSupport.d.ts.map
|