@paimaexample/wallets 0.3.117
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/README.md +1 -0
- package/esm/chain-types/src/hash.d.ts +28 -0
- package/esm/chain-types/src/hash.d.ts.map +1 -0
- package/esm/chain-types/src/hash.js +29 -0
- package/esm/chain-types/src/mod.d.ts +3 -0
- package/esm/chain-types/src/mod.d.ts.map +1 -0
- package/esm/chain-types/src/mod.js +2 -0
- package/esm/chain-types/src/types.d.ts +70 -0
- package/esm/chain-types/src/types.d.ts.map +1 -0
- package/esm/chain-types/src/types.js +1 -0
- package/esm/concise/src/batcher.d.ts +40 -0
- package/esm/concise/src/batcher.d.ts.map +1 -0
- package/esm/concise/src/batcher.js +117 -0
- package/esm/concise/src/delegate.d.ts +18 -0
- package/esm/concise/src/delegate.d.ts.map +1 -0
- package/esm/concise/src/delegate.js +118 -0
- package/esm/concise/src/mod.d.ts +5 -0
- package/esm/concise/src/mod.d.ts.map +1 -0
- package/esm/concise/src/mod.js +3 -0
- package/esm/concise/src/v2/builtins/batcher.d.ts +27 -0
- package/esm/concise/src/v2/builtins/batcher.d.ts.map +1 -0
- package/esm/concise/src/v2/builtins/batcher.js +51 -0
- package/esm/concise/src/v2/builtins/grammar.d.ts +25 -0
- package/esm/concise/src/v2/builtins/grammar.d.ts.map +1 -0
- package/esm/concise/src/v2/builtins/grammar.js +40 -0
- package/esm/concise/src/v2/builtins/index.d.ts +3 -0
- package/esm/concise/src/v2/builtins/index.d.ts.map +1 -0
- package/esm/concise/src/v2/builtins/index.js +3 -0
- package/esm/concise/src/v2/grammar.d.ts +8 -0
- package/esm/concise/src/v2/grammar.d.ts.map +1 -0
- package/esm/concise/src/v2/grammar.js +19 -0
- package/esm/concise/src/v2/inputs.d.ts +7 -0
- package/esm/concise/src/v2/inputs.d.ts.map +1 -0
- package/esm/concise/src/v2/inputs.js +37 -0
- package/esm/concise/src/v2/mod.d.ts +5 -0
- package/esm/concise/src/v2/mod.d.ts.map +1 -0
- package/esm/concise/src/v2/mod.js +4 -0
- package/esm/concise/src/v2/types.d.ts +23 -0
- package/esm/concise/src/v2/types.d.ts.map +1 -0
- package/esm/concise/src/v2/types.js +1 -0
- package/esm/config/src/config/builder.d.ts +33 -0
- package/esm/config/src/config/builder.d.ts.map +1 -0
- package/esm/config/src/config/builder.js +82 -0
- package/esm/config/src/config/configCheck.d.ts +32 -0
- package/esm/config/src/config/configCheck.d.ts.map +1 -0
- package/esm/config/src/config/configCheck.js +67 -0
- package/esm/config/src/config/context.d.ts +23 -0
- package/esm/config/src/config/context.d.ts.map +1 -0
- package/esm/config/src/config/context.js +25 -0
- package/esm/config/src/config/mod.d.ts +7 -0
- package/esm/config/src/config/mod.d.ts.map +1 -0
- package/esm/config/src/config/mod.js +4 -0
- package/esm/config/src/config/parts/deployedAddresses.d.ts +17 -0
- package/esm/config/src/config/parts/deployedAddresses.d.ts.map +1 -0
- package/esm/config/src/config/parts/deployedAddresses.js +24 -0
- package/esm/config/src/config/parts/network.d.ts +19 -0
- package/esm/config/src/config/parts/network.d.ts.map +1 -0
- package/esm/config/src/config/parts/network.js +29 -0
- package/esm/config/src/config/parts/primitive.d.ts +31 -0
- package/esm/config/src/config/parts/primitive.d.ts.map +1 -0
- package/esm/config/src/config/parts/primitive.js +28 -0
- package/esm/config/src/config/parts/securityNamespace.d.ts +14 -0
- package/esm/config/src/config/parts/securityNamespace.d.ts.map +1 -0
- package/esm/config/src/config/parts/securityNamespace.js +26 -0
- package/esm/config/src/config/parts/syncProtocols.d.ts +43 -0
- package/esm/config/src/config/parts/syncProtocols.d.ts.map +1 -0
- package/esm/config/src/config/parts/syncProtocols.js +66 -0
- package/esm/config/src/config/utils.d.ts +40 -0
- package/esm/config/src/config/utils.d.ts.map +1 -0
- package/esm/config/src/config/utils.js +55 -0
- package/esm/config/src/mod.d.ts +3 -0
- package/esm/config/src/mod.d.ts.map +1 -0
- package/esm/config/src/mod.js +2 -0
- package/esm/config/src/schema/common.d.ts +26 -0
- package/esm/config/src/schema/common.d.ts.map +1 -0
- package/esm/config/src/schema/common.js +51 -0
- package/esm/config/src/schema/mod.d.ts +7 -0
- package/esm/config/src/schema/mod.d.ts.map +1 -0
- package/esm/config/src/schema/mod.js +6 -0
- package/esm/config/src/schema/namespace.d.ts +39 -0
- package/esm/config/src/schema/namespace.d.ts.map +1 -0
- package/esm/config/src/schema/namespace.js +34 -0
- package/esm/config/src/schema/network/algorand.d.ts +12 -0
- package/esm/config/src/schema/network/algorand.d.ts.map +1 -0
- package/esm/config/src/schema/network/algorand.js +23 -0
- package/esm/config/src/schema/network/all.d.ts +175 -0
- package/esm/config/src/schema/network/all.d.ts.map +1 -0
- package/esm/config/src/schema/network/all.js +24 -0
- package/esm/config/src/schema/network/bitcoin.d.ts +19 -0
- package/esm/config/src/schema/network/bitcoin.d.ts.map +1 -0
- package/esm/config/src/schema/network/bitcoin.js +21 -0
- package/esm/config/src/schema/network/cardano.d.ts +12 -0
- package/esm/config/src/schema/network/cardano.d.ts.map +1 -0
- package/esm/config/src/schema/network/cardano.js +27 -0
- package/esm/config/src/schema/network/evm.d.ts +68 -0
- package/esm/config/src/schema/network/evm.d.ts.map +1 -0
- package/esm/config/src/schema/network/evm.js +70 -0
- package/esm/config/src/schema/network/mina.d.ts +14 -0
- package/esm/config/src/schema/network/mina.d.ts.map +1 -0
- package/esm/config/src/schema/network/mina.js +25 -0
- package/esm/config/src/schema/network/mod.d.ts +9 -0
- package/esm/config/src/schema/network/mod.d.ts.map +1 -0
- package/esm/config/src/schema/network/mod.js +8 -0
- package/esm/config/src/schema/network/ntp.d.ts +32 -0
- package/esm/config/src/schema/network/ntp.d.ts.map +1 -0
- package/esm/config/src/schema/network/ntp.js +39 -0
- package/esm/config/src/schema/network/substrate/avail.d.ts +14 -0
- package/esm/config/src/schema/network/substrate/avail.d.ts.map +1 -0
- package/esm/config/src/schema/network/substrate/avail.js +26 -0
- package/esm/config/src/schema/network/substrate/common.d.ts +18 -0
- package/esm/config/src/schema/network/substrate/common.d.ts.map +1 -0
- package/esm/config/src/schema/network/substrate/common.js +32 -0
- package/esm/config/src/schema/network/substrate/midnight.d.ts +20 -0
- package/esm/config/src/schema/network/substrate/midnight.d.ts.map +1 -0
- package/esm/config/src/schema/network/substrate/midnight.js +32 -0
- package/esm/config/src/schema/network/substrate/mod.d.ts +4 -0
- package/esm/config/src/schema/network/substrate/mod.d.ts.map +1 -0
- package/esm/config/src/schema/network/substrate/mod.js +3 -0
- package/esm/config/src/schema/network/types.d.ts +13 -0
- package/esm/config/src/schema/network/types.d.ts.map +1 -0
- package/esm/config/src/schema/network/types.js +13 -0
- package/esm/config/src/schema/network/utils.d.ts +5 -0
- package/esm/config/src/schema/network/utils.d.ts.map +1 -0
- package/esm/config/src/schema/network/utils.js +73 -0
- package/esm/config/src/schema/primitive/mod.d.ts +2 -0
- package/esm/config/src/schema/primitive/mod.d.ts.map +1 -0
- package/esm/config/src/schema/primitive/mod.js +1 -0
- package/esm/config/src/schema/primitive/types.d.ts +58 -0
- package/esm/config/src/schema/primitive/types.d.ts.map +1 -0
- package/esm/config/src/schema/primitive/types.js +1 -0
- package/esm/config/src/schema/sync-protocols/all.d.ts +583 -0
- package/esm/config/src/schema/sync-protocols/all.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/all.js +55 -0
- package/esm/config/src/schema/sync-protocols/avail/rpc.d.ts +76 -0
- package/esm/config/src/schema/sync-protocols/avail/rpc.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/avail/rpc.js +56 -0
- package/esm/config/src/schema/sync-protocols/bitcoin/rpc.d.ts +76 -0
- package/esm/config/src/schema/sync-protocols/bitcoin/rpc.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/bitcoin/rpc.js +47 -0
- package/esm/config/src/schema/sync-protocols/cardano/carp.d.ts +80 -0
- package/esm/config/src/schema/sync-protocols/cardano/carp.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/cardano/carp.js +62 -0
- package/esm/config/src/schema/sync-protocols/cardano/mod.d.ts +2 -0
- package/esm/config/src/schema/sync-protocols/cardano/mod.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/cardano/mod.js +1 -0
- package/esm/config/src/schema/sync-protocols/cardano/utxorpc.d.ts +56 -0
- package/esm/config/src/schema/sync-protocols/cardano/utxorpc.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/cardano/utxorpc.js +56 -0
- package/esm/config/src/schema/sync-protocols/common.d.ts +60 -0
- package/esm/config/src/schema/sync-protocols/common.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/common.js +54 -0
- package/esm/config/src/schema/sync-protocols/decorators/all.d.ts +17 -0
- package/esm/config/src/schema/sync-protocols/decorators/all.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/decorators/all.js +8 -0
- package/esm/config/src/schema/sync-protocols/decorators/emulated.d.ts +8 -0
- package/esm/config/src/schema/sync-protocols/decorators/emulated.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/decorators/emulated.js +12 -0
- package/esm/config/src/schema/sync-protocols/decorators/mod.d.ts +4 -0
- package/esm/config/src/schema/sync-protocols/decorators/mod.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/decorators/mod.js +3 -0
- package/esm/config/src/schema/sync-protocols/decorators/types.d.ts +4 -0
- package/esm/config/src/schema/sync-protocols/decorators/types.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/decorators/types.js +4 -0
- package/esm/config/src/schema/sync-protocols/evm/rpc.d.ts +68 -0
- package/esm/config/src/schema/sync-protocols/evm/rpc.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/evm/rpc.js +44 -0
- package/esm/config/src/schema/sync-protocols/midnight/graphql.d.ts +66 -0
- package/esm/config/src/schema/sync-protocols/midnight/graphql.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/midnight/graphql.js +50 -0
- package/esm/config/src/schema/sync-protocols/mina/graphql.d.ts +73 -0
- package/esm/config/src/schema/sync-protocols/mina/graphql.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/mina/graphql.js +59 -0
- package/esm/config/src/schema/sync-protocols/mod.d.ts +10 -0
- package/esm/config/src/schema/sync-protocols/mod.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/mod.js +9 -0
- package/esm/config/src/schema/sync-protocols/ntp/rpc.d.ts +45 -0
- package/esm/config/src/schema/sync-protocols/ntp/rpc.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/ntp/rpc.js +33 -0
- package/esm/config/src/schema/sync-protocols/types.d.ts +125 -0
- package/esm/config/src/schema/sync-protocols/types.d.ts.map +1 -0
- package/esm/config/src/schema/sync-protocols/types.js +22 -0
- package/esm/config/src/schema/utils.d.ts +53 -0
- package/esm/config/src/schema/utils.d.ts.map +1 -0
- package/esm/config/src/schema/utils.js +58 -0
- package/esm/events/src/app-events.d.ts +65 -0
- package/esm/events/src/app-events.d.ts.map +1 -0
- package/esm/events/src/app-events.js +51 -0
- package/esm/events/src/asyncapi.d.ts +1173 -0
- package/esm/events/src/asyncapi.d.ts.map +1 -0
- package/esm/events/src/asyncapi.js +7 -0
- package/esm/events/src/builtin-event-utils.d.ts +5 -0
- package/esm/events/src/builtin-event-utils.d.ts.map +1 -0
- package/esm/events/src/builtin-event-utils.js +58 -0
- package/esm/events/src/builtin-events.d.ts +106 -0
- package/esm/events/src/builtin-events.d.ts.map +1 -0
- package/esm/events/src/builtin-events.js +198 -0
- package/esm/events/src/event-connect.d.ts +15 -0
- package/esm/events/src/event-connect.d.ts.map +1 -0
- package/esm/events/src/event-connect.js +75 -0
- package/esm/events/src/event-manager.d.ts +54 -0
- package/esm/events/src/event-manager.d.ts.map +1 -0
- package/esm/events/src/event-manager.js +129 -0
- package/esm/events/src/evm.d.ts +6 -0
- package/esm/events/src/evm.d.ts.map +1 -0
- package/esm/events/src/evm.js +55 -0
- package/esm/events/src/mod.d.ts +10 -0
- package/esm/events/src/mod.d.ts.map +1 -0
- package/esm/events/src/mod.js +9 -0
- package/esm/events/src/types.d.ts +255 -0
- package/esm/events/src/types.d.ts.map +1 -0
- package/esm/events/src/types.js +103 -0
- package/esm/events/src/utils.d.ts +16 -0
- package/esm/events/src/utils.d.ts.map +1 -0
- package/esm/events/src/utils.js +93 -0
- package/esm/package.json +3 -0
- package/esm/utils/src/binary-search.d.ts +7 -0
- package/esm/utils/src/binary-search.d.ts.map +1 -0
- package/esm/utils/src/binary-search.js +38 -0
- package/esm/utils/src/captcha.d.ts +9 -0
- package/esm/utils/src/captcha.d.ts.map +1 -0
- package/esm/utils/src/captcha.js +19 -0
- package/esm/utils/src/concurrency/condVar.d.ts +25 -0
- package/esm/utils/src/concurrency/condVar.d.ts.map +1 -0
- package/esm/utils/src/concurrency/condVar.js +39 -0
- package/esm/utils/src/concurrency/latch.d.ts +25 -0
- package/esm/utils/src/concurrency/latch.d.ts.map +1 -0
- package/esm/utils/src/concurrency/latch.js +51 -0
- package/esm/utils/src/concurrency/mod.d.ts +5 -0
- package/esm/utils/src/concurrency/mod.d.ts.map +1 -0
- package/esm/utils/src/concurrency/mod.js +4 -0
- package/esm/utils/src/concurrency/retry.d.ts +14 -0
- package/esm/utils/src/concurrency/retry.d.ts.map +1 -0
- package/esm/utils/src/concurrency/retry.js +26 -0
- package/esm/utils/src/concurrency/utils.d.ts +27 -0
- package/esm/utils/src/concurrency/utils.d.ts.map +1 -0
- package/esm/utils/src/concurrency/utils.js +27 -0
- package/esm/utils/src/constants.d.ts +4 -0
- package/esm/utils/src/constants.d.ts.map +1 -0
- package/esm/utils/src/constants.js +7 -0
- package/esm/utils/src/decorators/bound.d.ts +10 -0
- package/esm/utils/src/decorators/bound.d.ts.map +1 -0
- package/esm/utils/src/decorators/bound.js +17 -0
- package/esm/utils/src/decorators/mod.d.ts +2 -0
- package/esm/utils/src/decorators/mod.d.ts.map +1 -0
- package/esm/utils/src/decorators/mod.js +1 -0
- package/esm/utils/src/mod.d.ts +8 -0
- package/esm/utils/src/mod.d.ts.map +1 -0
- package/esm/utils/src/mod.js +7 -0
- package/esm/utils/src/types/json-query.d.ts +30 -0
- package/esm/utils/src/types/json-query.d.ts.map +1 -0
- package/esm/utils/src/types/json-query.js +1 -0
- package/esm/utils/src/types/misc.d.ts +109 -0
- package/esm/utils/src/types/misc.d.ts.map +1 -0
- package/esm/utils/src/types/misc.js +2 -0
- package/esm/utils/src/types/mod.d.ts +7 -0
- package/esm/utils/src/types/mod.d.ts.map +1 -0
- package/esm/utils/src/types/mod.js +3 -0
- package/esm/utils/src/types/nominal.d.ts +87 -0
- package/esm/utils/src/types/nominal.d.ts.map +1 -0
- package/esm/utils/src/types/nominal.js +1 -0
- package/esm/utils/src/types/typebox-helpers.d.ts +183 -0
- package/esm/utils/src/types/typebox-helpers.d.ts.map +1 -0
- package/esm/utils/src/types/typebox-helpers.js +235 -0
- package/esm/utils/src/types/utils.d.ts +37 -0
- package/esm/utils/src/types/utils.d.ts.map +1 -0
- package/esm/utils/src/types/utils.js +46 -0
- package/esm/utils/src/types/validators/algorand.d.ts +31 -0
- package/esm/utils/src/types/validators/algorand.d.ts.map +1 -0
- package/esm/utils/src/types/validators/algorand.js +90 -0
- package/esm/utils/src/types/validators/cardano.d.ts +26 -0
- package/esm/utils/src/types/validators/cardano.d.ts.map +1 -0
- package/esm/utils/src/types/validators/cardano.js +113 -0
- package/esm/utils/src/types/validators/mina.d.ts +15 -0
- package/esm/utils/src/types/validators/mina.d.ts.map +1 -0
- package/esm/utils/src/types/validators/mina.js +43 -0
- package/esm/utils/src/types/validators/minicbor.d.ts +98 -0
- package/esm/utils/src/types/validators/minicbor.d.ts.map +1 -0
- package/esm/utils/src/types/validators/minicbor.js +332 -0
- package/esm/utils/src/types/validators/mod.d.ts +3 -0
- package/esm/utils/src/types/validators/mod.d.ts.map +1 -0
- package/esm/utils/src/types/validators/mod.js +2 -0
- package/esm/utils/src/types/validators/utils.d.ts +6 -0
- package/esm/utils/src/types/validators/utils.d.ts.map +1 -0
- package/esm/utils/src/types/validators/utils.js +24 -0
- package/esm/utils/src/viem.d.ts +6 -0
- package/esm/utils/src/viem.d.ts.map +1 -0
- package/esm/utils/src/viem.js +15 -0
- package/esm/wallets/src/IProvider.d.ts +48 -0
- package/esm/wallets/src/IProvider.d.ts.map +1 -0
- package/esm/wallets/src/IProvider.js +7 -0
- package/esm/wallets/src/avail/avail.d.ts +28 -0
- package/esm/wallets/src/avail/avail.d.ts.map +1 -0
- package/esm/wallets/src/avail/avail.js +65 -0
- package/esm/wallets/src/avail/wrapper.d.ts +6 -0
- package/esm/wallets/src/avail/wrapper.d.ts.map +1 -0
- package/esm/wallets/src/avail/wrapper.js +31 -0
- package/esm/wallets/src/cardano/cardano.d.ts +30 -0
- package/esm/wallets/src/cardano/cardano.d.ts.map +1 -0
- package/esm/wallets/src/cardano/cardano.js +158 -0
- package/esm/wallets/src/cardano/wrapper.d.ts +7 -0
- package/esm/wallets/src/cardano/wrapper.d.ts.map +1 -0
- package/esm/wallets/src/cardano/wrapper.js +22 -0
- package/esm/wallets/src/evm/ethers.d.ts +28 -0
- package/esm/wallets/src/evm/ethers.d.ts.map +1 -0
- package/esm/wallets/src/evm/ethers.js +79 -0
- package/esm/wallets/src/evm/injected.d.ts +74 -0
- package/esm/wallets/src/evm/injected.d.ts.map +1 -0
- package/esm/wallets/src/evm/injected.js +322 -0
- package/esm/wallets/src/evm/types.d.ts +3 -0
- package/esm/wallets/src/evm/types.d.ts.map +1 -0
- package/esm/wallets/src/evm/types.js +1 -0
- package/esm/wallets/src/evm/wrapper-ethers.d.ts +6 -0
- package/esm/wallets/src/evm/wrapper-ethers.d.ts.map +1 -0
- package/esm/wallets/src/evm/wrapper-ethers.js +38 -0
- package/esm/wallets/src/evm/wrapper-injected.d.ts +7 -0
- package/esm/wallets/src/evm/wrapper-injected.d.ts.map +1 -0
- package/esm/wallets/src/evm/wrapper-injected.js +80 -0
- package/esm/wallets/src/midnight/midnight.d.ts +26 -0
- package/esm/wallets/src/midnight/midnight.d.ts.map +1 -0
- package/esm/wallets/src/midnight/midnight.js +112 -0
- package/esm/wallets/src/midnight/wrapper.d.ts +7 -0
- package/esm/wallets/src/midnight/wrapper.d.ts.map +1 -0
- package/esm/wallets/src/midnight/wrapper.js +22 -0
- package/esm/wallets/src/mina/mina.d.ts +28 -0
- package/esm/wallets/src/mina/mina.d.ts.map +1 -0
- package/esm/wallets/src/mina/mina.js +133 -0
- package/esm/wallets/src/mina/wrapper.d.ts +6 -0
- package/esm/wallets/src/mina/wrapper.d.ts.map +1 -0
- package/esm/wallets/src/mina/wrapper.js +12 -0
- package/esm/wallets/src/mod.d.ts +8 -0
- package/esm/wallets/src/mod.d.ts.map +1 -0
- package/esm/wallets/src/mod.js +5 -0
- package/esm/wallets/src/paima.d.ts +104 -0
- package/esm/wallets/src/paima.d.ts.map +1 -0
- package/esm/wallets/src/paima.js +244 -0
- package/esm/wallets/src/types.d.ts +49 -0
- package/esm/wallets/src/types.d.ts.map +1 -0
- package/esm/wallets/src/types.js +1 -0
- package/esm/wallets/src/utils.d.ts +41 -0
- package/esm/wallets/src/utils.d.ts.map +1 -0
- package/esm/wallets/src/utils.js +75 -0
- package/esm/wallets/src/wallet-modes.d.ts +49 -0
- package/esm/wallets/src/wallet-modes.d.ts.map +1 -0
- package/esm/wallets/src/wallet-modes.js +26 -0
- package/esm/wallets/src/wallets.d.ts +5 -0
- package/esm/wallets/src/wallets.d.ts.map +1 -0
- package/esm/wallets/src/wallets.js +55 -0
- package/esm/wallets/src/windows.d.ts +5 -0
- package/esm/wallets/src/windows.d.ts.map +1 -0
- package/esm/wallets/src/windows.js +9 -0
- package/package.json +51 -0
- package/script/chain-types/src/hash.d.ts +28 -0
- package/script/chain-types/src/hash.d.ts.map +1 -0
- package/script/chain-types/src/hash.js +36 -0
- package/script/chain-types/src/mod.d.ts +3 -0
- package/script/chain-types/src/mod.d.ts.map +1 -0
- package/script/chain-types/src/mod.js +18 -0
- package/script/chain-types/src/types.d.ts +70 -0
- package/script/chain-types/src/types.d.ts.map +1 -0
- package/script/chain-types/src/types.js +2 -0
- package/script/concise/src/batcher.d.ts +40 -0
- package/script/concise/src/batcher.d.ts.map +1 -0
- package/script/concise/src/batcher.js +122 -0
- package/script/concise/src/delegate.d.ts +18 -0
- package/script/concise/src/delegate.d.ts.map +1 -0
- package/script/concise/src/delegate.js +123 -0
- package/script/concise/src/mod.d.ts +5 -0
- package/script/concise/src/mod.d.ts.map +1 -0
- package/script/concise/src/mod.js +19 -0
- package/script/concise/src/v2/builtins/batcher.d.ts +27 -0
- package/script/concise/src/v2/builtins/batcher.d.ts.map +1 -0
- package/script/concise/src/v2/builtins/batcher.js +54 -0
- package/script/concise/src/v2/builtins/grammar.d.ts +25 -0
- package/script/concise/src/v2/builtins/grammar.d.ts.map +1 -0
- package/script/concise/src/v2/builtins/grammar.js +43 -0
- package/script/concise/src/v2/builtins/index.d.ts +3 -0
- package/script/concise/src/v2/builtins/index.d.ts.map +1 -0
- package/script/concise/src/v2/builtins/index.js +19 -0
- package/script/concise/src/v2/grammar.d.ts +8 -0
- package/script/concise/src/v2/grammar.d.ts.map +1 -0
- package/script/concise/src/v2/grammar.js +24 -0
- package/script/concise/src/v2/inputs.d.ts +7 -0
- package/script/concise/src/v2/inputs.d.ts.map +1 -0
- package/script/concise/src/v2/inputs.js +43 -0
- package/script/concise/src/v2/mod.d.ts +5 -0
- package/script/concise/src/v2/mod.d.ts.map +1 -0
- package/script/concise/src/v2/mod.js +20 -0
- package/script/concise/src/v2/types.d.ts +23 -0
- package/script/concise/src/v2/types.d.ts.map +1 -0
- package/script/concise/src/v2/types.js +2 -0
- package/script/config/src/config/builder.d.ts +33 -0
- package/script/config/src/config/builder.d.ts.map +1 -0
- package/script/config/src/config/builder.js +86 -0
- package/script/config/src/config/configCheck.d.ts +32 -0
- package/script/config/src/config/configCheck.d.ts.map +1 -0
- package/script/config/src/config/configCheck.js +70 -0
- package/script/config/src/config/context.d.ts +23 -0
- package/script/config/src/config/context.d.ts.map +1 -0
- package/script/config/src/config/context.js +31 -0
- package/script/config/src/config/mod.d.ts +7 -0
- package/script/config/src/config/mod.d.ts.map +1 -0
- package/script/config/src/config/mod.js +22 -0
- package/script/config/src/config/parts/deployedAddresses.d.ts +17 -0
- package/script/config/src/config/parts/deployedAddresses.d.ts.map +1 -0
- package/script/config/src/config/parts/deployedAddresses.js +28 -0
- package/script/config/src/config/parts/network.d.ts +19 -0
- package/script/config/src/config/parts/network.d.ts.map +1 -0
- package/script/config/src/config/parts/network.js +33 -0
- package/script/config/src/config/parts/primitive.d.ts +31 -0
- package/script/config/src/config/parts/primitive.d.ts.map +1 -0
- package/script/config/src/config/parts/primitive.js +32 -0
- package/script/config/src/config/parts/securityNamespace.d.ts +14 -0
- package/script/config/src/config/parts/securityNamespace.d.ts.map +1 -0
- package/script/config/src/config/parts/securityNamespace.js +30 -0
- package/script/config/src/config/parts/syncProtocols.d.ts +43 -0
- package/script/config/src/config/parts/syncProtocols.d.ts.map +1 -0
- package/script/config/src/config/parts/syncProtocols.js +70 -0
- package/script/config/src/config/utils.d.ts +40 -0
- package/script/config/src/config/utils.d.ts.map +1 -0
- package/script/config/src/config/utils.js +62 -0
- package/script/config/src/mod.d.ts +3 -0
- package/script/config/src/mod.d.ts.map +1 -0
- package/script/config/src/mod.js +18 -0
- package/script/config/src/schema/common.d.ts +26 -0
- package/script/config/src/schema/common.d.ts.map +1 -0
- package/script/config/src/schema/common.js +54 -0
- package/script/config/src/schema/mod.d.ts +7 -0
- package/script/config/src/schema/mod.d.ts.map +1 -0
- package/script/config/src/schema/mod.js +22 -0
- package/script/config/src/schema/namespace.d.ts +39 -0
- package/script/config/src/schema/namespace.d.ts.map +1 -0
- package/script/config/src/schema/namespace.js +38 -0
- package/script/config/src/schema/network/algorand.d.ts +12 -0
- package/script/config/src/schema/network/algorand.d.ts.map +1 -0
- package/script/config/src/schema/network/algorand.js +26 -0
- package/script/config/src/schema/network/all.d.ts +175 -0
- package/script/config/src/schema/network/all.d.ts.map +1 -0
- package/script/config/src/schema/network/all.js +28 -0
- package/script/config/src/schema/network/bitcoin.d.ts +19 -0
- package/script/config/src/schema/network/bitcoin.d.ts.map +1 -0
- package/script/config/src/schema/network/bitcoin.js +24 -0
- package/script/config/src/schema/network/cardano.d.ts +12 -0
- package/script/config/src/schema/network/cardano.d.ts.map +1 -0
- package/script/config/src/schema/network/cardano.js +30 -0
- package/script/config/src/schema/network/evm.d.ts +68 -0
- package/script/config/src/schema/network/evm.d.ts.map +1 -0
- package/script/config/src/schema/network/evm.js +75 -0
- package/script/config/src/schema/network/mina.d.ts +14 -0
- package/script/config/src/schema/network/mina.d.ts.map +1 -0
- package/script/config/src/schema/network/mina.js +28 -0
- package/script/config/src/schema/network/mod.d.ts +9 -0
- package/script/config/src/schema/network/mod.d.ts.map +1 -0
- package/script/config/src/schema/network/mod.js +24 -0
- package/script/config/src/schema/network/ntp.d.ts +32 -0
- package/script/config/src/schema/network/ntp.d.ts.map +1 -0
- package/script/config/src/schema/network/ntp.js +42 -0
- package/script/config/src/schema/network/substrate/avail.d.ts +14 -0
- package/script/config/src/schema/network/substrate/avail.d.ts.map +1 -0
- package/script/config/src/schema/network/substrate/avail.js +29 -0
- package/script/config/src/schema/network/substrate/common.d.ts +18 -0
- package/script/config/src/schema/network/substrate/common.d.ts.map +1 -0
- package/script/config/src/schema/network/substrate/common.js +35 -0
- package/script/config/src/schema/network/substrate/midnight.d.ts +20 -0
- package/script/config/src/schema/network/substrate/midnight.d.ts.map +1 -0
- package/script/config/src/schema/network/substrate/midnight.js +35 -0
- package/script/config/src/schema/network/substrate/mod.d.ts +4 -0
- package/script/config/src/schema/network/substrate/mod.d.ts.map +1 -0
- package/script/config/src/schema/network/substrate/mod.js +19 -0
- package/script/config/src/schema/network/types.d.ts +13 -0
- package/script/config/src/schema/network/types.d.ts.map +1 -0
- package/script/config/src/schema/network/types.js +16 -0
- package/script/config/src/schema/network/utils.d.ts +5 -0
- package/script/config/src/schema/network/utils.d.ts.map +1 -0
- package/script/config/src/schema/network/utils.js +76 -0
- package/script/config/src/schema/primitive/mod.d.ts +2 -0
- package/script/config/src/schema/primitive/mod.d.ts.map +1 -0
- package/script/config/src/schema/primitive/mod.js +17 -0
- package/script/config/src/schema/primitive/types.d.ts +58 -0
- package/script/config/src/schema/primitive/types.d.ts.map +1 -0
- package/script/config/src/schema/primitive/types.js +2 -0
- package/script/config/src/schema/sync-protocols/all.d.ts +583 -0
- package/script/config/src/schema/sync-protocols/all.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/all.js +62 -0
- package/script/config/src/schema/sync-protocols/avail/rpc.d.ts +76 -0
- package/script/config/src/schema/sync-protocols/avail/rpc.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/avail/rpc.js +59 -0
- package/script/config/src/schema/sync-protocols/bitcoin/rpc.d.ts +76 -0
- package/script/config/src/schema/sync-protocols/bitcoin/rpc.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/bitcoin/rpc.js +50 -0
- package/script/config/src/schema/sync-protocols/cardano/carp.d.ts +80 -0
- package/script/config/src/schema/sync-protocols/cardano/carp.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/cardano/carp.js +65 -0
- package/script/config/src/schema/sync-protocols/cardano/mod.d.ts +2 -0
- package/script/config/src/schema/sync-protocols/cardano/mod.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/cardano/mod.js +17 -0
- package/script/config/src/schema/sync-protocols/cardano/utxorpc.d.ts +56 -0
- package/script/config/src/schema/sync-protocols/cardano/utxorpc.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/cardano/utxorpc.js +59 -0
- package/script/config/src/schema/sync-protocols/common.d.ts +60 -0
- package/script/config/src/schema/sync-protocols/common.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/common.js +61 -0
- package/script/config/src/schema/sync-protocols/decorators/all.d.ts +17 -0
- package/script/config/src/schema/sync-protocols/decorators/all.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/decorators/all.js +12 -0
- package/script/config/src/schema/sync-protocols/decorators/emulated.d.ts +8 -0
- package/script/config/src/schema/sync-protocols/decorators/emulated.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/decorators/emulated.js +15 -0
- package/script/config/src/schema/sync-protocols/decorators/mod.d.ts +4 -0
- package/script/config/src/schema/sync-protocols/decorators/mod.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/decorators/mod.js +19 -0
- package/script/config/src/schema/sync-protocols/decorators/types.d.ts +4 -0
- package/script/config/src/schema/sync-protocols/decorators/types.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/decorators/types.js +7 -0
- package/script/config/src/schema/sync-protocols/evm/rpc.d.ts +68 -0
- package/script/config/src/schema/sync-protocols/evm/rpc.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/evm/rpc.js +47 -0
- package/script/config/src/schema/sync-protocols/midnight/graphql.d.ts +66 -0
- package/script/config/src/schema/sync-protocols/midnight/graphql.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/midnight/graphql.js +53 -0
- package/script/config/src/schema/sync-protocols/mina/graphql.d.ts +73 -0
- package/script/config/src/schema/sync-protocols/mina/graphql.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/mina/graphql.js +62 -0
- package/script/config/src/schema/sync-protocols/mod.d.ts +10 -0
- package/script/config/src/schema/sync-protocols/mod.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/mod.js +25 -0
- package/script/config/src/schema/sync-protocols/ntp/rpc.d.ts +45 -0
- package/script/config/src/schema/sync-protocols/ntp/rpc.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/ntp/rpc.js +36 -0
- package/script/config/src/schema/sync-protocols/types.d.ts +125 -0
- package/script/config/src/schema/sync-protocols/types.d.ts.map +1 -0
- package/script/config/src/schema/sync-protocols/types.js +25 -0
- package/script/config/src/schema/utils.d.ts +53 -0
- package/script/config/src/schema/utils.d.ts.map +1 -0
- package/script/config/src/schema/utils.js +62 -0
- package/script/events/src/app-events.d.ts +65 -0
- package/script/events/src/app-events.d.ts.map +1 -0
- package/script/events/src/app-events.js +62 -0
- package/script/events/src/asyncapi.d.ts +1173 -0
- package/script/events/src/asyncapi.d.ts.map +1 -0
- package/script/events/src/asyncapi.js +8 -0
- package/script/events/src/builtin-event-utils.d.ts +5 -0
- package/script/events/src/builtin-event-utils.d.ts.map +1 -0
- package/script/events/src/builtin-event-utils.js +63 -0
- package/script/events/src/builtin-events.d.ts +106 -0
- package/script/events/src/builtin-events.d.ts.map +1 -0
- package/script/events/src/builtin-events.js +204 -0
- package/script/events/src/event-connect.d.ts +15 -0
- package/script/events/src/event-connect.d.ts.map +1 -0
- package/script/events/src/event-connect.js +82 -0
- package/script/events/src/event-manager.d.ts +54 -0
- package/script/events/src/event-manager.d.ts.map +1 -0
- package/script/events/src/event-manager.js +133 -0
- package/script/events/src/evm.d.ts +6 -0
- package/script/events/src/evm.d.ts.map +1 -0
- package/script/events/src/evm.js +59 -0
- package/script/events/src/mod.d.ts +10 -0
- package/script/events/src/mod.d.ts.map +1 -0
- package/script/events/src/mod.js +25 -0
- package/script/events/src/types.d.ts +255 -0
- package/script/events/src/types.d.ts.map +1 -0
- package/script/events/src/types.js +111 -0
- package/script/events/src/utils.d.ts +16 -0
- package/script/events/src/utils.d.ts.map +1 -0
- package/script/events/src/utils.js +98 -0
- package/script/package.json +3 -0
- package/script/utils/src/binary-search.d.ts +7 -0
- package/script/utils/src/binary-search.d.ts.map +1 -0
- package/script/utils/src/binary-search.js +41 -0
- package/script/utils/src/captcha.d.ts +9 -0
- package/script/utils/src/captcha.d.ts.map +1 -0
- package/script/utils/src/captcha.js +22 -0
- package/script/utils/src/concurrency/condVar.d.ts +25 -0
- package/script/utils/src/concurrency/condVar.d.ts.map +1 -0
- package/script/utils/src/concurrency/condVar.js +42 -0
- package/script/utils/src/concurrency/latch.d.ts +25 -0
- package/script/utils/src/concurrency/latch.d.ts.map +1 -0
- package/script/utils/src/concurrency/latch.js +54 -0
- package/script/utils/src/concurrency/mod.d.ts +5 -0
- package/script/utils/src/concurrency/mod.d.ts.map +1 -0
- package/script/utils/src/concurrency/mod.js +20 -0
- package/script/utils/src/concurrency/retry.d.ts +14 -0
- package/script/utils/src/concurrency/retry.d.ts.map +1 -0
- package/script/utils/src/concurrency/retry.js +30 -0
- package/script/utils/src/concurrency/utils.d.ts +27 -0
- package/script/utils/src/concurrency/utils.d.ts.map +1 -0
- package/script/utils/src/concurrency/utils.js +30 -0
- package/script/utils/src/constants.d.ts +4 -0
- package/script/utils/src/constants.d.ts.map +1 -0
- package/script/utils/src/constants.js +12 -0
- package/script/utils/src/decorators/bound.d.ts +10 -0
- package/script/utils/src/decorators/bound.d.ts.map +1 -0
- package/script/utils/src/decorators/bound.js +20 -0
- package/script/utils/src/decorators/mod.d.ts +2 -0
- package/script/utils/src/decorators/mod.d.ts.map +1 -0
- package/script/utils/src/decorators/mod.js +17 -0
- package/script/utils/src/mod.d.ts +8 -0
- package/script/utils/src/mod.d.ts.map +1 -0
- package/script/utils/src/mod.js +23 -0
- package/script/utils/src/types/json-query.d.ts +30 -0
- package/script/utils/src/types/json-query.d.ts.map +1 -0
- package/script/utils/src/types/json-query.js +2 -0
- package/script/utils/src/types/misc.d.ts +109 -0
- package/script/utils/src/types/misc.d.ts.map +1 -0
- package/script/utils/src/types/misc.js +3 -0
- package/script/utils/src/types/mod.d.ts +7 -0
- package/script/utils/src/types/mod.d.ts.map +1 -0
- package/script/utils/src/types/mod.js +19 -0
- package/script/utils/src/types/nominal.d.ts +87 -0
- package/script/utils/src/types/nominal.d.ts.map +1 -0
- package/script/utils/src/types/nominal.js +2 -0
- package/script/utils/src/types/typebox-helpers.d.ts +183 -0
- package/script/utils/src/types/typebox-helpers.d.ts.map +1 -0
- package/script/utils/src/types/typebox-helpers.js +277 -0
- package/script/utils/src/types/utils.d.ts +37 -0
- package/script/utils/src/types/utils.d.ts.map +1 -0
- package/script/utils/src/types/utils.js +52 -0
- package/script/utils/src/types/validators/algorand.d.ts +31 -0
- package/script/utils/src/types/validators/algorand.d.ts.map +1 -0
- package/script/utils/src/types/validators/algorand.js +98 -0
- package/script/utils/src/types/validators/cardano.d.ts +26 -0
- package/script/utils/src/types/validators/cardano.d.ts.map +1 -0
- package/script/utils/src/types/validators/cardano.js +121 -0
- package/script/utils/src/types/validators/mina.d.ts +15 -0
- package/script/utils/src/types/validators/mina.d.ts.map +1 -0
- package/script/utils/src/types/validators/mina.js +51 -0
- package/script/utils/src/types/validators/minicbor.d.ts +98 -0
- package/script/utils/src/types/validators/minicbor.d.ts.map +1 -0
- package/script/utils/src/types/validators/minicbor.js +337 -0
- package/script/utils/src/types/validators/mod.d.ts +3 -0
- package/script/utils/src/types/validators/mod.d.ts.map +1 -0
- package/script/utils/src/types/validators/mod.js +18 -0
- package/script/utils/src/types/validators/utils.d.ts +6 -0
- package/script/utils/src/types/validators/utils.d.ts.map +1 -0
- package/script/utils/src/types/validators/utils.js +31 -0
- package/script/utils/src/viem.d.ts +6 -0
- package/script/utils/src/viem.d.ts.map +1 -0
- package/script/utils/src/viem.js +19 -0
- package/script/wallets/src/IProvider.d.ts +48 -0
- package/script/wallets/src/IProvider.d.ts.map +1 -0
- package/script/wallets/src/IProvider.js +10 -0
- package/script/wallets/src/avail/avail.d.ts +28 -0
- package/script/wallets/src/avail/avail.d.ts.map +1 -0
- package/script/wallets/src/avail/avail.js +70 -0
- package/script/wallets/src/avail/wrapper.d.ts +6 -0
- package/script/wallets/src/avail/wrapper.d.ts.map +1 -0
- package/script/wallets/src/avail/wrapper.js +34 -0
- package/script/wallets/src/cardano/cardano.d.ts +30 -0
- package/script/wallets/src/cardano/cardano.d.ts.map +1 -0
- package/script/wallets/src/cardano/cardano.js +163 -0
- package/script/wallets/src/cardano/wrapper.d.ts +7 -0
- package/script/wallets/src/cardano/wrapper.d.ts.map +1 -0
- package/script/wallets/src/cardano/wrapper.js +26 -0
- package/script/wallets/src/evm/ethers.d.ts +28 -0
- package/script/wallets/src/evm/ethers.d.ts.map +1 -0
- package/script/wallets/src/evm/ethers.js +84 -0
- package/script/wallets/src/evm/injected.d.ts +74 -0
- package/script/wallets/src/evm/injected.d.ts.map +1 -0
- package/script/wallets/src/evm/injected.js +360 -0
- package/script/wallets/src/evm/types.d.ts +3 -0
- package/script/wallets/src/evm/types.d.ts.map +1 -0
- package/script/wallets/src/evm/types.js +4 -0
- package/script/wallets/src/evm/wrapper-ethers.d.ts +6 -0
- package/script/wallets/src/evm/wrapper-ethers.d.ts.map +1 -0
- package/script/wallets/src/evm/wrapper-ethers.js +41 -0
- package/script/wallets/src/evm/wrapper-injected.d.ts +7 -0
- package/script/wallets/src/evm/wrapper-injected.d.ts.map +1 -0
- package/script/wallets/src/evm/wrapper-injected.js +84 -0
- package/script/wallets/src/midnight/midnight.d.ts +26 -0
- package/script/wallets/src/midnight/midnight.d.ts.map +1 -0
- package/script/wallets/src/midnight/midnight.js +117 -0
- package/script/wallets/src/midnight/wrapper.d.ts +7 -0
- package/script/wallets/src/midnight/wrapper.d.ts.map +1 -0
- package/script/wallets/src/midnight/wrapper.js +26 -0
- package/script/wallets/src/mina/mina.d.ts +28 -0
- package/script/wallets/src/mina/mina.d.ts.map +1 -0
- package/script/wallets/src/mina/mina.js +138 -0
- package/script/wallets/src/mina/wrapper.d.ts +6 -0
- package/script/wallets/src/mina/wrapper.d.ts.map +1 -0
- package/script/wallets/src/mina/wrapper.js +15 -0
- package/script/wallets/src/mod.d.ts +8 -0
- package/script/wallets/src/mod.d.ts.map +1 -0
- package/script/wallets/src/mod.js +26 -0
- package/script/wallets/src/paima.d.ts +104 -0
- package/script/wallets/src/paima.d.ts.map +1 -0
- package/script/wallets/src/paima.js +253 -0
- package/script/wallets/src/types.d.ts +49 -0
- package/script/wallets/src/types.d.ts.map +1 -0
- package/script/wallets/src/types.js +2 -0
- package/script/wallets/src/utils.d.ts +41 -0
- package/script/wallets/src/utils.d.ts.map +1 -0
- package/script/wallets/src/utils.js +81 -0
- package/script/wallets/src/wallet-modes.d.ts +49 -0
- package/script/wallets/src/wallet-modes.d.ts.map +1 -0
- package/script/wallets/src/wallet-modes.js +29 -0
- package/script/wallets/src/wallets.d.ts +5 -0
- package/script/wallets/src/wallets.d.ts.map +1 -0
- package/script/wallets/src/wallets.js +58 -0
- package/script/wallets/src/windows.d.ts +5 -0
- package/script/wallets/src/windows.d.ts.map +1 -0
- package/script/wallets/src/windows.js +12 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Static } from "@sinclair/typebox";
|
|
2
|
+
import { ConfigSyncProtocolType } from "../types.js";
|
|
3
|
+
import { type MergeIntersects } from "../../../../../utils/src/mod.js";
|
|
4
|
+
export declare const ConfigSyncProtocolSchemaNtpBase: import("../../utils.js").ConfigSchema<import("@sinclair/typebox").TObject<{
|
|
5
|
+
name: import("@sinclair/typebox").TString;
|
|
6
|
+
} & {
|
|
7
|
+
pollingInterval: import("@sinclair/typebox").TUnsafe<import("../../../../../utils/src/mod.js").IntervalMs>;
|
|
8
|
+
} & {
|
|
9
|
+
startBlockHeight: import("@sinclair/typebox").TUnsafe<import("../../../../../utils/src/mod.js").BlockNumber>;
|
|
10
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
11
|
+
stopBlockHeight: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnsafe<import("../../../../../utils/src/mod.js").BlockNumber>, import("@sinclair/typebox").TNull]>;
|
|
12
|
+
} & {
|
|
13
|
+
stepSize: import("@sinclair/typebox").TNumber;
|
|
14
|
+
}>>;
|
|
15
|
+
export declare const CommonResponseNtpBase: {
|
|
16
|
+
readonly internal: {};
|
|
17
|
+
readonly payload: {
|
|
18
|
+
readonly ownChain: import("@sinclair/typebox").TObject<{
|
|
19
|
+
blockNumber: import("@sinclair/typebox").TUnsafe<import("../../../../../utils/src/mod.js").BlockNumber>;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare const ConfigSyncProtocolSchemaNtpMain: import("../../utils.js").ConfigSchema<import("@sinclair/typebox").TObject<{
|
|
24
|
+
name: import("@sinclair/typebox").TString;
|
|
25
|
+
} & {
|
|
26
|
+
pollingInterval: import("@sinclair/typebox").TUnsafe<import("../../../../../utils/src/mod.js").IntervalMs>;
|
|
27
|
+
} & {
|
|
28
|
+
startBlockHeight: import("@sinclair/typebox").TUnsafe<import("../../../../../utils/src/mod.js").BlockNumber>;
|
|
29
|
+
} & {
|
|
30
|
+
type: import("@sinclair/typebox").TLiteral<ConfigSyncProtocolType.NTP_MAIN>;
|
|
31
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
32
|
+
stopBlockHeight: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnsafe<import("../../../../../utils/src/mod.js").BlockNumber>, import("@sinclair/typebox").TNull]>;
|
|
33
|
+
} & {
|
|
34
|
+
stepSize: import("@sinclair/typebox").TNumber;
|
|
35
|
+
}>>;
|
|
36
|
+
export type ConfigSyncProtocolNtpMain = MergeIntersects<Static<ReturnType<typeof ConfigSyncProtocolSchemaNtpMain.allProperties<true>>>>;
|
|
37
|
+
export declare const CommonResponseNtpMain: import("@sinclair/typebox").TObject<{
|
|
38
|
+
internal: import("@sinclair/typebox").TObject<{}>;
|
|
39
|
+
payload: import("@sinclair/typebox").TObject<{
|
|
40
|
+
readonly ownChain: import("@sinclair/typebox").TObject<{
|
|
41
|
+
blockNumber: import("@sinclair/typebox").TUnsafe<import("../../../../../utils/src/mod.js").BlockNumber>;
|
|
42
|
+
}>;
|
|
43
|
+
}>;
|
|
44
|
+
}>;
|
|
45
|
+
//# sourceMappingURL=rpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../../../../../src/config/src/schema/sync-protocols/ntp/rpc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAMrD,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,iCAAiC,CAAC;AAUvF,eAAO,MAAM,+BAA+B;;;;;;;;;;GAO1C,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;CAOmB,CAAC;AAMtD,eAAO,MAAM,+BAA+B;;;;;;;;;;;;GAMxC,CAAC;AACL,MAAM,MAAM,yBAAyB,GAAG,eAAe,CACrD,MAAM,CAAC,UAAU,CAAC,OAAO,+BAA+B,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAC/E,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;EAEjC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { ConfigSyncProtocolType } from "../types.js";
|
|
3
|
+
import { NameField, PollingSyncProtocol, StartStopBlockheight, } from "../../common.js";
|
|
4
|
+
import { TypeboxHelpers } from "../../../../../utils/src/mod.js";
|
|
5
|
+
import { genCommonResponse, } from "../common.js";
|
|
6
|
+
// ===========
|
|
7
|
+
// Base schema
|
|
8
|
+
// ===========
|
|
9
|
+
export const ConfigSyncProtocolSchemaNtpBase = NameField.cloneMerge(PollingSyncProtocol).cloneMerge(StartStopBlockheight).cloneMerge({
|
|
10
|
+
required: Type.Object({}),
|
|
11
|
+
optional: Type.Object({
|
|
12
|
+
stepSize: Type.Number({ default: 1000 }),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
export const CommonResponseNtpBase = {
|
|
16
|
+
internal: {},
|
|
17
|
+
payload: {
|
|
18
|
+
ownChain: Type.Object({
|
|
19
|
+
blockNumber: TypeboxHelpers.BlockNumber(),
|
|
20
|
+
}),
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
// ======================
|
|
24
|
+
// NTP Main config
|
|
25
|
+
// ======================
|
|
26
|
+
export const ConfigSyncProtocolSchemaNtpMain = ConfigSyncProtocolSchemaNtpBase
|
|
27
|
+
.cloneMerge({
|
|
28
|
+
required: Type.Object({
|
|
29
|
+
type: Type.Literal(ConfigSyncProtocolType.NTP_MAIN),
|
|
30
|
+
}),
|
|
31
|
+
optional: Type.Object({}),
|
|
32
|
+
});
|
|
33
|
+
export const CommonResponseNtpMain = genCommonResponse(CommonResponseNtpBase);
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { FlipObject } from "../../../../utils/src/mod.js";
|
|
2
|
+
import { ConfigNetworkType } from "../network/mod.js";
|
|
3
|
+
import type { ConfigSyncProtocolDecoratorType } from "./decorators/types.js";
|
|
4
|
+
import type { NetworkConfig } from "../../config/parts/network.js";
|
|
5
|
+
import type { ConfigSyncProtocolMapping } from "./all.js";
|
|
6
|
+
import type { EncodedStateValue, getEvmEvent } from "../../mod.js";
|
|
7
|
+
export declare enum ConfigSyncProtocolType {
|
|
8
|
+
NTP_MAIN = "ntp-main",
|
|
9
|
+
EVM_RPC_PARALLEL = "evm-rpc-parallel",
|
|
10
|
+
CARDANO_CARP_PARALLEL = "cardano-carp-parallel",
|
|
11
|
+
CARDANO_UTXORPC_PARALLEL = "cardano-utxorpc-parallel",
|
|
12
|
+
MINA_PARALLEL = "mina-sql-parallel",
|
|
13
|
+
AVAIL_PARALLEL = "avail-rpc-parallel",
|
|
14
|
+
MIDNIGHT_PARALLEL = "midnight-graphql-parallel",
|
|
15
|
+
BITCOIN_RPC_PARALLEL = "bitcoin-rpc-parallel"
|
|
16
|
+
}
|
|
17
|
+
export declare const SyncProtocolToNetwork: {
|
|
18
|
+
"ntp-main": ConfigNetworkType.NTP;
|
|
19
|
+
"evm-rpc-parallel": ConfigNetworkType.EVM;
|
|
20
|
+
"cardano-carp-parallel": ConfigNetworkType.CARDANO;
|
|
21
|
+
"cardano-utxorpc-parallel": ConfigNetworkType.CARDANO;
|
|
22
|
+
"mina-sql-parallel": ConfigNetworkType.MINA;
|
|
23
|
+
"avail-rpc-parallel": ConfigNetworkType.AVAIL;
|
|
24
|
+
"midnight-graphql-parallel": ConfigNetworkType.MIDNIGHT;
|
|
25
|
+
"bitcoin-rpc-parallel": ConfigNetworkType.BITCOIN;
|
|
26
|
+
};
|
|
27
|
+
export type NetworkTypeFromSyncProtocol<T extends ConfigSyncProtocolType> = (typeof SyncProtocolToNetwork)[T];
|
|
28
|
+
export type SyncProtocolFromNetwork<T extends ConfigNetworkType> = FlipObject<typeof SyncProtocolToNetwork> extends Partial<Record<ConfigNetworkType, ConfigSyncProtocolType>> ? FlipObject<typeof SyncProtocolToNetwork>[T] : never;
|
|
29
|
+
type BasePrimitive = {
|
|
30
|
+
name: string;
|
|
31
|
+
type: `${string}:${string}`;
|
|
32
|
+
startBlockHeight: number;
|
|
33
|
+
scheduledPrefix?: string;
|
|
34
|
+
};
|
|
35
|
+
type EVMPrimitive = BasePrimitive & {
|
|
36
|
+
abi: ReturnType<typeof getEvmEvent> | ReturnType<typeof getEvmEvent>[];
|
|
37
|
+
contractAddress: string;
|
|
38
|
+
};
|
|
39
|
+
type MidnightPrimitive = BasePrimitive & {
|
|
40
|
+
name: string;
|
|
41
|
+
contractAddress: string;
|
|
42
|
+
contract: {
|
|
43
|
+
ledger: (data: EncodedStateValue) => any;
|
|
44
|
+
};
|
|
45
|
+
networkId?: number;
|
|
46
|
+
genesisHash?: string;
|
|
47
|
+
};
|
|
48
|
+
type CardanoUtxoRpcPrimitive = BasePrimitive & {
|
|
49
|
+
TODO_ADD_MISSING_FIELDS: string;
|
|
50
|
+
};
|
|
51
|
+
type CardanoCarpPrimitive = BasePrimitive & {
|
|
52
|
+
TODO_ADD_MISSING_FIELDS: string;
|
|
53
|
+
};
|
|
54
|
+
type MinaPrimitive = BasePrimitive & {
|
|
55
|
+
TODO_ADD_MISSING_FIELDS: string;
|
|
56
|
+
};
|
|
57
|
+
type AvailPrimitive = BasePrimitive & {
|
|
58
|
+
appId: number;
|
|
59
|
+
applicationKey: string;
|
|
60
|
+
genesisHash: string;
|
|
61
|
+
};
|
|
62
|
+
type NtpMainPrimitive = BasePrimitive & {};
|
|
63
|
+
export type BitcoinPrimitiveDirection = "inputs" | "outputs" | "both";
|
|
64
|
+
type BitcoinPrimitive = BasePrimitive & {
|
|
65
|
+
/**
|
|
66
|
+
* The address to watch for transactions. Must be a fixed address, for now multi address wallets are not supported.
|
|
67
|
+
*/
|
|
68
|
+
watchAddress: string;
|
|
69
|
+
/**
|
|
70
|
+
* Allows narrowing notifications to only creations or spends.
|
|
71
|
+
* Defaults to `both`.
|
|
72
|
+
*/
|
|
73
|
+
direction?: BitcoinPrimitiveDirection;
|
|
74
|
+
/**
|
|
75
|
+
* Optional human label for this address (e.g. exchange name).
|
|
76
|
+
*/
|
|
77
|
+
label?: string;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* A mapping between specific sync protocols and their corresponding primitive types.
|
|
81
|
+
* This helps in creating a discriminated union for PrimitiveEntry.
|
|
82
|
+
*/
|
|
83
|
+
export type ProtocolPrimitiveMap = {
|
|
84
|
+
[ConfigSyncProtocolType.NTP_MAIN]: NtpMainPrimitive;
|
|
85
|
+
[ConfigSyncProtocolType.EVM_RPC_PARALLEL]: EVMPrimitive;
|
|
86
|
+
[ConfigSyncProtocolType.MIDNIGHT_PARALLEL]: MidnightPrimitive;
|
|
87
|
+
[ConfigSyncProtocolType.CARDANO_CARP_PARALLEL]: CardanoCarpPrimitive;
|
|
88
|
+
[ConfigSyncProtocolType.CARDANO_UTXORPC_PARALLEL]: CardanoUtxoRpcPrimitive;
|
|
89
|
+
[ConfigSyncProtocolType.MINA_PARALLEL]: MinaPrimitive;
|
|
90
|
+
[ConfigSyncProtocolType.AVAIL_PARALLEL]: AvailPrimitive;
|
|
91
|
+
[ConfigSyncProtocolType.BITCOIN_RPC_PARALLEL]: BitcoinPrimitive;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* PrimitiveEntry contains the sync protocol name,
|
|
95
|
+
* and the primitive configuration created by `getConfig()`
|
|
96
|
+
*/
|
|
97
|
+
export type PrimitiveEntry = {
|
|
98
|
+
[K in ConfigSyncProtocolType]: {
|
|
99
|
+
/** The sync protocol this primitive belongs to */
|
|
100
|
+
syncProtocol: K;
|
|
101
|
+
/**
|
|
102
|
+
* The primitive configuration, correctly typed based on the syncProtocol.
|
|
103
|
+
* Protocols not in ProtocolPrimitiveMap will default to DefaultPrimitive.
|
|
104
|
+
*/
|
|
105
|
+
primitive: K extends keyof ProtocolPrimitiveMap ? ProtocolPrimitiveMap[K] : never;
|
|
106
|
+
/** Custom identifier for the primitive */
|
|
107
|
+
id: string;
|
|
108
|
+
};
|
|
109
|
+
}[ConfigSyncProtocolType];
|
|
110
|
+
export type NetworkFromSyncProtocol<T extends ConfigSyncProtocolType | ConfigSyncProtocolDecoratorType> = T extends ConfigSyncProtocolType ? Extract<NetworkConfig, {
|
|
111
|
+
type: NetworkTypeFromSyncProtocol<T>;
|
|
112
|
+
}> : undefined;
|
|
113
|
+
export type SyncProtocolWithNetwork = {
|
|
114
|
+
[K in keyof typeof SyncProtocolToNetwork]: {
|
|
115
|
+
networkType: NetworkFromSyncProtocol<K>["type"];
|
|
116
|
+
syncProtocolType: ConfigSyncProtocolMapping[K]["type"];
|
|
117
|
+
syncProtocol: ConfigSyncProtocolMapping[K];
|
|
118
|
+
network: NetworkFromSyncProtocol<K>;
|
|
119
|
+
primitives: Extract<PrimitiveEntry, {
|
|
120
|
+
syncProtocol: ConfigSyncProtocolMapping[K]["type"];
|
|
121
|
+
}>[];
|
|
122
|
+
};
|
|
123
|
+
}[keyof typeof SyncProtocolToNetwork];
|
|
124
|
+
export {};
|
|
125
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/config/src/schema/sync-protocols/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,M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vD,EAAE,CAAC;KACL;CACF,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ConfigNetworkType } from "../network/mod.js";
|
|
2
|
+
export var ConfigSyncProtocolType;
|
|
3
|
+
(function (ConfigSyncProtocolType) {
|
|
4
|
+
ConfigSyncProtocolType["NTP_MAIN"] = "ntp-main";
|
|
5
|
+
ConfigSyncProtocolType["EVM_RPC_PARALLEL"] = "evm-rpc-parallel";
|
|
6
|
+
ConfigSyncProtocolType["CARDANO_CARP_PARALLEL"] = "cardano-carp-parallel";
|
|
7
|
+
ConfigSyncProtocolType["CARDANO_UTXORPC_PARALLEL"] = "cardano-utxorpc-parallel";
|
|
8
|
+
ConfigSyncProtocolType["MINA_PARALLEL"] = "mina-sql-parallel";
|
|
9
|
+
ConfigSyncProtocolType["AVAIL_PARALLEL"] = "avail-rpc-parallel";
|
|
10
|
+
ConfigSyncProtocolType["MIDNIGHT_PARALLEL"] = "midnight-graphql-parallel";
|
|
11
|
+
ConfigSyncProtocolType["BITCOIN_RPC_PARALLEL"] = "bitcoin-rpc-parallel";
|
|
12
|
+
})(ConfigSyncProtocolType || (ConfigSyncProtocolType = {}));
|
|
13
|
+
export const SyncProtocolToNetwork = {
|
|
14
|
+
[ConfigSyncProtocolType.NTP_MAIN]: ConfigNetworkType.NTP,
|
|
15
|
+
[ConfigSyncProtocolType.EVM_RPC_PARALLEL]: ConfigNetworkType.EVM,
|
|
16
|
+
[ConfigSyncProtocolType.CARDANO_CARP_PARALLEL]: ConfigNetworkType.CARDANO,
|
|
17
|
+
[ConfigSyncProtocolType.CARDANO_UTXORPC_PARALLEL]: ConfigNetworkType.CARDANO,
|
|
18
|
+
[ConfigSyncProtocolType.MINA_PARALLEL]: ConfigNetworkType.MINA,
|
|
19
|
+
[ConfigSyncProtocolType.AVAIL_PARALLEL]: ConfigNetworkType.AVAIL,
|
|
20
|
+
[ConfigSyncProtocolType.MIDNIGHT_PARALLEL]: ConfigNetworkType.MIDNIGHT,
|
|
21
|
+
[ConfigSyncProtocolType.BITCOIN_RPC_PARALLEL]: ConfigNetworkType.BITCOIN,
|
|
22
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { MergeIntersects } from "../../../utils/src/mod.js";
|
|
2
|
+
import type { Static, TIntersect, TObject, TPartial } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* We limit the top-level types that are allowed to avoid performance issues.
|
|
5
|
+
* The problem comes with `cloneMerge` where we need to combine many ConfigSchemas together.
|
|
6
|
+
* If we allow things other than objects, we have to support almost *any* type
|
|
7
|
+
*
|
|
8
|
+
* You might be tempted to think you could just handle only common cases:
|
|
9
|
+
* - TObject, TUnion, TIntersect
|
|
10
|
+
* But the problem is combining these is non-trivial in a general way.
|
|
11
|
+
* There exists a general solution `TComposite<TObject[]>`,
|
|
12
|
+
* but the type is extremely complex which slows down Typescript a lot.
|
|
13
|
+
*/
|
|
14
|
+
type ObjectLike = TObject;
|
|
15
|
+
type ObjectContent<T extends ObjectLike> = T extends TObject<infer O> ? O : never;
|
|
16
|
+
export type ConfigProperties<Required extends ObjectLike, Optional extends ObjectLike> = {
|
|
17
|
+
required: Required;
|
|
18
|
+
/**
|
|
19
|
+
* Note: each `optional` value MUST contain a `default` field.
|
|
20
|
+
* the default value can be null
|
|
21
|
+
*/
|
|
22
|
+
optional: Optional;
|
|
23
|
+
};
|
|
24
|
+
export type AllProperties<Required extends ObjectLike, Optional extends ObjectLike, Bool extends boolean> = TIntersect<[Required, Bool extends true ? Optional : TPartial<Optional>]>;
|
|
25
|
+
export type AllPropertiesFor<Schema extends ConfigSchema<any, any>, Bool extends boolean> = Schema extends ConfigSchema<infer Required, infer Optional> ? AllProperties<Required, Optional, Bool> : never;
|
|
26
|
+
export type ToMapping<Type extends string, T extends Partial<Record<Type, ConfigSchema<TObject, TObject>>>> = {
|
|
27
|
+
[K in keyof T]: T[K] extends ConfigSchema<TObject, TObject> ? MergeIntersects<Static<AllPropertiesFor<T[K], true>>> : never;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* This class is to used to help handle the fact that some fields are required and some are optional.
|
|
31
|
+
*
|
|
32
|
+
* Notably, in some cases we want to allow omitting optional fields (when defining your configuration)
|
|
33
|
+
* But in other cases (ex: using the config after it's been generated), we want to enforce that all optional fields that have a default are present.
|
|
34
|
+
*
|
|
35
|
+
* You can't easily solve this in Typebox without this class
|
|
36
|
+
* because default values aren't part of the type signature
|
|
37
|
+
* so there is no easy way to recover them after-the-fact
|
|
38
|
+
* (aka distinguish between a field that defaults to null vs defaults to a non-nullable specific value)
|
|
39
|
+
* However, it's possible thanks to this class
|
|
40
|
+
*/
|
|
41
|
+
export declare class ConfigSchema<Required extends ObjectLike, Optional extends ObjectLike> {
|
|
42
|
+
readonly config: ConfigProperties<Required, Optional>;
|
|
43
|
+
constructor(config: ConfigProperties<Required, Optional>);
|
|
44
|
+
allProperties: <Bool extends boolean>(requireOptional: Bool) => AllProperties<Required, Optional, Bool>;
|
|
45
|
+
defaultProperties: () => MergeIntersects<Partial<Static<Optional>>>;
|
|
46
|
+
/**
|
|
47
|
+
* Merge two ConfigSchemas together
|
|
48
|
+
* DANGER: this will not merge top-level `options` of these objects
|
|
49
|
+
*/
|
|
50
|
+
cloneMerge: <NewRequired extends ObjectLike, NewOptional extends ObjectLike>(newConfig: ConfigProperties<NewRequired, NewOptional> | ConfigSchema<NewRequired, NewOptional>) => ConfigSchema<TObject<ObjectContent<Required> & ObjectContent<NewRequired>>, TObject<ObjectContent<Optional> & ObjectContent<NewOptional>>>;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/config/src/schema/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,C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,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,GACrD,KAAK;CACV,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,qBAAa,YAAY,CACvB,QAAQ,SAAS,UAAU,EAC3B,QAAQ,SAAS,UAAU;aAEC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC;gBAA5C,MAAM,EAAE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAWxE,aAAa,GAAI,IAAI,SAAS,OAAO,EACnC,iBAAiB,IAAI,KACpB,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAOxC;IAEF,iBAAiB,QAAO,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAGhE;IAEF;;;OAGG;IACH,UAAU,GAAI,WAAW,SAAS,UAAU,EAAE,WAAW,SAAS,UAAU,EAC1E,WACI,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,GAC1C,YAAY,CAAC,WAAW,EAAE,WAAW,CAAC,KACzC,YAAY,CACb,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,EAC7D,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,CAC9D,CAeC;CACH"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { Value } from "@sinclair/typebox/value";
|
|
3
|
+
/**
|
|
4
|
+
* This class is to used to help handle the fact that some fields are required and some are optional.
|
|
5
|
+
*
|
|
6
|
+
* Notably, in some cases we want to allow omitting optional fields (when defining your configuration)
|
|
7
|
+
* But in other cases (ex: using the config after it's been generated), we want to enforce that all optional fields that have a default are present.
|
|
8
|
+
*
|
|
9
|
+
* You can't easily solve this in Typebox without this class
|
|
10
|
+
* because default values aren't part of the type signature
|
|
11
|
+
* so there is no easy way to recover them after-the-fact
|
|
12
|
+
* (aka distinguish between a field that defaults to null vs defaults to a non-nullable specific value)
|
|
13
|
+
* However, it's possible thanks to this class
|
|
14
|
+
*/
|
|
15
|
+
export class ConfigSchema {
|
|
16
|
+
config;
|
|
17
|
+
constructor(config) {
|
|
18
|
+
// TODO: fast-fail if
|
|
19
|
+
// 1. any required property is an optional field
|
|
20
|
+
// 1. any `optional` does not set a default value
|
|
21
|
+
this.config = config;
|
|
22
|
+
// TODO: replace once TS5 decorators are better supported
|
|
23
|
+
this.allProperties.bind(this);
|
|
24
|
+
this.defaultProperties.bind(this);
|
|
25
|
+
this.cloneMerge.bind(this);
|
|
26
|
+
}
|
|
27
|
+
allProperties = (requireOptional) => {
|
|
28
|
+
return Type.Intersect([
|
|
29
|
+
this.config.required,
|
|
30
|
+
requireOptional
|
|
31
|
+
? this.config.optional
|
|
32
|
+
: Type.Partial(this.config.optional),
|
|
33
|
+
]);
|
|
34
|
+
};
|
|
35
|
+
defaultProperties = () => {
|
|
36
|
+
const defaults = Value.Default(this.config.optional, {});
|
|
37
|
+
return defaults;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Merge two ConfigSchemas together
|
|
41
|
+
* DANGER: this will not merge top-level `options` of these objects
|
|
42
|
+
*/
|
|
43
|
+
cloneMerge = (newConfig) => {
|
|
44
|
+
const config = newConfig instanceof ConfigSchema
|
|
45
|
+
? newConfig.config
|
|
46
|
+
: newConfig;
|
|
47
|
+
return new ConfigSchema({
|
|
48
|
+
required: Type.Object({
|
|
49
|
+
...this.config.required.properties,
|
|
50
|
+
...config.required.properties,
|
|
51
|
+
}),
|
|
52
|
+
optional: Type.Object({
|
|
53
|
+
...this.config.optional.properties,
|
|
54
|
+
...config.optional.properties,
|
|
55
|
+
}),
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ArgPath, BrokerName, ExcludeFromTuple, LogEvent, LogEventFields, OutputKeypairToObj, RemoveAllIndexed, TransformAllEventInput } from './types.js';
|
|
2
|
+
import { TopicPrefix } from './types.js';
|
|
3
|
+
import type { TSchema, Static, TObject } from '@sinclair/typebox';
|
|
4
|
+
type Data<T extends LogEvent<LogEventFields<TSchema>[]>> = {
|
|
5
|
+
name: T['name'];
|
|
6
|
+
fields: KeypairToObj<T['fields']>;
|
|
7
|
+
topic: string;
|
|
8
|
+
};
|
|
9
|
+
type AllEventsUnion<T extends Record<string, LogEvent<LogEventFields<TSchema>[]>>> = {
|
|
10
|
+
[K in keyof T]: Data<T[K]>;
|
|
11
|
+
};
|
|
12
|
+
export type EventQueue<T extends Record<string, LogEvent<LogEventFields<TSchema>[]>>> = {
|
|
13
|
+
address: `0x${string}`;
|
|
14
|
+
data: AllEventsUnion<T>[keyof T];
|
|
15
|
+
}[];
|
|
16
|
+
export declare const toSignature: <T extends LogEvent<LogEventFields<TSchema>[]>>(event: T) => string;
|
|
17
|
+
export declare const toSignatureHash: <T extends LogEvent<LogEventFields<TSchema>[]>>(event: T) => string;
|
|
18
|
+
export type AppEvents = ReturnType<typeof groupEvents>;
|
|
19
|
+
export type RegisteredEvent<T extends LogEvent<LogEventFields<TSchema>[]>> = {
|
|
20
|
+
/**
|
|
21
|
+
* the next three properties are basically the return type of toPath, but
|
|
22
|
+
* using ReturnType for some reason binds path to never[], which makes any
|
|
23
|
+
* assignment fail to typecheck.
|
|
24
|
+
*/
|
|
25
|
+
path: (string | ArgPath)[];
|
|
26
|
+
broker: BrokerName<TopicPrefix.App>;
|
|
27
|
+
type: TObject<OutputKeypairToObj<ExcludeFromTuple<TransformAllEventInput<RemoveAllIndexed<T['fields']>>, never>>>;
|
|
28
|
+
/**
|
|
29
|
+
* keep the original definition around since it's nicer to work with, it
|
|
30
|
+
* also has the advantage that it allows recovering the initial order in
|
|
31
|
+
* case the signature/topicHash needs to be computed again, which can't be
|
|
32
|
+
* done from the path (since you don't know which non indexed fields go in
|
|
33
|
+
* between each indexed field).
|
|
34
|
+
*/
|
|
35
|
+
definition: T;
|
|
36
|
+
/**
|
|
37
|
+
* we add this to avoid having to re-compute it all the time
|
|
38
|
+
*/
|
|
39
|
+
topicHash: string;
|
|
40
|
+
};
|
|
41
|
+
export declare const registerEvents: <const T extends Record<string, LogEvent<LogEventFields<TSchema>[]>>>(entries: T) => { [K in keyof T]: RegisteredEvent<T[K]>; };
|
|
42
|
+
/**
|
|
43
|
+
* groups events by their name (essentially, grouping by overloads)
|
|
44
|
+
*/
|
|
45
|
+
export declare const groupEvents: <T extends Record<string, RegisteredEvent<LogEvent<LogEventFields<TSchema>[]>>>>(events: T) => { [K in T[string] as K["definition"]["name"]]: T[string][]; };
|
|
46
|
+
export declare const encodeEventForStf: <T extends Omit<RegisteredEvent<LogEvent<LogEventFields<TSchema>[]>>, "path">>(args: {
|
|
47
|
+
from: `0x${string}`;
|
|
48
|
+
topic: T;
|
|
49
|
+
data: KeypairToObj<T["definition"]["fields"]>;
|
|
50
|
+
}) => {
|
|
51
|
+
address: `0x${string}`;
|
|
52
|
+
data: {
|
|
53
|
+
name: T["definition"]["name"];
|
|
54
|
+
fields: KeypairToObj<T["definition"]["fields"]>;
|
|
55
|
+
topic: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
type KeypairToObj<T extends {
|
|
59
|
+
name: string;
|
|
60
|
+
type: any;
|
|
61
|
+
}[]> = {
|
|
62
|
+
[K in T[number] as K['name']]: Static<K['type']>;
|
|
63
|
+
};
|
|
64
|
+
export {};
|
|
65
|
+
//# sourceMappingURL=app-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-events.d.ts","sourceRoot":"","sources":["../../../src/events/src/app-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAA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AAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC/C,KAAG;IACF,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,IAAI,EAAE;QACJ,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;QAC9B,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;QAChD,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CAUH,CAAC;AAGF,KAAK,YAAY,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,EAAE,IAAI;KAC1D,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;CACjD,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { toPath, TopicPrefix } from './types.js';
|
|
2
|
+
import sha3 from 'js-sha3';
|
|
3
|
+
const { keccak_256 } = sha3;
|
|
4
|
+
export const toSignature = (event) => {
|
|
5
|
+
return event.name + '(' + event.fields.map(f => f.type.type).join(',') + ')';
|
|
6
|
+
};
|
|
7
|
+
export const toSignatureHash = (event) => {
|
|
8
|
+
return keccak_256(toSignature(event));
|
|
9
|
+
};
|
|
10
|
+
export const registerEvents = (entries) => {
|
|
11
|
+
return Object.fromEntries(Object.keys(entries).map(key => {
|
|
12
|
+
const event = entries[key];
|
|
13
|
+
const topicHash = toSignatureHash(event);
|
|
14
|
+
return [
|
|
15
|
+
key,
|
|
16
|
+
{
|
|
17
|
+
...toPath(TopicPrefix.App, event, topicHash),
|
|
18
|
+
definition: event,
|
|
19
|
+
topicHash,
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
})); // we can't know the type here
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* groups events by their name (essentially, grouping by overloads)
|
|
26
|
+
*/
|
|
27
|
+
export const groupEvents = (events) => {
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
+
let result = {}; // we can't know the type here
|
|
30
|
+
for (const key of Object.keys(events)) {
|
|
31
|
+
const event = events[key];
|
|
32
|
+
if (!result[event.definition.name]) {
|
|
33
|
+
result[event.definition.name] = [];
|
|
34
|
+
}
|
|
35
|
+
result[event.definition.name].push(event);
|
|
36
|
+
}
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
// Create payload for the stf from an object. Using this allows statically
|
|
41
|
+
// checking `data` with the type from `T`.
|
|
42
|
+
export const encodeEventForStf = (args) => {
|
|
43
|
+
return {
|
|
44
|
+
address: args.from,
|
|
45
|
+
data: {
|
|
46
|
+
name: args.topic.definition.name,
|
|
47
|
+
fields: args.data,
|
|
48
|
+
topic: toSignatureHash(args.topic.definition),
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
};
|