Peaq rpc add (#9547)

* Add the krest network's url

* Add peaqdid/peaqstorage's RPC

* Remove the peaq-type-definitions.d.ts

* Update the package to the latest peaq version

* Fix lint errors

* Fix lint error again

---------

Co-authored-by: jaypan <pan@peaq.io>
This commit is contained in:
Jay Pan 2023-06-09 17:06:49 +02:00 committed by GitHub
parent 185cebffc1
commit 2ef185d82d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 621 additions and 1 deletions

View File

@ -33,6 +33,7 @@
"@logion/node-api": "0.16.0-1",
"@metaverse-network-sdk/type-definitions": "0.0.1-16",
"@parallel-finance/type-definitions": "1.7.17",
"@peaqnetwork/type-definitions": "0.0.4",
"@phala/typedefs": "0.2.33",
"@polkadot/api": "^10.8.1",
"@polkadot/api-derive": "^10.8.1",

View File

@ -90,6 +90,7 @@ import pangolin from './pangolin.js';
import pangoro from './pangoro.js';
import parallel from './parallel.js';
import parami from './parami.js';
import peaq from './peaq.js';
import phoenix from './phoenix.js';
import pichiu from './pichiu.js';
import polkadex from './polkadex.js';
@ -250,6 +251,9 @@ const spec: Record<string, OverrideBundleDefinition> = {
'origintrail-parachain': origintrail,
parallel,
parami,
'peaq-node': peaq,
'peaq-node-dev': peaq,
'peaq-node-krest': peaq,
'phoenix-node': phoenix,
'phoenix-parachain': phoenix,
pichiu,

View File

@ -0,0 +1,8 @@
// Copyright 2017-2023 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { OverrideBundleDefinition } from '@polkadot/types/types';
import { typesBundleForPolkadot } from '@peaqnetwork/type-definitions';
export default (typesBundleForPolkadot as { spec: { peaq: OverrideBundleDefinition } }).spec.peaq;

View File

@ -70357,6 +70357,603 @@ export const typesBundle = {
}
]
},
"peaq-node": {
"rpc": {
"oracle": {
"getValue": {
"description": "Retrieves the oracle value for a given key.",
"params": [
{
"name": "providerId",
"type": "RpcDataProviderId"
},
{
"name": "key",
"type": "OracleKey"
},
{
"name": "at",
"type": "BlockHash",
"isHistoric": true,
"isOptional": true
}
],
"type": "Option<TimestampedValue>",
"isSubscription": false,
"jsonrpc": "oracle_getValue",
"method": "getValue",
"section": "oracle"
},
"getAllValues": {
"description": "Retrieves all oracle values.",
"params": [
{
"name": "providerId",
"type": "RpcDataProviderId"
},
{
"name": "at",
"type": "BlockHash",
"isHistoric": true,
"isOptional": true
}
],
"type": "Vec<(OracleKey, Option<TimestampedValue>)>",
"isSubscription": false,
"jsonrpc": "oracle_getAllValues",
"method": "getAllValues",
"section": "oracle"
}
},
"peaqdid": {
"readAttribute": {
"description": "Read attribute",
"params": [
{
"name": "didAccount",
"type": "AccountId"
},
{
"name": "name",
"type": "Bytes"
},
{
"name": "at",
"type": "BlockHash",
"isHistoric": true,
"isOptional": true
}
],
"type": "Option<RPCAttribute>",
"isSubscription": false,
"jsonrpc": "peaqdid_readAttribute",
"method": "readAttribute",
"section": "peaqdid"
}
},
"peaqstorage": {
"readAttribute": {
"description": "Read attribute",
"params": [
{
"name": "didAccount",
"type": "AccountId"
},
{
"name": "itemType",
"type": "Bytes"
},
{
"name": "at",
"type": "BlockHash",
"isHistoric": true,
"isOptional": true
}
],
"type": "Option<StorageRpcResult>",
"isSubscription": false,
"jsonrpc": "peaqstorage_readAttribute",
"method": "readAttribute",
"section": "peaqstorage"
}
}
},
"types": [
{
"minmax": [
0,
null
],
"types": {
"CallOf": "Call",
"DispatchTime": {
"_enum": {
"At": "BlockNumber",
"After": "BlockNumber"
}
},
"ScheduleTaskIndex": "u32",
"DelayedOrigin": {
"delay": "BlockNumber",
"origin": "PalletsOrigin"
},
"AuthorityOrigin": "DelayedOrigin",
"StorageValue": "Vec<u8>",
"GraduallyUpdate": {
"key": "StorageKey",
"targetValue": "StorageValue",
"perBlock": "StorageValue"
},
"StorageKeyBytes": "Vec<u8>",
"StorageValueBytes": "Vec<u8>",
"RpcDataProviderId": "Text",
"DataProviderId": "u8",
"TimestampedValue": {
"value": "OracleValue",
"timestamp": "Moment"
},
"TimestampedValueOf": "TimestampedValue",
"OrderedSet": "Vec<AccountId>",
"OrmlAccountData": {
"free": "Balance",
"frozen": "Balance",
"reserved": "Balance"
},
"OrmlBalanceLock": {
"amount": "Balance",
"id": "LockIdentifier"
},
"AuctionInfo": {
"bid": "Option<(AccountId, Balance)>",
"start": "BlockNumber",
"end": "Option<BlockNumber>"
},
"DelayedDispatchTime": {
"_enum": {
"At": "BlockNumber",
"After": "BlockNumber"
}
},
"DispatchId": "u32",
"Price": "FixedU128",
"OrmlVestingSchedule": {
"start": "BlockNumber",
"period": "BlockNumber",
"periodCount": "u32",
"perPeriod": "Compact<Balance>"
},
"VestingScheduleOf": "OrmlVestingSchedule",
"OrmlCurrencyId": "u8",
"PoolInfo": {
"totalShares": "Share",
"rewards": "BTreeMap<OrmlCurrencyId, (Balance, Balance)>"
},
"CompactBalance": "Compact<Balance>",
"PoolInfoV0": {
"totalShares": "Compact<Share>",
"totalRewards": "CompactBalance",
"totalWithdrawnRewards": "CompactBalance"
},
"Share": "u128",
"OracleValue": "FixedU128",
"RPCAttribute": {
"name": "Bytes",
"value": "Bytes",
"validity": "Bytes",
"created": "Moment"
},
"StorageRpcResult": {
"item": "Bytes"
},
"Keys": "SessionKeys1"
}
}
],
"alias": {
"tokens": {
"AccountData": "OrmlAccountData",
"BalanceLock": "OrmlBalanceLock"
}
}
},
"peaq-node-dev": {
"rpc": {
"oracle": {
"getValue": {
"description": "Retrieves the oracle value for a given key.",
"params": [
{
"name": "providerId",
"type": "RpcDataProviderId"
},
{
"name": "key",
"type": "OracleKey"
},
{
"name": "at",
"type": "BlockHash",
"isHistoric": true,
"isOptional": true
}
],
"type": "Option<TimestampedValue>",
"isSubscription": false,
"jsonrpc": "oracle_getValue",
"method": "getValue",
"section": "oracle"
},
"getAllValues": {
"description": "Retrieves all oracle values.",
"params": [
{
"name": "providerId",
"type": "RpcDataProviderId"
},
{
"name": "at",
"type": "BlockHash",
"isHistoric": true,
"isOptional": true
}
],
"type": "Vec<(OracleKey, Option<TimestampedValue>)>",
"isSubscription": false,
"jsonrpc": "oracle_getAllValues",
"method": "getAllValues",
"section": "oracle"
}
},
"peaqdid": {
"readAttribute": {
"description": "Read attribute",
"params": [
{
"name": "didAccount",
"type": "AccountId"
},
{
"name": "name",
"type": "Bytes"
},
{
"name": "at",
"type": "BlockHash",
"isHistoric": true,
"isOptional": true
}
],
"type": "Option<RPCAttribute>",
"isSubscription": false,
"jsonrpc": "peaqdid_readAttribute",
"method": "readAttribute",
"section": "peaqdid"
}
},
"peaqstorage": {
"readAttribute": {
"description": "Read attribute",
"params": [
{
"name": "didAccount",
"type": "AccountId"
},
{
"name": "itemType",
"type": "Bytes"
},
{
"name": "at",
"type": "BlockHash",
"isHistoric": true,
"isOptional": true
}
],
"type": "Option<StorageRpcResult>",
"isSubscription": false,
"jsonrpc": "peaqstorage_readAttribute",
"method": "readAttribute",
"section": "peaqstorage"
}
}
},
"types": [
{
"minmax": [
0,
null
],
"types": {
"CallOf": "Call",
"DispatchTime": {
"_enum": {
"At": "BlockNumber",
"After": "BlockNumber"
}
},
"ScheduleTaskIndex": "u32",
"DelayedOrigin": {
"delay": "BlockNumber",
"origin": "PalletsOrigin"
},
"AuthorityOrigin": "DelayedOrigin",
"StorageValue": "Vec<u8>",
"GraduallyUpdate": {
"key": "StorageKey",
"targetValue": "StorageValue",
"perBlock": "StorageValue"
},
"StorageKeyBytes": "Vec<u8>",
"StorageValueBytes": "Vec<u8>",
"RpcDataProviderId": "Text",
"DataProviderId": "u8",
"TimestampedValue": {
"value": "OracleValue",
"timestamp": "Moment"
},
"TimestampedValueOf": "TimestampedValue",
"OrderedSet": "Vec<AccountId>",
"OrmlAccountData": {
"free": "Balance",
"frozen": "Balance",
"reserved": "Balance"
},
"OrmlBalanceLock": {
"amount": "Balance",
"id": "LockIdentifier"
},
"AuctionInfo": {
"bid": "Option<(AccountId, Balance)>",
"start": "BlockNumber",
"end": "Option<BlockNumber>"
},
"DelayedDispatchTime": {
"_enum": {
"At": "BlockNumber",
"After": "BlockNumber"
}
},
"DispatchId": "u32",
"Price": "FixedU128",
"OrmlVestingSchedule": {
"start": "BlockNumber",
"period": "BlockNumber",
"periodCount": "u32",
"perPeriod": "Compact<Balance>"
},
"VestingScheduleOf": "OrmlVestingSchedule",
"OrmlCurrencyId": "u8",
"PoolInfo": {
"totalShares": "Share",
"rewards": "BTreeMap<OrmlCurrencyId, (Balance, Balance)>"
},
"CompactBalance": "Compact<Balance>",
"PoolInfoV0": {
"totalShares": "Compact<Share>",
"totalRewards": "CompactBalance",
"totalWithdrawnRewards": "CompactBalance"
},
"Share": "u128",
"OracleValue": "FixedU128",
"RPCAttribute": {
"name": "Bytes",
"value": "Bytes",
"validity": "Bytes",
"created": "Moment"
},
"StorageRpcResult": {
"item": "Bytes"
},
"Keys": "SessionKeys1"
}
}
],
"alias": {
"tokens": {
"AccountData": "OrmlAccountData",
"BalanceLock": "OrmlBalanceLock"
}
}
},
"peaq-node-krest": {
"rpc": {
"oracle": {
"getValue": {
"description": "Retrieves the oracle value for a given key.",
"params": [
{
"name": "providerId",
"type": "RpcDataProviderId"
},
{
"name": "key",
"type": "OracleKey"
},
{
"name": "at",
"type": "BlockHash",
"isHistoric": true,
"isOptional": true
}
],
"type": "Option<TimestampedValue>",
"isSubscription": false,
"jsonrpc": "oracle_getValue",
"method": "getValue",
"section": "oracle"
},
"getAllValues": {
"description": "Retrieves all oracle values.",
"params": [
{
"name": "providerId",
"type": "RpcDataProviderId"
},
{
"name": "at",
"type": "BlockHash",
"isHistoric": true,
"isOptional": true
}
],
"type": "Vec<(OracleKey, Option<TimestampedValue>)>",
"isSubscription": false,
"jsonrpc": "oracle_getAllValues",
"method": "getAllValues",
"section": "oracle"
}
},
"peaqdid": {
"readAttribute": {
"description": "Read attribute",
"params": [
{
"name": "didAccount",
"type": "AccountId"
},
{
"name": "name",
"type": "Bytes"
},
{
"name": "at",
"type": "BlockHash",
"isHistoric": true,
"isOptional": true
}
],
"type": "Option<RPCAttribute>",
"isSubscription": false,
"jsonrpc": "peaqdid_readAttribute",
"method": "readAttribute",
"section": "peaqdid"
}
},
"peaqstorage": {
"readAttribute": {
"description": "Read attribute",
"params": [
{
"name": "didAccount",
"type": "AccountId"
},
{
"name": "itemType",
"type": "Bytes"
},
{
"name": "at",
"type": "BlockHash",
"isHistoric": true,
"isOptional": true
}
],
"type": "Option<StorageRpcResult>",
"isSubscription": false,
"jsonrpc": "peaqstorage_readAttribute",
"method": "readAttribute",
"section": "peaqstorage"
}
}
},
"types": [
{
"minmax": [
0,
null
],
"types": {
"CallOf": "Call",
"DispatchTime": {
"_enum": {
"At": "BlockNumber",
"After": "BlockNumber"
}
},
"ScheduleTaskIndex": "u32",
"DelayedOrigin": {
"delay": "BlockNumber",
"origin": "PalletsOrigin"
},
"AuthorityOrigin": "DelayedOrigin",
"StorageValue": "Vec<u8>",
"GraduallyUpdate": {
"key": "StorageKey",
"targetValue": "StorageValue",
"perBlock": "StorageValue"
},
"StorageKeyBytes": "Vec<u8>",
"StorageValueBytes": "Vec<u8>",
"RpcDataProviderId": "Text",
"DataProviderId": "u8",
"TimestampedValue": {
"value": "OracleValue",
"timestamp": "Moment"
},
"TimestampedValueOf": "TimestampedValue",
"OrderedSet": "Vec<AccountId>",
"OrmlAccountData": {
"free": "Balance",
"frozen": "Balance",
"reserved": "Balance"
},
"OrmlBalanceLock": {
"amount": "Balance",
"id": "LockIdentifier"
},
"AuctionInfo": {
"bid": "Option<(AccountId, Balance)>",
"start": "BlockNumber",
"end": "Option<BlockNumber>"
},
"DelayedDispatchTime": {
"_enum": {
"At": "BlockNumber",
"After": "BlockNumber"
}
},
"DispatchId": "u32",
"Price": "FixedU128",
"OrmlVestingSchedule": {
"start": "BlockNumber",
"period": "BlockNumber",
"periodCount": "u32",
"perPeriod": "Compact<Balance>"
},
"VestingScheduleOf": "OrmlVestingSchedule",
"OrmlCurrencyId": "u8",
"PoolInfo": {
"totalShares": "Share",
"rewards": "BTreeMap<OrmlCurrencyId, (Balance, Balance)>"
},
"CompactBalance": "Compact<Balance>",
"PoolInfoV0": {
"totalShares": "Compact<Share>",
"totalRewards": "CompactBalance",
"totalWithdrawnRewards": "CompactBalance"
},
"Share": "u128",
"OracleValue": "FixedU128",
"RPCAttribute": {
"name": "Bytes",
"value": "Bytes",
"validity": "Bytes",
"created": "Moment"
},
"StorageRpcResult": {
"item": "Bytes"
},
"Keys": "SessionKeys1"
}
}
],
"alias": {
"tokens": {
"AccountData": "OrmlAccountData",
"BalanceLock": "OrmlBalanceLock"
}
}
},
"phoenix-node": {
"types": [
{

View File

@ -1196,7 +1196,7 @@ __metadata:
languageName: node
linkType: hard
"@open-web3/orml-type-definitions@npm:^0.9.4-7":
"@open-web3/orml-type-definitions@npm:^0.9.4-38, @open-web3/orml-type-definitions@npm:^0.9.4-7":
version: 0.9.4-38
resolution: "@open-web3/orml-type-definitions@npm:0.9.4-38"
dependencies:
@ -1223,6 +1223,15 @@ __metadata:
languageName: node
linkType: hard
"@peaqnetwork/type-definitions@npm:0.0.4":
version: 0.0.4
resolution: "@peaqnetwork/type-definitions@npm:0.0.4"
dependencies:
"@open-web3/orml-type-definitions": ^0.9.4-38
checksum: 6c38272a2170c8bfb91bb05bd8b46195c1dc9cd5ea85fc17531dd0d567eb889e2605080286a6c0bcd449217c999bc6d393bbc42db6347609aab23ec80cabcc1f
languageName: node
linkType: hard
"@phala/typedefs@npm:0.2.33":
version: 0.2.33
resolution: "@phala/typedefs@npm:0.2.33"
@ -1846,6 +1855,7 @@ __metadata:
"@logion/node-api": 0.16.0-1
"@metaverse-network-sdk/type-definitions": 0.0.1-16
"@parallel-finance/type-definitions": 1.7.17
"@peaqnetwork/type-definitions": 0.0.4
"@phala/typedefs": 0.2.33
"@polkadot/api": ^10.8.1
"@polkadot/api-derive": ^10.8.1