git.delta.rocks / unique-network / refs/commits / 895a035cdc96

difftreelog

source

tests/src/interfaces/rmrk/definitions.ts3.4 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<RmrkTraitsCollectionCollectionInfo>'),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<RmrkTraitsNftNftInfo>',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<RmrkTraitsNftNftChild>',58    ),59    collectionProperties: fn(60      'Get collection properties',61      [62        {name: 'collectionId', type: 'u32'},63        {name: 'filterKeys', type: 'Vec<String>', isOptional: true},64      ],65      'Vec<RmrkTraitsPropertyPropertyInfo>',66    ),67    nftProperties: fn(68      'Get NFT properties',69      [70        {name: 'collectionId', type: 'u32'},71        {name: 'nftId', type: 'u32'},72        {name: 'filterKeys', type: 'Vec<String>', isOptional: true},73      ],74      'Vec<RmrkTraitsPropertyPropertyInfo>',75    ),76    nftResources: fn(77      'Get NFT resources',78      [79        {name: 'collectionId', type: 'u32'},80        {name: 'nftId', type: 'u32'},81      ],82      'Vec<RmrkTraitsResourceResourceInfo>',83    ),84    nftResourcePriority: fn(85      'Get NFT resource priorities',86      [87        {name: 'collectionId', type: 'u32'},88        {name: 'nftId', type: 'u32'},89        {name: 'resourceId', type: 'u32'},90      ],91      'Option<u32>',92    ),93    base: fn(94      'Get base info',95      [{name: 'baseId', type: 'u32'}],96      'Option<RmrkTraitsBaseBaseInfo>',97    ),98    baseParts: fn(99      'Get all Base\'s parts',100      [{name: 'baseId', type: 'u32'}],101      'Vec<RmrkTraitsPartPartType>',102    ),103    themeNames: fn(104      'Get Base\'s theme names',105      [{name: 'baseId', type: 'u32'}],106      'Vec<Bytes>',107    ),108    themes: fn(109      'Get Theme\'s keys values',110      [111        {name: 'baseId', type: 'u32'},112        {name: 'themeName', type: 'String'},113        {name: 'keys', type: 'Option<Vec<String>>'},114      ],115      'Option<RmrkTraitsTheme>',116    ),117  },118};