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<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 [62 {name: 'collectionId', type: 'u32'},63 {name: 'filterKeys', type: 'Vec<String>', isOptional: true},64 ],65 'Vec<UpDataStructsRmrkPropertyInfo>',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<UpDataStructsRmrkPropertyInfo>',75 ),76 nftResources: fn(77 'Get NFT resources',78 [79 {name: 'collectionId', type: 'u32'},80 {name: 'nftId', type: 'u32'},81 ],82 'Vec<UpDataStructsRmrkResourceInfo>',83 ),84 nftResourcePriorities: fn(85 'Get NFT resource priorities',86 [87 {name: 'collectionId', type: 'u32'},88 {name: 'nftId', type: 'u32'},89 ],90 'Vec<Bytes>',91 ),92 base: fn(93 'Get base info',94 [{name: 'baseId', type: 'u32'}],95 'Option<UpDataStructsRmrkBaseInfo>',96 ),97 baseParts: fn(98 'Get all Base\'s parts',99 [{name: 'baseId', type: 'u32'}],100 'Vec<UpDataStructsRmrkPartType>',101 ),102 themeNames: fn(103 'Get Base\'s theme names',104 [{name: 'baseId', type: 'u32'}],105 'Vec<Bytes>',106 ),107 themes: fn(108 'Get Theme\'s keys values',109 [110 {name: 'baseId', type: 'u32'},111 {name: 'themeName', type: 'String'},112 {name: 'keys', type: 'Option<Vec<String>>'},113 ],114 'Option<UpDataStructsRmrkTheme>',115 ),116 },117};