@nevermined-io/core-kit 1.8.0 → 1.10.0
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/dist/contracts/ContractBase.d.ts.map +1 -1
- package/dist/contracts/ContractBase.js +2 -2
- package/dist/contracts/ContractBase.js.map +1 -1
- package/dist/models/NvmApiKey.d.ts +9 -0
- package/dist/models/NvmApiKey.d.ts.map +1 -1
- package/dist/models/NvmApiKey.js +2 -1
- package/dist/models/NvmApiKey.js.map +1 -1
- package/dist/nevermined/utils/BlockchainViemUtils.d.ts +29 -14
- package/dist/nevermined/utils/BlockchainViemUtils.d.ts.map +1 -1
- package/dist/nevermined/utils/BlockchainViemUtils.js +48 -33
- package/dist/nevermined/utils/BlockchainViemUtils.js.map +1 -1
- package/dist/nevermined/utils/ZeroDevPolicies.d.ts +2 -2
- package/dist/nevermined/utils/ZeroDevPolicies.d.ts.map +1 -1
- package/dist/nevermined/utils/ZeroDevPolicies.js +27 -14
- package/dist/nevermined/utils/ZeroDevPolicies.js.map +1 -1
- package/dist/utils/Network.d.ts +6 -1
- package/dist/utils/Network.d.ts.map +1 -1
- package/dist/utils/Network.js +6 -1
- package/dist/utils/Network.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/Network.ts"],"sourcesContent":["import { defineChain } from 'viem'\nimport {\n type Chain,\n arbitrum,\n arbitrumSepolia,\n aurora,\n auroraTestnet,\n base,\n baseSepolia,\n celo,\n celoAlfajores,\n gnosis,\n hardhat,\n mainnet,\n optimism,\n polygon,\n polygonMumbai,\n tempo,\n tempoModerato,\n} from 'viem/chains'\nimport { ContractsError } from '../errors/NeverminedErrors.js'\n\nconst localhostChain = (id: number): Chain =>\n defineChain({\n id,\n name: 'Localhost',\n fees: { baseFeeMultiplier: 1.2 },\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },\n rpcUrls: { default: { http: [`http://127.0.0.1:${process.env.ETH_PORT || 18545}`] } },\n })\n\n/**\n * Single source of truth for every supported network (#1929). Each entry ties the\n * chainId to its `name`, `testnet` flag, and viem `chain`. Adding a network is ONE\n * entry here — `getNetworkName` / `isTestnet` / `getChain` all read from this map.\n *\n * `chain` is optional: legacy testnets we still name/classify but no longer have a\n * viem chain for (`getChain` throws for those, as before).\n */\nconst NETWORKS: Record<number, { name: string; testnet: boolean; chain?: Chain }> = {\n 1: { name: 'mainnet', testnet: false, chain: mainnet },\n 2: { name: 'morden', testnet: true },\n 3: { name: 'ropsten', testnet: true },\n 4: { name: 'rinkeby', testnet: true },\n 5: { name: 'goerli', testnet: true },\n 10: { name: 'optimism', testnet: false, chain: optimism as Chain },\n 42: { name: 'kovan', testnet: true },\n 77: { name: 'poa_sokol', testnet: false },\n 99: { name: 'poa_core', testnet: false },\n 100: { name: 'gnosis', testnet: false, chain: gnosis },\n 137: { name: 'matic', testnet: false, chain: polygon },\n 1337: {\n name: 'geth-localnet',\n testnet: true,\n chain: defineChain({\n id: 1337,\n name: 'geth-localnet',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },\n rpcUrls: { default: { http: ['http://contracts.nevermined.localnet'] } },\n }),\n },\n 3141: { name: 'hyperspace', testnet: true },\n 3338: {\n name: 'peaq-mainnet',\n testnet: false,\n chain: defineChain({\n id: 3338,\n name: 'peaq-network',\n nativeCurrency: { name: 'Peaq', symbol: 'PEAQ', decimals: 18 },\n rpcUrls: { default: { http: ['https://evm.peaq.network'] } },\n }),\n },\n 8453: { name: 'base', testnet: false, chain: base as Chain },\n 8996: { name: 'spree', testnet: true, chain: localhostChain(8996) },\n 8997: { name: 'polygon-localnet', testnet: true, chain: localhostChain(8997) },\n 8998: { name: 'hardhat', testnet: true, chain: localhostChain(8998) },\n 10200: { name: 'chiado', testnet: true }, // Gnosis testnet\n 31337: { name: 'geth-localnet', testnet: true, chain: hardhat },\n 42220: { name: 'celo', testnet: false, chain: celo as Chain },\n 44787: { name: 'celo-alfajores', testnet: true, chain: celoAlfajores as Chain },\n 62320: { name: 'celo-baklava', testnet: true },\n 80001: { name: 'mumbai', testnet: true, chain: polygonMumbai },\n 84532: { name: 'base-sepolia', testnet: true, chain: baseSepolia as Chain },\n 42161: { name: 'arbitrum-one', testnet: false, chain: arbitrum },\n 421613: { name: 'arbitrum-goerli', testnet: true },\n 421614: { name: 'arbitrum-sepolia', testnet: true, chain: arbitrumSepolia },\n 1313161554: { name: 'aurora', testnet: false, chain: aurora },\n 1313161555: { name: 'aurora-testnet', testnet: true, chain: auroraTestnet },\n 1313161556: { name: 'aurora-betanet', testnet: true },\n 4217: { name: 'tempo', testnet: false, chain: tempo as Chain },\n 42431: { name: 'tempo-moderato', testnet: true, chain: tempoModerato as Chain },\n}\n\nexport async function getNetworkName(networkId: number): Promise<string> {\n const entry = NETWORKS[networkId]\n if (!entry) throw new ContractsError(`Network with id ${networkId} not supported.`)\n return entry.name\n}\n\nexport function isTestnet(networkId: number): boolean {\n const entry = NETWORKS[networkId]\n if (!entry) throw new ContractsError(`Network with id ${networkId} not supported.`)\n return entry.testnet\n}\n\nexport function getChain(networkId: number | undefined): Chain {\n const entry = networkId != null ? NETWORKS[networkId] : undefined\n if (!entry?.chain) throw new ContractsError(`Network with id ${networkId} not supported.`)\n return entry.chain\n}\n\n/**\n * True for Tempo networks (mainnet 4217 + moderato 42431); name-prefixed so new\n * Tempo entries are covered
|
|
1
|
+
{"version":3,"sources":["../../src/utils/Network.ts"],"sourcesContent":["import { defineChain } from 'viem'\nimport {\n type Chain,\n arbitrum,\n arbitrumSepolia,\n aurora,\n auroraTestnet,\n base,\n baseSepolia,\n celo,\n celoAlfajores,\n gnosis,\n hardhat,\n mainnet,\n optimism,\n polygon,\n polygonMumbai,\n tempo,\n tempoModerato,\n} from 'viem/chains'\nimport { ContractsError } from '../errors/NeverminedErrors.js'\n\nconst localhostChain = (id: number): Chain =>\n defineChain({\n id,\n name: 'Localhost',\n fees: { baseFeeMultiplier: 1.2 },\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },\n rpcUrls: { default: { http: [`http://127.0.0.1:${process.env.ETH_PORT || 18545}`] } },\n })\n\n/**\n * Single source of truth for every supported network (#1929). Each entry ties the\n * chainId to its `name`, `testnet` flag, and viem `chain`. Adding a network is ONE\n * entry here — `getNetworkName` / `isTestnet` / `getChain` all read from this map.\n *\n * `chain` is optional: legacy testnets we still name/classify but no longer have a\n * viem chain for (`getChain` throws for those, as before).\n */\nconst NETWORKS: Record<number, { name: string; testnet: boolean; chain?: Chain }> = {\n 1: { name: 'mainnet', testnet: false, chain: mainnet },\n 2: { name: 'morden', testnet: true },\n 3: { name: 'ropsten', testnet: true },\n 4: { name: 'rinkeby', testnet: true },\n 5: { name: 'goerli', testnet: true },\n 10: { name: 'optimism', testnet: false, chain: optimism as Chain },\n 42: { name: 'kovan', testnet: true },\n 77: { name: 'poa_sokol', testnet: false },\n 99: { name: 'poa_core', testnet: false },\n 100: { name: 'gnosis', testnet: false, chain: gnosis },\n 137: { name: 'matic', testnet: false, chain: polygon },\n 1337: {\n name: 'geth-localnet',\n testnet: true,\n chain: defineChain({\n id: 1337,\n name: 'geth-localnet',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },\n rpcUrls: { default: { http: ['http://contracts.nevermined.localnet'] } },\n }),\n },\n 3141: { name: 'hyperspace', testnet: true },\n 3338: {\n name: 'peaq-mainnet',\n testnet: false,\n chain: defineChain({\n id: 3338,\n name: 'peaq-network',\n nativeCurrency: { name: 'Peaq', symbol: 'PEAQ', decimals: 18 },\n rpcUrls: { default: { http: ['https://evm.peaq.network'] } },\n }),\n },\n 8453: { name: 'base', testnet: false, chain: base as Chain },\n 8996: { name: 'spree', testnet: true, chain: localhostChain(8996) },\n 8997: { name: 'polygon-localnet', testnet: true, chain: localhostChain(8997) },\n 8998: { name: 'hardhat', testnet: true, chain: localhostChain(8998) },\n 10200: { name: 'chiado', testnet: true }, // Gnosis testnet\n 31337: { name: 'geth-localnet', testnet: true, chain: hardhat },\n 42220: { name: 'celo', testnet: false, chain: celo as Chain },\n 44787: { name: 'celo-alfajores', testnet: true, chain: celoAlfajores as Chain },\n 62320: { name: 'celo-baklava', testnet: true },\n 80001: { name: 'mumbai', testnet: true, chain: polygonMumbai },\n 84532: { name: 'base-sepolia', testnet: true, chain: baseSepolia as Chain },\n 42161: { name: 'arbitrum-one', testnet: false, chain: arbitrum },\n 421613: { name: 'arbitrum-goerli', testnet: true },\n 421614: { name: 'arbitrum-sepolia', testnet: true, chain: arbitrumSepolia },\n 1313161554: { name: 'aurora', testnet: false, chain: aurora },\n 1313161555: { name: 'aurora-testnet', testnet: true, chain: auroraTestnet },\n 1313161556: { name: 'aurora-betanet', testnet: true },\n 4217: { name: 'tempo', testnet: false, chain: tempo as Chain },\n 42431: { name: 'tempo-moderato', testnet: true, chain: tempoModerato as Chain },\n}\n\nexport async function getNetworkName(networkId: number): Promise<string> {\n const entry = NETWORKS[networkId]\n if (!entry) throw new ContractsError(`Network with id ${networkId} not supported.`)\n return entry.name\n}\n\nexport function isTestnet(networkId: number): boolean {\n const entry = NETWORKS[networkId]\n if (!entry) throw new ContractsError(`Network with id ${networkId} not supported.`)\n return entry.testnet\n}\n\nexport function getChain(networkId: number | undefined): Chain {\n const entry = networkId != null ? NETWORKS[networkId] : undefined\n if (!entry?.chain) throw new ContractsError(`Network with id ${networkId} not supported.`)\n return entry.chain\n}\n\n/**\n * True for Tempo networks (mainnet 4217 + moderato 42431); name-prefixed so new\n * Tempo entries are covered.\n *\n * Tempo is the only chain with a session-key enable-gas ceiling low enough to\n * constrain what a CallPolicy may contain, so callers use this to apply\n * Tempo-only rules — see `MAX_CALLPOLICY_PERMISSIONS` and the SCA/7702 gate in\n * the API's key minting.\n */\nexport function isTempoNetwork(networkId: number | undefined): boolean {\n const entry = networkId != null ? NETWORKS[networkId] : undefined\n return Boolean(entry?.name.startsWith('tempo'))\n}\n"],"names":["defineChain","arbitrum","arbitrumSepolia","aurora","auroraTestnet","base","baseSepolia","celo","celoAlfajores","gnosis","hardhat","mainnet","optimism","polygon","polygonMumbai","tempo","tempoModerato","ContractsError","localhostChain","id","name","fees","baseFeeMultiplier","nativeCurrency","symbol","decimals","rpcUrls","default","http","process","env","ETH_PORT","NETWORKS","testnet","chain","getNetworkName","networkId","entry","isTestnet","getChain","undefined","isTempoNetwork","Boolean","startsWith"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAM;AAClC,SAEEC,QAAQ,EACRC,eAAe,EACfC,MAAM,EACNC,aAAa,EACbC,IAAI,EACJC,WAAW,EACXC,IAAI,EACJC,aAAa,EACbC,MAAM,EACNC,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,OAAO,EACPC,aAAa,EACbC,KAAK,EACLC,aAAa,QACR,cAAa;AACpB,SAASC,cAAc,QAAQ,gCAA+B;AAE9D,MAAMC,iBAAiB,CAACC,KACtBnB,YAAY;QACVmB;QACAC,MAAM;QACNC,MAAM;YAAEC,mBAAmB;QAAI;QAC/BC,gBAAgB;YAAEH,MAAM;YAASI,QAAQ;YAAOC,UAAU;QAAG;QAC7DC,SAAS;YAAEC,SAAS;gBAAEC,MAAM;oBAAC,CAAC,iBAAiB,EAAEC,QAAQC,GAAG,CAACC,QAAQ,IAAI,OAAO;iBAAC;YAAC;QAAE;IACtF;AAEF;;;;;;;CAOC,GACD,MAAMC,WAA8E;IAClF,GAAG;QAAEZ,MAAM;QAAWa,SAAS;QAAOC,OAAOvB;IAAQ;IACrD,GAAG;QAAES,MAAM;QAAUa,SAAS;IAAK;IACnC,GAAG;QAAEb,MAAM;QAAWa,SAAS;IAAK;IACpC,GAAG;QAAEb,MAAM;QAAWa,SAAS;IAAK;IACpC,GAAG;QAAEb,MAAM;QAAUa,SAAS;IAAK;IACnC,IAAI;QAAEb,MAAM;QAAYa,SAAS;QAAOC,OAAOtB;IAAkB;IACjE,IAAI;QAAEQ,MAAM;QAASa,SAAS;IAAK;IACnC,IAAI;QAAEb,MAA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