@xyo-network/xl1-network-model 1.25.26 → 1.25.28
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/neutral/index.mjs.map +1 -1
- package/dist/neutral/lib/NetworkDataLakeUrls.d.ts +1 -0
- package/dist/neutral/lib/NetworkDataLakeUrls.d.ts.map +1 -1
- package/dist/neutral/lib/Networks.d.ts +4 -0
- package/dist/neutral/lib/Networks.d.ts.map +1 -1
- package/dist/neutral/models/Bootstrap.d.ts +9 -0
- package/dist/neutral/models/Bootstrap.d.ts.map +1 -1
- package/dist/neutral/modules/node/getNetworkNode.d.ts +1 -0
- package/dist/neutral/modules/node/getNetworkNode.d.ts.map +1 -1
- package/dist/neutral/modules/node/getNetworkNodes.d.ts +1 -0
- package/dist/neutral/modules/node/getNetworkNodes.d.ts.map +1 -1
- package/dist/neutral/modules/node/initNetworkNode.d.ts +1 -0
- package/dist/neutral/modules/node/initNetworkNode.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/lib/NetworkDataLakeUrls.ts +1 -2
- package/src/lib/Networks.ts +4 -0
- package/src/models/Bootstrap.ts +9 -0
- package/src/modules/node/getNetworkNode.ts +1 -0
- package/src/modules/node/getNetworkNodes.ts +1 -0
- package/src/modules/node/initNetworkNode.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/icons/local/local.svg","../../src/icons/mainnet/mainnet.svg","../../src/icons/sequence/testnet.svg","../../src/lib/Networks.ts","../../src/models/Bootstrap.ts","../../src/lib/NetworkDataLakeUrls.ts","../../src/modules/node/getNetworkNode.ts","../../src/manifest/network.json","../../src/manifest/networkManifest.ts","../../src/modules/node/getNetworkNodes.ts","../../src/modules/node/initNetworkNode.ts"],"sourcesContent":["<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\"><g style=\"opacity:.5;\"><path d=\"M154.71,97c.46,2.59,2.5,4.62,5.1,5.05l14.05,2.34,31.71-46.17c4.57-6.65-3.62-14.62-10.14-9.87l-43.68,31.83,2.97,16.82Z\" style=\"fill:#f47f00;\"/><path d=\"M173.86,151.62l-14.05,2.34c-2.6.43-4.64,2.45-5.1,5.05l-2.97,16.82,43.68,31.83c6.52,4.75,14.71-3.21,10.14-9.87l-31.71-46.17Z\" style=\"fill:#f47f00;\"/><path d=\"M82.14,104.38l14.05-2.34c2.6-.43,4.64-2.45,5.1-5.05l2.97-16.82-43.68-31.83c-6.52-4.75-14.71,3.21-10.14,9.87l31.71,46.17Z\" style=\"fill:#f47f00;\"/><path d=\"M101.29,159c-.46-2.59-2.5-4.62-5.1-5.05l-14.05-2.34-31.71,46.17c-4.57,6.65,3.62,14.62,10.14,9.87l43.68-31.83-2.97-16.82Z\" style=\"fill:#f47f00;\"/></g><path d=\"M107.33,104l15.94-90.32c.93-5.3,8.53-5.3,9.47,0l15.94,90.32c.35,2.01,1.94,3.57,3.95,3.91l92.24,15.35c5.36.89,5.36,8.59,0,9.49l-92.24,15.35c-2.01.33-3.59,1.9-3.95,3.91l-15.94,90.32c-.93,5.3-8.53,5.3-9.47,0l-15.94-90.32c-.35-2.01-1.94-3.57-3.95-3.91l-92.24-15.35c-5.36-.89-5.36-8.59,0-9.49l92.24-15.35c2.01-.33,3.59-1.9,3.95-3.91Z\" style=\"fill:#f47f00;\"/></svg>","<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\"><path d=\"M154.71,97c.46,2.59,2.5,4.62,5.1,5.05l14.05,2.34,31.71-46.17c4.57-6.65-3.62-14.62-10.14-9.87l-43.68,31.83,2.97,16.82Z\" style=\"fill:#8d8fc6;\"/><path d=\"M173.86,151.62l-14.05,2.34c-2.6.43-4.64,2.45-5.1,5.05l-2.97,16.82,43.68,31.83c6.52,4.75,14.71-3.21,10.14-9.87l-31.71-46.17Z\" style=\"fill:#eb407a;\"/><path d=\"M82.14,104.38l14.05-2.34c2.6-.43,4.64-2.45,5.1-5.05l2.97-16.82-43.68-31.83c-6.52-4.75-14.71,3.21-10.14,9.87l31.71,46.17Z\" style=\"fill:#579fd6;\"/><path d=\"M101.29,159c-.46-2.59-2.5-4.62-5.1-5.05l-14.05-2.34-31.71,46.17c-4.57,6.65,3.62,14.62,10.14,9.87l43.68-31.83-2.97-16.82Z\" style=\"fill:#f27046;\"/><path d=\"M107.33,104l15.94-90.32c.93-5.3,8.53-5.3,9.47,0l15.94,90.32c.35,2.01,1.94,3.57,3.95,3.91l92.24,15.35c5.36.89,5.36,8.59,0,9.49l-92.24,15.35c-2.01.33-3.59,1.9-3.95,3.91l-15.94,90.32c-.93,5.3-8.53,5.3-9.47,0l-15.94-90.32c-.35-2.01-1.94-3.57-3.95-3.91l-92.24-15.35c-5.36-.89-5.36-8.59,0-9.49l92.24-15.35c2.01-.33,3.59-1.9,3.95-3.91Z\" style=\"fill:#572aff;\"/></svg>","<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\"><g style=\"opacity:.5;\"><path d=\"M154.71,97c.46,2.59,2.5,4.62,5.1,5.05l14.05,2.34,31.71-46.17c4.57-6.65-3.62-14.62-10.14-9.87l-43.68,31.83,2.97,16.82Z\" style=\"fill:#579fd6;\"/><path d=\"M173.86,151.62l-14.05,2.34c-2.6.43-4.64,2.45-5.1,5.05l-2.97,16.82,43.68,31.83c6.52,4.75,14.71-3.21,10.14-9.87l-31.71-46.17Z\" style=\"fill:#579fd6;\"/><path d=\"M82.14,104.38l14.05-2.34c2.6-.43,4.64-2.45,5.1-5.05l2.97-16.82-43.68-31.83c-6.52-4.75-14.71,3.21-10.14,9.87l31.71,46.17Z\" style=\"fill:#579fd6;\"/><path d=\"M101.29,159c-.46-2.59-2.5-4.62-5.1-5.05l-14.05-2.34-31.71,46.17c-4.57,6.65,3.62,14.62,10.14,9.87l43.68-31.83-2.97-16.82Z\" style=\"fill:#579fd6;\"/></g><path d=\"M107.33,104l15.94-90.32c.93-5.3,8.53-5.3,9.47,0l15.94,90.32c.35,2.01,1.94,3.57,3.95,3.91l92.24,15.35c5.36.89,5.36,8.59,0,9.49l-92.24,15.35c-2.01.33-3.59,1.9-3.95,3.91l-15.94,90.32c-.93,5.3-8.53,5.3-9.47,0l-15.94-90.32c-.35-2.01-1.94-3.57-3.95-3.91l-92.24-15.35c-5.36-.89-5.36-8.59,0-9.49l92.24-15.35c2.01-.33,3.59-1.9,3.95-3.91Z\" style=\"fill:#579fd6;\"/></svg>","import { asHex } from '@xylabs/sdk-js'\nimport type { NetworkId } from '@xyo-network/xl1-protocol'\n\nimport {\n LocalNetworkIconString, MainNetworkIconString, SequenceNetworkIconString,\n} from '../icons/index.ts'\nimport type { NetworkBootstrap } from '../models/index.ts'\nimport { NetworkBootstrapSchema } from '../models/index.ts'\n\nexport const MainNetwork: NetworkBootstrap = {\n chain: asHex('319e667ced10452a117472811130444ded357f26', true),\n description: 'Main Network for XYO Layer 1',\n icon: MainNetworkIconString,\n id: 'mainnet' as NetworkId,\n name: 'Mainnet',\n schema: NetworkBootstrapSchema,\n symbol: 'XL1',\n url: 'https://api.chain.xyo.network',\n explorerUrl: 'https://explore.xyo.network',\n}\n\nexport const SequenceNetwork: NetworkBootstrap = {\n chain: asHex('4b43a753c8024c0e5000e8ac948ac0063ac624bc', true),\n description: 'Test Network for XYO Layer 1',\n icon: SequenceNetworkIconString,\n id: 'sequence' as NetworkId,\n name: 'Sequence',\n schema: NetworkBootstrapSchema,\n symbol: 'XL1',\n url: 'https://beta.api.chain.xyo.network',\n explorerUrl: 'https://beta.explore.xyo.network',\n}\n\nexport const LocalNetwork: NetworkBootstrap = {\n description: 'Local Node',\n icon: LocalNetworkIconString,\n id: 'local' as NetworkId,\n name: 'Local',\n schema: NetworkBootstrapSchema,\n symbol: 'XL1',\n url: 'http://localhost:8080',\n explorerUrl: 'http://localhost:3000',\n}\n\nexport const DefaultNetworks: NetworkBootstrap[] = [MainNetwork, SequenceNetwork, LocalNetwork]\n","import type { Address } from '@xylabs/sdk-js'\nimport { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { Payload } from '@xyo-network/sdk-js'\nimport { asSchema, isPayloadOfSchemaType } from '@xyo-network/sdk-js'\nimport type { ChainId, NetworkId } from '@xyo-network/xl1-protocol'\n\nexport interface ChainConnection {\n /** Chain Identifier - can be a hex (eth contract address) or a string */\n chain?: ChainId\n /** Name of the chain */\n name: string\n /** Url for accessing the network */\n url: string\n}\n\nexport const NetworkBootstrapSchema = asSchema('network.xyo.network.bootstrap', true)\nexport type NetworkBootstrapSchema = typeof NetworkBootstrapSchema\n\nexport interface ChainForkFields {\n /** Block Number at which the chain was forked from */\n forkedAtLastBlockNumber?: string\n /** Hash in the last block the chain was forked from */\n forkedAtLastHash?: string\n /** Address of the forked chain */\n forkedChainId?: Address\n}\n\nexport interface NetworkFields {\n /** Description of the network */\n description: string\n /** Url for accessing the network explorer */\n explorerUrl?: string\n /** string representation of the icon (svg) */\n icon?: string\n /** Machine-readable identifier */\n id: NetworkId\n schema: NetworkBootstrapSchema\n /** Symbol of the network */\n symbol?: string\n}\n\n/** Optional Properties can be found walking the chain to the genesis block */\nexport interface NetworkBootstrapFields extends NetworkFields, ChainForkFields, ChainConnection {}\n\nexport interface Network extends NetworkBootstrap {\n custom: boolean\n}\n\nexport type NetworkBootstrap = Payload<NetworkBootstrapFields, NetworkBootstrapSchema>\n\nexport const isNetworkBootstrap = isPayloadOfSchemaType<NetworkBootstrap>(NetworkBootstrapSchema)\n\nexport const asOptionalNetwork = AsObjectFactory.createOptional(isNetworkBootstrap)\n","import type { GatewayName } from '@xyo-network/xl1-protocol'\n\nimport {\n LocalNetwork, MainNetwork, SequenceNetwork,\n} from './Networks.ts'\n\n// Map of network Ids to their corresponding Data Lake URLs\n// This lives here for now but could be moved to a protocol package if we want to share more broadly.\nexport const NetworkDataLakeUrls = {\n [MainNetwork.id]: 'https://api.archivist.xyo.network/dataLake',\n [SequenceNetwork.id]: 'https://beta.api.archivist.xyo.network/dataLake',\n [LocalNetwork.id]: 'http://localhost:8080/dataLake',\n} as const satisfies Record<GatewayName, string>\n","import type { WalletInstance } from '@xyo-network/sdk-js'\nimport { ManifestWrapper, ModuleFactoryLocator } from '@xyo-network/sdk-js'\n\nimport { NetworkNodeManifest } from '../../manifest/index.ts'\n\nexport const getNetworkNode = async (wallet: WalletInstance) => {\n const wrapper = new ManifestWrapper(NetworkNodeManifest, wallet, new ModuleFactoryLocator())\n const [node] = await wrapper.loadNodes()\n return node\n}\n","{\n \"$schema\": \"https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/schema.json\",\n \"nodes\": [\n {\n \"config\": {\n \"accountPath\": \"44'/60'/1\",\n \"name\": \"Network\",\n \"schema\": \"network.xyo.node.config\"\n },\n \"modules\": {\n \"private\": [],\n \"public\": []\n }\n }\n ],\n \"schema\": \"network.xyo.manifest\"\n}","import type { PackageManifestPayload } from '@xyo-network/sdk-js'\n\nimport node from './network.json' with { type: 'json' }\n\n/**\n * Root Node Manifest\n */\nexport const NetworkNodeManifest = node as unknown as PackageManifestPayload\n","import type { AttachableNodeInstance } from '@xyo-network/sdk-js'\n\nconst networkNodeMap = new Map<string, AttachableNodeInstance>()\n\nexport const getNetworkNodes = () => {\n return networkNodeMap\n}\n","import type { AttachableNodeInstance, WalletInstance } from '@xyo-network/sdk-js'\n\nimport type { NetworkBootstrap } from '../../models/index.ts'\nimport { getNetworkNode } from './getNetworkNode.ts'\nimport { getNetworkNodes } from './getNetworkNodes.ts'\n\nexport const initNetworkNode = async (activeNetwork: NetworkBootstrap, wallet: WalletInstance): Promise<AttachableNodeInstance> => {\n const networkNodeMap = getNetworkNodes()\n if (networkNodeMap.has(activeNetwork.url)) return networkNodeMap.get(activeNetwork.url)!\n\n const activeNetworkNode = await getNetworkNode(wallet)\n networkNodeMap.set(activeNetwork.url, activeNetworkNode)\n\n return activeNetworkNode\n}\n"],"mappings":";AAAA;;;ACAA;;;ACAA;;;ACAA,SAAS,aAAa;;;ACCtB,SAAS,uBAAuB;AAEhC,SAAS,UAAU,6BAA6B;AAYzC,IAAM,yBAAyB,SAAS,iCAAiC,IAAI;AAmC7E,IAAM,qBAAqB,sBAAwC,sBAAsB;AAEzF,IAAM,oBAAoB,gBAAgB,eAAe,kBAAkB;;;AD3C3E,IAAM,cAAgC;AAAA,EAC3C,OAAO,MAAM,4CAA4C,IAAI;AAAA,EAC7D,aAAa;AAAA,EACb,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,aAAa;AACf;AAEO,IAAM,kBAAoC;AAAA,EAC/C,OAAO,MAAM,4CAA4C,IAAI;AAAA,EAC7D,aAAa;AAAA,EACb,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,aAAa;AACf;AAEO,IAAM,eAAiC;AAAA,EAC5C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,aAAa;AACf;AAEO,IAAM,kBAAsC,CAAC,aAAa,iBAAiB,YAAY;;;AEpCvF,IAAM,sBAAsB;AAAA,EACjC,CAAC,YAAY,EAAE,GAAG;AAAA,EAClB,CAAC,gBAAgB,EAAE,GAAG;AAAA,EACtB,CAAC,aAAa,EAAE,GAAG;AACrB;;;ACXA,SAAS,iBAAiB,4BAA4B;;;ACDtD;AAAA,EACE,SAAW;AAAA,EACX,OAAS;AAAA,IACP;AAAA,MACE,QAAU;AAAA,QACR,aAAe;AAAA,QACf,MAAQ;AAAA,QACR,QAAU;AAAA,MACZ;AAAA,MACA,SAAW;AAAA,QACT,SAAW,CAAC;AAAA,QACZ,QAAU,CAAC;AAAA,MACb;AAAA,IACF;AAAA,EACF;AAAA,EACA,QAAU;AACZ;;;ACTO,IAAM,sBAAsB;;;AFF5B,IAAM,iBAAiB,OAAO,WAA2B;AAC9D,QAAM,UAAU,IAAI,gBAAgB,qBAAqB,QAAQ,IAAI,qBAAqB,CAAC;AAC3F,QAAM,CAAC,IAAI,IAAI,MAAM,QAAQ,UAAU;AACvC,SAAO;AACT;;;AGPA,IAAM,iBAAiB,oBAAI,IAAoC;AAExD,IAAM,kBAAkB,MAAM;AACnC,SAAO;AACT;;;ACAO,IAAM,kBAAkB,OAAO,eAAiC,WAA4D;AACjI,QAAMA,kBAAiB,gBAAgB;AACvC,MAAIA,gBAAe,IAAI,cAAc,GAAG,EAAG,QAAOA,gBAAe,IAAI,cAAc,GAAG;AAEtF,QAAM,oBAAoB,MAAM,eAAe,MAAM;AACrD,EAAAA,gBAAe,IAAI,cAAc,KAAK,iBAAiB;AAEvD,SAAO;AACT;","names":["networkNodeMap"]}
|
|
1
|
+
{"version":3,"sources":["../../src/icons/local/local.svg","../../src/icons/mainnet/mainnet.svg","../../src/icons/sequence/testnet.svg","../../src/lib/Networks.ts","../../src/models/Bootstrap.ts","../../src/lib/NetworkDataLakeUrls.ts","../../src/modules/node/getNetworkNode.ts","../../src/manifest/network.json","../../src/manifest/networkManifest.ts","../../src/modules/node/getNetworkNodes.ts","../../src/modules/node/initNetworkNode.ts"],"sourcesContent":["<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\"><g style=\"opacity:.5;\"><path d=\"M154.71,97c.46,2.59,2.5,4.62,5.1,5.05l14.05,2.34,31.71-46.17c4.57-6.65-3.62-14.62-10.14-9.87l-43.68,31.83,2.97,16.82Z\" style=\"fill:#f47f00;\"/><path d=\"M173.86,151.62l-14.05,2.34c-2.6.43-4.64,2.45-5.1,5.05l-2.97,16.82,43.68,31.83c6.52,4.75,14.71-3.21,10.14-9.87l-31.71-46.17Z\" style=\"fill:#f47f00;\"/><path d=\"M82.14,104.38l14.05-2.34c2.6-.43,4.64-2.45,5.1-5.05l2.97-16.82-43.68-31.83c-6.52-4.75-14.71,3.21-10.14,9.87l31.71,46.17Z\" style=\"fill:#f47f00;\"/><path d=\"M101.29,159c-.46-2.59-2.5-4.62-5.1-5.05l-14.05-2.34-31.71,46.17c-4.57,6.65,3.62,14.62,10.14,9.87l43.68-31.83-2.97-16.82Z\" style=\"fill:#f47f00;\"/></g><path d=\"M107.33,104l15.94-90.32c.93-5.3,8.53-5.3,9.47,0l15.94,90.32c.35,2.01,1.94,3.57,3.95,3.91l92.24,15.35c5.36.89,5.36,8.59,0,9.49l-92.24,15.35c-2.01.33-3.59,1.9-3.95,3.91l-15.94,90.32c-.93,5.3-8.53,5.3-9.47,0l-15.94-90.32c-.35-2.01-1.94-3.57-3.95-3.91l-92.24-15.35c-5.36-.89-5.36-8.59,0-9.49l92.24-15.35c2.01-.33,3.59-1.9,3.95-3.91Z\" style=\"fill:#f47f00;\"/></svg>","<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\"><path d=\"M154.71,97c.46,2.59,2.5,4.62,5.1,5.05l14.05,2.34,31.71-46.17c4.57-6.65-3.62-14.62-10.14-9.87l-43.68,31.83,2.97,16.82Z\" style=\"fill:#8d8fc6;\"/><path d=\"M173.86,151.62l-14.05,2.34c-2.6.43-4.64,2.45-5.1,5.05l-2.97,16.82,43.68,31.83c6.52,4.75,14.71-3.21,10.14-9.87l-31.71-46.17Z\" style=\"fill:#eb407a;\"/><path d=\"M82.14,104.38l14.05-2.34c2.6-.43,4.64-2.45,5.1-5.05l2.97-16.82-43.68-31.83c-6.52-4.75-14.71,3.21-10.14,9.87l31.71,46.17Z\" style=\"fill:#579fd6;\"/><path d=\"M101.29,159c-.46-2.59-2.5-4.62-5.1-5.05l-14.05-2.34-31.71,46.17c-4.57,6.65,3.62,14.62,10.14,9.87l43.68-31.83-2.97-16.82Z\" style=\"fill:#f27046;\"/><path d=\"M107.33,104l15.94-90.32c.93-5.3,8.53-5.3,9.47,0l15.94,90.32c.35,2.01,1.94,3.57,3.95,3.91l92.24,15.35c5.36.89,5.36,8.59,0,9.49l-92.24,15.35c-2.01.33-3.59,1.9-3.95,3.91l-15.94,90.32c-.93,5.3-8.53,5.3-9.47,0l-15.94-90.32c-.35-2.01-1.94-3.57-3.95-3.91l-92.24-15.35c-5.36-.89-5.36-8.59,0-9.49l92.24-15.35c2.01-.33,3.59-1.9,3.95-3.91Z\" style=\"fill:#572aff;\"/></svg>","<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\"><g style=\"opacity:.5;\"><path d=\"M154.71,97c.46,2.59,2.5,4.62,5.1,5.05l14.05,2.34,31.71-46.17c4.57-6.65-3.62-14.62-10.14-9.87l-43.68,31.83,2.97,16.82Z\" style=\"fill:#579fd6;\"/><path d=\"M173.86,151.62l-14.05,2.34c-2.6.43-4.64,2.45-5.1,5.05l-2.97,16.82,43.68,31.83c6.52,4.75,14.71-3.21,10.14-9.87l-31.71-46.17Z\" style=\"fill:#579fd6;\"/><path d=\"M82.14,104.38l14.05-2.34c2.6-.43,4.64-2.45,5.1-5.05l2.97-16.82-43.68-31.83c-6.52-4.75-14.71,3.21-10.14,9.87l31.71,46.17Z\" style=\"fill:#579fd6;\"/><path d=\"M101.29,159c-.46-2.59-2.5-4.62-5.1-5.05l-14.05-2.34-31.71,46.17c-4.57,6.65,3.62,14.62,10.14,9.87l43.68-31.83-2.97-16.82Z\" style=\"fill:#579fd6;\"/></g><path d=\"M107.33,104l15.94-90.32c.93-5.3,8.53-5.3,9.47,0l15.94,90.32c.35,2.01,1.94,3.57,3.95,3.91l92.24,15.35c5.36.89,5.36,8.59,0,9.49l-92.24,15.35c-2.01.33-3.59,1.9-3.95,3.91l-15.94,90.32c-.93,5.3-8.53,5.3-9.47,0l-15.94-90.32c-.35-2.01-1.94-3.57-3.95-3.91l-92.24-15.35c-5.36-.89-5.36-8.59,0-9.49l92.24-15.35c2.01-.33,3.59-1.9,3.95-3.91Z\" style=\"fill:#579fd6;\"/></svg>","import { asHex } from '@xylabs/sdk-js'\nimport type { NetworkId } from '@xyo-network/xl1-protocol'\n\nimport {\n LocalNetworkIconString, MainNetworkIconString, SequenceNetworkIconString,\n} from '../icons/index.ts'\nimport type { NetworkBootstrap } from '../models/index.ts'\nimport { NetworkBootstrapSchema } from '../models/index.ts'\n\n/** Bootstrap configuration for the XYO Layer 1 mainnet. */\nexport const MainNetwork: NetworkBootstrap = {\n chain: asHex('319e667ced10452a117472811130444ded357f26', true),\n description: 'Main Network for XYO Layer 1',\n icon: MainNetworkIconString,\n id: 'mainnet' as NetworkId,\n name: 'Mainnet',\n schema: NetworkBootstrapSchema,\n symbol: 'XL1',\n url: 'https://api.chain.xyo.network',\n explorerUrl: 'https://explore.xyo.network',\n}\n\n/** Bootstrap configuration for the XYO Layer 1 sequence (test) network. */\nexport const SequenceNetwork: NetworkBootstrap = {\n chain: asHex('4b43a753c8024c0e5000e8ac948ac0063ac624bc', true),\n description: 'Test Network for XYO Layer 1',\n icon: SequenceNetworkIconString,\n id: 'sequence' as NetworkId,\n name: 'Sequence',\n schema: NetworkBootstrapSchema,\n symbol: 'XL1',\n url: 'https://beta.api.chain.xyo.network',\n explorerUrl: 'https://beta.explore.xyo.network',\n}\n\n/** Bootstrap configuration for a local development network. */\nexport const LocalNetwork: NetworkBootstrap = {\n description: 'Local Node',\n icon: LocalNetworkIconString,\n id: 'local' as NetworkId,\n name: 'Local',\n schema: NetworkBootstrapSchema,\n symbol: 'XL1',\n url: 'http://localhost:8080',\n explorerUrl: 'http://localhost:3000',\n}\n\n/** Default set of available XYO Layer 1 networks (mainnet, sequence, local). */\nexport const DefaultNetworks: NetworkBootstrap[] = [MainNetwork, SequenceNetwork, LocalNetwork]\n","import type { Address } from '@xylabs/sdk-js'\nimport { AsObjectFactory } from '@xylabs/sdk-js'\nimport type { Payload } from '@xyo-network/sdk-js'\nimport { asSchema, isPayloadOfSchemaType } from '@xyo-network/sdk-js'\nimport type { ChainId, NetworkId } from '@xyo-network/xl1-protocol'\n\n/** Connection details for accessing a chain endpoint. */\nexport interface ChainConnection {\n /** Chain Identifier - can be a hex (eth contract address) or a string */\n chain?: ChainId\n /** Name of the chain */\n name: string\n /** Url for accessing the network */\n url: string\n}\n\n/** Schema identifier for network bootstrap payloads. */\nexport const NetworkBootstrapSchema = asSchema('network.xyo.network.bootstrap', true)\n/** Schema type for network bootstrap payloads. */\nexport type NetworkBootstrapSchema = typeof NetworkBootstrapSchema\n\n/** Fields describing a chain fork origin. */\nexport interface ChainForkFields {\n /** Block Number at which the chain was forked from */\n forkedAtLastBlockNumber?: string\n /** Hash in the last block the chain was forked from */\n forkedAtLastHash?: string\n /** Address of the forked chain */\n forkedChainId?: Address\n}\n\n/** Core fields describing an XYO network. */\nexport interface NetworkFields {\n /** Description of the network */\n description: string\n /** Url for accessing the network explorer */\n explorerUrl?: string\n /** string representation of the icon (svg) */\n icon?: string\n /** Machine-readable identifier */\n id: NetworkId\n schema: NetworkBootstrapSchema\n /** Symbol of the network */\n symbol?: string\n}\n\n/** Optional Properties can be found walking the chain to the genesis block */\nexport interface NetworkBootstrapFields extends NetworkFields, ChainForkFields, ChainConnection {}\n\n/** A network bootstrap extended with a flag indicating whether it is a custom network. */\nexport interface Network extends NetworkBootstrap {\n custom: boolean\n}\n\n/** Payload type containing all network bootstrap configuration fields. */\nexport type NetworkBootstrap = Payload<NetworkBootstrapFields, NetworkBootstrapSchema>\n\n/** Type guard that checks whether a payload is a NetworkBootstrap. */\nexport const isNetworkBootstrap = isPayloadOfSchemaType<NetworkBootstrap>(NetworkBootstrapSchema)\n\n/** Optionally casts a value to a Network if it is a valid NetworkBootstrap. */\nexport const asOptionalNetwork = AsObjectFactory.createOptional(isNetworkBootstrap)\n","import type { GatewayName } from '@xyo-network/xl1-protocol'\n\nimport {\n LocalNetwork, MainNetwork, SequenceNetwork,\n} from './Networks.ts'\n\n/** Map of network IDs to their corresponding Data Lake API URLs. */\nexport const NetworkDataLakeUrls = {\n [MainNetwork.id]: 'https://api.archivist.xyo.network/dataLake',\n [SequenceNetwork.id]: 'https://beta.api.archivist.xyo.network/dataLake',\n [LocalNetwork.id]: 'http://localhost:8080/dataLake',\n} as const satisfies Record<GatewayName, string>\n","import type { WalletInstance } from '@xyo-network/sdk-js'\nimport { ManifestWrapper, ModuleFactoryLocator } from '@xyo-network/sdk-js'\n\nimport { NetworkNodeManifest } from '../../manifest/index.ts'\n\n/** Creates a network node from the network manifest using the provided wallet. */\nexport const getNetworkNode = async (wallet: WalletInstance) => {\n const wrapper = new ManifestWrapper(NetworkNodeManifest, wallet, new ModuleFactoryLocator())\n const [node] = await wrapper.loadNodes()\n return node\n}\n","{\n \"$schema\": \"https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/schema.json\",\n \"nodes\": [\n {\n \"config\": {\n \"accountPath\": \"44'/60'/1\",\n \"name\": \"Network\",\n \"schema\": \"network.xyo.node.config\"\n },\n \"modules\": {\n \"private\": [],\n \"public\": []\n }\n }\n ],\n \"schema\": \"network.xyo.manifest\"\n}","import type { PackageManifestPayload } from '@xyo-network/sdk-js'\n\nimport node from './network.json' with { type: 'json' }\n\n/**\n * Root Node Manifest\n */\nexport const NetworkNodeManifest = node as unknown as PackageManifestPayload\n","import type { AttachableNodeInstance } from '@xyo-network/sdk-js'\n\nconst networkNodeMap = new Map<string, AttachableNodeInstance>()\n\n/** Returns the global map of network URL to node instance. */\nexport const getNetworkNodes = () => {\n return networkNodeMap\n}\n","import type { AttachableNodeInstance, WalletInstance } from '@xyo-network/sdk-js'\n\nimport type { NetworkBootstrap } from '../../models/index.ts'\nimport { getNetworkNode } from './getNetworkNode.ts'\nimport { getNetworkNodes } from './getNetworkNodes.ts'\n\n/** Initializes or retrieves a cached network node for the given network and wallet. */\nexport const initNetworkNode = async (activeNetwork: NetworkBootstrap, wallet: WalletInstance): Promise<AttachableNodeInstance> => {\n const networkNodeMap = getNetworkNodes()\n if (networkNodeMap.has(activeNetwork.url)) return networkNodeMap.get(activeNetwork.url)!\n\n const activeNetworkNode = await getNetworkNode(wallet)\n networkNodeMap.set(activeNetwork.url, activeNetworkNode)\n\n return activeNetworkNode\n}\n"],"mappings":";AAAA;;;ACAA;;;ACAA;;;ACAA,SAAS,aAAa;;;ACCtB,SAAS,uBAAuB;AAEhC,SAAS,UAAU,6BAA6B;AAczC,IAAM,yBAAyB,SAAS,iCAAiC,IAAI;AAyC7E,IAAM,qBAAqB,sBAAwC,sBAAsB;AAGzF,IAAM,oBAAoB,gBAAgB,eAAe,kBAAkB;;;ADnD3E,IAAM,cAAgC;AAAA,EAC3C,OAAO,MAAM,4CAA4C,IAAI;AAAA,EAC7D,aAAa;AAAA,EACb,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,aAAa;AACf;AAGO,IAAM,kBAAoC;AAAA,EAC/C,OAAO,MAAM,4CAA4C,IAAI;AAAA,EAC7D,aAAa;AAAA,EACb,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,aAAa;AACf;AAGO,IAAM,eAAiC;AAAA,EAC5C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,aAAa;AACf;AAGO,IAAM,kBAAsC,CAAC,aAAa,iBAAiB,YAAY;;;AEzCvF,IAAM,sBAAsB;AAAA,EACjC,CAAC,YAAY,EAAE,GAAG;AAAA,EAClB,CAAC,gBAAgB,EAAE,GAAG;AAAA,EACtB,CAAC,aAAa,EAAE,GAAG;AACrB;;;ACVA,SAAS,iBAAiB,4BAA4B;;;ACDtD;AAAA,EACE,SAAW;AAAA,EACX,OAAS;AAAA,IACP;AAAA,MACE,QAAU;AAAA,QACR,aAAe;AAAA,QACf,MAAQ;AAAA,QACR,QAAU;AAAA,MACZ;AAAA,MACA,SAAW;AAAA,QACT,SAAW,CAAC;AAAA,QACZ,QAAU,CAAC;AAAA,MACb;AAAA,IACF;AAAA,EACF;AAAA,EACA,QAAU;AACZ;;;ACTO,IAAM,sBAAsB;;;AFD5B,IAAM,iBAAiB,OAAO,WAA2B;AAC9D,QAAM,UAAU,IAAI,gBAAgB,qBAAqB,QAAQ,IAAI,qBAAqB,CAAC;AAC3F,QAAM,CAAC,IAAI,IAAI,MAAM,QAAQ,UAAU;AACvC,SAAO;AACT;;;AGRA,IAAM,iBAAiB,oBAAI,IAAoC;AAGxD,IAAM,kBAAkB,MAAM;AACnC,SAAO;AACT;;;ACAO,IAAM,kBAAkB,OAAO,eAAiC,WAA4D;AACjI,QAAMA,kBAAiB,gBAAgB;AACvC,MAAIA,gBAAe,IAAI,cAAc,GAAG,EAAG,QAAOA,gBAAe,IAAI,cAAc,GAAG;AAEtF,QAAM,oBAAoB,MAAM,eAAe,MAAM;AACrD,EAAAA,gBAAe,IAAI,cAAc,KAAK,iBAAiB;AAEvD,SAAO;AACT;","names":["networkNodeMap"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LocalNetwork, MainNetwork, SequenceNetwork } from './Networks.ts';
|
|
2
|
+
/** Map of network IDs to their corresponding Data Lake API URLs. */
|
|
2
3
|
export declare const NetworkDataLakeUrls: {
|
|
3
4
|
readonly [MainNetwork.id]: "https://api.archivist.xyo.network/dataLake";
|
|
4
5
|
readonly [SequenceNetwork.id]: "https://beta.api.archivist.xyo.network/dataLake";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkDataLakeUrls.d.ts","sourceRoot":"","sources":["../../../src/lib/NetworkDataLakeUrls.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAAE,WAAW,EAAE,eAAe,EAC3C,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"NetworkDataLakeUrls.d.ts","sourceRoot":"","sources":["../../../src/lib/NetworkDataLakeUrls.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAAE,WAAW,EAAE,eAAe,EAC3C,MAAM,eAAe,CAAA;AAEtB,oEAAoE;AACpE,eAAO,MAAM,mBAAmB;IAC9B,SAAA,CAAC,WAAW,CAAC,EAAE,CAAC,+CAA8C;IAC9D,SAAA,CAAC,eAAe,CAAC,EAAE,CAAC,oDAAmD;IACvE,SAAA,CAAC,YAAY,CAAC,EAAE,CAAC,mCAAkC;CACL,CAAA"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { NetworkBootstrap } from '../models/index.ts';
|
|
2
|
+
/** Bootstrap configuration for the XYO Layer 1 mainnet. */
|
|
2
3
|
export declare const MainNetwork: NetworkBootstrap;
|
|
4
|
+
/** Bootstrap configuration for the XYO Layer 1 sequence (test) network. */
|
|
3
5
|
export declare const SequenceNetwork: NetworkBootstrap;
|
|
6
|
+
/** Bootstrap configuration for a local development network. */
|
|
4
7
|
export declare const LocalNetwork: NetworkBootstrap;
|
|
8
|
+
/** Default set of available XYO Layer 1 networks (mainnet, sequence, local). */
|
|
5
9
|
export declare const DefaultNetworks: NetworkBootstrap[];
|
|
6
10
|
//# sourceMappingURL=Networks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Networks.d.ts","sourceRoot":"","sources":["../../../src/lib/Networks.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAG1D,eAAO,MAAM,WAAW,EAAE,gBAUzB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,gBAU7B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,gBAS1B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,gBAAgB,EAAiD,CAAA"}
|
|
1
|
+
{"version":3,"file":"Networks.d.ts","sourceRoot":"","sources":["../../../src/lib/Networks.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAG1D,2DAA2D;AAC3D,eAAO,MAAM,WAAW,EAAE,gBAUzB,CAAA;AAED,2EAA2E;AAC3E,eAAO,MAAM,eAAe,EAAE,gBAU7B,CAAA;AAED,+DAA+D;AAC/D,eAAO,MAAM,YAAY,EAAE,gBAS1B,CAAA;AAED,gFAAgF;AAChF,eAAO,MAAM,eAAe,EAAE,gBAAgB,EAAiD,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Address } from '@xylabs/sdk-js';
|
|
2
2
|
import type { Payload } from '@xyo-network/sdk-js';
|
|
3
3
|
import type { ChainId, NetworkId } from '@xyo-network/xl1-protocol';
|
|
4
|
+
/** Connection details for accessing a chain endpoint. */
|
|
4
5
|
export interface ChainConnection {
|
|
5
6
|
/** Chain Identifier - can be a hex (eth contract address) or a string */
|
|
6
7
|
chain?: ChainId;
|
|
@@ -9,10 +10,13 @@ export interface ChainConnection {
|
|
|
9
10
|
/** Url for accessing the network */
|
|
10
11
|
url: string;
|
|
11
12
|
}
|
|
13
|
+
/** Schema identifier for network bootstrap payloads. */
|
|
12
14
|
export declare const NetworkBootstrapSchema: "network.xyo.network.bootstrap" & {
|
|
13
15
|
readonly __schema: true;
|
|
14
16
|
};
|
|
17
|
+
/** Schema type for network bootstrap payloads. */
|
|
15
18
|
export type NetworkBootstrapSchema = typeof NetworkBootstrapSchema;
|
|
19
|
+
/** Fields describing a chain fork origin. */
|
|
16
20
|
export interface ChainForkFields {
|
|
17
21
|
/** Block Number at which the chain was forked from */
|
|
18
22
|
forkedAtLastBlockNumber?: string;
|
|
@@ -21,6 +25,7 @@ export interface ChainForkFields {
|
|
|
21
25
|
/** Address of the forked chain */
|
|
22
26
|
forkedChainId?: Address;
|
|
23
27
|
}
|
|
28
|
+
/** Core fields describing an XYO network. */
|
|
24
29
|
export interface NetworkFields {
|
|
25
30
|
/** Description of the network */
|
|
26
31
|
description: string;
|
|
@@ -37,10 +42,14 @@ export interface NetworkFields {
|
|
|
37
42
|
/** Optional Properties can be found walking the chain to the genesis block */
|
|
38
43
|
export interface NetworkBootstrapFields extends NetworkFields, ChainForkFields, ChainConnection {
|
|
39
44
|
}
|
|
45
|
+
/** A network bootstrap extended with a flag indicating whether it is a custom network. */
|
|
40
46
|
export interface Network extends NetworkBootstrap {
|
|
41
47
|
custom: boolean;
|
|
42
48
|
}
|
|
49
|
+
/** Payload type containing all network bootstrap configuration fields. */
|
|
43
50
|
export type NetworkBootstrap = Payload<NetworkBootstrapFields, NetworkBootstrapSchema>;
|
|
51
|
+
/** Type guard that checks whether a payload is a NetworkBootstrap. */
|
|
44
52
|
export declare const isNetworkBootstrap: (x?: unknown | null) => x is NetworkBootstrap;
|
|
53
|
+
/** Optionally casts a value to a Network if it is a valid NetworkBootstrap. */
|
|
45
54
|
export declare const asOptionalNetwork: (value: import("@xylabs/promise").AnyNonPromise) => NetworkBootstrap | undefined;
|
|
46
55
|
//# sourceMappingURL=Bootstrap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bootstrap.d.ts","sourceRoot":"","sources":["../../../src/models/Bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAEnE,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,eAAO,MAAM,sBAAsB;;CAAkD,CAAA;AACrF,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAA;AAElE,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,kCAAkC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAA;IACnB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,EAAE,EAAE,SAAS,CAAA;IACb,MAAM,EAAE,sBAAsB,CAAA;IAC9B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,8EAA8E;AAC9E,MAAM,WAAW,sBAAuB,SAAQ,aAAa,EAAE,eAAe,EAAE,eAAe;CAAG;AAElG,MAAM,WAAW,OAAQ,SAAQ,gBAAgB;IAC/C,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAA;AAEtF,eAAO,MAAM,kBAAkB,+CAAkE,CAAA;AAEjG,eAAO,MAAM,iBAAiB,kFAAqD,CAAA"}
|
|
1
|
+
{"version":3,"file":"Bootstrap.d.ts","sourceRoot":"","sources":["../../../src/models/Bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAEnE,yDAAyD;AACzD,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,wDAAwD;AACxD,eAAO,MAAM,sBAAsB;;CAAkD,CAAA;AACrF,kDAAkD;AAClD,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAA;AAElE,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,kCAAkC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,6CAA6C;AAC7C,MAAM,WAAW,aAAa;IAC5B,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAA;IACnB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,EAAE,EAAE,SAAS,CAAA;IACb,MAAM,EAAE,sBAAsB,CAAA;IAC9B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,8EAA8E;AAC9E,MAAM,WAAW,sBAAuB,SAAQ,aAAa,EAAE,eAAe,EAAE,eAAe;CAAG;AAElG,0FAA0F;AAC1F,MAAM,WAAW,OAAQ,SAAQ,gBAAgB;IAC/C,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,0EAA0E;AAC1E,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAA;AAEtF,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,+CAAkE,CAAA;AAEjG,+EAA+E;AAC/E,eAAO,MAAM,iBAAiB,kFAAqD,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { WalletInstance } from '@xyo-network/sdk-js';
|
|
2
|
+
/** Creates a network node from the network manifest using the provided wallet. */
|
|
2
3
|
export declare const getNetworkNode: (wallet: WalletInstance) => Promise<import("@xyo-network/sdk-js").MemoryNode<import("@xyo-network/sdk-js").MemoryNodeParams, import("@xyo-network/sdk-js").NodeModuleEventData>>;
|
|
3
4
|
//# sourceMappingURL=getNetworkNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNetworkNode.d.ts","sourceRoot":"","sources":["../../../../src/modules/node/getNetworkNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAKzD,eAAO,MAAM,cAAc,GAAU,QAAQ,cAAc,yJAI1D,CAAA"}
|
|
1
|
+
{"version":3,"file":"getNetworkNode.d.ts","sourceRoot":"","sources":["../../../../src/modules/node/getNetworkNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAKzD,kFAAkF;AAClF,eAAO,MAAM,cAAc,GAAU,QAAQ,cAAc,yJAI1D,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AttachableNodeInstance } from '@xyo-network/sdk-js';
|
|
2
|
+
/** Returns the global map of network URL to node instance. */
|
|
2
3
|
export declare const getNetworkNodes: () => Map<string, AttachableNodeInstance<import("@xyo-network/sdk-js").NodeParams<import("@xyo-network/sdk-js").AnyConfigSchema<import("@xyo-network/sdk-js").NodeConfig>>, import("@xyo-network/sdk-js").NodeModuleEventData>>;
|
|
3
4
|
//# sourceMappingURL=getNetworkNodes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNetworkNodes.d.ts","sourceRoot":"","sources":["../../../../src/modules/node/getNetworkNodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAIjE,eAAO,MAAM,eAAe,iOAE3B,CAAA"}
|
|
1
|
+
{"version":3,"file":"getNetworkNodes.d.ts","sourceRoot":"","sources":["../../../../src/modules/node/getNetworkNodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAIjE,8DAA8D;AAC9D,eAAO,MAAM,eAAe,iOAE3B,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AttachableNodeInstance, WalletInstance } from '@xyo-network/sdk-js';
|
|
2
2
|
import type { NetworkBootstrap } from '../../models/index.ts';
|
|
3
|
+
/** Initializes or retrieves a cached network node for the given network and wallet. */
|
|
3
4
|
export declare const initNetworkNode: (activeNetwork: NetworkBootstrap, wallet: WalletInstance) => Promise<AttachableNodeInstance>;
|
|
4
5
|
//# sourceMappingURL=initNetworkNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initNetworkNode.d.ts","sourceRoot":"","sources":["../../../../src/modules/node/initNetworkNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAI7D,eAAO,MAAM,eAAe,GAAU,eAAe,gBAAgB,EAAE,QAAQ,cAAc,KAAG,OAAO,CAAC,sBAAsB,CAQ7H,CAAA"}
|
|
1
|
+
{"version":3,"file":"initNetworkNode.d.ts","sourceRoot":"","sources":["../../../../src/modules/node/initNetworkNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAI7D,uFAAuF;AACvF,eAAO,MAAM,eAAe,GAAU,eAAe,gBAAgB,EAAE,QAAQ,cAAc,KAAG,OAAO,CAAC,sBAAsB,CAQ7H,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/xl1-network-model",
|
|
4
|
-
"version": "1.25.
|
|
4
|
+
"version": "1.25.28",
|
|
5
5
|
"description": "XYO Layer One API",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -49,17 +49,17 @@
|
|
|
49
49
|
"!**/*.test.*"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@xyo-network/xl1-protocol": "~1.25.
|
|
52
|
+
"@xyo-network/xl1-protocol": "~1.25.28"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@types/node": "^25.
|
|
55
|
+
"@types/node": "^25.5.0",
|
|
56
56
|
"@xylabs/sdk-js": "^5.0.86",
|
|
57
|
-
"@xylabs/ts-scripts-yarn3": "~7.4.
|
|
58
|
-
"@xylabs/tsconfig": "~7.4.
|
|
57
|
+
"@xylabs/ts-scripts-yarn3": "~7.4.25",
|
|
58
|
+
"@xylabs/tsconfig": "~7.4.25",
|
|
59
59
|
"@xyo-network/sdk-js": "^5.3.16",
|
|
60
60
|
"dotenv": "~17.3.1",
|
|
61
61
|
"typescript": "~5.9.3",
|
|
62
|
-
"vitest": "~4.
|
|
62
|
+
"vitest": "~4.1.1",
|
|
63
63
|
"zod": "~4.3.6"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
@@ -4,8 +4,7 @@ import {
|
|
|
4
4
|
LocalNetwork, MainNetwork, SequenceNetwork,
|
|
5
5
|
} from './Networks.ts'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
// This lives here for now but could be moved to a protocol package if we want to share more broadly.
|
|
7
|
+
/** Map of network IDs to their corresponding Data Lake API URLs. */
|
|
9
8
|
export const NetworkDataLakeUrls = {
|
|
10
9
|
[MainNetwork.id]: 'https://api.archivist.xyo.network/dataLake',
|
|
11
10
|
[SequenceNetwork.id]: 'https://beta.api.archivist.xyo.network/dataLake',
|
package/src/lib/Networks.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
import type { NetworkBootstrap } from '../models/index.ts'
|
|
8
8
|
import { NetworkBootstrapSchema } from '../models/index.ts'
|
|
9
9
|
|
|
10
|
+
/** Bootstrap configuration for the XYO Layer 1 mainnet. */
|
|
10
11
|
export const MainNetwork: NetworkBootstrap = {
|
|
11
12
|
chain: asHex('319e667ced10452a117472811130444ded357f26', true),
|
|
12
13
|
description: 'Main Network for XYO Layer 1',
|
|
@@ -19,6 +20,7 @@ export const MainNetwork: NetworkBootstrap = {
|
|
|
19
20
|
explorerUrl: 'https://explore.xyo.network',
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
/** Bootstrap configuration for the XYO Layer 1 sequence (test) network. */
|
|
22
24
|
export const SequenceNetwork: NetworkBootstrap = {
|
|
23
25
|
chain: asHex('4b43a753c8024c0e5000e8ac948ac0063ac624bc', true),
|
|
24
26
|
description: 'Test Network for XYO Layer 1',
|
|
@@ -31,6 +33,7 @@ export const SequenceNetwork: NetworkBootstrap = {
|
|
|
31
33
|
explorerUrl: 'https://beta.explore.xyo.network',
|
|
32
34
|
}
|
|
33
35
|
|
|
36
|
+
/** Bootstrap configuration for a local development network. */
|
|
34
37
|
export const LocalNetwork: NetworkBootstrap = {
|
|
35
38
|
description: 'Local Node',
|
|
36
39
|
icon: LocalNetworkIconString,
|
|
@@ -42,4 +45,5 @@ export const LocalNetwork: NetworkBootstrap = {
|
|
|
42
45
|
explorerUrl: 'http://localhost:3000',
|
|
43
46
|
}
|
|
44
47
|
|
|
48
|
+
/** Default set of available XYO Layer 1 networks (mainnet, sequence, local). */
|
|
45
49
|
export const DefaultNetworks: NetworkBootstrap[] = [MainNetwork, SequenceNetwork, LocalNetwork]
|
package/src/models/Bootstrap.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { Payload } from '@xyo-network/sdk-js'
|
|
|
4
4
|
import { asSchema, isPayloadOfSchemaType } from '@xyo-network/sdk-js'
|
|
5
5
|
import type { ChainId, NetworkId } from '@xyo-network/xl1-protocol'
|
|
6
6
|
|
|
7
|
+
/** Connection details for accessing a chain endpoint. */
|
|
7
8
|
export interface ChainConnection {
|
|
8
9
|
/** Chain Identifier - can be a hex (eth contract address) or a string */
|
|
9
10
|
chain?: ChainId
|
|
@@ -13,9 +14,12 @@ export interface ChainConnection {
|
|
|
13
14
|
url: string
|
|
14
15
|
}
|
|
15
16
|
|
|
17
|
+
/** Schema identifier for network bootstrap payloads. */
|
|
16
18
|
export const NetworkBootstrapSchema = asSchema('network.xyo.network.bootstrap', true)
|
|
19
|
+
/** Schema type for network bootstrap payloads. */
|
|
17
20
|
export type NetworkBootstrapSchema = typeof NetworkBootstrapSchema
|
|
18
21
|
|
|
22
|
+
/** Fields describing a chain fork origin. */
|
|
19
23
|
export interface ChainForkFields {
|
|
20
24
|
/** Block Number at which the chain was forked from */
|
|
21
25
|
forkedAtLastBlockNumber?: string
|
|
@@ -25,6 +29,7 @@ export interface ChainForkFields {
|
|
|
25
29
|
forkedChainId?: Address
|
|
26
30
|
}
|
|
27
31
|
|
|
32
|
+
/** Core fields describing an XYO network. */
|
|
28
33
|
export interface NetworkFields {
|
|
29
34
|
/** Description of the network */
|
|
30
35
|
description: string
|
|
@@ -42,12 +47,16 @@ export interface NetworkFields {
|
|
|
42
47
|
/** Optional Properties can be found walking the chain to the genesis block */
|
|
43
48
|
export interface NetworkBootstrapFields extends NetworkFields, ChainForkFields, ChainConnection {}
|
|
44
49
|
|
|
50
|
+
/** A network bootstrap extended with a flag indicating whether it is a custom network. */
|
|
45
51
|
export interface Network extends NetworkBootstrap {
|
|
46
52
|
custom: boolean
|
|
47
53
|
}
|
|
48
54
|
|
|
55
|
+
/** Payload type containing all network bootstrap configuration fields. */
|
|
49
56
|
export type NetworkBootstrap = Payload<NetworkBootstrapFields, NetworkBootstrapSchema>
|
|
50
57
|
|
|
58
|
+
/** Type guard that checks whether a payload is a NetworkBootstrap. */
|
|
51
59
|
export const isNetworkBootstrap = isPayloadOfSchemaType<NetworkBootstrap>(NetworkBootstrapSchema)
|
|
52
60
|
|
|
61
|
+
/** Optionally casts a value to a Network if it is a valid NetworkBootstrap. */
|
|
53
62
|
export const asOptionalNetwork = AsObjectFactory.createOptional(isNetworkBootstrap)
|
|
@@ -3,6 +3,7 @@ import { ManifestWrapper, ModuleFactoryLocator } from '@xyo-network/sdk-js'
|
|
|
3
3
|
|
|
4
4
|
import { NetworkNodeManifest } from '../../manifest/index.ts'
|
|
5
5
|
|
|
6
|
+
/** Creates a network node from the network manifest using the provided wallet. */
|
|
6
7
|
export const getNetworkNode = async (wallet: WalletInstance) => {
|
|
7
8
|
const wrapper = new ManifestWrapper(NetworkNodeManifest, wallet, new ModuleFactoryLocator())
|
|
8
9
|
const [node] = await wrapper.loadNodes()
|
|
@@ -2,6 +2,7 @@ import type { AttachableNodeInstance } from '@xyo-network/sdk-js'
|
|
|
2
2
|
|
|
3
3
|
const networkNodeMap = new Map<string, AttachableNodeInstance>()
|
|
4
4
|
|
|
5
|
+
/** Returns the global map of network URL to node instance. */
|
|
5
6
|
export const getNetworkNodes = () => {
|
|
6
7
|
return networkNodeMap
|
|
7
8
|
}
|
|
@@ -4,6 +4,7 @@ import type { NetworkBootstrap } from '../../models/index.ts'
|
|
|
4
4
|
import { getNetworkNode } from './getNetworkNode.ts'
|
|
5
5
|
import { getNetworkNodes } from './getNetworkNodes.ts'
|
|
6
6
|
|
|
7
|
+
/** Initializes or retrieves a cached network node for the given network and wallet. */
|
|
7
8
|
export const initNetworkNode = async (activeNetwork: NetworkBootstrap, wallet: WalletInstance): Promise<AttachableNodeInstance> => {
|
|
8
9
|
const networkNodeMap = getNetworkNodes()
|
|
9
10
|
if (networkNodeMap.has(activeNetwork.url)) return networkNodeMap.get(activeNetwork.url)!
|