@paimaexample/wallets 0.3.117 → 0.3.121
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/esm/concise/src/batcher.d.ts.map +1 -1
- package/esm/concise/src/batcher.js +7 -25
- package/esm/concise/src/delegate.d.ts.map +1 -1
- package/esm/concise/src/delegate.js +14 -38
- package/esm/concise/src/v2/builtins/batcher.d.ts +2 -2
- package/esm/crypto/src/CryptoManager.d.ts +24 -0
- package/esm/crypto/src/CryptoManager.d.ts.map +1 -0
- package/esm/crypto/src/CryptoManager.js +72 -0
- package/esm/crypto/src/IVerify.d.ts +7 -0
- package/esm/crypto/src/IVerify.d.ts.map +1 -0
- package/esm/crypto/src/Prando.d.ts +59 -0
- package/esm/crypto/src/Prando.d.ts.map +1 -0
- package/esm/crypto/src/Prando.js +123 -0
- package/esm/crypto/src/chains/algorand.d.ts +11 -0
- package/esm/crypto/src/chains/algorand.d.ts.map +1 -0
- package/esm/crypto/src/chains/algorand.js +86 -0
- package/esm/crypto/src/chains/cardano.d.ts +8 -0
- package/esm/crypto/src/chains/cardano.d.ts.map +1 -0
- package/esm/crypto/src/chains/cardano.js +30 -0
- package/esm/crypto/src/chains/evm.d.ts +9 -0
- package/esm/crypto/src/chains/evm.d.ts.map +1 -0
- package/esm/crypto/src/chains/evm.js +29 -0
- package/esm/crypto/src/chains/midnight.d.ts +9 -0
- package/esm/crypto/src/chains/midnight.d.ts.map +1 -0
- package/esm/crypto/src/chains/midnight.js +25 -0
- package/esm/crypto/src/chains/mina.d.ts +8 -0
- package/esm/crypto/src/chains/mina.d.ts.map +1 -0
- package/esm/crypto/src/chains/mina.js +32 -0
- package/esm/crypto/src/chains/polkadot.d.ts +9 -0
- package/esm/crypto/src/chains/polkadot.d.ts.map +1 -0
- package/esm/crypto/src/chains/polkadot.js +28 -0
- package/esm/crypto/src/mod.d.ts +5 -0
- package/esm/crypto/src/mod.d.ts.map +1 -0
- package/esm/crypto/src/mod.js +4 -0
- package/esm/crypto/src/paima-hash.d.ts +14 -0
- package/esm/crypto/src/paima-hash.d.ts.map +1 -0
- package/esm/crypto/src/paima-hash.js +13 -0
- package/esm/utils/src/types/nominal.d.ts +5 -1
- package/esm/utils/src/types/nominal.d.ts.map +1 -1
- package/esm/utils/src/types/typebox-helpers.d.ts +7 -6
- package/esm/utils/src/types/typebox-helpers.d.ts.map +1 -1
- package/esm/utils/src/types/typebox-helpers.js +8 -5
- package/esm/wallets/src/algorand/algorand.d.ts +26 -0
- package/esm/wallets/src/algorand/algorand.d.ts.map +1 -0
- package/esm/wallets/src/algorand/algorand.js +133 -0
- package/esm/wallets/src/algorand/wrapper.d.ts +6 -0
- package/esm/wallets/src/algorand/wrapper.d.ts.map +1 -0
- package/esm/wallets/src/algorand/wrapper.js +12 -0
- package/esm/wallets/src/cardano/cardano.js +1 -1
- package/esm/wallets/src/midnight/midnight.js +1 -1
- package/esm/wallets/src/mina/mina.js +1 -1
- package/esm/wallets/src/mod.d.ts +1 -0
- package/esm/wallets/src/mod.d.ts.map +1 -1
- package/esm/wallets/src/mod.js +1 -0
- package/esm/wallets/src/polkadot/polkadot.d.ts +26 -0
- package/esm/wallets/src/polkadot/polkadot.d.ts.map +1 -0
- package/esm/wallets/src/polkadot/polkadot.js +133 -0
- package/esm/wallets/src/polkadot/wrapper.d.ts +6 -0
- package/esm/wallets/src/polkadot/wrapper.d.ts.map +1 -0
- package/esm/wallets/src/polkadot/wrapper.js +19 -0
- package/esm/wallets/src/utils.d.ts +12 -4
- package/esm/wallets/src/utils.d.ts.map +1 -1
- package/esm/wallets/src/utils.js +12 -12
- package/esm/wallets/src/wallet-modes.d.ts +7 -1
- package/esm/wallets/src/wallet-modes.d.ts.map +1 -1
- package/esm/wallets/src/wallet-modes.js +26 -2
- package/esm/wallets/src/wallets.js +8 -9
- package/package.json +8 -3
- package/script/concise/src/batcher.d.ts.map +1 -1
- package/script/concise/src/batcher.js +7 -25
- package/script/concise/src/delegate.d.ts.map +1 -1
- package/script/concise/src/delegate.js +13 -37
- package/script/concise/src/v2/builtins/batcher.d.ts +2 -2
- package/script/crypto/src/CryptoManager.d.ts +24 -0
- package/script/crypto/src/CryptoManager.d.ts.map +1 -0
- package/script/crypto/src/CryptoManager.js +76 -0
- package/script/crypto/src/IVerify.d.ts +7 -0
- package/script/crypto/src/IVerify.d.ts.map +1 -0
- package/script/crypto/src/Prando.d.ts +59 -0
- package/script/crypto/src/Prando.d.ts.map +1 -0
- package/script/crypto/src/Prando.js +127 -0
- package/script/crypto/src/chains/algorand.d.ts +11 -0
- package/script/crypto/src/chains/algorand.d.ts.map +1 -0
- package/script/crypto/src/chains/algorand.js +90 -0
- package/script/crypto/src/chains/cardano.d.ts +8 -0
- package/script/crypto/src/chains/cardano.d.ts.map +1 -0
- package/script/crypto/src/chains/cardano.js +37 -0
- package/script/crypto/src/chains/evm.d.ts +9 -0
- package/script/crypto/src/chains/evm.d.ts.map +1 -0
- package/script/crypto/src/chains/evm.js +33 -0
- package/script/crypto/src/chains/midnight.d.ts +9 -0
- package/script/crypto/src/chains/midnight.d.ts.map +1 -0
- package/script/crypto/src/chains/midnight.js +29 -0
- package/script/crypto/src/chains/mina.d.ts +8 -0
- package/script/crypto/src/chains/mina.d.ts.map +1 -0
- package/script/crypto/src/chains/mina.js +39 -0
- package/script/crypto/src/chains/polkadot.d.ts +9 -0
- package/script/crypto/src/chains/polkadot.d.ts.map +1 -0
- package/script/crypto/src/chains/polkadot.js +32 -0
- package/script/crypto/src/mod.d.ts +5 -0
- package/script/crypto/src/mod.d.ts.map +1 -0
- package/script/{config → crypto}/src/mod.js +7 -2
- package/script/crypto/src/paima-hash.d.ts +14 -0
- package/script/crypto/src/paima-hash.d.ts.map +1 -0
- package/script/crypto/src/paima-hash.js +19 -0
- package/script/utils/src/types/nominal.d.ts +5 -1
- package/script/utils/src/types/nominal.d.ts.map +1 -1
- package/script/utils/src/types/typebox-helpers.d.ts +7 -6
- package/script/utils/src/types/typebox-helpers.d.ts.map +1 -1
- package/script/utils/src/types/typebox-helpers.js +8 -5
- package/script/wallets/src/algorand/algorand.d.ts +26 -0
- package/script/wallets/src/algorand/algorand.d.ts.map +1 -0
- package/script/wallets/src/algorand/algorand.js +138 -0
- package/script/wallets/src/algorand/wrapper.d.ts +6 -0
- package/script/wallets/src/algorand/wrapper.d.ts.map +1 -0
- package/script/wallets/src/algorand/wrapper.js +15 -0
- package/script/wallets/src/cardano/cardano.js +1 -1
- package/script/wallets/src/midnight/midnight.js +1 -1
- package/script/wallets/src/mina/mina.js +1 -1
- package/script/wallets/src/mod.d.ts +1 -0
- package/script/wallets/src/mod.d.ts.map +1 -1
- package/script/wallets/src/mod.js +3 -1
- package/script/wallets/src/polkadot/polkadot.d.ts +26 -0
- package/script/wallets/src/polkadot/polkadot.d.ts.map +1 -0
- package/script/wallets/src/polkadot/polkadot.js +138 -0
- package/script/wallets/src/polkadot/wrapper.d.ts +6 -0
- package/script/wallets/src/polkadot/wrapper.d.ts.map +1 -0
- package/script/wallets/src/polkadot/wrapper.js +22 -0
- package/script/wallets/src/utils.d.ts +12 -4
- package/script/wallets/src/utils.d.ts.map +1 -1
- package/script/wallets/src/utils.js +12 -12
- package/script/wallets/src/wallet-modes.d.ts +7 -1
- package/script/wallets/src/wallet-modes.d.ts.map +1 -1
- package/script/wallets/src/wallet-modes.js +26 -1
- package/script/wallets/src/wallets.js +17 -18
- package/esm/chain-types/src/hash.d.ts +0 -28
- package/esm/chain-types/src/hash.d.ts.map +0 -1
- package/esm/chain-types/src/hash.js +0 -29
- package/esm/chain-types/src/mod.d.ts +0 -3
- package/esm/chain-types/src/mod.d.ts.map +0 -1
- package/esm/chain-types/src/mod.js +0 -2
- package/esm/chain-types/src/types.d.ts +0 -70
- package/esm/chain-types/src/types.d.ts.map +0 -1
- package/esm/config/src/config/builder.d.ts +0 -33
- package/esm/config/src/config/builder.d.ts.map +0 -1
- package/esm/config/src/config/builder.js +0 -82
- package/esm/config/src/config/configCheck.d.ts +0 -32
- package/esm/config/src/config/configCheck.d.ts.map +0 -1
- package/esm/config/src/config/configCheck.js +0 -67
- package/esm/config/src/config/context.d.ts +0 -23
- package/esm/config/src/config/context.d.ts.map +0 -1
- package/esm/config/src/config/context.js +0 -25
- package/esm/config/src/config/mod.d.ts +0 -7
- package/esm/config/src/config/mod.d.ts.map +0 -1
- package/esm/config/src/config/mod.js +0 -4
- package/esm/config/src/config/parts/deployedAddresses.d.ts +0 -17
- package/esm/config/src/config/parts/deployedAddresses.d.ts.map +0 -1
- package/esm/config/src/config/parts/deployedAddresses.js +0 -24
- package/esm/config/src/config/parts/network.d.ts +0 -19
- package/esm/config/src/config/parts/network.d.ts.map +0 -1
- package/esm/config/src/config/parts/network.js +0 -29
- package/esm/config/src/config/parts/primitive.d.ts +0 -31
- package/esm/config/src/config/parts/primitive.d.ts.map +0 -1
- package/esm/config/src/config/parts/primitive.js +0 -28
- package/esm/config/src/config/parts/securityNamespace.d.ts +0 -14
- package/esm/config/src/config/parts/securityNamespace.d.ts.map +0 -1
- package/esm/config/src/config/parts/securityNamespace.js +0 -26
- package/esm/config/src/config/parts/syncProtocols.d.ts +0 -43
- package/esm/config/src/config/parts/syncProtocols.d.ts.map +0 -1
- package/esm/config/src/config/parts/syncProtocols.js +0 -66
- package/esm/config/src/config/utils.d.ts +0 -40
- package/esm/config/src/config/utils.d.ts.map +0 -1
- package/esm/config/src/config/utils.js +0 -55
- package/esm/config/src/mod.d.ts +0 -3
- package/esm/config/src/mod.d.ts.map +0 -1
- package/esm/config/src/mod.js +0 -2
- package/esm/config/src/schema/common.d.ts +0 -26
- package/esm/config/src/schema/common.d.ts.map +0 -1
- package/esm/config/src/schema/common.js +0 -51
- package/esm/config/src/schema/mod.d.ts +0 -7
- package/esm/config/src/schema/mod.d.ts.map +0 -1
- package/esm/config/src/schema/mod.js +0 -6
- package/esm/config/src/schema/namespace.d.ts +0 -39
- package/esm/config/src/schema/namespace.d.ts.map +0 -1
- package/esm/config/src/schema/namespace.js +0 -34
- package/esm/config/src/schema/network/algorand.d.ts +0 -12
- package/esm/config/src/schema/network/algorand.d.ts.map +0 -1
- package/esm/config/src/schema/network/algorand.js +0 -23
- package/esm/config/src/schema/network/all.d.ts +0 -175
- package/esm/config/src/schema/network/all.d.ts.map +0 -1
- package/esm/config/src/schema/network/all.js +0 -24
- package/esm/config/src/schema/network/bitcoin.d.ts +0 -19
- package/esm/config/src/schema/network/bitcoin.d.ts.map +0 -1
- package/esm/config/src/schema/network/bitcoin.js +0 -21
- package/esm/config/src/schema/network/cardano.d.ts +0 -12
- package/esm/config/src/schema/network/cardano.d.ts.map +0 -1
- package/esm/config/src/schema/network/cardano.js +0 -27
- package/esm/config/src/schema/network/evm.d.ts +0 -68
- package/esm/config/src/schema/network/evm.d.ts.map +0 -1
- package/esm/config/src/schema/network/evm.js +0 -70
- package/esm/config/src/schema/network/mina.d.ts +0 -14
- package/esm/config/src/schema/network/mina.d.ts.map +0 -1
- package/esm/config/src/schema/network/mina.js +0 -25
- package/esm/config/src/schema/network/mod.d.ts +0 -9
- package/esm/config/src/schema/network/mod.d.ts.map +0 -1
- package/esm/config/src/schema/network/mod.js +0 -8
- package/esm/config/src/schema/network/ntp.d.ts +0 -32
- package/esm/config/src/schema/network/ntp.d.ts.map +0 -1
- package/esm/config/src/schema/network/ntp.js +0 -39
- package/esm/config/src/schema/network/substrate/avail.d.ts +0 -14
- package/esm/config/src/schema/network/substrate/avail.d.ts.map +0 -1
- package/esm/config/src/schema/network/substrate/avail.js +0 -26
- package/esm/config/src/schema/network/substrate/common.d.ts +0 -18
- package/esm/config/src/schema/network/substrate/common.d.ts.map +0 -1
- package/esm/config/src/schema/network/substrate/common.js +0 -32
- package/esm/config/src/schema/network/substrate/midnight.d.ts +0 -20
- package/esm/config/src/schema/network/substrate/midnight.d.ts.map +0 -1
- package/esm/config/src/schema/network/substrate/midnight.js +0 -32
- package/esm/config/src/schema/network/substrate/mod.d.ts +0 -4
- package/esm/config/src/schema/network/substrate/mod.d.ts.map +0 -1
- package/esm/config/src/schema/network/substrate/mod.js +0 -3
- package/esm/config/src/schema/network/types.d.ts +0 -13
- package/esm/config/src/schema/network/types.d.ts.map +0 -1
- package/esm/config/src/schema/network/types.js +0 -13
- package/esm/config/src/schema/network/utils.d.ts +0 -5
- package/esm/config/src/schema/network/utils.d.ts.map +0 -1
- package/esm/config/src/schema/network/utils.js +0 -73
- package/esm/config/src/schema/primitive/mod.d.ts +0 -2
- package/esm/config/src/schema/primitive/mod.d.ts.map +0 -1
- package/esm/config/src/schema/primitive/mod.js +0 -1
- package/esm/config/src/schema/primitive/types.d.ts +0 -58
- package/esm/config/src/schema/primitive/types.d.ts.map +0 -1
- package/esm/config/src/schema/primitive/types.js +0 -1
- package/esm/config/src/schema/sync-protocols/all.d.ts +0 -583
- package/esm/config/src/schema/sync-protocols/all.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/all.js +0 -55
- package/esm/config/src/schema/sync-protocols/avail/rpc.d.ts +0 -76
- package/esm/config/src/schema/sync-protocols/avail/rpc.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/avail/rpc.js +0 -56
- package/esm/config/src/schema/sync-protocols/bitcoin/rpc.d.ts +0 -76
- package/esm/config/src/schema/sync-protocols/bitcoin/rpc.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/bitcoin/rpc.js +0 -47
- package/esm/config/src/schema/sync-protocols/cardano/carp.d.ts +0 -80
- package/esm/config/src/schema/sync-protocols/cardano/carp.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/cardano/carp.js +0 -62
- package/esm/config/src/schema/sync-protocols/cardano/mod.d.ts +0 -2
- package/esm/config/src/schema/sync-protocols/cardano/mod.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/cardano/mod.js +0 -1
- package/esm/config/src/schema/sync-protocols/cardano/utxorpc.d.ts +0 -56
- package/esm/config/src/schema/sync-protocols/cardano/utxorpc.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/cardano/utxorpc.js +0 -56
- package/esm/config/src/schema/sync-protocols/common.d.ts +0 -60
- package/esm/config/src/schema/sync-protocols/common.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/common.js +0 -54
- package/esm/config/src/schema/sync-protocols/decorators/all.d.ts +0 -17
- package/esm/config/src/schema/sync-protocols/decorators/all.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/decorators/all.js +0 -8
- package/esm/config/src/schema/sync-protocols/decorators/emulated.d.ts +0 -8
- package/esm/config/src/schema/sync-protocols/decorators/emulated.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/decorators/emulated.js +0 -12
- package/esm/config/src/schema/sync-protocols/decorators/mod.d.ts +0 -4
- package/esm/config/src/schema/sync-protocols/decorators/mod.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/decorators/mod.js +0 -3
- package/esm/config/src/schema/sync-protocols/decorators/types.d.ts +0 -4
- package/esm/config/src/schema/sync-protocols/decorators/types.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/decorators/types.js +0 -4
- package/esm/config/src/schema/sync-protocols/evm/rpc.d.ts +0 -68
- package/esm/config/src/schema/sync-protocols/evm/rpc.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/evm/rpc.js +0 -44
- package/esm/config/src/schema/sync-protocols/midnight/graphql.d.ts +0 -66
- package/esm/config/src/schema/sync-protocols/midnight/graphql.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/midnight/graphql.js +0 -50
- package/esm/config/src/schema/sync-protocols/mina/graphql.d.ts +0 -73
- package/esm/config/src/schema/sync-protocols/mina/graphql.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/mina/graphql.js +0 -59
- package/esm/config/src/schema/sync-protocols/mod.d.ts +0 -10
- package/esm/config/src/schema/sync-protocols/mod.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/mod.js +0 -9
- package/esm/config/src/schema/sync-protocols/ntp/rpc.d.ts +0 -45
- package/esm/config/src/schema/sync-protocols/ntp/rpc.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/ntp/rpc.js +0 -33
- package/esm/config/src/schema/sync-protocols/types.d.ts +0 -125
- package/esm/config/src/schema/sync-protocols/types.d.ts.map +0 -1
- package/esm/config/src/schema/sync-protocols/types.js +0 -22
- package/esm/config/src/schema/utils.d.ts +0 -53
- package/esm/config/src/schema/utils.d.ts.map +0 -1
- package/esm/config/src/schema/utils.js +0 -58
- package/script/chain-types/src/hash.d.ts +0 -28
- package/script/chain-types/src/hash.d.ts.map +0 -1
- package/script/chain-types/src/hash.js +0 -36
- package/script/chain-types/src/mod.d.ts +0 -3
- package/script/chain-types/src/mod.d.ts.map +0 -1
- package/script/chain-types/src/mod.js +0 -18
- package/script/chain-types/src/types.d.ts +0 -70
- package/script/chain-types/src/types.d.ts.map +0 -1
- package/script/config/src/config/builder.d.ts +0 -33
- package/script/config/src/config/builder.d.ts.map +0 -1
- package/script/config/src/config/builder.js +0 -86
- package/script/config/src/config/configCheck.d.ts +0 -32
- package/script/config/src/config/configCheck.d.ts.map +0 -1
- package/script/config/src/config/configCheck.js +0 -70
- package/script/config/src/config/context.d.ts +0 -23
- package/script/config/src/config/context.d.ts.map +0 -1
- package/script/config/src/config/context.js +0 -31
- package/script/config/src/config/mod.d.ts +0 -7
- package/script/config/src/config/mod.d.ts.map +0 -1
- package/script/config/src/config/mod.js +0 -22
- package/script/config/src/config/parts/deployedAddresses.d.ts +0 -17
- package/script/config/src/config/parts/deployedAddresses.d.ts.map +0 -1
- package/script/config/src/config/parts/deployedAddresses.js +0 -28
- package/script/config/src/config/parts/network.d.ts +0 -19
- package/script/config/src/config/parts/network.d.ts.map +0 -1
- package/script/config/src/config/parts/network.js +0 -33
- package/script/config/src/config/parts/primitive.d.ts +0 -31
- package/script/config/src/config/parts/primitive.d.ts.map +0 -1
- package/script/config/src/config/parts/primitive.js +0 -32
- package/script/config/src/config/parts/securityNamespace.d.ts +0 -14
- package/script/config/src/config/parts/securityNamespace.d.ts.map +0 -1
- package/script/config/src/config/parts/securityNamespace.js +0 -30
- package/script/config/src/config/parts/syncProtocols.d.ts +0 -43
- package/script/config/src/config/parts/syncProtocols.d.ts.map +0 -1
- package/script/config/src/config/parts/syncProtocols.js +0 -70
- package/script/config/src/config/utils.d.ts +0 -40
- package/script/config/src/config/utils.d.ts.map +0 -1
- package/script/config/src/config/utils.js +0 -62
- package/script/config/src/mod.d.ts +0 -3
- package/script/config/src/mod.d.ts.map +0 -1
- package/script/config/src/schema/common.d.ts +0 -26
- package/script/config/src/schema/common.d.ts.map +0 -1
- package/script/config/src/schema/common.js +0 -54
- package/script/config/src/schema/mod.d.ts +0 -7
- package/script/config/src/schema/mod.d.ts.map +0 -1
- package/script/config/src/schema/mod.js +0 -22
- package/script/config/src/schema/namespace.d.ts +0 -39
- package/script/config/src/schema/namespace.d.ts.map +0 -1
- package/script/config/src/schema/namespace.js +0 -38
- package/script/config/src/schema/network/algorand.d.ts +0 -12
- package/script/config/src/schema/network/algorand.d.ts.map +0 -1
- package/script/config/src/schema/network/algorand.js +0 -26
- package/script/config/src/schema/network/all.d.ts +0 -175
- package/script/config/src/schema/network/all.d.ts.map +0 -1
- package/script/config/src/schema/network/all.js +0 -28
- package/script/config/src/schema/network/bitcoin.d.ts +0 -19
- package/script/config/src/schema/network/bitcoin.d.ts.map +0 -1
- package/script/config/src/schema/network/bitcoin.js +0 -24
- package/script/config/src/schema/network/cardano.d.ts +0 -12
- package/script/config/src/schema/network/cardano.d.ts.map +0 -1
- package/script/config/src/schema/network/cardano.js +0 -30
- package/script/config/src/schema/network/evm.d.ts +0 -68
- package/script/config/src/schema/network/evm.d.ts.map +0 -1
- package/script/config/src/schema/network/evm.js +0 -75
- package/script/config/src/schema/network/mina.d.ts +0 -14
- package/script/config/src/schema/network/mina.d.ts.map +0 -1
- package/script/config/src/schema/network/mina.js +0 -28
- package/script/config/src/schema/network/mod.d.ts +0 -9
- package/script/config/src/schema/network/mod.d.ts.map +0 -1
- package/script/config/src/schema/network/mod.js +0 -24
- package/script/config/src/schema/network/ntp.d.ts +0 -32
- package/script/config/src/schema/network/ntp.d.ts.map +0 -1
- package/script/config/src/schema/network/ntp.js +0 -42
- package/script/config/src/schema/network/substrate/avail.d.ts +0 -14
- package/script/config/src/schema/network/substrate/avail.d.ts.map +0 -1
- package/script/config/src/schema/network/substrate/avail.js +0 -29
- package/script/config/src/schema/network/substrate/common.d.ts +0 -18
- package/script/config/src/schema/network/substrate/common.d.ts.map +0 -1
- package/script/config/src/schema/network/substrate/common.js +0 -35
- package/script/config/src/schema/network/substrate/midnight.d.ts +0 -20
- package/script/config/src/schema/network/substrate/midnight.d.ts.map +0 -1
- package/script/config/src/schema/network/substrate/midnight.js +0 -35
- package/script/config/src/schema/network/substrate/mod.d.ts +0 -4
- package/script/config/src/schema/network/substrate/mod.d.ts.map +0 -1
- package/script/config/src/schema/network/substrate/mod.js +0 -19
- package/script/config/src/schema/network/types.d.ts +0 -13
- package/script/config/src/schema/network/types.d.ts.map +0 -1
- package/script/config/src/schema/network/types.js +0 -16
- package/script/config/src/schema/network/utils.d.ts +0 -5
- package/script/config/src/schema/network/utils.d.ts.map +0 -1
- package/script/config/src/schema/network/utils.js +0 -76
- package/script/config/src/schema/primitive/mod.d.ts +0 -2
- package/script/config/src/schema/primitive/mod.d.ts.map +0 -1
- package/script/config/src/schema/primitive/mod.js +0 -17
- package/script/config/src/schema/primitive/types.d.ts +0 -58
- package/script/config/src/schema/primitive/types.d.ts.map +0 -1
- package/script/config/src/schema/primitive/types.js +0 -2
- package/script/config/src/schema/sync-protocols/all.d.ts +0 -583
- package/script/config/src/schema/sync-protocols/all.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/all.js +0 -62
- package/script/config/src/schema/sync-protocols/avail/rpc.d.ts +0 -76
- package/script/config/src/schema/sync-protocols/avail/rpc.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/avail/rpc.js +0 -59
- package/script/config/src/schema/sync-protocols/bitcoin/rpc.d.ts +0 -76
- package/script/config/src/schema/sync-protocols/bitcoin/rpc.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/bitcoin/rpc.js +0 -50
- package/script/config/src/schema/sync-protocols/cardano/carp.d.ts +0 -80
- package/script/config/src/schema/sync-protocols/cardano/carp.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/cardano/carp.js +0 -65
- package/script/config/src/schema/sync-protocols/cardano/mod.d.ts +0 -2
- package/script/config/src/schema/sync-protocols/cardano/mod.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/cardano/mod.js +0 -17
- package/script/config/src/schema/sync-protocols/cardano/utxorpc.d.ts +0 -56
- package/script/config/src/schema/sync-protocols/cardano/utxorpc.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/cardano/utxorpc.js +0 -59
- package/script/config/src/schema/sync-protocols/common.d.ts +0 -60
- package/script/config/src/schema/sync-protocols/common.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/common.js +0 -61
- package/script/config/src/schema/sync-protocols/decorators/all.d.ts +0 -17
- package/script/config/src/schema/sync-protocols/decorators/all.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/decorators/all.js +0 -12
- package/script/config/src/schema/sync-protocols/decorators/emulated.d.ts +0 -8
- package/script/config/src/schema/sync-protocols/decorators/emulated.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/decorators/emulated.js +0 -15
- package/script/config/src/schema/sync-protocols/decorators/mod.d.ts +0 -4
- package/script/config/src/schema/sync-protocols/decorators/mod.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/decorators/mod.js +0 -19
- package/script/config/src/schema/sync-protocols/decorators/types.d.ts +0 -4
- package/script/config/src/schema/sync-protocols/decorators/types.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/decorators/types.js +0 -7
- package/script/config/src/schema/sync-protocols/evm/rpc.d.ts +0 -68
- package/script/config/src/schema/sync-protocols/evm/rpc.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/evm/rpc.js +0 -47
- package/script/config/src/schema/sync-protocols/midnight/graphql.d.ts +0 -66
- package/script/config/src/schema/sync-protocols/midnight/graphql.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/midnight/graphql.js +0 -53
- package/script/config/src/schema/sync-protocols/mina/graphql.d.ts +0 -73
- package/script/config/src/schema/sync-protocols/mina/graphql.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/mina/graphql.js +0 -62
- package/script/config/src/schema/sync-protocols/mod.d.ts +0 -10
- package/script/config/src/schema/sync-protocols/mod.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/mod.js +0 -25
- package/script/config/src/schema/sync-protocols/ntp/rpc.d.ts +0 -45
- package/script/config/src/schema/sync-protocols/ntp/rpc.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/ntp/rpc.js +0 -36
- package/script/config/src/schema/sync-protocols/types.d.ts +0 -125
- package/script/config/src/schema/sync-protocols/types.d.ts.map +0 -1
- package/script/config/src/schema/sync-protocols/types.js +0 -25
- package/script/config/src/schema/utils.d.ts +0 -53
- package/script/config/src/schema/utils.d.ts.map +0 -1
- package/script/config/src/schema/utils.js +0 -62
- /package/esm/{chain-types/src/types.js → crypto/src/IVerify.js} +0 -0
- /package/script/{chain-types/src/types.js → crypto/src/IVerify.js} +0 -0
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { ConfigSchema } from "../utils.js";
|
|
3
|
-
import { ConfigNetworkType } from "./types.js";
|
|
4
|
-
// =====
|
|
5
|
-
// Utils
|
|
6
|
-
// =====
|
|
7
|
-
export const CardanoNetwork = Type.Union([
|
|
8
|
-
Type.Literal("preview"),
|
|
9
|
-
Type.Literal("preprod"),
|
|
10
|
-
Type.Literal("mainnet"),
|
|
11
|
-
Type.Literal("yaci"),
|
|
12
|
-
]);
|
|
13
|
-
// ===========
|
|
14
|
-
// Base schema
|
|
15
|
-
// ===========
|
|
16
|
-
export const ConfigNetworkSchemaCardano = new ConfigSchema({
|
|
17
|
-
required: Type.Object({
|
|
18
|
-
name: Type.String(),
|
|
19
|
-
type: Type.Literal(ConfigNetworkType.CARDANO),
|
|
20
|
-
network: CardanoNetwork,
|
|
21
|
-
}),
|
|
22
|
-
optional: Type.Object({}),
|
|
23
|
-
});
|
|
24
|
-
// ===========
|
|
25
|
-
// Conversions
|
|
26
|
-
// ===========
|
|
27
|
-
// none
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { Static } from "@sinclair/typebox";
|
|
2
|
-
import { ConfigSchema } from "../utils.js";
|
|
3
|
-
import { ConfigNetworkType } from "./types.js";
|
|
4
|
-
import { type MergeIntersects } from "../../../../utils/src/mod.js";
|
|
5
|
-
import type { Chain, ChainFormatters } from "viem";
|
|
6
|
-
export declare const BlockExplorer: import("@sinclair/typebox").TObject<{
|
|
7
|
-
name: import("@sinclair/typebox").TString;
|
|
8
|
-
url: import("@sinclair/typebox").TString;
|
|
9
|
-
apiUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
10
|
-
}>;
|
|
11
|
-
export declare const RpcUrls: import("@sinclair/typebox").TUnsafe<{
|
|
12
|
-
readonly webSocket?: readonly string[] | undefined;
|
|
13
|
-
readonly http: readonly string[];
|
|
14
|
-
}>;
|
|
15
|
-
export declare const ChainNativeCurrency: import("@sinclair/typebox").TObject<{
|
|
16
|
-
name: import("@sinclair/typebox").TString;
|
|
17
|
-
symbol: import("@sinclair/typebox").TString;
|
|
18
|
-
decimals: import("@sinclair/typebox").TNumber;
|
|
19
|
-
}>;
|
|
20
|
-
/**
|
|
21
|
-
* Note: this tries as much as possible to follow Viem's network definition format
|
|
22
|
-
* we can't map it exactly because viem allows for some non-JSON serializable fields
|
|
23
|
-
*/
|
|
24
|
-
export declare const ConfigNetworkSchemaEvm: ConfigSchema<import("@sinclair/typebox").TObject<{
|
|
25
|
-
name: import("@sinclair/typebox").TString;
|
|
26
|
-
type: import("@sinclair/typebox").TLiteral<ConfigNetworkType.EVM>;
|
|
27
|
-
chainId: import("@sinclair/typebox").TNumber;
|
|
28
|
-
nativeCurrency: import("@sinclair/typebox").TObject<{
|
|
29
|
-
name: import("@sinclair/typebox").TString;
|
|
30
|
-
symbol: import("@sinclair/typebox").TString;
|
|
31
|
-
decimals: import("@sinclair/typebox").TNumber;
|
|
32
|
-
}>;
|
|
33
|
-
rpcUrls: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnsafe<{
|
|
34
|
-
readonly webSocket?: readonly string[] | undefined;
|
|
35
|
-
readonly http: readonly string[];
|
|
36
|
-
}>>, import("@sinclair/typebox").TObject<{
|
|
37
|
-
default: import("@sinclair/typebox").TUnsafe<{
|
|
38
|
-
readonly webSocket?: readonly string[] | undefined;
|
|
39
|
-
readonly http: readonly string[];
|
|
40
|
-
}>;
|
|
41
|
-
}>]>;
|
|
42
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
43
|
-
blockExplorers: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
|
|
44
|
-
name: import("@sinclair/typebox").TString;
|
|
45
|
-
url: import("@sinclair/typebox").TString;
|
|
46
|
-
apiUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
47
|
-
}>>, import("@sinclair/typebox").TObject<{
|
|
48
|
-
default: import("@sinclair/typebox").TObject<{
|
|
49
|
-
name: import("@sinclair/typebox").TString;
|
|
50
|
-
url: import("@sinclair/typebox").TString;
|
|
51
|
-
apiUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
52
|
-
}>;
|
|
53
|
-
}>]>, import("@sinclair/typebox").TNull]>;
|
|
54
|
-
/** Source Chain ID (ie. the L1 chain) */
|
|
55
|
-
sourceId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>;
|
|
56
|
-
testnet: import("@sinclair/typebox").TBoolean;
|
|
57
|
-
}>>;
|
|
58
|
-
export type ConfigNetworkEvm = MergeIntersects<Static<ReturnType<typeof ConfigNetworkSchemaEvm.allProperties<true>>>>;
|
|
59
|
-
export type MapNetworkTypes<chain extends Chain<ChainFormatters>> = Omit<chain, "id"> & {
|
|
60
|
-
chainId: chain["id"];
|
|
61
|
-
type: ConfigNetworkType.EVM;
|
|
62
|
-
blockExplorers: NonNullable<chain["blockExplorers"]> | null;
|
|
63
|
-
sourceId: NonNullable<chain["sourceId"]> | null;
|
|
64
|
-
testnet: NonNullable<chain["testnet"]> | false;
|
|
65
|
-
};
|
|
66
|
-
export declare function viemToConfigNetwork(chain: Chain<ChainFormatters>): ConfigNetworkEvm;
|
|
67
|
-
export declare function ConfigNetworkToViem(chain: ConfigNetworkEvm): Chain<ChainFormatters>;
|
|
68
|
-
//# sourceMappingURL=evm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../../../src/config/src/schema/network/evm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAMnD,eAAO,MAAM,aAAa;;;;EAIxB,CAAC;AAMH,eAAO,MAAM,OAAO;;;EAEnB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;EAI9B,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmB/B,yCAAyC;;;GAI3C,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAC5C,MAAM,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CACtE,CAAC;AAMF,MAAM,MAAM,eAAe,CAAC,KAAK,SAAS,KAAK,CAAC,eAAe,CAAC,IAC5D,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GACjB;IACA,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACrB,IAAI,EAAE,iBAAiB,CAAC,GAAG,CAAC;IAC5B,cAAc,EAAE,WAAW,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,GAAG,IAAI,CAAC;IAC5D,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC;IAChD,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC;CAChD,CAAC;AAEJ,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,GAC5B,gBAAgB,CAUlB;AACD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,gBAAgB,GACtB,KAAK,CAAC,eAAe,CAAC,CAQxB"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { ConfigSchema } from "../utils.js";
|
|
3
|
-
import { ConfigNetworkType } from "./types.js";
|
|
4
|
-
import { TypeboxHelpers, } from "../../../../utils/src/mod.js";
|
|
5
|
-
// =====
|
|
6
|
-
// Utils
|
|
7
|
-
// =====
|
|
8
|
-
export const BlockExplorer = Type.Object({
|
|
9
|
-
name: Type.String(),
|
|
10
|
-
url: Type.String(),
|
|
11
|
-
apiUrl: Type.Optional(Type.String()),
|
|
12
|
-
});
|
|
13
|
-
const RpcUrlInternal = Type.Object({
|
|
14
|
-
http: Type.Array(Type.String()),
|
|
15
|
-
webSocket: Type.Optional(Type.Array(Type.String())),
|
|
16
|
-
});
|
|
17
|
-
export const RpcUrls = Type.Unsafe(RpcUrlInternal);
|
|
18
|
-
export const ChainNativeCurrency = Type.Object({
|
|
19
|
-
name: Type.String(),
|
|
20
|
-
symbol: Type.String({ minLength: 2, maxLength: 6 }),
|
|
21
|
-
decimals: Type.Number(),
|
|
22
|
-
});
|
|
23
|
-
// ===========
|
|
24
|
-
// Base schema
|
|
25
|
-
// ===========
|
|
26
|
-
/**
|
|
27
|
-
* Note: this tries as much as possible to follow Viem's network definition format
|
|
28
|
-
* we can't map it exactly because viem allows for some non-JSON serializable fields
|
|
29
|
-
*/
|
|
30
|
-
export const ConfigNetworkSchemaEvm = new ConfigSchema({
|
|
31
|
-
required: Type.Object({
|
|
32
|
-
name: Type.String(),
|
|
33
|
-
type: Type.Literal(ConfigNetworkType.EVM),
|
|
34
|
-
chainId: Type.Number(),
|
|
35
|
-
nativeCurrency: ChainNativeCurrency,
|
|
36
|
-
rpcUrls: Type.Intersect([
|
|
37
|
-
Type.Record(Type.String(), RpcUrls),
|
|
38
|
-
Type.Object({ default: RpcUrls }),
|
|
39
|
-
]),
|
|
40
|
-
}),
|
|
41
|
-
optional: Type.Object({
|
|
42
|
-
blockExplorers: TypeboxHelpers.Nullable(Type.Intersect([
|
|
43
|
-
Type.Record(Type.String(), BlockExplorer),
|
|
44
|
-
Type.Object({ default: BlockExplorer }),
|
|
45
|
-
]), { default: null }),
|
|
46
|
-
/** Source Chain ID (ie. the L1 chain) */
|
|
47
|
-
sourceId: TypeboxHelpers.Nullable(Type.Number(), { default: null }),
|
|
48
|
-
testnet: Type.Boolean({ default: false }),
|
|
49
|
-
}),
|
|
50
|
-
});
|
|
51
|
-
export function viemToConfigNetwork(chain) {
|
|
52
|
-
const network = {
|
|
53
|
-
...chain,
|
|
54
|
-
type: ConfigNetworkType.EVM,
|
|
55
|
-
chainId: chain.id,
|
|
56
|
-
blockExplorers: chain.blockExplorers ?? null,
|
|
57
|
-
sourceId: chain.sourceId ?? null,
|
|
58
|
-
testnet: chain.testnet ?? false,
|
|
59
|
-
};
|
|
60
|
-
return network;
|
|
61
|
-
}
|
|
62
|
-
export function ConfigNetworkToViem(chain) {
|
|
63
|
-
const network = {
|
|
64
|
-
...chain,
|
|
65
|
-
id: chain.chainId,
|
|
66
|
-
blockExplorers: chain.blockExplorers ?? undefined,
|
|
67
|
-
sourceId: chain.sourceId ?? undefined,
|
|
68
|
-
};
|
|
69
|
-
return network;
|
|
70
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Static } from "@sinclair/typebox";
|
|
2
|
-
import { ConfigSchema } from "../utils.js";
|
|
3
|
-
import { ConfigNetworkType } from "./types.js";
|
|
4
|
-
import type { MergeIntersects } from "../../../../utils/src/mod.js";
|
|
5
|
-
export declare const ConfigNetworkSchemaMina: ConfigSchema<import("@sinclair/typebox").TObject<{
|
|
6
|
-
name: import("@sinclair/typebox").TString;
|
|
7
|
-
type: import("@sinclair/typebox").TLiteral<ConfigNetworkType.MINA>;
|
|
8
|
-
/**
|
|
9
|
-
* String name of the network (https://github.com/ChainAgnostic/namespaces/blob/main/mina/caip2.md)
|
|
10
|
-
*/
|
|
11
|
-
networkId: import("@sinclair/typebox").TString;
|
|
12
|
-
}>, import("@sinclair/typebox").TObject<{}>>;
|
|
13
|
-
export type ConfigNetworkMina = MergeIntersects<Static<ReturnType<typeof ConfigNetworkSchemaMina.allProperties<true>>>>;
|
|
14
|
-
//# sourceMappingURL=mina.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mina.d.ts","sourceRoot":"","sources":["../../../../../src/config/src/schema/network/mina.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAYpE,eAAO,MAAM,uBAAuB;;;IAIhC;;OAEG;;4CAIL,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAC7C,MAAM,CAAC,UAAU,CAAC,OAAO,uBAAuB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CACvE,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { ConfigSchema } from "../utils.js";
|
|
3
|
-
import { ConfigNetworkType } from "./types.js";
|
|
4
|
-
// =====
|
|
5
|
-
// Utils
|
|
6
|
-
// =====
|
|
7
|
-
// none
|
|
8
|
-
// ===========
|
|
9
|
-
// Base schema
|
|
10
|
-
// ===========
|
|
11
|
-
export const ConfigNetworkSchemaMina = new ConfigSchema({
|
|
12
|
-
required: Type.Object({
|
|
13
|
-
name: Type.String(),
|
|
14
|
-
type: Type.Literal(ConfigNetworkType.MINA),
|
|
15
|
-
/**
|
|
16
|
-
* String name of the network (https://github.com/ChainAgnostic/namespaces/blob/main/mina/caip2.md)
|
|
17
|
-
*/
|
|
18
|
-
networkId: Type.String(),
|
|
19
|
-
}),
|
|
20
|
-
optional: Type.Object({}),
|
|
21
|
-
});
|
|
22
|
-
// ===========
|
|
23
|
-
// Conversions
|
|
24
|
-
// ===========
|
|
25
|
-
// none
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./evm.js";
|
|
2
|
-
export * from "./cardano.js";
|
|
3
|
-
export * from "./mina.js";
|
|
4
|
-
export * from "./substrate/mod.js";
|
|
5
|
-
export * from "./bitcoin.js";
|
|
6
|
-
export * from "./types.js";
|
|
7
|
-
export * from "./utils.js";
|
|
8
|
-
export * from "./all.js";
|
|
9
|
-
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../src/config/src/schema/network/mod.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Static } from "@sinclair/typebox";
|
|
2
|
-
import { ConfigSchema } from "../utils.js";
|
|
3
|
-
import { ConfigNetworkType } from "./types.js";
|
|
4
|
-
import { type MergeIntersects } from "../../../../utils/src/mod.js";
|
|
5
|
-
export declare const BlockExplorer: import("@sinclair/typebox").TObject<{
|
|
6
|
-
name: import("@sinclair/typebox").TString;
|
|
7
|
-
url: import("@sinclair/typebox").TString;
|
|
8
|
-
apiUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
9
|
-
}>;
|
|
10
|
-
export declare const RpcUrls: import("@sinclair/typebox").TUnsafe<{
|
|
11
|
-
readonly webSocket?: readonly string[] | undefined;
|
|
12
|
-
readonly http: readonly string[];
|
|
13
|
-
}>;
|
|
14
|
-
export declare const ChainNativeCurrency: import("@sinclair/typebox").TObject<{
|
|
15
|
-
name: import("@sinclair/typebox").TString;
|
|
16
|
-
symbol: import("@sinclair/typebox").TString;
|
|
17
|
-
decimals: import("@sinclair/typebox").TNumber;
|
|
18
|
-
}>;
|
|
19
|
-
/**
|
|
20
|
-
* Note: this tries as much as possible to follow Viem's network definition format
|
|
21
|
-
* we can't map it exactly because viem allows for some non-JSON serializable fields
|
|
22
|
-
*/
|
|
23
|
-
export declare const ConfigNetworkSchemaNtp: ConfigSchema<import("@sinclair/typebox").TObject<{
|
|
24
|
-
name: import("@sinclair/typebox").TString;
|
|
25
|
-
type: import("@sinclair/typebox").TLiteral<ConfigNetworkType.NTP>;
|
|
26
|
-
startTime: import("@sinclair/typebox").TNumber;
|
|
27
|
-
blockTimeMS: import("@sinclair/typebox").TNumber;
|
|
28
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
29
|
-
servers: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
30
|
-
}>>;
|
|
31
|
-
export type ConfigNetworkNtp = MergeIntersects<Static<ReturnType<typeof ConfigNetworkSchemaNtp.allProperties<true>>>>;
|
|
32
|
-
//# sourceMappingURL=ntp.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ntp.d.ts","sourceRoot":"","sources":["../../../../../src/config/src/schema/network/ntp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,8BAA8B,CAAC;AAMtC,eAAO,MAAM,aAAa;;;;EAIxB,CAAC;AAMH,eAAO,MAAM,OAAO;;;EAEnB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;EAI9B,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;GAUjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAC5C,MAAM,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CACtE,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { ConfigSchema } from "../utils.js";
|
|
3
|
-
import { ConfigNetworkType } from "./types.js";
|
|
4
|
-
// =====
|
|
5
|
-
// Utils
|
|
6
|
-
// =====
|
|
7
|
-
export const BlockExplorer = Type.Object({
|
|
8
|
-
name: Type.String(),
|
|
9
|
-
url: Type.String(),
|
|
10
|
-
apiUrl: Type.Optional(Type.String()),
|
|
11
|
-
});
|
|
12
|
-
const RpcUrlInternal = Type.Object({
|
|
13
|
-
http: Type.Array(Type.String()),
|
|
14
|
-
webSocket: Type.Optional(Type.Array(Type.String())),
|
|
15
|
-
});
|
|
16
|
-
export const RpcUrls = Type.Unsafe(RpcUrlInternal);
|
|
17
|
-
export const ChainNativeCurrency = Type.Object({
|
|
18
|
-
name: Type.String(),
|
|
19
|
-
symbol: Type.String({ minLength: 2, maxLength: 6 }),
|
|
20
|
-
decimals: Type.Number(),
|
|
21
|
-
});
|
|
22
|
-
// ===========
|
|
23
|
-
// Base schema
|
|
24
|
-
// ===========
|
|
25
|
-
/**
|
|
26
|
-
* Note: this tries as much as possible to follow Viem's network definition format
|
|
27
|
-
* we can't map it exactly because viem allows for some non-JSON serializable fields
|
|
28
|
-
*/
|
|
29
|
-
export const ConfigNetworkSchemaNtp = new ConfigSchema({
|
|
30
|
-
required: Type.Object({
|
|
31
|
-
name: Type.String(),
|
|
32
|
-
type: Type.Literal(ConfigNetworkType.NTP),
|
|
33
|
-
startTime: Type.Number(),
|
|
34
|
-
blockTimeMS: Type.Number(),
|
|
35
|
-
}),
|
|
36
|
-
optional: Type.Object({
|
|
37
|
-
servers: Type.Array(Type.String()),
|
|
38
|
-
}),
|
|
39
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Static } from "@sinclair/typebox";
|
|
2
|
-
import { ConfigSchema } from "../../utils.js";
|
|
3
|
-
import { ConfigNetworkType } from "../types.js";
|
|
4
|
-
import type { MergeIntersects } from "../../../../../utils/src/mod.js";
|
|
5
|
-
export declare const ConfigNetworkSchemaAvail: ConfigSchema<import("@sinclair/typebox").TObject<{
|
|
6
|
-
name: import("@sinclair/typebox").TString;
|
|
7
|
-
type: import("@sinclair/typebox").TLiteral<ConfigNetworkType.AVAIL>;
|
|
8
|
-
genesisSeed: import("@sinclair/typebox").TString;
|
|
9
|
-
caip2: import("@sinclair/typebox").TUnsafe<import("../../../../../utils/src/mod.js").Caip2>;
|
|
10
|
-
nodeUrl: import("@sinclair/typebox").TString;
|
|
11
|
-
genesisHash: import("@sinclair/typebox").TString;
|
|
12
|
-
}>, import("@sinclair/typebox").TObject<{}>>;
|
|
13
|
-
export type ConfigNetworkAvail = MergeIntersects<Static<ReturnType<typeof ConfigNetworkSchemaAvail.allProperties<true>>>>;
|
|
14
|
-
//# sourceMappingURL=avail.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"avail.d.ts","sourceRoot":"","sources":["../../../../../../src/config/src/schema/network/substrate/avail.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAavE,eAAO,MAAM,wBAAwB;;;;;;;4CAUnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAC9C,MAAM,CAAC,UAAU,CAAC,OAAO,wBAAwB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CACxE,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { ConfigSchema } from "../../utils.js";
|
|
3
|
-
import { ConfigNetworkType } from "../types.js";
|
|
4
|
-
import { TypeboxHelpers } from "../../../../../utils/src/mod.js";
|
|
5
|
-
// =====
|
|
6
|
-
// Utils
|
|
7
|
-
// =====
|
|
8
|
-
// none
|
|
9
|
-
// ===========
|
|
10
|
-
// Base schema
|
|
11
|
-
// ===========
|
|
12
|
-
export const ConfigNetworkSchemaAvail = new ConfigSchema({
|
|
13
|
-
required: Type.Object({
|
|
14
|
-
name: Type.String(),
|
|
15
|
-
type: Type.Literal(ConfigNetworkType.AVAIL),
|
|
16
|
-
genesisSeed: Type.String(),
|
|
17
|
-
caip2: TypeboxHelpers.Caip2,
|
|
18
|
-
nodeUrl: Type.String(),
|
|
19
|
-
genesisHash: Type.String(),
|
|
20
|
-
}),
|
|
21
|
-
optional: Type.Object({}),
|
|
22
|
-
});
|
|
23
|
-
// ===========
|
|
24
|
-
// Conversions
|
|
25
|
-
// ===========
|
|
26
|
-
// none
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Static } from "@sinclair/typebox";
|
|
2
|
-
import { ConfigSchema } from "../../utils.js";
|
|
3
|
-
import { ConfigNetworkType } from "../types.js";
|
|
4
|
-
import { type MergeIntersects } from "../../../../../utils/src/mod.js";
|
|
5
|
-
/**
|
|
6
|
-
* This will be the network identifier of the Substrate chain.
|
|
7
|
-
* In Substrate it is always the genesis hash of the network (hash of the first block)
|
|
8
|
-
* You can retrieve this easily by going to PolkadotJS and looking for the hash on block 0
|
|
9
|
-
* e.g. for Kusama it is 0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe.
|
|
10
|
-
*/
|
|
11
|
-
export declare const SubstrateGenesisHash: import("@sinclair/typebox").TUnsafe<`0x${string}`>;
|
|
12
|
-
export declare const ConfigNetworkSchemaSubstrate: ConfigSchema<import("@sinclair/typebox").TObject<{
|
|
13
|
-
name: import("@sinclair/typebox").TString;
|
|
14
|
-
type: import("@sinclair/typebox").TLiteral<ConfigNetworkType.SUBSTRATE>;
|
|
15
|
-
genesisHash: import("@sinclair/typebox").TUnsafe<`0x${string}`>;
|
|
16
|
-
}>, import("@sinclair/typebox").TObject<{}>>;
|
|
17
|
-
export type ConfigNetworkSubstrate = MergeIntersects<Static<ReturnType<typeof ConfigNetworkSchemaSubstrate.allProperties<true>>>>;
|
|
18
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../../src/config/src/schema/network/substrate/common.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,iCAAiC,CAAC;AAMvF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,oDAG/B,CAAC;AAMH,eAAO,MAAM,4BAA4B;;;;4CAOvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,eAAe,CAClD,MAAM,CAAC,UAAU,CAAC,OAAO,4BAA4B,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5E,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { ConfigSchema } from "../../utils.js";
|
|
3
|
-
import { ConfigNetworkType } from "../types.js";
|
|
4
|
-
import { TypeboxHelpers } from "../../../../../utils/src/mod.js";
|
|
5
|
-
// =====
|
|
6
|
-
// Utils
|
|
7
|
-
// =====
|
|
8
|
-
/**
|
|
9
|
-
* This will be the network identifier of the Substrate chain.
|
|
10
|
-
* In Substrate it is always the genesis hash of the network (hash of the first block)
|
|
11
|
-
* You can retrieve this easily by going to PolkadotJS and looking for the hash on block 0
|
|
12
|
-
* e.g. for Kusama it is 0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe.
|
|
13
|
-
*/
|
|
14
|
-
export const SubstrateGenesisHash = TypeboxHelpers.HexString0x({
|
|
15
|
-
maxLength: 66, // 64 + '0x'.length
|
|
16
|
-
minLength: 66,
|
|
17
|
-
});
|
|
18
|
-
// ===========
|
|
19
|
-
// Base schema
|
|
20
|
-
// ===========
|
|
21
|
-
export const ConfigNetworkSchemaSubstrate = new ConfigSchema({
|
|
22
|
-
required: Type.Object({
|
|
23
|
-
name: Type.String(),
|
|
24
|
-
type: Type.Literal(ConfigNetworkType.SUBSTRATE),
|
|
25
|
-
genesisHash: SubstrateGenesisHash,
|
|
26
|
-
}),
|
|
27
|
-
optional: Type.Object({}),
|
|
28
|
-
});
|
|
29
|
-
// ===========
|
|
30
|
-
// Conversions
|
|
31
|
-
// ===========
|
|
32
|
-
// none
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Static } from "@sinclair/typebox";
|
|
2
|
-
import { ConfigSchema } from "../../utils.js";
|
|
3
|
-
import { ConfigNetworkType } from "../types.js";
|
|
4
|
-
import type { MergeIntersects } from "../../../../../utils/src/mod.js";
|
|
5
|
-
export declare const ConfigNetworkSchemaMidnight: ConfigSchema<import("@sinclair/typebox").TObject<{
|
|
6
|
-
name: import("@sinclair/typebox").TString;
|
|
7
|
-
type: import("@sinclair/typebox").TLiteral<ConfigNetworkType.MIDNIGHT>;
|
|
8
|
-
/**
|
|
9
|
-
* TODO: possibly this should switch to either
|
|
10
|
-
* - a string following @midnight-ntwrk/midnight-js-network-id
|
|
11
|
-
* - a genesis hash (following Substrate standard)
|
|
12
|
-
*
|
|
13
|
-
* 0 for localhost
|
|
14
|
-
* 1 for devnet
|
|
15
|
-
*/
|
|
16
|
-
networkId: import("@sinclair/typebox").TNumber;
|
|
17
|
-
genesisHash: import("@sinclair/typebox").TUnsafe<`0x${string}`>;
|
|
18
|
-
}>, import("@sinclair/typebox").TObject<{}>>;
|
|
19
|
-
export type ConfigNetworkMidnight = MergeIntersects<Static<ReturnType<typeof ConfigNetworkSchemaMidnight.allProperties<true>>>>;
|
|
20
|
-
//# sourceMappingURL=midnight.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"midnight.d.ts","sourceRoot":"","sources":["../../../../../../src/config/src/schema/network/substrate/midnight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAavE,eAAO,MAAM,2BAA2B;;;IAIpC;;;;;;;OAOG;;;4CAKL,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,eAAe,CACjD,MAAM,CAAC,UAAU,CAAC,OAAO,2BAA2B,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAC3E,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { ConfigSchema } from "../../utils.js";
|
|
3
|
-
import { ConfigNetworkType } from "../types.js";
|
|
4
|
-
import { SubstrateGenesisHash } from "./common.js";
|
|
5
|
-
// =====
|
|
6
|
-
// Utils
|
|
7
|
-
// =====
|
|
8
|
-
// none
|
|
9
|
-
// ===========
|
|
10
|
-
// Base schema
|
|
11
|
-
// ===========
|
|
12
|
-
export const ConfigNetworkSchemaMidnight = new ConfigSchema({
|
|
13
|
-
required: Type.Object({
|
|
14
|
-
name: Type.String(),
|
|
15
|
-
type: Type.Literal(ConfigNetworkType.MIDNIGHT),
|
|
16
|
-
/**
|
|
17
|
-
* TODO: possibly this should switch to either
|
|
18
|
-
* - a string following @midnight-ntwrk/midnight-js-network-id
|
|
19
|
-
* - a genesis hash (following Substrate standard)
|
|
20
|
-
*
|
|
21
|
-
* 0 for localhost
|
|
22
|
-
* 1 for devnet
|
|
23
|
-
*/
|
|
24
|
-
networkId: Type.Number(),
|
|
25
|
-
genesisHash: SubstrateGenesisHash,
|
|
26
|
-
}),
|
|
27
|
-
optional: Type.Object({}),
|
|
28
|
-
});
|
|
29
|
-
// ===========
|
|
30
|
-
// Conversions
|
|
31
|
-
// ===========
|
|
32
|
-
// none
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/config/src/schema/network/substrate/mod.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare enum ConfigNetworkType {
|
|
2
|
-
NTP = "ntp",
|
|
3
|
-
EVM = "evm",
|
|
4
|
-
CARDANO = "cardano",
|
|
5
|
-
MINA = "mina",
|
|
6
|
-
ALGORAND = "algorand",
|
|
7
|
-
/** generic substrate network */
|
|
8
|
-
SUBSTRATE = "substrate",
|
|
9
|
-
AVAIL = "avail",
|
|
10
|
-
MIDNIGHT = "midnight",
|
|
11
|
-
BITCOIN = "bitcoin"
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/config/src/schema/network/types.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,gCAAgC;IAChC,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export var ConfigNetworkType;
|
|
2
|
-
(function (ConfigNetworkType) {
|
|
3
|
-
ConfigNetworkType["NTP"] = "ntp";
|
|
4
|
-
ConfigNetworkType["EVM"] = "evm";
|
|
5
|
-
ConfigNetworkType["CARDANO"] = "cardano";
|
|
6
|
-
ConfigNetworkType["MINA"] = "mina";
|
|
7
|
-
ConfigNetworkType["ALGORAND"] = "algorand";
|
|
8
|
-
/** generic substrate network */
|
|
9
|
-
ConfigNetworkType["SUBSTRATE"] = "substrate";
|
|
10
|
-
ConfigNetworkType["AVAIL"] = "avail";
|
|
11
|
-
ConfigNetworkType["MIDNIGHT"] = "midnight";
|
|
12
|
-
ConfigNetworkType["BITCOIN"] = "bitcoin";
|
|
13
|
-
})(ConfigNetworkType || (ConfigNetworkType = {}));
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Static } from "@sinclair/typebox";
|
|
2
|
-
import { type Caip2, type MergeIntersects } from "../../../../utils/src/mod.js";
|
|
3
|
-
import type { ConfigNetworkAll } from "./all.js";
|
|
4
|
-
export declare function caip2PrefixFor(config: MergeIntersects<Static<ReturnType<typeof ConfigNetworkAll<false>>>>): Caip2;
|
|
5
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/config/src/schema/network/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,eAAe,EAAW,MAAM,8BAA8B,CAAC;AAGzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAsCjD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAC1E,KAAK,CA4CP"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { strip0x } from "../../../../utils/src/mod.js";
|
|
2
|
-
import { registry, toChainId } from "@dcspark/cip34-js";
|
|
3
|
-
import { ConfigNetworkType } from "./types.js";
|
|
4
|
-
import { Buffer } from "node:buffer";
|
|
5
|
-
function networkToCip34(config) {
|
|
6
|
-
switch (config.network) {
|
|
7
|
-
case "mainnet":
|
|
8
|
-
return toChainId({
|
|
9
|
-
networkId: registry.Mainnet.NetworkId,
|
|
10
|
-
networkMagic: registry.Mainnet.NetworkMagic,
|
|
11
|
-
});
|
|
12
|
-
case "preprod":
|
|
13
|
-
return toChainId({
|
|
14
|
-
networkId: registry.PreProduction.NetworkId,
|
|
15
|
-
networkMagic: registry.PreProduction.NetworkMagic,
|
|
16
|
-
});
|
|
17
|
-
case "preview":
|
|
18
|
-
return toChainId({
|
|
19
|
-
networkId: registry.Preview.NetworkId,
|
|
20
|
-
networkMagic: registry.Preview.NetworkMagic,
|
|
21
|
-
});
|
|
22
|
-
case "yaci":
|
|
23
|
-
// TODO: dynamically fetch (but it should probably be added inside `config` directly instead of fetched here)
|
|
24
|
-
// see: https://github.com/utxorpc/spec/pull/147#discussion_r2013805908
|
|
25
|
-
return toChainId({
|
|
26
|
-
// default values for yaci-devkit
|
|
27
|
-
networkId: 0,
|
|
28
|
-
networkMagic: 42,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
throw new Error(`Unknown network: ${config.network}`);
|
|
32
|
-
}
|
|
33
|
-
export function caip2PrefixFor(config) {
|
|
34
|
-
const type = config.type;
|
|
35
|
-
// see https://github.com/ChainAgnostic/namespaces
|
|
36
|
-
switch (type) {
|
|
37
|
-
case ConfigNetworkType.NTP:
|
|
38
|
-
// TODO What to return here
|
|
39
|
-
return `ntp:${config.name}`;
|
|
40
|
-
case ConfigNetworkType.EVM:
|
|
41
|
-
// https://github.com/ChainAgnostic/namespaces/tree/main/eip155
|
|
42
|
-
return `eip155:${config.chainId}`;
|
|
43
|
-
case ConfigNetworkType.MINA:
|
|
44
|
-
// https://github.com/ChainAgnostic/namespaces/blob/main/mina/caip2.md
|
|
45
|
-
return `mina:${config.networkId}`;
|
|
46
|
-
case ConfigNetworkType.CARDANO:
|
|
47
|
-
// https://github.com/cardano-foundation/CIPs/tree/master/CIP-0034
|
|
48
|
-
return networkToCip34(config);
|
|
49
|
-
case ConfigNetworkType.AVAIL:
|
|
50
|
-
// https://github.com/ChainAgnostic/namespaces/blob/main/polkadot/caip2.md
|
|
51
|
-
return `polkadot:${strip0x(config.genesisHash).slice(0, 32)}`;
|
|
52
|
-
case ConfigNetworkType.MIDNIGHT:
|
|
53
|
-
// https://github.com/ChainAgnostic/namespaces/blob/main/polkadot/caip2.md
|
|
54
|
-
return `polkadot:${strip0x(config.genesisHash).slice(0, 32)}`;
|
|
55
|
-
case ConfigNetworkType.BITCOIN: {
|
|
56
|
-
const chainIdentifier = config.chainIdentifier ??
|
|
57
|
-
config.network ??
|
|
58
|
-
config.name;
|
|
59
|
-
return `bip122:${chainIdentifier}`;
|
|
60
|
-
}
|
|
61
|
-
case ConfigNetworkType.SUBSTRATE:
|
|
62
|
-
// https://github.com/ChainAgnostic/namespaces/blob/main/polkadot/caip2.md
|
|
63
|
-
return `polkadot:${strip0x(config.genesisHash).slice(0, 32)}`;
|
|
64
|
-
case ConfigNetworkType.ALGORAND: {
|
|
65
|
-
// https://github.com/ChainAgnostic/namespaces/blob/main/algorand/caip2.md
|
|
66
|
-
const urlSafe = Buffer.from(config.genesisHash, "base64").toString("base64url");
|
|
67
|
-
const prefix = urlSafe.substring(0, 32);
|
|
68
|
-
const identifier = "algorand:" + prefix;
|
|
69
|
-
return identifier;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
throw new Error(`Unknown network type: ${type}`);
|
|
73
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../src/config/src/schema/primitive/mod.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./types.js";
|