@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,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example address: B62qpLST3UC1rpVT6SHfB7wqW2iQgiopFAGfrcovPgLjgfpDUN2LLeg
|
|
3
|
+
*/
|
|
4
|
+
export declare function verifyMinaAddress(address: string): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Example block hash: 3NK9ToRM1gnzyDbafWzdde7EYemjUN2cb5isjtchcCuupty2MgbC
|
|
7
|
+
*/
|
|
8
|
+
export declare function verifyMinaBlockHash(hash: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* See https://github.com/openmina/openmina/blob/26354df0b4165a82ba67fa9ab1f2301841f7b033/mina-p2p-messages/src/v2/hashing.rs#L89-L92
|
|
11
|
+
*
|
|
12
|
+
* Example tx hash: 5JuYVpv6njuwUjgf8WLfXhTEJGHck1pwJXt92Lpcskiwu8kBL632
|
|
13
|
+
*/
|
|
14
|
+
export declare function verifyMinaTransactionHash(hash: string): boolean;
|
|
15
|
+
//# sourceMappingURL=mina.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mina.d.ts","sourceRoot":"","sources":["../../../../../src/utils/src/types/validators/mina.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAS1D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CASzD;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAS/D"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.verifyMinaAddress = verifyMinaAddress;
|
|
7
|
+
exports.verifyMinaBlockHash = verifyMinaBlockHash;
|
|
8
|
+
exports.verifyMinaTransactionHash = verifyMinaTransactionHash;
|
|
9
|
+
const bs58check_1 = __importDefault(require("bs58check"));
|
|
10
|
+
const utils_js_1 = require("./utils.js");
|
|
11
|
+
const BLOCK_HASH_BYTE_LENGTH = 34;
|
|
12
|
+
const TX_ID_BYTE_LENGTH = 34;
|
|
13
|
+
const ADDRESS_BYTE_LENGTH = 36;
|
|
14
|
+
const MALFORMED_BLOCK_HASH_ERROR_MSG = (0, utils_js_1.MALFORMED_ERROR_MSG)("block hash");
|
|
15
|
+
const MALFORMED_TX_ID_ERROR_MSG = (0, utils_js_1.MALFORMED_ERROR_MSG)("tx id");
|
|
16
|
+
const MALFORMED_ADDRESS_ERROR_MSG = (0, utils_js_1.MALFORMED_ERROR_MSG)("address");
|
|
17
|
+
/**
|
|
18
|
+
* Example address: B62qpLST3UC1rpVT6SHfB7wqW2iQgiopFAGfrcovPgLjgfpDUN2LLeg
|
|
19
|
+
*/
|
|
20
|
+
function verifyMinaAddress(address) {
|
|
21
|
+
const decoded = bs58check_1.default.decode(address);
|
|
22
|
+
// Sanity check
|
|
23
|
+
if (decoded.length !== ADDRESS_BYTE_LENGTH) {
|
|
24
|
+
throw new Error(`${MALFORMED_ADDRESS_ERROR_MSG}: expected byte length ${ADDRESS_BYTE_LENGTH}, got ${decoded.length}`);
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Example block hash: 3NK9ToRM1gnzyDbafWzdde7EYemjUN2cb5isjtchcCuupty2MgbC
|
|
30
|
+
*/
|
|
31
|
+
function verifyMinaBlockHash(hash) {
|
|
32
|
+
const decoded = bs58check_1.default.decode(hash);
|
|
33
|
+
// Sanity check
|
|
34
|
+
if (decoded.length !== TX_ID_BYTE_LENGTH) {
|
|
35
|
+
throw new Error(`${MALFORMED_BLOCK_HASH_ERROR_MSG}: expected byte length ${BLOCK_HASH_BYTE_LENGTH}, got ${decoded.length}`);
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* See https://github.com/openmina/openmina/blob/26354df0b4165a82ba67fa9ab1f2301841f7b033/mina-p2p-messages/src/v2/hashing.rs#L89-L92
|
|
41
|
+
*
|
|
42
|
+
* Example tx hash: 5JuYVpv6njuwUjgf8WLfXhTEJGHck1pwJXt92Lpcskiwu8kBL632
|
|
43
|
+
*/
|
|
44
|
+
function verifyMinaTransactionHash(hash) {
|
|
45
|
+
const decoded = bs58check_1.default.decode(hash);
|
|
46
|
+
// Sanity check
|
|
47
|
+
if (decoded.length !== TX_ID_BYTE_LENGTH) {
|
|
48
|
+
throw new Error(`${MALFORMED_TX_ID_ERROR_MSG}: expected byte length ${TX_ID_BYTE_LENGTH}, got ${decoded.length}`);
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* We need CBOR to parse Cardano Byron addresses
|
|
3
|
+
* but CBOR parsing libraries are massive
|
|
4
|
+
* we want to avoid having to import megabytes JS code in the browser just for Cardano Byron address parsing
|
|
5
|
+
*
|
|
6
|
+
* As a middle ground, this file copies just the CBOR parsing code required for Byron checksum matching
|
|
7
|
+
* reference: https://github.com/input-output-hk/cardano-js-sdk/blob/d1544fc9d1fb3997eb7c5b94a233789bb9e5cd9f/packages/core/src/Serialization/CBOR/MiniCborReader.ts#L26
|
|
8
|
+
*
|
|
9
|
+
* This file is 3kb when compressing with gzip
|
|
10
|
+
*/
|
|
11
|
+
type HexBlob = string;
|
|
12
|
+
export declare const CborContentException: ErrorConstructor;
|
|
13
|
+
export declare const CborInvalidOperationException: ErrorConstructor;
|
|
14
|
+
export declare enum CborReaderState {
|
|
15
|
+
Undefined = 0,
|
|
16
|
+
UnsignedInteger = 1,
|
|
17
|
+
NegativeInteger = 2,
|
|
18
|
+
ByteString = 3,
|
|
19
|
+
StartIndefiniteLengthByteString = 4,
|
|
20
|
+
EndIndefiniteLengthByteString = 5,
|
|
21
|
+
TextString = 6,
|
|
22
|
+
StartIndefiniteLengthTextString = 7,
|
|
23
|
+
EndIndefiniteLengthTextString = 8,
|
|
24
|
+
StartArray = 9,
|
|
25
|
+
EndArray = 10,
|
|
26
|
+
StartMap = 11,
|
|
27
|
+
EndMap = 12,
|
|
28
|
+
Tag = 13,
|
|
29
|
+
SimpleValue = 14,
|
|
30
|
+
HalfPrecisionFloat = 15,
|
|
31
|
+
SinglePrecisionFloat = 16,
|
|
32
|
+
DoublePrecisionFloat = 17,
|
|
33
|
+
Null = 18,
|
|
34
|
+
Boolean = 19,
|
|
35
|
+
Finished = 20
|
|
36
|
+
}
|
|
37
|
+
export declare enum CborMajorType {
|
|
38
|
+
UnsignedInteger = 0,
|
|
39
|
+
NegativeInteger = 1,
|
|
40
|
+
ByteString = 2,
|
|
41
|
+
Utf8String = 3,
|
|
42
|
+
Array = 4,
|
|
43
|
+
Map = 5,
|
|
44
|
+
Tag = 6,
|
|
45
|
+
Simple = 7
|
|
46
|
+
}
|
|
47
|
+
export declare enum CborTag {
|
|
48
|
+
DateTimeString = 0,
|
|
49
|
+
UnixTimeSeconds = 1,
|
|
50
|
+
UnsignedBigNum = 2,
|
|
51
|
+
NegativeBigNum = 3,
|
|
52
|
+
DecimalFraction = 4,
|
|
53
|
+
BigFloat = 5,
|
|
54
|
+
Base64UrlLaterEncoding = 21,
|
|
55
|
+
Base64StringLaterEncoding = 22,
|
|
56
|
+
Base16StringLaterEncoding = 23,
|
|
57
|
+
EncodedCborDataItem = 24,
|
|
58
|
+
RationalNumber = 30,
|
|
59
|
+
Uri = 32,
|
|
60
|
+
Base64Url = 33,
|
|
61
|
+
Base64 = 34,
|
|
62
|
+
Regex = 35,
|
|
63
|
+
MimeMessage = 36,
|
|
64
|
+
Set = 258,
|
|
65
|
+
SelfDescribeCbor = 55799
|
|
66
|
+
}
|
|
67
|
+
export declare enum CborAdditionalInfo {
|
|
68
|
+
AdditionalFalse = 20,
|
|
69
|
+
AdditionalTrue = 21,
|
|
70
|
+
AdditionalNull = 22,
|
|
71
|
+
Additional8BitData = 24,
|
|
72
|
+
Additional16BitData = 25,
|
|
73
|
+
Additional32BitData = 26,
|
|
74
|
+
Additional64BitData = 27,
|
|
75
|
+
IndefiniteLength = 31
|
|
76
|
+
}
|
|
77
|
+
export declare class CborInitialByte {
|
|
78
|
+
private initialByte;
|
|
79
|
+
static readonly IndefiniteLengthBreakByte = 255;
|
|
80
|
+
static readonly AdditionalInformationMask = 31;
|
|
81
|
+
constructor(initialByte: number);
|
|
82
|
+
CborInitialByte(majorType: CborMajorType, additionalInfo: CborAdditionalInfo): void;
|
|
83
|
+
static from(initialByte: number): CborInitialByte;
|
|
84
|
+
getInitialByte(): number;
|
|
85
|
+
getMajorType(): CborMajorType;
|
|
86
|
+
getAdditionalInfo(): CborAdditionalInfo;
|
|
87
|
+
}
|
|
88
|
+
export declare class MiniCborReader {
|
|
89
|
+
#private;
|
|
90
|
+
constructor(data: HexBlob);
|
|
91
|
+
readStartArray(): number | null;
|
|
92
|
+
readTag(): CborTag;
|
|
93
|
+
readByteString(): Uint8Array;
|
|
94
|
+
readInt(): bigint;
|
|
95
|
+
static ensureReadCapacityInArray(data: Uint8Array, bytesToRead: number): void;
|
|
96
|
+
}
|
|
97
|
+
export {};
|
|
98
|
+
//# sourceMappingURL=minicbor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minicbor.d.ts","sourceRoot":"","sources":["../../../../../src/utils/src/types/validators/minicbor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,KAAK,OAAO,GAAG,MAAM,CAAC;AAEtB,eAAO,MAAM,oBAAoB,kBAAQ,CAAC;AAC1C,eAAO,MAAM,6BAA6B,kBAAQ,CAAC;AAEnD,oBAAY,eAAe;IACzB,SAAS,IAAI;IACb,eAAe,IAAA;IACf,eAAe,IAAA;IACf,UAAU,IAAA;IACV,+BAA+B,IAAA;IAC/B,6BAA6B,IAAA;IAC7B,UAAU,IAAA;IACV,+BAA+B,IAAA;IAC/B,6BAA6B,IAAA;IAC7B,UAAU,IAAA;IACV,QAAQ,KAAA;IACR,QAAQ,KAAA;IACR,MAAM,KAAA;IACN,GAAG,KAAA;IACH,WAAW,KAAA;IACX,kBAAkB,KAAA;IAClB,oBAAoB,KAAA;IACpB,oBAAoB,KAAA;IACpB,IAAI,KAAA;IACJ,OAAO,KAAA;IACP,QAAQ,KAAA;CACT;AAED,oBAAY,aAAa;IACvB,eAAe,IAAI;IACnB,eAAe,IAAI;IACnB,UAAU,IAAI;IACd,UAAU,IAAI;IACd,KAAK,IAAI;IACT,GAAG,IAAI;IACP,GAAG,IAAI;IACP,MAAM,IAAI;CACX;AAUD,oBAAY,OAAO;IACjB,cAAc,IAAI;IAClB,eAAe,IAAI;IACnB,cAAc,IAAI;IAClB,cAAc,IAAI;IAClB,eAAe,IAAI;IACnB,QAAQ,IAAI;IACZ,sBAAsB,KAAK;IAC3B,yBAAyB,KAAK;IAC9B,yBAAyB,KAAK;IAC9B,mBAAmB,KAAK;IACxB,cAAc,KAAK;IACnB,GAAG,KAAK;IACR,SAAS,KAAK;IACd,MAAM,KAAK;IACX,KAAK,KAAK;IACV,WAAW,KAAK;IAChB,GAAG,MAAM;IACT,gBAAgB,QAAS;CAC1B;AAID,oBAAY,kBAAkB;IAC5B,eAAe,KAAK;IACpB,cAAc,KAAK;IACnB,cAAc,KAAK;IACnB,kBAAkB,KAAK;IACvB,mBAAmB,KAAK;IACxB,mBAAmB,KAAK;IACxB,mBAAmB,KAAK;IACxB,gBAAgB,KAAK;CACtB;AAED,qBAAa,eAAe;IAId,OAAO,CAAC,WAAW;IAH/B,MAAM,CAAC,QAAQ,CAAC,yBAAyB,OAAQ;IACjD,MAAM,CAAC,QAAQ,CAAC,yBAAyB,MAAe;gBAEpC,WAAW,EAAE,MAAM;IACvC,eAAe,CACb,SAAS,EAAE,aAAa,EACxB,cAAc,EAAE,kBAAkB;IAIpC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM;IAK/B,cAAc,IAAI,MAAM;IAGxB,YAAY,IAAI,aAAa;IAG7B,iBAAiB,IAAI,kBAAkB;CAGxC;AAED,qBAAa,cAAc;;gBAQb,IAAI,EAAE,OAAO;IAUzB,cAAc,IAAI,MAAM,GAAG,IAAI;IAoB/B,OAAO,IAAI,OAAO;IAQlB,cAAc,IAAI,UAAU;IA4B5B,OAAO,IAAI,MAAM;IA2OjB,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM;CAoCvE"}
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* We need CBOR to parse Cardano Byron addresses
|
|
4
|
+
* but CBOR parsing libraries are massive
|
|
5
|
+
* we want to avoid having to import megabytes JS code in the browser just for Cardano Byron address parsing
|
|
6
|
+
*
|
|
7
|
+
* As a middle ground, this file copies just the CBOR parsing code required for Byron checksum matching
|
|
8
|
+
* reference: https://github.com/input-output-hk/cardano-js-sdk/blob/d1544fc9d1fb3997eb7c5b94a233789bb9e5cd9f/packages/core/src/Serialization/CBOR/MiniCborReader.ts#L26
|
|
9
|
+
*
|
|
10
|
+
* This file is 3kb when compressing with gzip
|
|
11
|
+
*/
|
|
12
|
+
var _a;
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.MiniCborReader = exports.CborInitialByte = exports.CborAdditionalInfo = exports.CborTag = exports.CborMajorType = exports.CborReaderState = exports.CborInvalidOperationException = exports.CborContentException = void 0;
|
|
15
|
+
const node_buffer_1 = require("node:buffer");
|
|
16
|
+
exports.CborContentException = Error;
|
|
17
|
+
exports.CborInvalidOperationException = Error;
|
|
18
|
+
var CborReaderState;
|
|
19
|
+
(function (CborReaderState) {
|
|
20
|
+
CborReaderState[CborReaderState["Undefined"] = 0] = "Undefined";
|
|
21
|
+
CborReaderState[CborReaderState["UnsignedInteger"] = 1] = "UnsignedInteger";
|
|
22
|
+
CborReaderState[CborReaderState["NegativeInteger"] = 2] = "NegativeInteger";
|
|
23
|
+
CborReaderState[CborReaderState["ByteString"] = 3] = "ByteString";
|
|
24
|
+
CborReaderState[CborReaderState["StartIndefiniteLengthByteString"] = 4] = "StartIndefiniteLengthByteString";
|
|
25
|
+
CborReaderState[CborReaderState["EndIndefiniteLengthByteString"] = 5] = "EndIndefiniteLengthByteString";
|
|
26
|
+
CborReaderState[CborReaderState["TextString"] = 6] = "TextString";
|
|
27
|
+
CborReaderState[CborReaderState["StartIndefiniteLengthTextString"] = 7] = "StartIndefiniteLengthTextString";
|
|
28
|
+
CborReaderState[CborReaderState["EndIndefiniteLengthTextString"] = 8] = "EndIndefiniteLengthTextString";
|
|
29
|
+
CborReaderState[CborReaderState["StartArray"] = 9] = "StartArray";
|
|
30
|
+
CborReaderState[CborReaderState["EndArray"] = 10] = "EndArray";
|
|
31
|
+
CborReaderState[CborReaderState["StartMap"] = 11] = "StartMap";
|
|
32
|
+
CborReaderState[CborReaderState["EndMap"] = 12] = "EndMap";
|
|
33
|
+
CborReaderState[CborReaderState["Tag"] = 13] = "Tag";
|
|
34
|
+
CborReaderState[CborReaderState["SimpleValue"] = 14] = "SimpleValue";
|
|
35
|
+
CborReaderState[CborReaderState["HalfPrecisionFloat"] = 15] = "HalfPrecisionFloat";
|
|
36
|
+
CborReaderState[CborReaderState["SinglePrecisionFloat"] = 16] = "SinglePrecisionFloat";
|
|
37
|
+
CborReaderState[CborReaderState["DoublePrecisionFloat"] = 17] = "DoublePrecisionFloat";
|
|
38
|
+
CborReaderState[CborReaderState["Null"] = 18] = "Null";
|
|
39
|
+
CborReaderState[CborReaderState["Boolean"] = 19] = "Boolean";
|
|
40
|
+
CborReaderState[CborReaderState["Finished"] = 20] = "Finished";
|
|
41
|
+
})(CborReaderState || (exports.CborReaderState = CborReaderState = {}));
|
|
42
|
+
var CborMajorType;
|
|
43
|
+
(function (CborMajorType) {
|
|
44
|
+
CborMajorType[CborMajorType["UnsignedInteger"] = 0] = "UnsignedInteger";
|
|
45
|
+
CborMajorType[CborMajorType["NegativeInteger"] = 1] = "NegativeInteger";
|
|
46
|
+
CborMajorType[CborMajorType["ByteString"] = 2] = "ByteString";
|
|
47
|
+
CborMajorType[CborMajorType["Utf8String"] = 3] = "Utf8String";
|
|
48
|
+
CborMajorType[CborMajorType["Array"] = 4] = "Array";
|
|
49
|
+
CborMajorType[CborMajorType["Map"] = 5] = "Map";
|
|
50
|
+
CborMajorType[CborMajorType["Tag"] = 6] = "Tag";
|
|
51
|
+
CborMajorType[CborMajorType["Simple"] = 7] = "Simple";
|
|
52
|
+
})(CborMajorType || (exports.CborMajorType = CborMajorType = {}));
|
|
53
|
+
var CborTag;
|
|
54
|
+
(function (CborTag) {
|
|
55
|
+
CborTag[CborTag["DateTimeString"] = 0] = "DateTimeString";
|
|
56
|
+
CborTag[CborTag["UnixTimeSeconds"] = 1] = "UnixTimeSeconds";
|
|
57
|
+
CborTag[CborTag["UnsignedBigNum"] = 2] = "UnsignedBigNum";
|
|
58
|
+
CborTag[CborTag["NegativeBigNum"] = 3] = "NegativeBigNum";
|
|
59
|
+
CborTag[CborTag["DecimalFraction"] = 4] = "DecimalFraction";
|
|
60
|
+
CborTag[CborTag["BigFloat"] = 5] = "BigFloat";
|
|
61
|
+
CborTag[CborTag["Base64UrlLaterEncoding"] = 21] = "Base64UrlLaterEncoding";
|
|
62
|
+
CborTag[CborTag["Base64StringLaterEncoding"] = 22] = "Base64StringLaterEncoding";
|
|
63
|
+
CborTag[CborTag["Base16StringLaterEncoding"] = 23] = "Base16StringLaterEncoding";
|
|
64
|
+
CborTag[CborTag["EncodedCborDataItem"] = 24] = "EncodedCborDataItem";
|
|
65
|
+
CborTag[CborTag["RationalNumber"] = 30] = "RationalNumber";
|
|
66
|
+
CborTag[CborTag["Uri"] = 32] = "Uri";
|
|
67
|
+
CborTag[CborTag["Base64Url"] = 33] = "Base64Url";
|
|
68
|
+
CborTag[CborTag["Base64"] = 34] = "Base64";
|
|
69
|
+
CborTag[CborTag["Regex"] = 35] = "Regex";
|
|
70
|
+
CborTag[CborTag["MimeMessage"] = 36] = "MimeMessage";
|
|
71
|
+
CborTag[CborTag["Set"] = 258] = "Set";
|
|
72
|
+
CborTag[CborTag["SelfDescribeCbor"] = 55799] = "SelfDescribeCbor";
|
|
73
|
+
})(CborTag || (exports.CborTag = CborTag = {}));
|
|
74
|
+
const UNEXPECTED_END_OF_BUFFER_MSG = "Unexpected end of buffer";
|
|
75
|
+
var CborAdditionalInfo;
|
|
76
|
+
(function (CborAdditionalInfo) {
|
|
77
|
+
CborAdditionalInfo[CborAdditionalInfo["AdditionalFalse"] = 20] = "AdditionalFalse";
|
|
78
|
+
CborAdditionalInfo[CborAdditionalInfo["AdditionalTrue"] = 21] = "AdditionalTrue";
|
|
79
|
+
CborAdditionalInfo[CborAdditionalInfo["AdditionalNull"] = 22] = "AdditionalNull";
|
|
80
|
+
CborAdditionalInfo[CborAdditionalInfo["Additional8BitData"] = 24] = "Additional8BitData";
|
|
81
|
+
CborAdditionalInfo[CborAdditionalInfo["Additional16BitData"] = 25] = "Additional16BitData";
|
|
82
|
+
CborAdditionalInfo[CborAdditionalInfo["Additional32BitData"] = 26] = "Additional32BitData";
|
|
83
|
+
CborAdditionalInfo[CborAdditionalInfo["Additional64BitData"] = 27] = "Additional64BitData";
|
|
84
|
+
CborAdditionalInfo[CborAdditionalInfo["IndefiniteLength"] = 31] = "IndefiniteLength";
|
|
85
|
+
})(CborAdditionalInfo || (exports.CborAdditionalInfo = CborAdditionalInfo = {}));
|
|
86
|
+
class CborInitialByte {
|
|
87
|
+
initialByte;
|
|
88
|
+
static IndefiniteLengthBreakByte = 0xff;
|
|
89
|
+
static AdditionalInformationMask = 0b0001_1111;
|
|
90
|
+
constructor(initialByte) {
|
|
91
|
+
this.initialByte = initialByte;
|
|
92
|
+
}
|
|
93
|
+
CborInitialByte(majorType, additionalInfo) {
|
|
94
|
+
this.initialByte = (majorType << 5) | additionalInfo;
|
|
95
|
+
}
|
|
96
|
+
static from(initialByte) {
|
|
97
|
+
const init = new CborInitialByte(initialByte);
|
|
98
|
+
return init;
|
|
99
|
+
}
|
|
100
|
+
getInitialByte() {
|
|
101
|
+
return this.initialByte;
|
|
102
|
+
}
|
|
103
|
+
getMajorType() {
|
|
104
|
+
return this.initialByte >> 5;
|
|
105
|
+
}
|
|
106
|
+
getAdditionalInfo() {
|
|
107
|
+
return this.initialByte & CborInitialByte.AdditionalInformationMask;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.CborInitialByte = CborInitialByte;
|
|
111
|
+
class MiniCborReader {
|
|
112
|
+
#data;
|
|
113
|
+
#offset = 0;
|
|
114
|
+
#nestedItems = new Array();
|
|
115
|
+
#isTagContext = false;
|
|
116
|
+
#currentFrame;
|
|
117
|
+
#cachedState = CborReaderState.Undefined;
|
|
118
|
+
constructor(data) {
|
|
119
|
+
this.#data = new Uint8Array(node_buffer_1.Buffer.from(data, "hex"));
|
|
120
|
+
this.#currentFrame = {
|
|
121
|
+
currentKeyOffset: null,
|
|
122
|
+
frameOffset: 0,
|
|
123
|
+
itemsRead: 0,
|
|
124
|
+
type: null,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
readStartArray() {
|
|
128
|
+
const header = this.#peekInitialByte(CborMajorType.Array);
|
|
129
|
+
if (header.getAdditionalInfo() === CborAdditionalInfo.IndefiniteLength) {
|
|
130
|
+
this.#advanceBuffer(1);
|
|
131
|
+
this.#pushDataItem(CborMajorType.Array);
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
const buffer = this.#getRemainingBytes();
|
|
135
|
+
const { length, bytesRead } = _a.#peekDefiniteLength(header, buffer);
|
|
136
|
+
this.#advanceBuffer(bytesRead);
|
|
137
|
+
this.#pushDataItem(CborMajorType.Array, length);
|
|
138
|
+
return length;
|
|
139
|
+
}
|
|
140
|
+
readTag() {
|
|
141
|
+
const { tag, bytesRead } = this.#peekTagCore();
|
|
142
|
+
this.#advanceBuffer(bytesRead);
|
|
143
|
+
this.#isTagContext = true;
|
|
144
|
+
return tag;
|
|
145
|
+
}
|
|
146
|
+
readByteString() {
|
|
147
|
+
const header = this.#peekInitialByte(CborMajorType.ByteString);
|
|
148
|
+
if (header.getAdditionalInfo() === CborAdditionalInfo.IndefiniteLength) {
|
|
149
|
+
const { val, encodingLength } = this
|
|
150
|
+
.#readIndefiniteLengthByteStringConcatenated(CborMajorType.ByteString);
|
|
151
|
+
this.#advanceBuffer(encodingLength);
|
|
152
|
+
this.#advanceDataItemCounters();
|
|
153
|
+
return val;
|
|
154
|
+
}
|
|
155
|
+
const buffer = this.#getRemainingBytes();
|
|
156
|
+
const { length, bytesRead } = _a.#peekDefiniteLength(header, buffer);
|
|
157
|
+
this.#ensureReadCapacity(bytesRead + length);
|
|
158
|
+
this.#advanceBuffer(bytesRead + length);
|
|
159
|
+
this.#advanceDataItemCounters();
|
|
160
|
+
return buffer.slice(bytesRead, bytesRead + length);
|
|
161
|
+
}
|
|
162
|
+
readInt() {
|
|
163
|
+
const value = this.#peekSignedInteger();
|
|
164
|
+
this.#advanceBuffer(value.bytesRead);
|
|
165
|
+
this.#advanceDataItemCounters();
|
|
166
|
+
return value.signedInt;
|
|
167
|
+
}
|
|
168
|
+
#peekSignedInteger() {
|
|
169
|
+
const header = this.#peekInitialByte();
|
|
170
|
+
switch (header.getMajorType()) {
|
|
171
|
+
case CborMajorType.UnsignedInteger: {
|
|
172
|
+
const { unsignedInt: signedInt, bytesRead } = _a
|
|
173
|
+
.#decodeUnsignedInteger(header, this.#getRemainingBytes());
|
|
174
|
+
return { bytesRead, signedInt: BigInt(signedInt) };
|
|
175
|
+
}
|
|
176
|
+
case CborMajorType.NegativeInteger: {
|
|
177
|
+
const { unsignedInt, bytesRead } = _a
|
|
178
|
+
.#decodeUnsignedInteger(header, this.#getRemainingBytes());
|
|
179
|
+
return { bytesRead, signedInt: BigInt(-1) - unsignedInt };
|
|
180
|
+
}
|
|
181
|
+
default:
|
|
182
|
+
throw new exports.CborInvalidOperationException(`Reader type mismatch, expected ${CborMajorType.UnsignedInteger} or ${CborMajorType.NegativeInteger} but got ${header.getMajorType()}`);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
#ensureReadCapacity(bytesToRead) {
|
|
186
|
+
if (this.#data.length - this.#offset < bytesToRead) {
|
|
187
|
+
throw new exports.CborContentException(UNEXPECTED_END_OF_BUFFER_MSG);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
#readIndefiniteLengthByteStringConcatenated(type) {
|
|
191
|
+
const data = this.#getRemainingBytes();
|
|
192
|
+
let concat = node_buffer_1.Buffer.from([]);
|
|
193
|
+
let encodingLength = 0;
|
|
194
|
+
let i = 1; // skip the indefinite-length initial byte
|
|
195
|
+
let nextInitialByte = _a.#peekNextInitialByte(data.slice(i), type);
|
|
196
|
+
while (nextInitialByte.getInitialByte() !==
|
|
197
|
+
CborInitialByte.IndefiniteLengthBreakByte) {
|
|
198
|
+
const { length: chunkLength, bytesRead } = _a
|
|
199
|
+
.#peekDefiniteLength(nextInitialByte, data.slice(i));
|
|
200
|
+
const payloadSize = bytesRead + Number(chunkLength);
|
|
201
|
+
concat = node_buffer_1.Buffer.concat([
|
|
202
|
+
concat, // TODO: remove `as any` once @types/node gets updated properly
|
|
203
|
+
data.slice(i + (payloadSize - chunkLength), i + payloadSize),
|
|
204
|
+
]);
|
|
205
|
+
i += payloadSize;
|
|
206
|
+
nextInitialByte = _a.#peekNextInitialByte(data.slice(i), type);
|
|
207
|
+
}
|
|
208
|
+
encodingLength = i + 1; // include the break byte
|
|
209
|
+
return { encodingLength, val: new Uint8Array(concat) };
|
|
210
|
+
}
|
|
211
|
+
#advanceDataItemCounters() {
|
|
212
|
+
++this.#currentFrame.itemsRead;
|
|
213
|
+
this.#isTagContext = false;
|
|
214
|
+
}
|
|
215
|
+
static #peekNextInitialByte(buffer, expectedType) {
|
|
216
|
+
_a.ensureReadCapacityInArray(buffer, 1);
|
|
217
|
+
const header = CborInitialByte.from(buffer[0]);
|
|
218
|
+
if (header.getInitialByte() !== CborInitialByte.IndefiniteLengthBreakByte &&
|
|
219
|
+
header.getMajorType() !== expectedType) {
|
|
220
|
+
throw new exports.CborContentException("Indefinite length string contains invalid data item");
|
|
221
|
+
}
|
|
222
|
+
return header;
|
|
223
|
+
}
|
|
224
|
+
#peekTagCore() {
|
|
225
|
+
const header = this.#peekInitialByte(CborMajorType.Tag);
|
|
226
|
+
const { unsignedInt: result, bytesRead } = _a
|
|
227
|
+
.#decodeUnsignedInteger(header, this.#getRemainingBytes());
|
|
228
|
+
return { bytesRead, tag: Number(result) };
|
|
229
|
+
}
|
|
230
|
+
static #peekDefiniteLength(header, data) {
|
|
231
|
+
const { unsignedInt: length, bytesRead } = _a
|
|
232
|
+
.#decodeUnsignedInteger(header, data);
|
|
233
|
+
return { bytesRead, length: Number(length) };
|
|
234
|
+
}
|
|
235
|
+
#peekInitialByte(expectedType) {
|
|
236
|
+
if (this.#currentFrame.definiteLength !== undefined &&
|
|
237
|
+
this.#currentFrame.definiteLength - this.#currentFrame.itemsRead === 0) {
|
|
238
|
+
throw new exports.CborInvalidOperationException("No more data items to read");
|
|
239
|
+
}
|
|
240
|
+
if (this.#offset === this.#data.length) {
|
|
241
|
+
if (this.#currentFrame.type === null &&
|
|
242
|
+
this.#currentFrame.definiteLength === undefined &&
|
|
243
|
+
this.#offset > 0) {
|
|
244
|
+
throw new exports.CborInvalidOperationException("End of root-level. No more data items to read");
|
|
245
|
+
}
|
|
246
|
+
throw new exports.CborContentException(UNEXPECTED_END_OF_BUFFER_MSG);
|
|
247
|
+
}
|
|
248
|
+
const nextByte = CborInitialByte.from(this.#data[this.#offset]);
|
|
249
|
+
switch (this.#currentFrame.type) {
|
|
250
|
+
case CborMajorType.ByteString:
|
|
251
|
+
case CborMajorType.Utf8String:
|
|
252
|
+
// Indefinite-length string contexts allow two possible data items:
|
|
253
|
+
// 1) Definite-length string chunks of the same major type OR
|
|
254
|
+
// 2) a break byte denoting the end of the indefinite-length string context.
|
|
255
|
+
if (nextByte.getInitialByte() ===
|
|
256
|
+
CborInitialByte.IndefiniteLengthBreakByte ||
|
|
257
|
+
(nextByte.getMajorType() === this.#currentFrame.type &&
|
|
258
|
+
nextByte.getAdditionalInfo() !==
|
|
259
|
+
CborAdditionalInfo.IndefiniteLength)) {
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
throw new exports.CborContentException(`Indefinite length string contains invalid data item, ${nextByte.getMajorType()}`);
|
|
263
|
+
}
|
|
264
|
+
if (expectedType && expectedType !== nextByte.getMajorType()) {
|
|
265
|
+
throw new exports.CborInvalidOperationException(`Major type mismatch, expected type ${expectedType} but got ${nextByte.getMajorType()}`);
|
|
266
|
+
}
|
|
267
|
+
return nextByte;
|
|
268
|
+
}
|
|
269
|
+
static #decodeUnsignedInteger(header, data) {
|
|
270
|
+
if ((header.getInitialByte() & CborInitialByte.AdditionalInformationMask) <
|
|
271
|
+
CborAdditionalInfo.Additional8BitData) {
|
|
272
|
+
return { bytesRead: 1, unsignedInt: BigInt(header.getAdditionalInfo()) };
|
|
273
|
+
}
|
|
274
|
+
switch (header.getAdditionalInfo()) {
|
|
275
|
+
case CborAdditionalInfo.Additional8BitData: {
|
|
276
|
+
_a.ensureReadCapacityInArray(data, 2);
|
|
277
|
+
return { bytesRead: 2, unsignedInt: BigInt(data[1]) };
|
|
278
|
+
}
|
|
279
|
+
case CborAdditionalInfo.Additional16BitData: {
|
|
280
|
+
_a.ensureReadCapacityInArray(data, 3);
|
|
281
|
+
const buffer = node_buffer_1.Buffer.from(data.slice(1));
|
|
282
|
+
const val = buffer.readUInt16BE();
|
|
283
|
+
return { bytesRead: 3, unsignedInt: BigInt(val) };
|
|
284
|
+
}
|
|
285
|
+
case CborAdditionalInfo.Additional32BitData: {
|
|
286
|
+
_a.ensureReadCapacityInArray(data, 5);
|
|
287
|
+
const buffer = node_buffer_1.Buffer.from(data.slice(1));
|
|
288
|
+
const val = buffer.readUInt32BE();
|
|
289
|
+
return { bytesRead: 5, unsignedInt: BigInt(val) };
|
|
290
|
+
}
|
|
291
|
+
case CborAdditionalInfo.Additional64BitData: {
|
|
292
|
+
_a.ensureReadCapacityInArray(data, 9);
|
|
293
|
+
const buffer = node_buffer_1.Buffer.from(data.slice(1, 9));
|
|
294
|
+
let result = BigInt(0);
|
|
295
|
+
for (const element of buffer) {
|
|
296
|
+
result = (result << BigInt(8)) + BigInt(element);
|
|
297
|
+
}
|
|
298
|
+
return { bytesRead: 9, unsignedInt: result };
|
|
299
|
+
}
|
|
300
|
+
default:
|
|
301
|
+
throw new exports.CborContentException("Invalid integer encoding");
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
static ensureReadCapacityInArray(data, bytesToRead) {
|
|
305
|
+
if (data.length < bytesToRead) {
|
|
306
|
+
throw new exports.CborContentException(UNEXPECTED_END_OF_BUFFER_MSG);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
#advanceBuffer(length) {
|
|
310
|
+
if (this.#offset + length > this.#data.length) {
|
|
311
|
+
throw new exports.CborContentException("Buffer offset out of bounds");
|
|
312
|
+
}
|
|
313
|
+
this.#offset += length;
|
|
314
|
+
this.#cachedState = CborReaderState.Undefined;
|
|
315
|
+
}
|
|
316
|
+
#pushDataItem(majorType, definiteLength) {
|
|
317
|
+
const frame = {
|
|
318
|
+
currentKeyOffset: this.#currentFrame.currentKeyOffset,
|
|
319
|
+
definiteLength: this.#currentFrame.definiteLength,
|
|
320
|
+
frameOffset: this.#currentFrame.frameOffset,
|
|
321
|
+
itemsRead: this.#currentFrame.itemsRead,
|
|
322
|
+
type: this.#currentFrame.type,
|
|
323
|
+
};
|
|
324
|
+
this.#nestedItems.push(frame);
|
|
325
|
+
this.#currentFrame.type = majorType;
|
|
326
|
+
this.#currentFrame.definiteLength = definiteLength;
|
|
327
|
+
this.#currentFrame.itemsRead = 0;
|
|
328
|
+
this.#currentFrame.frameOffset = this.#offset;
|
|
329
|
+
this.#isTagContext = false;
|
|
330
|
+
this.#currentFrame.currentKeyOffset = null;
|
|
331
|
+
}
|
|
332
|
+
#getRemainingBytes() {
|
|
333
|
+
return this.#data.slice(this.#offset);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
exports.MiniCborReader = MiniCborReader;
|
|
337
|
+
_a = MiniCborReader;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../src/utils/src/types/validators/mod.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./algorand.js"), exports);
|
|
18
|
+
__exportStar(require("./utils.js"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HexStringNo0x, UnknownFormat } from "../nominal.js";
|
|
2
|
+
export declare function hexStringToUint8Array(hexString: UnknownFormat): Uint8Array;
|
|
3
|
+
export declare function uint8ArrayToHexString(uint8Array: Uint8Array): HexStringNo0x;
|
|
4
|
+
export declare const MALFORMED_ERROR_MSG: (str: string) => string;
|
|
5
|
+
export declare const CHECKSUM_ERROR_MSG: (str: string) => string;
|
|
6
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/utils/src/types/validators/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAiBlE,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,aAAa,GAAG,UAAU,CAE1E;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,aAAa,CAO3E;AAED,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,KAAG,MAC3B,CAAC;AACxB,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,MACrB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CHECKSUM_ERROR_MSG = exports.MALFORMED_ERROR_MSG = void 0;
|
|
4
|
+
exports.hexStringToUint8Array = hexStringToUint8Array;
|
|
5
|
+
exports.uint8ArrayToHexString = uint8ArrayToHexString;
|
|
6
|
+
function hexStringToBytes(hexString) {
|
|
7
|
+
if (!/^[0-9a-fA-F]+$/.test(hexString)) {
|
|
8
|
+
throw new Error("Non-hex digits found in hex string");
|
|
9
|
+
}
|
|
10
|
+
const bytes = [];
|
|
11
|
+
if (hexString.length % 2 !== 0) {
|
|
12
|
+
hexString = "0" + hexString;
|
|
13
|
+
}
|
|
14
|
+
for (let c = 0; c < hexString.length; c += 2) {
|
|
15
|
+
const nextByte = hexString.slice(c, c + 2);
|
|
16
|
+
bytes.push(parseInt(nextByte, 16));
|
|
17
|
+
}
|
|
18
|
+
return bytes;
|
|
19
|
+
}
|
|
20
|
+
function hexStringToUint8Array(hexString) {
|
|
21
|
+
return new Uint8Array(hexStringToBytes(hexString));
|
|
22
|
+
}
|
|
23
|
+
function uint8ArrayToHexString(uint8Array) {
|
|
24
|
+
// recall: slice(-2) takes two characters starting from the end of the string
|
|
25
|
+
// so this works because we <16 numbers with '0'
|
|
26
|
+
return Array.prototype.map.call(uint8Array, (byte) => ("0" + byte.toString(16)).slice(-2)).join("");
|
|
27
|
+
}
|
|
28
|
+
const MALFORMED_ERROR_MSG = (str) => `${str} is malformed`;
|
|
29
|
+
exports.MALFORMED_ERROR_MSG = MALFORMED_ERROR_MSG;
|
|
30
|
+
const CHECKSUM_ERROR_MSG = (str) => `${str} checksum is wrong`;
|
|
31
|
+
exports.CHECKSUM_ERROR_MSG = CHECKSUM_ERROR_MSG;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Account, Address, HttpTransport, ParseAccount, PublicClient, PublicClientConfig, RpcSchema, Transport } from "viem";
|
|
2
|
+
import { type Chain } from "viem";
|
|
3
|
+
import type { Evm4ByteSelector, EvmSelector } from "./types/nominal.js";
|
|
4
|
+
export declare function truncateSelector(fullSelector: EvmSelector): Evm4ByteSelector;
|
|
5
|
+
export declare function createViemPublicClient<chain extends Chain, transport extends Transport = HttpTransport, accountOrAddress extends Account | Address | undefined = undefined, rpcSchema extends RpcSchema | undefined = undefined>(chain: chain, override?: Partial<Omit<PublicClientConfig<transport, chain, accountOrAddress, rpcSchema>, "chain">>): PublicClient<transport, chain, ParseAccount<accountOrAddress>, rpcSchema>;
|
|
6
|
+
//# sourceMappingURL=viem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viem.d.ts","sourceRoot":"","sources":["../../../src/utils/src/viem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,SAAS,EACV,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,KAAK,KAAK,EAA4B,MAAM,MAAM,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAExE,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,WAAW,GAAG,gBAAgB,CAE5E;AAED,wBAAgB,sBAAsB,CACpC,KAAK,SAAS,KAAK,EACnB,SAAS,SAAS,SAAS,GAAG,aAAa,EAC3C,gBAAgB,SAAS,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,EAClE,SAAS,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,EAEnD,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,OAAO,CAChB,IAAI,CACF,kBAAkB,CAAC,SAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,CAAC,EACjE,OAAO,CACR,CACF,GACA,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,YAAY,CAAC,gBAAgB,CAAC,EAAE,SAAS,CAAC,CAU3E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.truncateSelector = truncateSelector;
|
|
4
|
+
exports.createViemPublicClient = createViemPublicClient;
|
|
5
|
+
const viem_1 = require("viem");
|
|
6
|
+
function truncateSelector(fullSelector) {
|
|
7
|
+
return fullSelector.slice(0, 10);
|
|
8
|
+
}
|
|
9
|
+
function createViemPublicClient(chain, override) {
|
|
10
|
+
return (0, viem_1.createPublicClient)({
|
|
11
|
+
chain,
|
|
12
|
+
transport: (0, viem_1.http)(chain.rpcUrls.default.http[0], {
|
|
13
|
+
// batch is needed for sync protocols to be efficient. Does this ever cause issues in other scenarios?
|
|
14
|
+
batch: true,
|
|
15
|
+
// TODO: transport options should come from the sync protocol configuration
|
|
16
|
+
}),
|
|
17
|
+
...override,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { AddressType } from "../../utils/src/mod.js";
|
|
2
|
+
export type WalletOption = {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
/**
|
|
6
|
+
* URI-encoded image
|
|
7
|
+
* DANGER: SVGs can contain Javascript, so these should only be rendered with <img> tags
|
|
8
|
+
*
|
|
9
|
+
* Note: not every wallet type has an image (ex: locally generated keypairs)
|
|
10
|
+
* Example values:
|
|
11
|
+
* data:image/svg+xml,...
|
|
12
|
+
* data:image/png;base64,...
|
|
13
|
+
*/
|
|
14
|
+
icon?: undefined | string;
|
|
15
|
+
};
|
|
16
|
+
export type ActiveConnection<T> = {
|
|
17
|
+
metadata: WalletOption;
|
|
18
|
+
api: T;
|
|
19
|
+
};
|
|
20
|
+
export type ConnectionOption<T> = {
|
|
21
|
+
metadata: WalletOption;
|
|
22
|
+
api: () => Promise<T>;
|
|
23
|
+
};
|
|
24
|
+
export declare function optionToActive<T>(option: ConnectionOption<T>): Promise<ActiveConnection<T>>;
|
|
25
|
+
export interface IConnector<T> {
|
|
26
|
+
getProvider(): undefined | IProvider<T>;
|
|
27
|
+
getOrThrowProvider(): IProvider<T>;
|
|
28
|
+
isConnected(): boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface IInjectedConnector<T> {
|
|
31
|
+
/** connect while letting Paima pick all the connection logic for you */
|
|
32
|
+
connectSimple(): Promise<IProvider<T>>;
|
|
33
|
+
/** connect to an explicit API that Paima supports */
|
|
34
|
+
connectNamed(name: string): Promise<IProvider<T>>;
|
|
35
|
+
/** connect to an API that you've initialized yourself externally */
|
|
36
|
+
connectExternal(conn: ActiveConnection<T>): Promise<IProvider<T>>;
|
|
37
|
+
}
|
|
38
|
+
export type AddressAndType = {
|
|
39
|
+
type: AddressType;
|
|
40
|
+
address: string;
|
|
41
|
+
};
|
|
42
|
+
export type UserSignature = string;
|
|
43
|
+
export interface IProvider<T> {
|
|
44
|
+
getConnection(): ActiveConnection<T>;
|
|
45
|
+
signMessage(message: string): Promise<UserSignature>;
|
|
46
|
+
getAddress(): AddressAndType;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=IProvider.d.ts.map
|