@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,109 @@
|
|
|
1
|
+
import type { TObject } from "@sinclair/typebox";
|
|
2
|
+
import type { EvmAddress } from "./nominal.js";
|
|
3
|
+
export type IntersectObject<T, Obj> = T extends TObject<infer O> ? TObject<ShallowMergeIntersects<O & Obj>> : never;
|
|
4
|
+
export type TransactionTemplate = {
|
|
5
|
+
data: string;
|
|
6
|
+
to: EvmAddress;
|
|
7
|
+
gasPrice: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @description Combines members of an intersection into a readable type.
|
|
11
|
+
*
|
|
12
|
+
* @see {@link https://twitter.com/Riyaadh_Abr/status/1622736576303312899/photo/1}
|
|
13
|
+
* @example
|
|
14
|
+
* MergeIntersects<{ a: string } & { b: string } & { c: number, d: bigint }>
|
|
15
|
+
* => { a: string, b: string, c: number, d: bigint }
|
|
16
|
+
*/
|
|
17
|
+
export type MergeIntersects<T> = T extends Record<string, unknown> | readonly Record<string, unknown>[] ? T extends infer Obj ? {
|
|
18
|
+
[K in keyof Obj]: MergeIntersects<Obj[K]>;
|
|
19
|
+
} : never : T;
|
|
20
|
+
/**
|
|
21
|
+
* Same as the above, but shallow (not recursive)
|
|
22
|
+
* This is useful if you don't want Typescript to expand an underlying type
|
|
23
|
+
*
|
|
24
|
+
* ex: avoid { foo: FooType } turning into { foo: { a: string, b: string } }
|
|
25
|
+
*/
|
|
26
|
+
export type ShallowMergeIntersects<T> = {
|
|
27
|
+
[K in keyof T]: T[K];
|
|
28
|
+
} & {};
|
|
29
|
+
/**
|
|
30
|
+
* Flips an object so key are values and values are keys
|
|
31
|
+
*
|
|
32
|
+
* ex: Record<A, B> becomes Partial<Record<B, A>>
|
|
33
|
+
*/
|
|
34
|
+
export type FlipObject<T extends Record<any, any>> = {
|
|
35
|
+
[Value in T[keyof T]]: keyof {
|
|
36
|
+
[Key in keyof T as Value extends T[Key] ? Key : never]: any;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type NoUndefinedField<T> = {
|
|
40
|
+
[P in keyof T]-?: NonNullable<T[P]>;
|
|
41
|
+
};
|
|
42
|
+
export type ElementOf<T extends readonly any[]> = T extends (infer Elem)[] ? Elem : never;
|
|
43
|
+
export type ValueOf<T> = T[keyof T];
|
|
44
|
+
export type Satisfies<Base, T> = T extends Base ? true : false;
|
|
45
|
+
export type RemoveNeverEntries<T extends Record<any, any>> = {
|
|
46
|
+
[K in keyof T as T[K] extends never ? never : K]: T[K];
|
|
47
|
+
};
|
|
48
|
+
export type IdxOf<T> = {
|
|
49
|
+
[idx in keyof T]: idx;
|
|
50
|
+
}[any];
|
|
51
|
+
export type RemoveUnknown<T> = unknown extends T ? (T extends unknown ? never : T) : T;
|
|
52
|
+
type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
|
|
53
|
+
export type Mutable<T> = {
|
|
54
|
+
-readonly [P in keyof T]: T[P];
|
|
55
|
+
};
|
|
56
|
+
export type DeepMutable<T> = T extends ImmutablePrimitive ? T : T extends ReadonlyArray<infer U> ? Array<DeepMutable<U>> : T extends ReadonlySet<infer U> ? Set<DeepMutable<U>> : T extends ReadonlyMap<infer K, infer V> ? Map<DeepMutable<K>, DeepMutable<V>> : T extends Function ? T : T extends object ? {
|
|
57
|
+
-readonly [K in keyof T]: DeepMutable<T[K]>;
|
|
58
|
+
} : T;
|
|
59
|
+
export type DeepReadonly<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ReadonlyArray<DeepReadonly<U>> : T extends Map<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends Set<infer M> ? ReadonlySet<DeepReadonly<M>> : {
|
|
60
|
+
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
61
|
+
};
|
|
62
|
+
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I extends U) => void ? I : never;
|
|
63
|
+
declare const __TypeError: unique symbol;
|
|
64
|
+
type TypeError<BaseType extends string> = BaseType & {
|
|
65
|
+
readonly [__TypeError]: BaseType;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Prints custom error message
|
|
69
|
+
* Taken from https://github.com/wevm/abitype/blob/main/packages/abitype/src/types.ts#L11
|
|
70
|
+
*
|
|
71
|
+
* @param messages - Error message
|
|
72
|
+
* @returns Custom error message
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* type Result = Error<'Custom error message'>
|
|
76
|
+
* // ^? type Result = ['Error: Custom error message']
|
|
77
|
+
*/
|
|
78
|
+
export type TypeErrorMessage<messages extends string | string[]> = messages extends string ? TypeError<messages> : {
|
|
79
|
+
[key in keyof messages]: messages[key] extends infer message extends string ? TypeError<message> : never;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Types that Typescript allows inside a string template
|
|
83
|
+
*/
|
|
84
|
+
export type Stringifiable = string | number | bigint | boolean | null | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Turns an Object whose keys are numbers into an equivalent tuple
|
|
87
|
+
* WARNING: This ONLY works if the keys are consecutive numbers starting from 0
|
|
88
|
+
*/
|
|
89
|
+
export type ToTupleSimple<T extends {
|
|
90
|
+
[key: number]: any;
|
|
91
|
+
}, Acc extends any[] = []> = Acc["length"] extends keyof T ? ToTupleSimple<T, [...Acc, T[Acc["length"]]]> : Acc;
|
|
92
|
+
type BuildTuple<T extends {
|
|
93
|
+
[key: number]: any;
|
|
94
|
+
}, MaxSize extends number, Acc extends any[] = []> = Acc["length"] extends MaxSize ? Acc : BuildTuple<T, MaxSize, [
|
|
95
|
+
...Acc,
|
|
96
|
+
Acc["length"] extends keyof T ? T[Acc["length"]] : never
|
|
97
|
+
]>;
|
|
98
|
+
type FilterNeverArray<T extends any[]> = T extends [infer First, ...infer Rest] ? [First] extends [never] ? FilterNeverArray<Rest> : [First, ...FilterNeverArray<Rest>] : [];
|
|
99
|
+
/**
|
|
100
|
+
* Turns an Object whose keys are numbers into an equivalent tuple
|
|
101
|
+
* WARNING: This supports objects that are missing entries (not consecutive numbers starting from 0)
|
|
102
|
+
* However, you MUST specify the maximum value in the object keys instead
|
|
103
|
+
* This is required since Typescript doesn't easily support artihmetic at the type level
|
|
104
|
+
*/
|
|
105
|
+
export type ToTupleComplex<T extends {
|
|
106
|
+
[key: number]: any;
|
|
107
|
+
}, MaxSize extends number> = FilterNeverArray<BuildTuple<T, MaxSize>>;
|
|
108
|
+
export {};
|
|
109
|
+
//# sourceMappingURL=misc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../../src/utils/src/types/misc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,MAAM,eAAe,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAC5D,OAAO,CAAC,sBAAsB,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GACxC,KAAK,CAAC;AAGV,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,UAAU,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,SAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,SAAS,MAAM,CAAC,MAAM,EAA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1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/utils/src/types/mod.ts"],"names":[],"mappings":"AAAA,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,cAAc,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { FastFlavor } from "@coderspirit/nominal";
|
|
2
|
+
/**
|
|
3
|
+
* TODO: remove any instance of this in the codebase
|
|
4
|
+
* Note: often this is uncertainty between HexString0x and HexStringNo0x
|
|
5
|
+
*/
|
|
6
|
+
export type UnknownFormat = string;
|
|
7
|
+
export type URI = FastFlavor<string, "Uri">;
|
|
8
|
+
export type Caip2 = FastFlavor<string, "Caip2">;
|
|
9
|
+
/**
|
|
10
|
+
* TODO: probably best to make this more granular to different cryptographic schemes
|
|
11
|
+
* esp. since some return 0x and others don't
|
|
12
|
+
*/
|
|
13
|
+
export type EvmSignature = FastFlavor<HexString0x, "EvmSignature">;
|
|
14
|
+
export type GenericSignature = FastFlavor<string, "OtherSignature">;
|
|
15
|
+
export type Signature = EvmSignature | GenericSignature;
|
|
16
|
+
export type VersionString = `${number}.${number}.${number}`;
|
|
17
|
+
export type PaimaBlockNumber = FastFlavor<number, "PaimaBlockNumber">;
|
|
18
|
+
export type EvmBlockNumber = FastFlavor<number, "EvmBlockNumber">;
|
|
19
|
+
export type NtpBlockNumber = FastFlavor<number, "NtpBlockNumber">;
|
|
20
|
+
export type MidnightBlockNumber = FastFlavor<number, "MidnightBlockNumber">;
|
|
21
|
+
export type CardanoBlockNumber = FastFlavor<number, "CardanoBlockNumber">;
|
|
22
|
+
export type BitcoinBlockNumber = FastFlavor<number, "BitcoinBlockNumber">;
|
|
23
|
+
export type BlockNumber = PaimaBlockNumber | EvmBlockNumber | NtpBlockNumber | MidnightBlockNumber | CardanoBlockNumber | BitcoinBlockNumber;
|
|
24
|
+
/**
|
|
25
|
+
* recall: slots may be empty, so absolute slot number is not usually equal to block number
|
|
26
|
+
*/
|
|
27
|
+
export type AbsoluteSlotNumber = FastFlavor<number, "AbsoluteSlotNumber">;
|
|
28
|
+
export type RelativeSlotNumber = FastFlavor<number, "RelativeSlotNumber">;
|
|
29
|
+
export type EpochNumber = FastFlavor<number, "EpochNumber">;
|
|
30
|
+
export type HexString0x = `0x${string}`;
|
|
31
|
+
export type HexStringNo0x = FastFlavor<string, "HexStringNo0x">;
|
|
32
|
+
export type Base64String = FastFlavor<string, "Base64String">;
|
|
33
|
+
export type IntervalMs = FastFlavor<number, "IntervalMs">;
|
|
34
|
+
export type IntervalSec = FastFlavor<number, "IntervalSec">;
|
|
35
|
+
export type TimestampMs = FastFlavor<number, "TimestampMs">;
|
|
36
|
+
export type TimestampMsStr = FastFlavor<string, "TimestampMsStr">;
|
|
37
|
+
export type TimestampSec = FastFlavor<number, "TimestampSec">;
|
|
38
|
+
export type TimestampIso8601 = FastFlavor<string, "TimestampIso8601">;
|
|
39
|
+
export type AlgorandBlockHash = FastFlavor<UnknownFormat, "AlgorandBlockHash">;
|
|
40
|
+
export type AlgorandTxHash = FastFlavor<UnknownFormat, "AlgorandTxHash">;
|
|
41
|
+
export type AlgorandAddress = FastFlavor<string, "AlgorandAddress">;
|
|
42
|
+
export type AvailBlockHash = FastFlavor<UnknownFormat, "AvailBlockHash">;
|
|
43
|
+
export type AvailTxHash = FastFlavor<UnknownFormat, "AvailTxHash">;
|
|
44
|
+
export type AvailAddress = SubstrateAddress;
|
|
45
|
+
export type CardanoBlockHash = FastFlavor<string, "CardanoBlockHash">;
|
|
46
|
+
export type CardanoTxHash = FastFlavor<string, "CardanoTxHash">;
|
|
47
|
+
export type CardanoAddress = FastFlavor<string, "CardanoAddress">;
|
|
48
|
+
export type CardanoCredential = FastFlavor<string, "CardanoCredential">;
|
|
49
|
+
export type CardanoPolicyId = FastFlavor<string, "CardanoPolicyId">;
|
|
50
|
+
export type CardanoAssetName = FastFlavor<string, "CardanoAssetName">;
|
|
51
|
+
export type CardanoCip14Fingerprint = FastFlavor<string, "CardanoCip14Fingerprint">;
|
|
52
|
+
export type CardanoPoolId = FastFlavor<string, "CardanoPoolId">;
|
|
53
|
+
export type CardanoAmountLovelace = FastFlavor<string, "CardanoAmountLovelace">;
|
|
54
|
+
export type NtpBlockHash = FastFlavor<string, "NtpBlockHash">;
|
|
55
|
+
export type NtpTxHash = FastFlavor<string, "NtpTxHash">;
|
|
56
|
+
export type NtpAddress = FastFlavor<string, "NtpAddress">;
|
|
57
|
+
export type EvmBlockHash = FastFlavor<HexString0x, "EvmBlockHash">;
|
|
58
|
+
export type EvmTxHash = FastFlavor<HexString0x, "EvmTxHash">;
|
|
59
|
+
export type EvmAddress = FastFlavor<HexString0x, "EvmAddress">;
|
|
60
|
+
export type EvmSelector = FastFlavor<HexString0x, "EvmSelector">;
|
|
61
|
+
export type Evm4ByteSelector = FastFlavor<HexString0x, "Evm4ByteSelector">;
|
|
62
|
+
export type MidnightBlockHash = FastFlavor<HexString0x, "MidnightBlockHash">;
|
|
63
|
+
export type MidnightTxHash = FastFlavor<HexString0x, "MidnightTxHash">;
|
|
64
|
+
export type MidnightAddress = FastFlavor<string, "MidnightAddress">;
|
|
65
|
+
export type MinaBlockHash = FastFlavor<UnknownFormat, "MinaBlockHash">;
|
|
66
|
+
export type MinaTxHash = FastFlavor<UnknownFormat, "MinaTxHash">;
|
|
67
|
+
export type MinaAddress = FastFlavor<string, "MinaAddress">;
|
|
68
|
+
export type SubstrateAddress = FastFlavor<string, "SubstrateAddress">;
|
|
69
|
+
export type BitcoinBlockHash = FastFlavor<string, "BitcoinBlockHash">;
|
|
70
|
+
export type BitcoinTxId = FastFlavor<string, "BitcoinTxId">;
|
|
71
|
+
export type BitcoinAddress = FastFlavor<string, "BitcoinAddress">;
|
|
72
|
+
export type WalletAddress = AlgorandAddress | AvailAddress | CardanoAddress | EvmAddress | MidnightAddress | MinaAddress | SubstrateAddress | BitcoinAddress;
|
|
73
|
+
/**
|
|
74
|
+
* TODO: probably best to make this more granular to different cryptographic schemes
|
|
75
|
+
*/
|
|
76
|
+
export type EvmPrivateKey = FastFlavor<HexString0x, "EvmPrivateKey">;
|
|
77
|
+
export type GenericPrivateKey = FastFlavor<string, "GenericPrivateKey">;
|
|
78
|
+
export type PrivateKey = EvmPrivateKey | GenericPrivateKey;
|
|
79
|
+
export type PaimaTxHash = FastFlavor<HexString0x, "PaimaTxHash">;
|
|
80
|
+
export type TxHash = AlgorandTxHash | AvailTxHash | CardanoTxHash | EvmTxHash | MidnightTxHash | MinaTxHash | PaimaTxHash | NtpTxHash;
|
|
81
|
+
export type PaimaBlockHash = FastFlavor<HexString0x, "PaimaBlockHash">;
|
|
82
|
+
export type BlockHash = AlgorandBlockHash | AvailBlockHash | CardanoBlockHash | EvmBlockHash | MidnightBlockHash | MinaBlockHash | PaimaBlockHash | NtpBlockHash | BitcoinBlockHash;
|
|
83
|
+
export type NtpPageJson = FastFlavor<string, "NTPPageJson">;
|
|
84
|
+
export type EvmRpcPageJson = FastFlavor<string, "EvmRpcPageJson">;
|
|
85
|
+
export type CarpCursorJson = FastFlavor<string, "CarpCursorJson">;
|
|
86
|
+
export type MidnightEncodedStateJson = FastFlavor<string, "MidnightEncodedStateJson">;
|
|
87
|
+
//# sourceMappingURL=nominal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nominal.d.ts","sourceRoot":"","sources":["../../../../src/utils/src/types/nominal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,MAAM,MAAM,GAAG,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE5C,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;A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ACZ,gBAAgB,CAAC;AAGrB,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAC5D,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAClE,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAClE,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAC/C,MAAM,EACN,0BAA0B,CAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { type Kind } from "@sinclair/typebox";
|
|
2
|
+
import type { NumberOptions, RegExpOptions, SchemaOptions, Static, StaticDecode, TNull, TObject, TSchema, TString, TTransform, TUnion, TUnsafe } from "@sinclair/typebox";
|
|
3
|
+
import type { AbiEvent } from "abitype";
|
|
4
|
+
import type { TypeErrorMessage } from "./misc.js";
|
|
5
|
+
import type * as Nominal from "./nominal.js";
|
|
6
|
+
export type MaybeStaticDecode<T extends never | TSchema> = T extends TSchema ? StaticDecode<T> : never;
|
|
7
|
+
export declare enum AddressType {
|
|
8
|
+
NONE = -1,
|
|
9
|
+
EVM = 0,
|
|
10
|
+
CARDANO = 1,
|
|
11
|
+
SUBSTRATE = 2,
|
|
12
|
+
ALGORAND = 3,
|
|
13
|
+
MINA = 4,
|
|
14
|
+
MIDNIGHT = 5,
|
|
15
|
+
AVAIL = 6,
|
|
16
|
+
POLKADOT = 7
|
|
17
|
+
}
|
|
18
|
+
export declare const TypeboxHelpers: {
|
|
19
|
+
Uint256: TTransform<import("@sinclair/typebox").TBigInt, string>;
|
|
20
|
+
BlockNumber: (options?: NumberOptions) => TUnsafe<Nominal.BlockNumber>;
|
|
21
|
+
AbsoluteSlotNumber: (options?: NumberOptions) => TUnsafe<Nominal.AbsoluteSlotNumber>;
|
|
22
|
+
EpochNumber: (options?: NumberOptions) => TUnsafe<Nominal.EpochNumber>;
|
|
23
|
+
Algorand: {
|
|
24
|
+
BlockHash: TUnsafe<Nominal.AlgorandBlockHash>;
|
|
25
|
+
TxHash: TUnsafe<Nominal.AlgorandTxHash>;
|
|
26
|
+
Address: TUnsafe<Nominal.AlgorandAddress>;
|
|
27
|
+
};
|
|
28
|
+
Substrate: {
|
|
29
|
+
Address: TUnsafe<Nominal.SubstrateAddress>;
|
|
30
|
+
};
|
|
31
|
+
Avail: {
|
|
32
|
+
BlockHash: TUnsafe<Nominal.AvailBlockHash>;
|
|
33
|
+
Address: TUnsafe<Nominal.SubstrateAddress>;
|
|
34
|
+
};
|
|
35
|
+
Cardano: {
|
|
36
|
+
BlockHash: TUnsafe<Nominal.CardanoBlockHash>;
|
|
37
|
+
TxHash: TUnsafe<Nominal.CardanoTxHash>;
|
|
38
|
+
Address: TUnsafe<Nominal.CardanoAddress>;
|
|
39
|
+
Credential: TUnsafe<Nominal.CardanoCredential>;
|
|
40
|
+
PoolId: TUnsafe<Nominal.CardanoPoolId>;
|
|
41
|
+
PolicyId: TUnsafe<Nominal.CardanoPolicyId>;
|
|
42
|
+
AssetName: TUnsafe<Nominal.CardanoAssetName>;
|
|
43
|
+
Cip14Fingerprint: TUnsafe<Nominal.CardanoCip14Fingerprint>;
|
|
44
|
+
AmountLovelace: TUnsafe<Nominal.CardanoAmountLovelace>;
|
|
45
|
+
};
|
|
46
|
+
Evm: {
|
|
47
|
+
BlockHash: TUnsafe<Nominal.EvmBlockHash>;
|
|
48
|
+
TxHash: TUnsafe<Nominal.EvmTxHash>;
|
|
49
|
+
Address: TUnsafe<Nominal.EvmAddress>;
|
|
50
|
+
Selector: TUnsafe<Nominal.Evm4ByteSelector>;
|
|
51
|
+
FullSelector: TUnsafe<Nominal.EvmSelector>;
|
|
52
|
+
Signature: TUnsafe<Nominal.Signature>;
|
|
53
|
+
PrivateKey: TUnsafe<Nominal.EvmPrivateKey>;
|
|
54
|
+
};
|
|
55
|
+
Midnight: {
|
|
56
|
+
BlockHash: TUnsafe<Nominal.MidnightBlockHash>;
|
|
57
|
+
TxHash: TUnsafe<Nominal.MidnightTxHash>;
|
|
58
|
+
Address: TUnsafe<Nominal.MidnightAddress>;
|
|
59
|
+
};
|
|
60
|
+
Mina: {
|
|
61
|
+
BlockHash: TUnsafe<Nominal.MinaBlockHash>;
|
|
62
|
+
TxHash: TUnsafe<Nominal.MinaTxHash>;
|
|
63
|
+
Address: TUnsafe<Nominal.MinaAddress>;
|
|
64
|
+
};
|
|
65
|
+
Polkadot: {
|
|
66
|
+
BlockHash: TUnsafe<Nominal.MinaBlockHash>;
|
|
67
|
+
TxHash: TUnsafe<Nominal.MinaTxHash>;
|
|
68
|
+
Address: TUnsafe<Nominal.MinaAddress>;
|
|
69
|
+
};
|
|
70
|
+
Caip2: TUnsafe<Nominal.Caip2>;
|
|
71
|
+
WalletAddress: () => TUnion<[TObject<{
|
|
72
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.NONE>;
|
|
73
|
+
address: import("@sinclair/typebox").TLiteral<"0x0">;
|
|
74
|
+
}>, TObject<{
|
|
75
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.EVM>;
|
|
76
|
+
address: TUnsafe<Nominal.EvmAddress>;
|
|
77
|
+
}>, TObject<{
|
|
78
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.CARDANO>;
|
|
79
|
+
address: TUnsafe<Nominal.CardanoAddress>;
|
|
80
|
+
}>, TObject<{
|
|
81
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.SUBSTRATE>;
|
|
82
|
+
address: TUnsafe<Nominal.SubstrateAddress>;
|
|
83
|
+
}>, TObject<{
|
|
84
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.AVAIL>;
|
|
85
|
+
address: TUnsafe<Nominal.SubstrateAddress>;
|
|
86
|
+
}>, TObject<{
|
|
87
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.ALGORAND>;
|
|
88
|
+
address: TUnsafe<Nominal.AlgorandAddress>;
|
|
89
|
+
}>, TObject<{
|
|
90
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.MINA>;
|
|
91
|
+
address: TUnsafe<Nominal.MinaAddress>;
|
|
92
|
+
}>, TObject<{
|
|
93
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.MIDNIGHT>;
|
|
94
|
+
address: TUnsafe<Nominal.MidnightAddress>;
|
|
95
|
+
}>, TObject<{
|
|
96
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.POLKADOT>;
|
|
97
|
+
address: TUnsafe<Nominal.MinaAddress>;
|
|
98
|
+
}>]>;
|
|
99
|
+
IntervalMs: (options?: NumberOptions) => TUnsafe<Nominal.IntervalMs>;
|
|
100
|
+
IntervalSec: (options?: NumberOptions) => TUnsafe<Nominal.IntervalSec>;
|
|
101
|
+
TimestampMs: (options?: NumberOptions) => TUnsafe<Nominal.TimestampMs>;
|
|
102
|
+
TimestampMsStr: TUnsafe<Nominal.TimestampMsStr>;
|
|
103
|
+
HexString0x: (options?: RegExpOptions) => TUnsafe<`0x${string}`>;
|
|
104
|
+
HexStringNo0x: (options?: RegExpOptions) => TUnsafe<Nominal.HexStringNo0x>;
|
|
105
|
+
UnknownFormat: TUnsafe<string>;
|
|
106
|
+
Lowercase: TTransform<TString, unknown>;
|
|
107
|
+
TrueOrFalse: TTransform<TUnion<[import("@sinclair/typebox").TLiteral<"T">, import("@sinclair/typebox").TLiteral<"F">]>, boolean>;
|
|
108
|
+
Nullable: <T extends TSchema>(schema: T, options?: SchemaOptions) => TUnion<[T, TNull]>;
|
|
109
|
+
SerializeObjAsJson: <T, StringSchema extends TSchema & {
|
|
110
|
+
[Kind]: string;
|
|
111
|
+
} = TString>() => TTransform<TUnsafe<T>, Static<StringSchema>>;
|
|
112
|
+
SerializeJsonAsObj: <T, StringSchema extends TSchema & {
|
|
113
|
+
[Kind]: string;
|
|
114
|
+
} = TString>(schema: StringSchema) => TTransform<StringSchema, T>;
|
|
115
|
+
EvmAbiEvent: TUnsafe<AbiEvent>;
|
|
116
|
+
};
|
|
117
|
+
export declare const AddressValidator: {
|
|
118
|
+
readonly [-1]: import("@sinclair/typebox").TLiteral<"0x0">;
|
|
119
|
+
readonly 0: TUnsafe<Nominal.EvmAddress>;
|
|
120
|
+
readonly 1: TUnsafe<Nominal.CardanoAddress>;
|
|
121
|
+
readonly 2: TUnsafe<Nominal.SubstrateAddress>;
|
|
122
|
+
readonly 6: TUnsafe<Nominal.SubstrateAddress>;
|
|
123
|
+
readonly 3: TUnsafe<Nominal.AlgorandAddress>;
|
|
124
|
+
readonly 4: TUnsafe<Nominal.MinaAddress>;
|
|
125
|
+
readonly 5: TUnsafe<Nominal.MidnightAddress>;
|
|
126
|
+
readonly 7: TUnsafe<Nominal.MinaAddress>;
|
|
127
|
+
};
|
|
128
|
+
export declare const AddressTypebox: readonly [TObject<{
|
|
129
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.NONE>;
|
|
130
|
+
address: import("@sinclair/typebox").TLiteral<"0x0">;
|
|
131
|
+
}>, TObject<{
|
|
132
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.EVM>;
|
|
133
|
+
address: TUnsafe<Nominal.EvmAddress>;
|
|
134
|
+
}>, TObject<{
|
|
135
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.CARDANO>;
|
|
136
|
+
address: TUnsafe<Nominal.CardanoAddress>;
|
|
137
|
+
}>, TObject<{
|
|
138
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.SUBSTRATE>;
|
|
139
|
+
address: TUnsafe<Nominal.SubstrateAddress>;
|
|
140
|
+
}>, TObject<{
|
|
141
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.AVAIL>;
|
|
142
|
+
address: TUnsafe<Nominal.SubstrateAddress>;
|
|
143
|
+
}>, TObject<{
|
|
144
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.ALGORAND>;
|
|
145
|
+
address: TUnsafe<Nominal.AlgorandAddress>;
|
|
146
|
+
}>, TObject<{
|
|
147
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.MINA>;
|
|
148
|
+
address: TUnsafe<Nominal.MinaAddress>;
|
|
149
|
+
}>, TObject<{
|
|
150
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.MIDNIGHT>;
|
|
151
|
+
address: TUnsafe<Nominal.MidnightAddress>;
|
|
152
|
+
}>, TObject<{
|
|
153
|
+
type: import("@sinclair/typebox").TLiteral<AddressType.POLKADOT>;
|
|
154
|
+
address: TUnsafe<Nominal.MinaAddress>;
|
|
155
|
+
}>];
|
|
156
|
+
type AddressTypeMap = {
|
|
157
|
+
[K in keyof typeof AddressValidator]: StaticDecode<(typeof AddressValidator)[K]>;
|
|
158
|
+
};
|
|
159
|
+
export type AddressAndType = {
|
|
160
|
+
[K in keyof AddressTypeMap]: {
|
|
161
|
+
type: K;
|
|
162
|
+
address: AddressTypeMap[K];
|
|
163
|
+
};
|
|
164
|
+
}[keyof AddressTypeMap];
|
|
165
|
+
export declare function checkOrError<T extends TSchema>(name: string | undefined, structure: T, config: unknown): StaticDecode<T>;
|
|
166
|
+
type TObjectToTuple<Obj extends TObject<any>, Keys extends (keyof Obj["properties"])[]> = {
|
|
167
|
+
[K in keyof Keys]: [
|
|
168
|
+
Keys[K],
|
|
169
|
+
Obj extends TObject<Record<Keys[K] & string, infer V extends TSchema>> ? V : never
|
|
170
|
+
];
|
|
171
|
+
};
|
|
172
|
+
export declare function pick<const Keys extends string[]>(keys: Keys): {
|
|
173
|
+
from: <Obj extends TObject<Record<Keys[number], any>>>(obj: Obj) => TObjectToTuple<Obj, Keys>;
|
|
174
|
+
};
|
|
175
|
+
type HasAllProperties<T extends TObject<any>, K extends string[]> = keyof T["properties"] extends K[number] ? T : TypeErrorMessage<`Missing properties: ${string & Exclude<keyof T["properties"], K[number]>}`>;
|
|
176
|
+
/**
|
|
177
|
+
* Same as `pick`, but requires that you include ALL properties and not just a subset of them
|
|
178
|
+
*/
|
|
179
|
+
export declare function pickAll<const Keys extends string[]>(keys: Keys): {
|
|
180
|
+
from: <Obj extends TObject<Record<Keys[number], any>>>(obj: HasAllProperties<Obj, Keys>) => TObjectToTuple<Obj, Keys>;
|
|
181
|
+
};
|
|
182
|
+
export {};
|
|
183
|
+
//# sourceMappingURL=typebox-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typebox-helpers.d.ts","sourceRoot":"","sources":["../../../../src/utils/src/types/typebox-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,IAAI,EAAQ,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACb,MAAM,EACN,YAAY,EACZ,KAAK,EACL,OAAO,EAEP,OAAO,EACP,OAAO,EACP,UAAU,EACV,MAAM,EACN,OAAO,EACR,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAsB,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,KAAK,KAAK,OAAO,MAAM,cAAc,CAAC;AAmB7C,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,KAAK,GAAG,OAAO,IAAI,CAAC,SAAS,OAAO,GACxE,YAAY,CAAC,CAAC,CAAC,GACf,KAAK,CAAC;AAKV,oBAAY,WAAW;IACrB,IAAI,KAAK;IACT,GAAG,IAAI;IACP,OAAO,IAAI;IACX,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,QAAQ,IAAI;CACb;AAwDD,eAAO,MAAM,cAAc;;4BAQD,aAAa;mCAEN,aAAa;4BAEpB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAmHd,aAAa;4BAEZ,aAAa;4BAEb,aAAa;;4BAGb,aAAa;8BAEX,aAAa;;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