git.delta.rocks / unique-network / refs/commits / afa958b4c036

difftreelog

source

tests/src/interfaces/rmrk/definitions.ts3.2 KiBsourcehistory
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617type RpcParam = {18  name: string;19  type: string;20  isOptional?: true;21};2223const atParam = {name: 'at', type: 'Hash', isOptional: true};24const fn = (description: string, params: RpcParam[], type: string) => ({25  description,26  params: [...params, atParam],27  type,28});2930export default {31  types: {},32  rpc: {33    lastCollectionIdx: fn('Get the latest created collection id', [], 'u32'),34    collectionById: fn('Get collection by id', [{name: 'id', type: 'u32'}], 'Option<UpDataStructsRmrkCollectionInfo>'),35    nftById: fn(36      'Get NFT by collection id and NFT id',37      [38        {name: 'collectionId', type: 'u32'},39        {name: 'nftId', type: 'u32'},40      ],41      'Option<UpDataStructsRmrkNftInfo>',42    ),43    accountTokens: fn(44      'Get tokens owned by an account in a collection',45      [46        {name: 'accountId', type: 'AccountId32'},47        {name: 'collectionId', type: 'u32'},48      ],49      'Vec<u32>',50    ),51    nftChildren: fn(52      'Get NFT children',53      [54        {name: 'collectionId', type: 'u32'},55        {name: 'nftId', type: 'u32'},56      ],57      'Vec<UpDataStructsRmrkNftChild>',58    ),59    collectionProperties: fn(60      'Get collection properties',61      [{name: 'collectionId', type: 'u32'}],62      'Vec<UpDataStructsRmrkPropertyInfo>',63    ),64    nftProperties: fn(65      'Get NFT properties',66      [67        {name: 'collectionId', type: 'u32'},68        {name: 'nftId', type: 'u32'},69      ],70      'Vec<UpDataStructsRmrkPropertyInfo>',71    ),72    nftResources: fn(73      'Get NFT resources',74      [75        {name: 'collectionId', type: 'u32'},76        {name: 'nftId', type: 'u32'},77      ],78      'Vec<UpDataStructsRmrkResourceInfo>',79    ),80    nftResourcePriorities: fn(81      'Get NFT resource priorities',82      [83        {name: 'collectionId', type: 'u32'},84        {name: 'nftId', type: 'u32'},85      ],86      'Vec<Bytes>',87    ),88    base: fn(89      'Get base info',90      [{name: 'baseId', type: 'u32'}],91      'Option<UpDataStructsRmrkBaseInfo>',92    ),93    baseParts: fn(94      'Get all Base\'s parts',95      [{name: 'baseId', type: 'u32'}],96      'Vec<UpDataStructsRmrkPartType>',97    ),98    themeNames: fn(99      'Get Base\'s theme names',100      [{name: 'baseId', type: 'u32'}],101      'Vec<Bytes>',102    ),103    themes: fn(104      'Get Theme\'s keys values',105      [106        {name: 'baseId', type: 'u32'},107        {name: 'themeName', type: 'String'},108        {name: 'keys', type: 'Option<Vec<String>>'},109      ],110      'Option<UpDataStructsRmrkTheme>',111    ),112  },113};