1234567891011121314151617type 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};