1234567891011121314151617import types from '../lookup';1819type RpcParam = {20 name: string;21 type: string;22 isOptional?: true;23};2425const atParam = {name: 'at', type: 'Hash', isOptional: true};26const fn = (description: string, params: RpcParam[], type: string) => ({27 description,28 params: [...params, atParam],29 type,30});3132export default {33 types,34 rpc: {35 lastCollectionIdx: fn('Get the latest created collection id', [], 'u32'),36 collectionById: fn('Get collection by id', [{name: 'id', type: 'u32'}], 'Option<RmrkTypesCollectionInfo>'),37 nftById: fn(38 'Get NFT by collection id and NFT id',39 [40 {name: 'collectionId', type: 'u32'},41 {name: 'nftId', type: 'u32'},42 ],43 'Option<RmrkTypesNftInfo>'44 ),45 accountTokens: fn(46 'Get tokens owned by an account in a collection',47 [48 {name: 'accountId', type: 'AccountId32'},49 {name: 'collectionId', type: 'u32'}50 ],51 'Vec<u32>'52 ),53 nftChildren: fn(54 'Get NFT children',55 [56 {name: 'collectionId', type: 'u32'},57 {name: 'nftId', type: 'u32'},58 ],59 'Vec<RmrkTypesNftChild>'60 ),61 collectionProperties: fn(62 'Get collection properties',63 [{name: 'collectionId', type: 'u32'}],64 'Vec<RmrkTypesPropertyInfo>'65 ),66 nftProperties: fn(67 'Get NFT properties',68 [69 {name: 'collectionId', type: 'u32'},70 {name: 'nftId', type: 'u32'}71 ],72 'Vec<RmrkTypesPropertyInfo>'73 ),74 nftResources: fn(75 'Get NFT resources',76 [77 {name: 'collectionId', type: 'u32'},78 {name: 'nftId', type: 'u32'}79 ],80 'Vec<RmrkTypesResourceInfo>'81 ),82 nftResourcePriorities: fn(83 'Get NFT resource priorities',84 [85 {name: 'collectionId', type: 'u32'},86 {name: 'nftId', type: 'u32'}87 ],88 'Vec<Bytes>'89 ),90 base: fn(91 'Get base info',92 [{name: 'baseId', type: 'u32'}],93 'Option<RmrkTypesBaseInfo>'94 ),95 baseParts: fn(96 'Get all Base\'s parts',97 [{name: 'baseId', type: 'u32'}],98 'Vec<RmrkTypesPartType>'99 ),100 themeNames: fn(101 'Get Base\'s theme names',102 [{name: 'baseId', type: 'u32'}],103 'Vec<Bytes>'104 ),105 themes: fn(106 'Get Theme\'s keys values',107 [108 {name: 'baseId', type: 'u32'},109 {name: 'themeName', type: 'String'},110 {name: 'keys', type: 'Option<Vec<String>>'}111 ],112 'Option<RmrkTypesTheme>'113 )114 }115};