@@ -466,22 +466,50 @@ export const LIT_CHAINS: LITChain<LITEVMChain> = {
466466 type : null ,
467467 vmType : 'EVM' ,
468468 } ,
469+
470+ /**
471+ * Chainlist entry for the Chronicle Testnet.
472+ * https://chainlist.org/chain/175177
473+ */
469474 chronicleTestnet : {
470475 contractAddress : null ,
471476 chainId : 175177 ,
472477 name : 'Chronicle - Lit Protocol Testnet' ,
473- symbol : 'testLPX ' ,
478+ symbol : 'tstLIT ' ,
474479 decimals : 18 ,
475- rpcUrls : [ 'https://lit-protocol.calderachain.xyz/replica-http' ] ,
480+ rpcUrls : [
481+ 'https://lit-protocol.calderachain.xyz/replica-http' ,
482+ 'https://chain-rpc.litprotocol.com/http' ,
483+ ] ,
476484 blockExplorerUrls : [ 'https://chain.litprotocol.com/' ] ,
477485 type : null ,
478486 vmType : 'EVM' ,
479487 } ,
488+
489+ /**
490+ * @deprecated Will be removed in version 7.x. - Use `chronicleVesuviusTestnet` instead.
491+ */
480492 datilDevnet : {
481493 contractAddress : null ,
482494 chainId : 2311 ,
483- name : 'Vesuvius - Lit Protocol Devnet' ,
484- symbol : 'testLIT' ,
495+ name : 'Chronicle Vesuvius - Lit Protocol Testnet' ,
496+ symbol : 'tstLPX' ,
497+ decimals : 18 ,
498+ rpcUrls : [ 'https://vesuvius-rpc.litprotocol.com/' ] ,
499+ blockExplorerUrls : [ 'https://vesuvius-explorer.litprotocol.com/' ] ,
500+ type : null ,
501+ vmType : 'EVM' ,
502+ } ,
503+
504+ /**
505+ * Chainlist entry for the Chronicle Vesuvius Testnet.
506+ * https://chainlist.org/chain/2311
507+ */
508+ chronicleVesuviusTestnet : {
509+ contractAddress : null ,
510+ chainId : 2311 ,
511+ name : 'Chronicle Vesuvius - Lit Protocol Testnet' ,
512+ symbol : 'tstLPX' ,
485513 decimals : 18 ,
486514 rpcUrls : [ 'https://vesuvius-rpc.litprotocol.com/' ] ,
487515 blockExplorerUrls : [ 'https://vesuvius-explorer.litprotocol.com/' ] ,
@@ -492,9 +520,12 @@ export const LIT_CHAINS: LITChain<LITEVMChain> = {
492520 contractAddress : null ,
493521 chainId : 175177 ,
494522 name : 'Chronicle - Lit Protocol Testnet' ,
495- symbol : 'testLPX ' ,
523+ symbol : 'tstLIT ' ,
496524 decimals : 18 ,
497- rpcUrls : [ 'https://lit-protocol.calderachain.xyz/replica-http' ] ,
525+ rpcUrls : [
526+ 'https://lit-protocol.calderachain.xyz/replica-http' ,
527+ 'https://chain-rpc.litprotocol.com/http' ,
528+ ] ,
498529 blockExplorerUrls : [ 'https://chain.litprotocol.com/' ] ,
499530 type : null ,
500531 vmType : 'EVM' ,
@@ -611,30 +642,179 @@ export const LIT_CHAINS: LITChain<LITEVMChain> = {
611642 } ,
612643} ;
613644
645+ /**
646+ * @deprecated Will be removed in version 7.x. - This is using the OLD chornicle testnet. `LIT_CHAINS['chronicleTestnet']` instead, or use `LIT_CHAINS['chronicleVesuviusTestnet']` for the new Chronicle Vesuvius Testnet (Jul 2024).
647+ */
614648export const LIT_CHAIN_RPC_URL = LIT_CHAINS [ 'chronicleTestnet' ] . rpcUrls [ 0 ] ;
615649
616650/**
617- * Enum representing the available LIT RPC endpoints.
651+ * Object containing information to submit to Metamask
652+ */
653+ export const metamaskChainInfo = {
654+ /**
655+ * Information about the "chronicle" chain.
656+ */
657+ chronicle : {
658+ chainId : LIT_CHAINS [ 'chronicleTestnet' ] . chainId ,
659+ chainName : LIT_CHAINS [ 'chronicleTestnet' ] . name ,
660+ nativeCurrency : {
661+ name : LIT_CHAINS [ 'chronicleTestnet' ] . symbol ,
662+ symbol : LIT_CHAINS [ 'chronicleTestnet' ] . symbol ,
663+ decimals : LIT_CHAINS [ 'chronicleTestnet' ] . decimals ,
664+ } ,
665+ rpcUrls : LIT_CHAINS [ 'chronicleTestnet' ] . rpcUrls ,
666+ blockExplorerUrls : LIT_CHAINS [ 'chronicleTestnet' ] . blockExplorerUrls ,
667+ iconUrls : [ 'future' ] ,
668+ } ,
669+ /**
670+ * Information about the "chronicleVesuvius" chain.
671+ */
672+ chronicleVesuvius : {
673+ chainId : LIT_CHAINS [ 'chronicleVesuviusTestnet' ] . chainId ,
674+ chainName : LIT_CHAINS [ 'chronicleVesuviusTestnet' ] . name ,
675+ nativeCurrency : {
676+ name : LIT_CHAINS [ 'chronicleVesuviusTestnet' ] . symbol ,
677+ symbol : LIT_CHAINS [ 'chronicleVesuviusTestnet' ] . symbol ,
678+ decimals : LIT_CHAINS [ 'chronicleVesuviusTestnet' ] . decimals ,
679+ } ,
680+ rpcUrls : LIT_CHAINS [ 'chronicleVesuviusTestnet' ] . rpcUrls ,
681+ blockExplorerUrls : LIT_CHAINS [ 'chronicleVesuviusTestnet' ] . blockExplorerUrls ,
682+ iconUrls : [ 'future' ] ,
683+ } ,
684+ } ;
685+
686+ /**
687+ * Constants representing the available LIT RPC endpoints.
618688 */
619- export enum LIT_RPC {
689+ export const LIT_RPC = {
620690 /**
621691 * Local Anvil RPC endpoint.
622692 */
623- LOCAL_ANVIL = 'http://127.0.0.1:8545' ,
693+ LOCAL_ANVIL : 'http://127.0.0.1:8545' ,
624694
625695 /**
626696 * Chronicle RPC endpoint - Used for Cayenne, Manzano, Habanero
627697 */
628- CHRONICLE = 'https://chain-rpc.litprotocol.com/http' ,
698+ CHRONICLE : 'https://chain-rpc.litprotocol.com/http' ,
629699
630700 /**
631- * Vesuvius RPC endpoint - used for >= Datil-dev
701+ * Chronicle Vesuvius RPC endpoint - used for >= Datil-dev, Datil-test
702+ * @deprecated Will be removed in version 7.x. - Use CHRONICLE_VESUVIUS instead
632703 */
633- VESUVIUS = 'https://vesuvius-rpc.litprotocol.com' ,
634- }
704+ VESUVIUS : 'https://vesuvius-rpc.litprotocol.com' ,
705+
706+ /**
707+ * Chronicle Vesuvius RPC endpoint - used for >= Datil-dev, Datil-test
708+ */
709+ CHRONICLE_VESUVIUS : 'https://vesuvius-rpc.litprotocol.com' ,
710+ } as const ;
635711
636712export const LIT_EVM_CHAINS = LIT_CHAINS ;
637713
714+ /**
715+ * Represents the Lit Network constants.
716+ */
717+ export const LIT_NETWORK = {
718+ Cayenne : 'cayenne' ,
719+ Manzano : 'manzano' ,
720+ Habanero : 'habanero' ,
721+ DatilDev : 'datil-dev' ,
722+ DatilTest : 'datil-test' ,
723+ Custom : 'custom' ,
724+ Localhost : 'localhost' ,
725+ } ;
726+
727+ /**
728+ * The type representing the keys of the LIT_NETWORK object.
729+ */
730+ export type LIT_NETWORK_TYPES = keyof typeof LIT_NETWORK ;
731+
732+ /**
733+ * The type representing the values of the LIT_NETWORK object.
734+ */
735+ export type LIT_NETWORK_VALUES = ( typeof LIT_NETWORK ) [ keyof typeof LIT_NETWORK ] ;
736+
737+ /**
738+ * RPC URL by Network
739+ *
740+ * A mapping of network names to their corresponding RPC URLs.
741+ */
742+ export const RPC_URL_BY_NETWORK : { [ key in LIT_NETWORK_VALUES ] : string } = {
743+ cayenne : LIT_RPC . CHRONICLE ,
744+ manzano : LIT_RPC . CHRONICLE ,
745+ habanero : LIT_RPC . CHRONICLE ,
746+ 'datil-dev' : LIT_RPC . CHRONICLE_VESUVIUS ,
747+ 'datil-test' : LIT_RPC . CHRONICLE_VESUVIUS ,
748+ custom : LIT_RPC . LOCAL_ANVIL ,
749+ localhost : LIT_RPC . LOCAL_ANVIL ,
750+ } ;
751+
752+ /**
753+ * Mapping of network names to their corresponding relayer URLs.
754+ */
755+ export const RELAYER_URL_BY_NETWORK : {
756+ [ key in LIT_NETWORK_VALUES ] : string ;
757+ } = {
758+ cayenne : 'https://relayer-server-staging-cayenne.getlit.dev' ,
759+ manzano : 'https://manzano-relayer.getlit.dev' ,
760+ habanero : 'https://habanero-relayer.getlit.dev' ,
761+ 'datil-dev' : 'https://datil-dev-relayer.getlit.dev' ,
762+ 'datil-test' : 'https://datil-test-relayer.getlit.dev' ,
763+ custom : 'http://localhost:3000' ,
764+ localhost : 'http://localhost:3000' ,
765+ } ;
766+
767+ /**
768+ * URL mappings for general worker URLs by network.
769+ */
770+ export const GENERAL_WORKER_URL_BY_NETWORK : {
771+ [ key in LIT_NETWORK_VALUES ] : string ;
772+ } = {
773+ cayenne : 'https://apis.getlit.dev/cayenne/contracts' ,
774+ manzano : 'https://apis.getlit.dev/manzano/contracts' ,
775+ habanero : 'https://apis.getlit.dev/habanero/contracts' ,
776+ 'datil-dev' : 'https://apis.getlit.dev/datil-dev/contracts' ,
777+ 'datil-test' : 'https://apis.getlit.dev/datil-test/contracts' ,
778+
779+ // just use cayenne abis for custom and localhost
780+ custom : 'https://apis.getlit.dev/cayenne/contracts' ,
781+ localhost : 'https://apis.getlit.dev/cayenne/contracts' ,
782+ } ;
783+
784+ /**
785+ * URL constants for the staging worker by network.
786+ */
787+ export const GENERAL_STAGING_WORKER_URL_BY_NETWORK : {
788+ [ key in LIT_NETWORK_VALUES ] : string ;
789+ } = {
790+ cayenne : 'https://staging.apis.getlit.dev/cayenne/contracts' ,
791+ manzano : 'https://staging.apis.getlit.dev/manzano/contracts' ,
792+ habanero : 'https://staging.apis.getlit.dev/habanero/contracts' ,
793+ 'datil-dev' : 'https://staging.apis.getlit.dev/datil-dev/contracts' ,
794+ 'datil-test' : 'https://staging.apis.getlit.dev/datil-test/contracts' ,
795+
796+ // just use cayenne abis for custom and localhost
797+ custom : 'https://apis.getlit.dev/cayenne/contracts' ,
798+ localhost : 'https://apis.getlit.dev/cayenne/contracts' ,
799+ } ;
800+
801+ /**
802+ * Mapping of network values to corresponding Metamask chain info.
803+ */
804+ export const METAMASK_CHAIN_INFO_BY_NETWORK : Record <
805+ LIT_NETWORK_VALUES ,
806+ | typeof metamaskChainInfo . chronicle
807+ | typeof metamaskChainInfo . chronicleVesuvius
808+ > = {
809+ cayenne : metamaskChainInfo . chronicle ,
810+ manzano : metamaskChainInfo . chronicle ,
811+ habanero : metamaskChainInfo . chronicle ,
812+ 'datil-dev' : metamaskChainInfo . chronicleVesuvius ,
813+ 'datil-test' : metamaskChainInfo . chronicleVesuvius ,
814+ custom : metamaskChainInfo . chronicleVesuvius ,
815+ localhost : metamaskChainInfo . chronicleVesuvius ,
816+ } ;
817+
638818/**
639819 * Solana Chains supported by the LIT protocol. Use the chain name as a key in this object.
640820 * @constant
@@ -790,6 +970,7 @@ export const LIT_NETWORKS: { [key in LitNetwork]: string[] } & {
790970 [ LitNetwork . Cayenne ] : [ ] ,
791971 [ LitNetwork . Manzano ] : [ ] ,
792972 [ LitNetwork . DatilDev ] : [ ] ,
973+ [ LitNetwork . DatilTest ] : [ ] ,
793974 [ LitNetwork . Habanero ] : [ ] ,
794975 [ LitNetwork . Custom ] : [ ] ,
795976 // FIXME: Remove localhost and internalDev; replaced with 'custom' type networks
@@ -827,12 +1008,32 @@ export const TELEM_API_URL = 'https://lit-general-worker.getlit.dev';
8271008// ========== RLI Delegation ==========
8281009export const SIWE_DELEGATION_URI = 'lit:capability:delegation' ;
8291010
1011+ /**
1012+ * @deprecated Will be removed in version 7.x. - Use RELAYER_URL_BY_NETWORK.Cayenne instead
1013+ */
8301014export const RELAY_URL_CAYENNE =
8311015 'https://relayer-server-staging-cayenne.getlit.dev' ;
1016+
1017+ /**
1018+ * @deprecated Will be removed in version 7.x. - Use RELAYER_URL_BY_NETWORK.Habanero instead
1019+ */
8321020export const RELAY_URL_HABANERO = 'https://habanero-relayer.getlit.dev' ;
1021+
1022+ /**
1023+ * @deprecated Will be removed in version 7.x. - Use RELAYER_URL_BY_NETWORK.Manzano instead
1024+ */
8331025export const RELAY_URL_MANZANO = 'https://manzano-relayer.getlit.dev' ;
1026+
1027+ /**
1028+ * @deprecated Will be removed in version 7.x. - Use RELAYER_URL_BY_NETWORK.DatilDev instead
1029+ */
8341030export const RELAY_URL_DATIL_DEV = 'https://datil-dev-relayer.getlit.dev' ;
8351031
1032+ /**
1033+ * @deprecated Will be removed in version 7.x. - Use RELAYER_URL_BY_NETWORK.DatilTest instead
1034+ */
1035+ export const RELAY_URL_DATIL_TEST = 'https://datil-test-relayer.getlit.dev' ;
1036+
8361037// ========== Lit Actions ==========
8371038export const LIT_ACTION_IPFS_HASH =
8381039 'QmUjX8MW6StQ7NKNdaS6g4RMkvN5hcgtKmEi8Mca6oX4t3' ;
0 commit comments