From c4e44b7f93d8afd9360792ab83c2819148e97490 Mon Sep 17 00:00:00 2001 From: Wil Wade Date: Wed, 23 Nov 2022 11:20:49 -0500 Subject: [PATCH] Add Frequency Mainnet (#8398) * Add Frequency Mainnet * Adding Spec for Frequency --- packages/apps-config/package.json | 1 + .../apps-config/src/api/spec/frequency.ts | 17 + packages/apps-config/src/api/spec/index.ts | 3 + packages/apps-config/src/api/typesBundle.ts | 492 ++++++++++++++++++ .../src/endpoints/productionRelayPolkadot.ts | 10 + packages/apps-config/src/ui/colors.ts | 2 + .../src/ui/logos/chains/frequency.svg | 2 +- packages/apps-config/src/ui/logos/index.ts | 2 + yarn.lock | 12 + 9 files changed, 540 insertions(+), 1 deletion(-) create mode 100644 packages/apps-config/src/api/spec/frequency.ts diff --git a/packages/apps-config/package.json b/packages/apps-config/package.json index a03f5c8f73..948bcc19fd 100644 --- a/packages/apps-config/package.json +++ b/packages/apps-config/package.json @@ -23,6 +23,7 @@ "@docknetwork/node-types": "0.13.0", "@edgeware/node-types": "3.6.2-wako", "@equilab/definitions": "1.4.14", + "@frequency-chain/api-augment": "^0.9.29", "@interlay/interbtc-types": "1.9.0", "@kiltprotocol/type-definitions": "^0.2.1", "@laminar/type-definitions": "0.3.1", diff --git a/packages/apps-config/src/api/spec/frequency.ts b/packages/apps-config/src/api/spec/frequency.ts new file mode 100644 index 0000000000..289f7df99e --- /dev/null +++ b/packages/apps-config/src/api/spec/frequency.ts @@ -0,0 +1,17 @@ +// Copyright 2017-2022 @polkadot/apps-config authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { OverrideBundleDefinition } from '@polkadot/types/types'; + +import { options } from '@frequency-chain/api-augment'; + +export default { + ...options, + types: [ + { + // on all versions + minmax: [0, undefined], + types: options.types + } + ] +} as OverrideBundleDefinition; diff --git a/packages/apps-config/src/api/spec/index.ts b/packages/apps-config/src/api/spec/index.ts index b1543eb803..9a36d23cdc 100644 --- a/packages/apps-config/src/api/spec/index.ts +++ b/packages/apps-config/src/api/spec/index.ts @@ -44,6 +44,7 @@ import encointerNodeTeeproxy from './encointer-node-teeproxy'; import encointerPara from './encointer-para'; import equilibrium from './equilibrium'; import fantour from './fantour'; +import frequency from './frequency'; import galital from './galital'; import galitalParachain from './galital-parachain'; import galois from './galois'; @@ -185,6 +186,8 @@ const spec: Record = { 'encointer-node-teeproxy': encointerNodeTeeproxy, 'encointer-parachain': encointerPara, fantour, + frequency, + 'frequency-rococo': frequency, galital, 'galital-collator': galitalParachain, gamepower, diff --git a/packages/apps-config/src/api/typesBundle.ts b/packages/apps-config/src/api/typesBundle.ts index 4c65f8a31d..775d2903ef 100644 --- a/packages/apps-config/src/api/typesBundle.ts +++ b/packages/apps-config/src/api/typesBundle.ts @@ -33573,6 +33573,498 @@ export const typesBundle = { } ] }, + "frequency": { + "rpc": { + "msa": { + "checkDelegations": { + "description": "Test a list of MSAs to see if they have delegated to the provider MSA", + "params": [ + { + "name": "delegator_msa_ids", + "type": "Vec" + }, + { + "name": "provider_msa_id", + "type": "ProviderId" + }, + { + "name": "block_number", + "type": "BlockNumber" + }, + { + "name": "schema_id", + "type": "Option" + } + ], + "type": "Vec<(DelegatorId, bool)>" + }, + "grantedSchemaIdsByMsaId": { + "description": "Fetch the list of schema ids that a delegator has granted to provider", + "params": [ + { + "name": "delegator_msa_id", + "type": "DelegatorId" + }, + { + "name": "provider_msa_id", + "type": "ProviderId" + } + ], + "type": "Option>" + } + }, + "messages": { + "getBySchemaId": { + "description": "Get messages by schemaId paginated", + "params": [ + { + "name": "schema_id", + "type": "SchemaId" + }, + { + "name": "pagination", + "type": "BlockPaginationRequest" + } + ], + "type": "BlockPaginationResponseMessage" + } + }, + "schemas": { + "getBySchemaId": { + "description": "Get a Schema by Id", + "params": [ + { + "name": "schema_id", + "type": "SchemaId" + } + ], + "type": "Option" + }, + "checkSchemaValidity": { + "description": "", + "params": [ + { + "name": "model", + "type": "SchemaModel" + }, + { + "name": "at", + "type": "BlockHash", + "isOptional": true + } + ], + "type": "bool" + } + } + }, + "types": [ + { + "minmax": [ + 0, + null + ], + "types": { + "MessageSourceId": "u64", + "DelegatorId": "MessageSourceId", + "ProviderId": "MessageSourceId", + "KeyInfoResponse": { + "key": "AccountId", + "msaId": "MessageSourceId" + }, + "BlockPaginationRequest": { + "from_block": "BlockNumber", + "from_index": "u32", + "to_block": "BlockNumber", + "page_size": "u32" + }, + "MessageResponse": { + "payload": "Option>", + "cid": "Option>", + "provider_msa_id": "MessageSourceId", + "msa_id": "Option", + "index": "u16", + "block_number": "BlockNumber", + "payload_length": "Option" + }, + "BlockPaginationResponseMessage": { + "content": "Vec", + "has_next": "bool", + "next_block": "Option", + "next_index": "Option" + }, + "SchemaId": "u16", + "SchemaModel": "Vec", + "SchemaResponse": { + "schema_id": "SchemaId", + "model": "SchemaModel", + "model_type": "ModelType", + "payload_location": "PayloadLocation" + }, + "ModelType": { + "_enum": [ + "AvroBinary", + "Parquet" + ] + }, + "PayloadLocation": { + "_enum": [ + "OnChain", + "IPFS" + ] + } + } + } + ], + "signedExtensions": { + "CheckFreeExtrinsicUse": { + "extrinsic": {}, + "payload": {} + } + }, + "runtime": { + "MsaRuntimeApi": [ + { + "methods": { + "has_delegation": { + "description": "Check to see if a delegation existed between the given delegator and provider at a given block", + "params": [ + { + "name": "delegator_id", + "type": "DelegatorId" + }, + { + "name": "provider_id", + "type": "ProviderId" + }, + { + "name": "block_number", + "type": "BlockNumber" + }, + { + "name": "schema_id", + "type": "Option" + } + ], + "type": "bool" + }, + "get_granted_schemas_by_msa_id": { + "description": "Get the list of schema ids (if any) that exist in any delegation between the delegator and provider", + "params": [ + { + "name": "delegator_id", + "type": "DelegatorId" + }, + { + "name": "provider_id", + "type": "ProviderId" + } + ], + "type": "Option>" + } + }, + "version": 1 + } + ], + "MessagesRuntimeApi": [ + { + "methods": { + "get_messages_by_schema_and_block": { + "description": "Retrieve the messages for a particular schema and block number", + "params": [ + { + "name": "schema_id", + "type": "SchemaId" + }, + { + "name": "schema_payload_location", + "type": "PayloadLocation" + }, + { + "name": "block_number", + "type": "BlockNumber" + } + ], + "type": "Vec" + }, + "get_schema_by_id": { + "description": "Retrieve a schema by id", + "params": [ + { + "name": "schema_id", + "type": "SchemaId" + } + ], + "type": "Option" + } + }, + "version": 1 + } + ], + "SchemasRuntimeApi": [ + { + "methods": { + "get_schema_by_id": { + "description": "Fetch the schema by id", + "params": [ + { + "name": "schema_id", + "type": "SchemaId" + } + ], + "type": "Option" + } + }, + "version": 1 + } + ] + } + }, + "frequency-rococo": { + "rpc": { + "msa": { + "checkDelegations": { + "description": "Test a list of MSAs to see if they have delegated to the provider MSA", + "params": [ + { + "name": "delegator_msa_ids", + "type": "Vec" + }, + { + "name": "provider_msa_id", + "type": "ProviderId" + }, + { + "name": "block_number", + "type": "BlockNumber" + }, + { + "name": "schema_id", + "type": "Option" + } + ], + "type": "Vec<(DelegatorId, bool)>" + }, + "grantedSchemaIdsByMsaId": { + "description": "Fetch the list of schema ids that a delegator has granted to provider", + "params": [ + { + "name": "delegator_msa_id", + "type": "DelegatorId" + }, + { + "name": "provider_msa_id", + "type": "ProviderId" + } + ], + "type": "Option>" + } + }, + "messages": { + "getBySchemaId": { + "description": "Get messages by schemaId paginated", + "params": [ + { + "name": "schema_id", + "type": "SchemaId" + }, + { + "name": "pagination", + "type": "BlockPaginationRequest" + } + ], + "type": "BlockPaginationResponseMessage" + } + }, + "schemas": { + "getBySchemaId": { + "description": "Get a Schema by Id", + "params": [ + { + "name": "schema_id", + "type": "SchemaId" + } + ], + "type": "Option" + }, + "checkSchemaValidity": { + "description": "", + "params": [ + { + "name": "model", + "type": "SchemaModel" + }, + { + "name": "at", + "type": "BlockHash", + "isOptional": true + } + ], + "type": "bool" + } + } + }, + "types": [ + { + "minmax": [ + 0, + null + ], + "types": { + "MessageSourceId": "u64", + "DelegatorId": "MessageSourceId", + "ProviderId": "MessageSourceId", + "KeyInfoResponse": { + "key": "AccountId", + "msaId": "MessageSourceId" + }, + "BlockPaginationRequest": { + "from_block": "BlockNumber", + "from_index": "u32", + "to_block": "BlockNumber", + "page_size": "u32" + }, + "MessageResponse": { + "payload": "Option>", + "cid": "Option>", + "provider_msa_id": "MessageSourceId", + "msa_id": "Option", + "index": "u16", + "block_number": "BlockNumber", + "payload_length": "Option" + }, + "BlockPaginationResponseMessage": { + "content": "Vec", + "has_next": "bool", + "next_block": "Option", + "next_index": "Option" + }, + "SchemaId": "u16", + "SchemaModel": "Vec", + "SchemaResponse": { + "schema_id": "SchemaId", + "model": "SchemaModel", + "model_type": "ModelType", + "payload_location": "PayloadLocation" + }, + "ModelType": { + "_enum": [ + "AvroBinary", + "Parquet" + ] + }, + "PayloadLocation": { + "_enum": [ + "OnChain", + "IPFS" + ] + } + } + } + ], + "signedExtensions": { + "CheckFreeExtrinsicUse": { + "extrinsic": {}, + "payload": {} + } + }, + "runtime": { + "MsaRuntimeApi": [ + { + "methods": { + "has_delegation": { + "description": "Check to see if a delegation existed between the given delegator and provider at a given block", + "params": [ + { + "name": "delegator_id", + "type": "DelegatorId" + }, + { + "name": "provider_id", + "type": "ProviderId" + }, + { + "name": "block_number", + "type": "BlockNumber" + }, + { + "name": "schema_id", + "type": "Option" + } + ], + "type": "bool" + }, + "get_granted_schemas_by_msa_id": { + "description": "Get the list of schema ids (if any) that exist in any delegation between the delegator and provider", + "params": [ + { + "name": "delegator_id", + "type": "DelegatorId" + }, + { + "name": "provider_id", + "type": "ProviderId" + } + ], + "type": "Option>" + } + }, + "version": 1 + } + ], + "MessagesRuntimeApi": [ + { + "methods": { + "get_messages_by_schema_and_block": { + "description": "Retrieve the messages for a particular schema and block number", + "params": [ + { + "name": "schema_id", + "type": "SchemaId" + }, + { + "name": "schema_payload_location", + "type": "PayloadLocation" + }, + { + "name": "block_number", + "type": "BlockNumber" + } + ], + "type": "Vec" + }, + "get_schema_by_id": { + "description": "Retrieve a schema by id", + "params": [ + { + "name": "schema_id", + "type": "SchemaId" + } + ], + "type": "Option" + } + }, + "version": 1 + } + ], + "SchemasRuntimeApi": [ + { + "methods": { + "get_schema_by_id": { + "description": "Fetch the schema by id", + "params": [ + { + "name": "schema_id", + "type": "SchemaId" + } + ], + "type": "Option" + } + }, + "version": 1 + } + ] + } + }, "galital": { "types": [ { diff --git a/packages/apps-config/src/endpoints/productionRelayPolkadot.ts b/packages/apps-config/src/endpoints/productionRelayPolkadot.ts index 1f37d09d9e..04431a32f1 100644 --- a/packages/apps-config/src/endpoints/productionRelayPolkadot.ts +++ b/packages/apps-config/src/endpoints/productionRelayPolkadot.ts @@ -181,6 +181,16 @@ export const prodParasPolkadot: EndpointOption[] = [ Dwellir: 'wss://equilibrium-rpc.dwellir.com' } }, + { + info: 'frequency', + homepage: 'https://frequency.xyz', + paraId: 2091, + text: 'Frequency', + providers: { + 'Frequency 0': 'wss://0.rpc.frequency.xyz', + 'Frequency 1': 'wss://1.rpc.frequency.xyz' + } + }, { info: 'geminis', isUnreachable: true, diff --git a/packages/apps-config/src/ui/colors.ts b/packages/apps-config/src/ui/colors.ts index 7a868b6d1b..ba08deca50 100644 --- a/packages/apps-config/src/ui/colors.ts +++ b/packages/apps-config/src/ui/colors.ts @@ -54,6 +54,7 @@ const chainDotMog = '#020609'; const chainEfinity = '#496ddb'; const chainEquilibrium = '#1792ff'; const chainFantour = '#5a189a'; +const chainFrequency = '#4b64ff'; const chainFrequencyRococo = '#29fd47'; const chainGalital = '#00063F'; const chainGalois = '#000000'; @@ -339,6 +340,7 @@ export const chainColors: Record = Object.entries({ 'Equilibrium parachain': chainEquilibrium, EquilibriumTestnet: chainGenshiro, 'Fantour Development': chainFantour, + Frequency: chainFrequency, 'Frequency Rococo': chainFrequencyRococo, Galital: chainGalital, 'Galois-PoC-1': chainGalois, diff --git a/packages/apps-config/src/ui/logos/chains/frequency.svg b/packages/apps-config/src/ui/logos/chains/frequency.svg index 8257693320..5c3a6dbc5f 100644 --- a/packages/apps-config/src/ui/logos/chains/frequency.svg +++ b/packages/apps-config/src/ui/logos/chains/frequency.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/packages/apps-config/src/ui/logos/index.ts b/packages/apps-config/src/ui/logos/index.ts index 73cc048787..ee78727546 100644 --- a/packages/apps-config/src/ui/logos/index.ts +++ b/packages/apps-config/src/ui/logos/index.ts @@ -300,6 +300,7 @@ export const chainLogos = Object.entries({ Equilibrium: chainEquilibrium, 'Equilibrium parachain': chainEquilibrium, EquilibriumTestnet: chainEquilibrium, + Frequency: chainFrequency, 'Frequency Rococo': chainFrequency, Galital: nodeGalital, 'GamePower Network': nodeGamePower, @@ -759,6 +760,7 @@ export const namedLogos: Record = { encointer: nodeEncointer, equilibrium: chainEquilibrium, fantour: nodeFantour, + frequency: chainFrequency, galital: nodeGalital, galois: nodeMath, gamepower: nodeGamePower, diff --git a/yarn.lock b/yarn.lock index 9da8cd7e53..04011d4562 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1933,6 +1933,17 @@ __metadata: languageName: node linkType: hard +"@frequency-chain/api-augment@npm:^0.9.29": + version: 0.9.29 + resolution: "@frequency-chain/api-augment@npm:0.9.29" + dependencies: + "@polkadot/api": ^9.6.2 + "@polkadot/rpc-provider": ^9.6.2 + "@polkadot/types": ^9.6.2 + checksum: 452d3ecd2e322bea5063bbd744f75cc3ff4a5f38ee9864799eb09d7b2dd270bd541f7cd7c4fb632a47e9c6ec46ee06a2e4907f046c0c1821ddc8af2f08b8ce8e + languageName: node + linkType: hard + "@humanwhocodes/config-array@npm:^0.11.6": version: 0.11.6 resolution: "@humanwhocodes/config-array@npm:0.11.6" @@ -3150,6 +3161,7 @@ __metadata: "@docknetwork/node-types": 0.13.0 "@edgeware/node-types": 3.6.2-wako "@equilab/definitions": 1.4.14 + "@frequency-chain/api-augment": ^0.9.29 "@interlay/interbtc-types": 1.9.0 "@kiltprotocol/type-definitions": ^0.2.1 "@laminar/type-definitions": 0.3.1