@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,28 @@
|
|
|
1
|
+
import * as AuroMinaApi from "@aurowallet/mina-provider";
|
|
2
|
+
import { type IConnector, type IInjectedConnector, type ConnectionOption, type IProvider, type ActiveConnection, type AddressAndType, type UserSignature } from "../IProvider.js";
|
|
3
|
+
export type MinaApi = AuroMinaApi.default;
|
|
4
|
+
type MinaAddress = any;
|
|
5
|
+
export declare class MinaConnector implements IConnector<MinaApi>, IInjectedConnector<MinaApi> {
|
|
6
|
+
private provider;
|
|
7
|
+
private static INSTANCE;
|
|
8
|
+
static getWalletOptions(): ConnectionOption<MinaApi>[];
|
|
9
|
+
static instance(): MinaConnector;
|
|
10
|
+
connectSimple(): Promise<IProvider<any>>;
|
|
11
|
+
connectNamed(name: string): Promise<IProvider<any>>;
|
|
12
|
+
connectExternal: (conn: ActiveConnection<MinaApi>) => Promise<MinaProvider>;
|
|
13
|
+
getProvider: () => undefined | MinaProvider;
|
|
14
|
+
getOrThrowProvider: () => MinaProvider;
|
|
15
|
+
isConnected: () => boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare class MinaProvider implements IProvider<MinaApi> {
|
|
18
|
+
private readonly conn;
|
|
19
|
+
readonly address: MinaAddress;
|
|
20
|
+
constructor(conn: ActiveConnection<MinaApi>, address: MinaAddress);
|
|
21
|
+
static init: (conn: ActiveConnection<MinaApi>) => Promise<MinaProvider>;
|
|
22
|
+
getConnection: () => ActiveConnection<MinaApi>;
|
|
23
|
+
getAddress: () => AddressAndType;
|
|
24
|
+
signMessage: (message: string) => Promise<UserSignature>;
|
|
25
|
+
static fetchAddress: (conn: ActiveConnection<MinaApi>) => Promise<string>;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=mina.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mina.d.ts","sourceRoot":"","sources":["../../../../src/wallets/src/mina/mina.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EACL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAEd,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAC;AAGzB,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;AAE1C,KAAK,WAAW,GAAG,GAAG,CAAC;AASvB,qBAAa,aACX,YAAW,UAAU,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC;IAE3D,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAwC;IAE/D,MAAM,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE;IAiBtD,MAAM,CAAC,QAAQ,IAAI,aAAa;IAQ1B,aAAa,IAAI,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAcxC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAazD,eAAe,GACb,MAAM,gBAAgB,CAAC,OAAO,CAAC,KAC9B,OAAO,CAAC,YAAY,CAAC,CActB;IACF,WAAW,QAAO,SAAS,GAAG,YAAY,CAExC;IACF,kBAAkB,QAAO,YAAY,CAKnC;IACF,WAAW,QAAO,OAAO,CAEvB;CACH;AAED,qBAAa,YAAa,YAAW,SAAS,CAAC,OAAO,CAAC;IAEnD,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,QAAQ,CAAC,OAAO,EAAE,WAAW;gBADZ,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,EACvC,OAAO,EAAE,WAAW;IAG/B,MAAM,CAAC,IAAI,GACT,MAAM,gBAAgB,CAAC,OAAO,CAAC,KAC9B,OAAO,CAAC,YAAY,CAAC,CAItB;IACF,aAAa,QAAO,gBAAgB,CAAC,OAAO,CAAC,CAE3C;IACF,UAAU,QAAO,cAAc,CAK7B;IACF,WAAW,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,aAAa,CAAC,CAoB3D;IAEF,MAAM,CAAC,YAAY,GACjB,MAAM,gBAAgB,CAAC,OAAO,CAAC,KAC9B,OAAO,CAAC,MAAM,CAAC,CAahB;CACH"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { AddressType } from "../../../utils/src/mod.js";
|
|
2
|
+
import { optionToActive, } from "../IProvider.js";
|
|
3
|
+
import { getWindow } from "../windows.js";
|
|
4
|
+
// JSR Error: modifying global types is not allowed
|
|
5
|
+
// declare global {
|
|
6
|
+
// interface Window {
|
|
7
|
+
// mina?: Record<string, { name?: string; enable?: () => Promise<MinaApi> }>;
|
|
8
|
+
// }
|
|
9
|
+
// }
|
|
10
|
+
export class MinaConnector {
|
|
11
|
+
provider;
|
|
12
|
+
static INSTANCE = undefined;
|
|
13
|
+
static getWalletOptions() {
|
|
14
|
+
const minaApi = getWindow()?.mina;
|
|
15
|
+
if (minaApi == null || !minaApi.isAuro)
|
|
16
|
+
return [];
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
metadata: {
|
|
20
|
+
name: "auro",
|
|
21
|
+
displayName: "Auro Wallet",
|
|
22
|
+
},
|
|
23
|
+
api: async () => {
|
|
24
|
+
return minaApi;
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
static instance() {
|
|
30
|
+
if (MinaConnector.INSTANCE == null) {
|
|
31
|
+
const newInstance = new MinaConnector();
|
|
32
|
+
MinaConnector.INSTANCE = newInstance;
|
|
33
|
+
}
|
|
34
|
+
return MinaConnector.INSTANCE;
|
|
35
|
+
}
|
|
36
|
+
async connectSimple() {
|
|
37
|
+
if (this.provider != null) {
|
|
38
|
+
return this.provider;
|
|
39
|
+
}
|
|
40
|
+
const options = MinaConnector.getWalletOptions();
|
|
41
|
+
if (options.length === 0) {
|
|
42
|
+
throw new Error(`No Mina wallet found`);
|
|
43
|
+
}
|
|
44
|
+
return await this.connectExternal(await optionToActive(options[0]));
|
|
45
|
+
}
|
|
46
|
+
async connectNamed(name) {
|
|
47
|
+
if (this.provider?.getConnection().metadata?.name === name) {
|
|
48
|
+
return this.provider;
|
|
49
|
+
}
|
|
50
|
+
const provider = MinaConnector.getWalletOptions().find((entry) => entry.metadata.name === name);
|
|
51
|
+
if (provider == null) {
|
|
52
|
+
throw new Error(`MinaProvider: unsupported connection type ${name}`);
|
|
53
|
+
}
|
|
54
|
+
return await this.connectExternal(await optionToActive(provider));
|
|
55
|
+
}
|
|
56
|
+
connectExternal = async (conn) => {
|
|
57
|
+
if (this.provider?.getConnection().metadata?.name === conn.metadata.name) {
|
|
58
|
+
return this.provider;
|
|
59
|
+
}
|
|
60
|
+
this.provider = await MinaProvider.init(conn);
|
|
61
|
+
conn.api.on("accountsChanged", (accounts) => {
|
|
62
|
+
if (!accounts || !accounts[0] || accounts[0] !== this.provider?.address) {
|
|
63
|
+
this.provider = undefined;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return this.provider;
|
|
67
|
+
};
|
|
68
|
+
getProvider = () => {
|
|
69
|
+
return this.provider;
|
|
70
|
+
};
|
|
71
|
+
getOrThrowProvider = () => {
|
|
72
|
+
if (this.provider == null) {
|
|
73
|
+
throw new Error(`MinaConnector provider isn't initialized yet`);
|
|
74
|
+
}
|
|
75
|
+
return this.provider;
|
|
76
|
+
};
|
|
77
|
+
isConnected = () => {
|
|
78
|
+
return this.provider != null;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export class MinaProvider {
|
|
82
|
+
conn;
|
|
83
|
+
address;
|
|
84
|
+
constructor(conn, address) {
|
|
85
|
+
this.conn = conn;
|
|
86
|
+
this.address = address;
|
|
87
|
+
}
|
|
88
|
+
static init = async (conn) => {
|
|
89
|
+
const address = await MinaProvider.fetchAddress(conn);
|
|
90
|
+
return new MinaProvider(conn, address);
|
|
91
|
+
};
|
|
92
|
+
getConnection = () => {
|
|
93
|
+
return this.conn;
|
|
94
|
+
};
|
|
95
|
+
getAddress = () => {
|
|
96
|
+
return {
|
|
97
|
+
type: AddressType.MINA,
|
|
98
|
+
address: this.address,
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
signMessage = async (message) => {
|
|
102
|
+
// There is no way of choosing the signing account here. At most we could
|
|
103
|
+
// monitor the changed events and erroring out if it changed.
|
|
104
|
+
const signed = await this.conn.api.signMessage({ message: message });
|
|
105
|
+
if ("signature" in signed) {
|
|
106
|
+
const { signature } = signed;
|
|
107
|
+
const networkKind = await this.conn.api.requestNetwork();
|
|
108
|
+
// only these two options are used
|
|
109
|
+
// https://github.com/aurowallet/auro-wallet-browser-extension/blob/624de322dd99baaa09617bbad4a4a838f0a88edc/src/background/lib/index.js#L17
|
|
110
|
+
// this is part of the hashed message
|
|
111
|
+
const network = networkKind.networkID === "mainnet" ? "mainnet" : "testnet";
|
|
112
|
+
return `${signature.field};${signature.scalar};${network}`;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
throw new Error("Failed to sign message");
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
static fetchAddress = async (conn) => {
|
|
119
|
+
try {
|
|
120
|
+
const addresses = await conn.api.requestAccounts();
|
|
121
|
+
if ("length" in addresses && addresses.length > 0) {
|
|
122
|
+
return addresses[0];
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
throw new Error("requestAccounts request failed");
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
console.log("[pickMinaAddress] error calling requestAccounts:", err);
|
|
130
|
+
}
|
|
131
|
+
throw new Error("[pickMinaAddress] no used or unused addresses");
|
|
132
|
+
};
|
|
133
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Result } from "../../../utils/src/mod.js";
|
|
2
|
+
import type { IProvider } from "../IProvider.js";
|
|
3
|
+
import type { WalletMode, ApiForMode } from "../utils.js";
|
|
4
|
+
import { type LoginInfoMap } from "../wallet-modes.js";
|
|
5
|
+
export declare function minaLoginWrapper(loginInfo: LoginInfoMap[WalletMode.Mina]): Promise<Result<IProvider<ApiForMode<WalletMode.Mina>>>>;
|
|
6
|
+
//# sourceMappingURL=wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../../../src/wallets/src/mina/wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,oBAAoB,CAAC;AAGxE,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,GACvC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAazD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { connectInjected } from "../wallet-modes.js";
|
|
2
|
+
import { MinaConnector } from "./mina.js";
|
|
3
|
+
export async function minaLoginWrapper(loginInfo) {
|
|
4
|
+
const loginResult = await connectInjected("minaLoginWrapper", loginInfo, MinaConnector.instance());
|
|
5
|
+
if (loginResult.success === false) {
|
|
6
|
+
return loginResult;
|
|
7
|
+
}
|
|
8
|
+
return {
|
|
9
|
+
success: true,
|
|
10
|
+
result: loginResult.result,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { IProvider, AddressAndType, UserSignature, WalletOption } from "./IProvider.js";
|
|
2
|
+
export type { Wallet } from "./types.js";
|
|
3
|
+
export type { WalletAddress } from "../../utils/src/mod.js";
|
|
4
|
+
export { WalletMode, WalletNameMap } from "./utils.js";
|
|
5
|
+
export { walletLogin } from "./wallets.js";
|
|
6
|
+
export { allInjectedWallets } from "./utils.js";
|
|
7
|
+
export * from "./paima.js";
|
|
8
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/wallets/src/mod.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC7F,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { type EvmAddress } from "../../utils/src/mod.js";
|
|
2
|
+
import type { Wallet } from "./types.js";
|
|
3
|
+
import { type Chain } from "viem";
|
|
4
|
+
import type { AbiItem } from "web3-utils";
|
|
5
|
+
import { type TransactionReceipt, Web3 } from "web3";
|
|
6
|
+
/**
|
|
7
|
+
* This is main class used for setting up the Paima Engine
|
|
8
|
+
* communication. It sets up the location of the Paima L2 Contact.
|
|
9
|
+
*/
|
|
10
|
+
export declare class PaimaEngineConfig {
|
|
11
|
+
appName: string;
|
|
12
|
+
paimaL2SyncProtocolName: string;
|
|
13
|
+
paimaL2ContractAddress: EvmAddress;
|
|
14
|
+
paimaL2Abi: AbiItem[];
|
|
15
|
+
paimaL2Chain: Chain;
|
|
16
|
+
paimaL2CurrentFee: bigint;
|
|
17
|
+
web3: Web3 | undefined;
|
|
18
|
+
batcherURL: string | undefined;
|
|
19
|
+
preferBatchedMode: boolean;
|
|
20
|
+
constructor(appName: string | undefined, paimaL2SyncProtocolName: string, paimaL2ContractAddress: EvmAddress, paimaL2Chain: Chain, paimaL2Abi: AbiItem[] | undefined, batcherURL: string | undefined, preferBatchedMode?: boolean);
|
|
21
|
+
/** Return a Web3 client for the PaimaL2 chain. */
|
|
22
|
+
getWeb3Client(): Promise<Web3>;
|
|
23
|
+
/** Return a Paima L2 Contract Instance for the PaimaL2. */
|
|
24
|
+
getPaimaL2Contract(): Promise<import("web3-eth-contract").default<import("web3-types").AbiFragment[]>>;
|
|
25
|
+
private fallbackABI;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Paima Wallet Interface - Sign a message with a wallet.
|
|
29
|
+
* @param wallet - The wallet to sign the message with.
|
|
30
|
+
* @param message - The message to sign.
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
export declare function signMessage(wallet: Wallet, message: string): Promise<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Main function to send a transaction to a Paima L2 contract.
|
|
36
|
+
* It will decide whether to use the batcher or the self-sequenced transaction based on the preferBatchedMode flag.
|
|
37
|
+
*
|
|
38
|
+
* @param wallet - The wallet to send the transaction with.
|
|
39
|
+
* @param conciseData - The concise data to send.
|
|
40
|
+
* @param paimaEngineConfig - The Paima Engine configuration.
|
|
41
|
+
* @param waitForConfirmation - The confirmation mode to use:
|
|
42
|
+
* no-wait: Do not wait for any confirmation.
|
|
43
|
+
* wait-receipt: Wait only for the chain transaction receipt.
|
|
44
|
+
* wait-effectstream-processed: Wait for the transaction to be processed by the Paima Engine.
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
export declare function sendTransaction(wallet: Wallet, conciseData: any[], paimaEngineConfig: PaimaEngineConfig, waitForConfirmation?: "wait-effectstream-processed" | "wait-receipt" | "no-wait", batcherTarget?: string | undefined): Promise<ReturnType<typeof sendBatcherTransaction> | ReturnType<typeof sendSelfSequencedTransaction>>;
|
|
48
|
+
/**
|
|
49
|
+
* Paima Wallet Interface - Send a transaction to a Paima L2 contract with a wallet.
|
|
50
|
+
* The concise data must match the grammar; if not the input will be rejected by Paima Engine.
|
|
51
|
+
* @param wallet - The wallet to send the transaction with.
|
|
52
|
+
* @param conciseData - The concise data to send.
|
|
53
|
+
* @param paimaEngineConfig - The Paima Engine configuration.
|
|
54
|
+
* @param waitForConfirmation - The confirmation mode to use:
|
|
55
|
+
* no-wait: Do not wait for any confirmation.
|
|
56
|
+
* wait-receipt: Wait only for the chain transaction receipt.
|
|
57
|
+
* wait-effectstream-processed: Wait for the transaction to be processed by the Paima Engine.
|
|
58
|
+
** @returns
|
|
59
|
+
*/
|
|
60
|
+
export declare function sendSelfSequencedTransaction(wallet: Wallet, conciseData: any[], paimaEngineConfig: PaimaEngineConfig, waitForConfirmation?: "wait-effectstream-processed" | "wait-receipt" | "no-wait"): Promise<{
|
|
61
|
+
success: boolean;
|
|
62
|
+
type: "self-sequenced";
|
|
63
|
+
} & ({
|
|
64
|
+
wait: "wait-effectstream-processed";
|
|
65
|
+
hash: string;
|
|
66
|
+
receipt: TransactionReceipt;
|
|
67
|
+
rollup: number;
|
|
68
|
+
} | {
|
|
69
|
+
wait: "wait-receipt" | "no-wait";
|
|
70
|
+
hash: string;
|
|
71
|
+
})>;
|
|
72
|
+
/**
|
|
73
|
+
* Wait for specific block number to be processed by the Paima Engine.
|
|
74
|
+
* This guarantees that the block number is processed by the Paima Engine.
|
|
75
|
+
* @param blockNumber - The block number to wait for.
|
|
76
|
+
* @param paimaEngineConfig - The Paima Engine configuration.
|
|
77
|
+
* @param timeout (optional) - The timeout in milliseconds.
|
|
78
|
+
* @returns
|
|
79
|
+
*/
|
|
80
|
+
export declare function waitForPaimaEngineBlockProcessed(blockNumber: number, paimaEngineConfig: PaimaEngineConfig, timeout?: number): Promise<{
|
|
81
|
+
latestBlock: number;
|
|
82
|
+
rollup: number;
|
|
83
|
+
} | void>;
|
|
84
|
+
/**
|
|
85
|
+
* Paima Wallet Interface - Standard batcher communication for a Paima L2 contract.
|
|
86
|
+
* This is only a default implementation, your own batcher might have different requirements.
|
|
87
|
+
* @param wallet - The wallet to send the batched transaction with.
|
|
88
|
+
* @param paimaL2Address - The address of the Paima L2 contract.
|
|
89
|
+
* @param conciseData - The concise data to send.
|
|
90
|
+
* @param waitForConfirmation - The confirmation mode to use:
|
|
91
|
+
* no-wait: Do not wait for any confirmation.
|
|
92
|
+
* wait-receipt: Wait only for the chain transaction receipt.
|
|
93
|
+
* wait-effectstream-processed: Wait for the transaction to be processed by the Paima Engine.
|
|
94
|
+
* @returns
|
|
95
|
+
*/
|
|
96
|
+
export declare function sendBatcherTransaction(wallet: Wallet, conciseData: any[], paimaEngineConfig: PaimaEngineConfig, waitForConfirmation?: "wait-effectstream-processed" | "wait-receipt" | "no-wait", batcherTarget?: string | undefined): Promise<{
|
|
97
|
+
success: boolean;
|
|
98
|
+
type: "batcher";
|
|
99
|
+
message: string;
|
|
100
|
+
blockNumber: number;
|
|
101
|
+
blockHash: string;
|
|
102
|
+
rollup: number;
|
|
103
|
+
}>;
|
|
104
|
+
//# sourceMappingURL=paima.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paima.d.ts","sourceRoot":"","sources":["../../../src/wallets/src/paima.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,KAAK,KAAK,EAAe,MAAM,MAAM,CAAC;AAI/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,KAAK,kBAAkB,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAIrD;;;GAGG;AACH,qBAAa,iBAAiB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,UAAU,CAAC;IACnC,UAAU,EAAE,OAAO,EAAE,CAAC;IACtB,YAAY,EAAE,KAAK,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAM;IAC/B,IAAI,EAAE,IAAI,GAAG,SAAS,CAAa;IACnC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAa;IAC3C,iBAAiB,EAAE,OAAO,CAAS;gBAGxC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,uBAAuB,EAAE,MAAM,EAC/B,sBAAsB,EAAE,UAAU,EAClC,YAAY,EAAE,KAAK,EACnB,UAAU,EAAE,OAAO,EAAE,GAAG,SAAS,EACjC,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,iBAAiB,GAAE,OAAe;IAgBpC,kDAAkD;IACrC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAS3C,2DAA2D;IAC9C,kBAAkB;IAK/B,OAAO,CAAC,WAAW;CAWpB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAGhE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,GAAG,EAAE,EAClB,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,GAAE,6BAA6B,GAAG,cAAc,GAAG,SACvC,EAC/B,aAAa,GAAE,MAAM,GAAG,SAAqB,GAC5C,OAAO,CACN,UAAU,CAAC,OAAO,sBAAsB,CAAC,GACzC,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAClD,CAgBA;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,MAAM,EAEd,WAAW,EAAE,GAAG,EAAE,EAClB,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,GAAE,6BAA6B,GAAG,cAAc,GAAG,SACvC,GAC9B,OAAO,CACN;IACA,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,gBAAgB,CAAC;CACxB,GACC,CACE;IACA,IAAI,EAAE,6BAA6B,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,kBAAkB,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB,GACC;IACA,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd,CACF,CACF,CA4DA;AAqBD;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,MAAM,EACnB,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,GAAE,MAAc,GACtB,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAyCzD;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EAEd,WAAW,EAAE,GAAG,EAAE,EAClB,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,GAAE,6BAA6B,GAAG,cAAc,GAAG,SACvC,EAC/B,aAAa,GAAE,MAAM,GAAG,SAAqB,GAC5C,OAAO,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAmDD"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { AddressType } from "../../utils/src/mod.js";
|
|
2
|
+
import { numberToHex } from "viem";
|
|
3
|
+
import { utf8ToHex } from "web3-utils";
|
|
4
|
+
import { Web3 } from "web3";
|
|
5
|
+
import { createMessageForBatcher } from "../../concise/src/mod.js";
|
|
6
|
+
import { BuiltinEvents, PaimaEventManager } from "../../events/src/mod.js";
|
|
7
|
+
/**
|
|
8
|
+
* This is main class used for setting up the Paima Engine
|
|
9
|
+
* communication. It sets up the location of the Paima L2 Contact.
|
|
10
|
+
*/
|
|
11
|
+
export class PaimaEngineConfig {
|
|
12
|
+
appName;
|
|
13
|
+
paimaL2SyncProtocolName;
|
|
14
|
+
paimaL2ContractAddress;
|
|
15
|
+
paimaL2Abi;
|
|
16
|
+
paimaL2Chain;
|
|
17
|
+
paimaL2CurrentFee = 0n;
|
|
18
|
+
web3 = undefined;
|
|
19
|
+
batcherURL = undefined;
|
|
20
|
+
preferBatchedMode = false;
|
|
21
|
+
constructor(appName, paimaL2SyncProtocolName, paimaL2ContractAddress, paimaL2Chain, paimaL2Abi, batcherURL, preferBatchedMode = false) {
|
|
22
|
+
this.appName = appName ?? "";
|
|
23
|
+
this.paimaL2SyncProtocolName = paimaL2SyncProtocolName;
|
|
24
|
+
this.paimaL2ContractAddress = paimaL2ContractAddress;
|
|
25
|
+
this.paimaL2Abi = paimaL2Abi ?? this.fallbackABI();
|
|
26
|
+
this.paimaL2Chain = paimaL2Chain;
|
|
27
|
+
this.batcherURL = batcherURL;
|
|
28
|
+
if (!this.batcherURL && preferBatchedMode) {
|
|
29
|
+
throw new Error("To enable batcher, you need to set the batcher URL.");
|
|
30
|
+
}
|
|
31
|
+
this.preferBatchedMode = preferBatchedMode;
|
|
32
|
+
}
|
|
33
|
+
/** Return a Web3 client for the PaimaL2 chain. */
|
|
34
|
+
async getWeb3Client() {
|
|
35
|
+
if (this.web3) {
|
|
36
|
+
return this.web3;
|
|
37
|
+
}
|
|
38
|
+
this.web3 = new Web3(this.paimaL2Chain.rpcUrls.default.http[0]);
|
|
39
|
+
await this.web3.eth.getNodeInfo();
|
|
40
|
+
return this.web3;
|
|
41
|
+
}
|
|
42
|
+
/** Return a Paima L2 Contract Instance for the PaimaL2. */
|
|
43
|
+
async getPaimaL2Contract() {
|
|
44
|
+
const web3 = await this.getWeb3Client();
|
|
45
|
+
return new web3.eth.Contract(this.paimaL2Abi, this.paimaL2ContractAddress);
|
|
46
|
+
}
|
|
47
|
+
fallbackABI() {
|
|
48
|
+
return [
|
|
49
|
+
{
|
|
50
|
+
inputs: [{ name: "data", type: "bytes" }],
|
|
51
|
+
name: "paimaSubmitGameInput",
|
|
52
|
+
outputs: [],
|
|
53
|
+
stateMutability: "payable",
|
|
54
|
+
type: "function",
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Paima Wallet Interface - Sign a message with a wallet.
|
|
61
|
+
* @param wallet - The wallet to sign the message with.
|
|
62
|
+
* @param message - The message to sign.
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
export async function signMessage(wallet, message) {
|
|
66
|
+
const signature = await wallet.provider.signMessage(message);
|
|
67
|
+
return signature;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Main function to send a transaction to a Paima L2 contract.
|
|
71
|
+
* It will decide whether to use the batcher or the self-sequenced transaction based on the preferBatchedMode flag.
|
|
72
|
+
*
|
|
73
|
+
* @param wallet - The wallet to send the transaction with.
|
|
74
|
+
* @param conciseData - The concise data to send.
|
|
75
|
+
* @param paimaEngineConfig - The Paima Engine configuration.
|
|
76
|
+
* @param waitForConfirmation - The confirmation mode to use:
|
|
77
|
+
* no-wait: Do not wait for any confirmation.
|
|
78
|
+
* wait-receipt: Wait only for the chain transaction receipt.
|
|
79
|
+
* wait-effectstream-processed: Wait for the transaction to be processed by the Paima Engine.
|
|
80
|
+
* @returns
|
|
81
|
+
*/
|
|
82
|
+
export async function sendTransaction(wallet, conciseData, paimaEngineConfig, waitForConfirmation = "wait-effectstream-processed", batcherTarget = undefined) {
|
|
83
|
+
if (paimaEngineConfig.preferBatchedMode) {
|
|
84
|
+
return await sendBatcherTransaction(wallet, conciseData, paimaEngineConfig, waitForConfirmation, batcherTarget);
|
|
85
|
+
}
|
|
86
|
+
return await sendSelfSequencedTransaction(wallet, conciseData, paimaEngineConfig, waitForConfirmation);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Paima Wallet Interface - Send a transaction to a Paima L2 contract with a wallet.
|
|
90
|
+
* The concise data must match the grammar; if not the input will be rejected by Paima Engine.
|
|
91
|
+
* @param wallet - The wallet to send the transaction with.
|
|
92
|
+
* @param conciseData - The concise data to send.
|
|
93
|
+
* @param paimaEngineConfig - The Paima Engine configuration.
|
|
94
|
+
* @param waitForConfirmation - The confirmation mode to use:
|
|
95
|
+
* no-wait: Do not wait for any confirmation.
|
|
96
|
+
* wait-receipt: Wait only for the chain transaction receipt.
|
|
97
|
+
* wait-effectstream-processed: Wait for the transaction to be processed by the Paima Engine.
|
|
98
|
+
** @returns
|
|
99
|
+
*/
|
|
100
|
+
export async function sendSelfSequencedTransaction(wallet,
|
|
101
|
+
// TODO this should be any type of grammar.
|
|
102
|
+
conciseData, paimaEngineConfig, waitForConfirmation = "wait-effectstream-processed") {
|
|
103
|
+
// TODO: Where to get this value from?
|
|
104
|
+
const DEFAULT_GAS_PRICE = BigInt("61000000000");
|
|
105
|
+
const provider = wallet.provider;
|
|
106
|
+
const addressAndType = provider.getAddress();
|
|
107
|
+
// NOTE: If the Paima L2 contract interface is implemented in other chains,
|
|
108
|
+
// we need to add support for them here. Paima L2 is EVM only for now.
|
|
109
|
+
if (addressAndType.type !== AddressType.EVM) {
|
|
110
|
+
throw new Error("Paima L2 is EVM contract.");
|
|
111
|
+
}
|
|
112
|
+
const evmProvider = wallet.provider;
|
|
113
|
+
const hexData = utf8ToHex(JSON.stringify(conciseData));
|
|
114
|
+
const paimaL2Contract = await paimaEngineConfig.getPaimaL2Contract();
|
|
115
|
+
const txData = paimaL2Contract.methods["paimaSubmitGameInput"](hexData)
|
|
116
|
+
.encodeABI();
|
|
117
|
+
const tx = {
|
|
118
|
+
from: addressAndType.address,
|
|
119
|
+
data: txData,
|
|
120
|
+
to: paimaEngineConfig.paimaL2ContractAddress,
|
|
121
|
+
gasPrice: numberToHex(DEFAULT_GAS_PRICE),
|
|
122
|
+
value: numberToHex(paimaEngineConfig.paimaL2CurrentFee),
|
|
123
|
+
};
|
|
124
|
+
const tx_result = await evmProvider.sendTransaction(tx);
|
|
125
|
+
if (waitForConfirmation === "no-wait" || waitForConfirmation === "wait-receipt") {
|
|
126
|
+
return {
|
|
127
|
+
success: true,
|
|
128
|
+
type: "self-sequenced",
|
|
129
|
+
wait: waitForConfirmation,
|
|
130
|
+
hash: tx_result.txHash,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
// Wait for paima engine to process the transaction
|
|
134
|
+
const receipt = await getTxReceipt(tx_result.txHash, paimaEngineConfig);
|
|
135
|
+
const response = await waitForPaimaEngineBlockProcessed(Number(receipt.blockNumber), paimaEngineConfig);
|
|
136
|
+
const rollup = response ? response.rollup : 0;
|
|
137
|
+
return {
|
|
138
|
+
success: true,
|
|
139
|
+
type: "self-sequenced",
|
|
140
|
+
hash: tx_result.txHash,
|
|
141
|
+
wait: waitForConfirmation,
|
|
142
|
+
receipt: serializeBigInts(receipt),
|
|
143
|
+
rollup,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
// We return a json version of object for the frontend.
|
|
147
|
+
function serializeBigInts(value) {
|
|
148
|
+
return JSON.parse(JSON.stringify(value, (_, v) => typeof v === "bigint" ? v.toString() : v));
|
|
149
|
+
}
|
|
150
|
+
// Wait for the transaction receipt for a given transaction hash.
|
|
151
|
+
async function getTxReceipt(txHash, paimaEngineConfig) {
|
|
152
|
+
const web3 = await paimaEngineConfig.getWeb3Client();
|
|
153
|
+
return await web3.eth.getTransactionReceipt(txHash);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Wait for specific block number to be processed by the Paima Engine.
|
|
157
|
+
* This guarantees that the block number is processed by the Paima Engine.
|
|
158
|
+
* @param blockNumber - The block number to wait for.
|
|
159
|
+
* @param paimaEngineConfig - The Paima Engine configuration.
|
|
160
|
+
* @param timeout (optional) - The timeout in milliseconds.
|
|
161
|
+
* @returns
|
|
162
|
+
*/
|
|
163
|
+
export function waitForPaimaEngineBlockProcessed(blockNumber, paimaEngineConfig, timeout = 60000) {
|
|
164
|
+
let subscriptionReference = undefined;
|
|
165
|
+
let latestBlock = 0;
|
|
166
|
+
let timer = undefined; // node & deno differ in type of timer
|
|
167
|
+
return Promise.race([
|
|
168
|
+
new Promise((_, reject) => {
|
|
169
|
+
timer = setTimeout(() => reject(new Error("Timeout")), timeout);
|
|
170
|
+
}),
|
|
171
|
+
new Promise((resolve, reject) => {
|
|
172
|
+
if (!paimaEngineConfig.paimaL2SyncProtocolName) {
|
|
173
|
+
reject(new Error("Paima L2 Sync Protocol Name is not set"));
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
PaimaEventManager.Instance.subscribe({
|
|
177
|
+
topic: BuiltinEvents.SyncChains,
|
|
178
|
+
filter: {
|
|
179
|
+
chain: paimaEngineConfig.paimaL2SyncProtocolName,
|
|
180
|
+
block: undefined,
|
|
181
|
+
},
|
|
182
|
+
}, (event) => {
|
|
183
|
+
latestBlock = Math.max(event.block, latestBlock);
|
|
184
|
+
if (latestBlock > blockNumber) {
|
|
185
|
+
resolve({ latestBlock, rollup: event.rollup });
|
|
186
|
+
}
|
|
187
|
+
})
|
|
188
|
+
.then((subscription) => subscriptionReference = subscription)
|
|
189
|
+
.catch(reject);
|
|
190
|
+
}),
|
|
191
|
+
]).finally(() => {
|
|
192
|
+
if (subscriptionReference) {
|
|
193
|
+
PaimaEventManager.Instance.unsubscribe(subscriptionReference);
|
|
194
|
+
}
|
|
195
|
+
if (timer) {
|
|
196
|
+
clearTimeout(timer);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Paima Wallet Interface - Standard batcher communication for a Paima L2 contract.
|
|
202
|
+
* This is only a default implementation, your own batcher might have different requirements.
|
|
203
|
+
* @param wallet - The wallet to send the batched transaction with.
|
|
204
|
+
* @param paimaL2Address - The address of the Paima L2 contract.
|
|
205
|
+
* @param conciseData - The concise data to send.
|
|
206
|
+
* @param waitForConfirmation - The confirmation mode to use:
|
|
207
|
+
* no-wait: Do not wait for any confirmation.
|
|
208
|
+
* wait-receipt: Wait only for the chain transaction receipt.
|
|
209
|
+
* wait-effectstream-processed: Wait for the transaction to be processed by the Paima Engine.
|
|
210
|
+
* @returns
|
|
211
|
+
*/
|
|
212
|
+
export async function sendBatcherTransaction(wallet,
|
|
213
|
+
// TODO we need to pass the batcher address here.
|
|
214
|
+
conciseData, paimaEngineConfig, waitForConfirmation = "wait-effectstream-processed", batcherTarget = undefined) {
|
|
215
|
+
if (!paimaEngineConfig.batcherURL) {
|
|
216
|
+
throw new Error("Batcher URL is not set");
|
|
217
|
+
}
|
|
218
|
+
const conciseDataStr = JSON.stringify(conciseData);
|
|
219
|
+
// Send a batched message.
|
|
220
|
+
const timestamp = Date.now().toString();
|
|
221
|
+
const signature = await wallet.provider.signMessage(createMessageForBatcher(paimaEngineConfig.appName, timestamp, wallet.provider.getAddress().address, wallet.provider.getAddress().type, conciseDataStr, batcherTarget));
|
|
222
|
+
const response = await fetch(`${paimaEngineConfig.batcherURL}/send-input`, {
|
|
223
|
+
method: "POST",
|
|
224
|
+
headers: {
|
|
225
|
+
"Content-Type": "application/json",
|
|
226
|
+
},
|
|
227
|
+
body: JSON.stringify({
|
|
228
|
+
data: {
|
|
229
|
+
target: batcherTarget,
|
|
230
|
+
addressType: wallet.provider.getAddress().type,
|
|
231
|
+
address: wallet.provider.getAddress().address,
|
|
232
|
+
signature,
|
|
233
|
+
input: conciseDataStr,
|
|
234
|
+
timestamp,
|
|
235
|
+
},
|
|
236
|
+
confirmationLevel: waitForConfirmation,
|
|
237
|
+
}),
|
|
238
|
+
});
|
|
239
|
+
return await {
|
|
240
|
+
...(await response.json()),
|
|
241
|
+
type: "batcher",
|
|
242
|
+
success: response.ok,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export type Hash = string;
|
|
2
|
+
import type { WalletAddress } from "../../utils/src/mod.js";
|
|
3
|
+
import type { IProvider, UserSignature, WalletOption } from "./IProvider.js";
|
|
4
|
+
export type SignFunction = (message: string) => Promise<UserSignature>;
|
|
5
|
+
export type QueryValue = string | number | boolean;
|
|
6
|
+
export type QueryOptions = Record<string, QueryValue>;
|
|
7
|
+
export interface Wallet {
|
|
8
|
+
provider: IProvider<unknown>;
|
|
9
|
+
walletAddress: WalletAddress;
|
|
10
|
+
metadata: WalletOption;
|
|
11
|
+
}
|
|
12
|
+
interface BatcherPostResponseSuccessful {
|
|
13
|
+
success: true;
|
|
14
|
+
hash: Hash;
|
|
15
|
+
}
|
|
16
|
+
interface BatcherPostResponseUnsuccessful {
|
|
17
|
+
success: false;
|
|
18
|
+
message: string;
|
|
19
|
+
code?: number;
|
|
20
|
+
}
|
|
21
|
+
export type BatcherPostResponse = BatcherPostResponseSuccessful | BatcherPostResponseUnsuccessful;
|
|
22
|
+
interface BatcherTrackResponseCore {
|
|
23
|
+
success: true;
|
|
24
|
+
hash: Hash;
|
|
25
|
+
}
|
|
26
|
+
interface BatcherTrackResponsePosted extends BatcherTrackResponseCore {
|
|
27
|
+
status: "posted";
|
|
28
|
+
block_height: number;
|
|
29
|
+
transaction_hash: Hash;
|
|
30
|
+
}
|
|
31
|
+
interface BatcherTrackResponseRejected extends BatcherTrackResponseCore {
|
|
32
|
+
status: "rejected";
|
|
33
|
+
message: string;
|
|
34
|
+
}
|
|
35
|
+
interface BatcherTrackResponseOther extends BatcherTrackResponseCore {
|
|
36
|
+
status: "accepted" | "validating";
|
|
37
|
+
}
|
|
38
|
+
export type BatcherTrackResponse = BatcherTrackResponsePosted | BatcherTrackResponseRejected | BatcherTrackResponseOther;
|
|
39
|
+
export type BaseSuccessResponse = {
|
|
40
|
+
success: true;
|
|
41
|
+
};
|
|
42
|
+
export type PostDataResponse = BaseSuccessResponse & {
|
|
43
|
+
blockHeight: number;
|
|
44
|
+
};
|
|
45
|
+
export type PostDataResponseAsync = BaseSuccessResponse & {
|
|
46
|
+
hash: string;
|
|
47
|
+
};
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/wallets/src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE7E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;AAEvE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AACnD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAEtD,MAAM,WAAW,MAAM;IACrB,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC7B,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,UAAU,6BAA6B;IACrC,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,UAAU,+BAA+B;IACvC,OAAO,EAAE,KAAK,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,mBAAmB,GAC3B,6BAA6B,GAC7B,+BAA+B,CAAC;AAEpC,UAAU,wBAAwB;IAChC,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,UAAU,0BAA2B,SAAQ,wBAAwB;IACnE,MAAM,EAAE,QAAQ,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,IAAI,CAAC;CACxB;AAED,UAAU,4BAA6B,SAAQ,wBAAwB;IACrE,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,yBAA0B,SAAQ,wBAAwB;IAClE,MAAM,EAAE,UAAU,GAAG,YAAY,CAAC;CACnC;AAED,MAAM,MAAM,oBAAoB,GAC5B,0BAA0B,GAC1B,4BAA4B,GAC5B,yBAAyB,CAAC;AAE9B,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,IAAI,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7E,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ActiveConnection, IConnector, IInjectedConnector, IProvider } from "./IProvider.js";
|
|
2
|
+
import { EthersConnector } from "./evm/ethers.js";
|
|
3
|
+
import { EvmInjectedConnector } from "./evm/injected.js";
|
|
4
|
+
import { CardanoConnector } from "./cardano/cardano.js";
|
|
5
|
+
import { MinaConnector } from "./mina/mina.js";
|
|
6
|
+
import { AvailConnector } from "./avail/avail.js";
|
|
7
|
+
import { MidnightConnector } from "./midnight/midnight.js";
|
|
8
|
+
export declare const enum WalletMode {
|
|
9
|
+
EvmInjected = 0,
|
|
10
|
+
EvmEthers = 1,
|
|
11
|
+
Midnight = 2,
|
|
12
|
+
Cardano = 3,
|
|
13
|
+
Mina = 4,
|
|
14
|
+
AvailJs = 5
|
|
15
|
+
}
|
|
16
|
+
export declare const WalletNameMap: Record<WalletMode, string>;
|
|
17
|
+
export declare const WalletModeMap: {
|
|
18
|
+
0: EvmInjectedConnector;
|
|
19
|
+
1: EthersConnector;
|
|
20
|
+
2: MidnightConnector;
|
|
21
|
+
3: CardanoConnector;
|
|
22
|
+
4: MinaConnector;
|
|
23
|
+
5: AvailConnector;
|
|
24
|
+
};
|
|
25
|
+
type ExtractGeneric<T> = T extends IConnector<infer U> ? U : never;
|
|
26
|
+
export type ApiForMode<Mode extends WalletMode> = ExtractGeneric<(typeof WalletModeMap)[Mode]>;
|
|
27
|
+
export type InjectionPreference<T> = {
|
|
28
|
+
name: string;
|
|
29
|
+
} | {
|
|
30
|
+
connection: ActiveConnection<T>;
|
|
31
|
+
};
|
|
32
|
+
export declare function allInjectedWallets(): Promise<{
|
|
33
|
+
[WalletMode.EvmInjected]: ReturnType<typeof EvmInjectedConnector.getWalletOptions>;
|
|
34
|
+
[WalletMode.Cardano]: ReturnType<typeof CardanoConnector.getWalletOptions>;
|
|
35
|
+
[WalletMode.Mina]: ReturnType<typeof MinaConnector.getWalletOptions>;
|
|
36
|
+
[WalletMode.Midnight]: ReturnType<typeof MidnightConnector.getWalletOptions>;
|
|
37
|
+
}>;
|
|
38
|
+
export declare function connectInjectedWallet<Api>(typeName: string, preference: undefined | InjectionPreference<Api>, connector: IInjectedConnector<Api>): Promise<IProvider<Api>>;
|
|
39
|
+
export declare function callProvider<Mode extends WalletMode, Api extends ApiForMode<Mode>, Func extends keyof IProvider<Api>>(mode: Mode, funcName: Func, ...args: Parameters<IProvider<Api>[Func]>): ReturnType<IProvider<Api>[Func]>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=utils.d.ts.map
|