car_rental_service.json 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. {
  2. "version": "0.1.0",
  3. "name": "car_rental_service",
  4. "instructions": [
  5. {
  6. "name": "AddCar",
  7. "accounts": [
  8. {
  9. "name": "carAccount",
  10. "isMut": true,
  11. "isSigner": false,
  12. "desc": "The account that will represent the Car being created"
  13. },
  14. {
  15. "name": "payer",
  16. "isMut": true,
  17. "isSigner": false,
  18. "desc": "Fee payer"
  19. },
  20. {
  21. "name": "systemProgram",
  22. "isMut": false,
  23. "isSigner": false,
  24. "desc": "The System Program"
  25. }
  26. ],
  27. "args": [
  28. {
  29. "name": "addCarArgs",
  30. "type": {
  31. "defined": "AddCarArgs"
  32. }
  33. }
  34. ],
  35. "discriminant": {
  36. "type": "u8",
  37. "value": 0
  38. }
  39. },
  40. {
  41. "name": "BookRental",
  42. "accounts": [
  43. {
  44. "name": "rentalAccount",
  45. "isMut": true,
  46. "isSigner": false,
  47. "desc": "The account that will represent the actual order for the rental"
  48. },
  49. {
  50. "name": "carAccount",
  51. "isMut": false,
  52. "isSigner": false,
  53. "desc": "The account representing the Car being rented in this order"
  54. },
  55. {
  56. "name": "payer",
  57. "isMut": true,
  58. "isSigner": false,
  59. "desc": "Fee payer"
  60. },
  61. {
  62. "name": "systemProgram",
  63. "isMut": false,
  64. "isSigner": false,
  65. "desc": "The System Program"
  66. }
  67. ],
  68. "args": [
  69. {
  70. "name": "bookRentalArgs",
  71. "type": {
  72. "defined": "BookRentalArgs"
  73. }
  74. }
  75. ],
  76. "discriminant": {
  77. "type": "u8",
  78. "value": 1
  79. }
  80. },
  81. {
  82. "name": "PickUpCar",
  83. "accounts": [
  84. {
  85. "name": "rentalAccount",
  86. "isMut": true,
  87. "isSigner": false,
  88. "desc": "The account representing the active rental"
  89. },
  90. {
  91. "name": "carAccount",
  92. "isMut": false,
  93. "isSigner": false,
  94. "desc": "The account representing the Car being rented in this order"
  95. },
  96. {
  97. "name": "payer",
  98. "isMut": true,
  99. "isSigner": false,
  100. "desc": "Fee payer"
  101. }
  102. ],
  103. "args": [],
  104. "discriminant": {
  105. "type": "u8",
  106. "value": 2
  107. }
  108. },
  109. {
  110. "name": "ReturnCar",
  111. "accounts": [
  112. {
  113. "name": "rentalAccount",
  114. "isMut": true,
  115. "isSigner": false,
  116. "desc": "The account representing the active rental"
  117. },
  118. {
  119. "name": "carAccount",
  120. "isMut": false,
  121. "isSigner": false,
  122. "desc": "The account representing the Car being rented in this order"
  123. },
  124. {
  125. "name": "payer",
  126. "isMut": true,
  127. "isSigner": false,
  128. "desc": "Fee payer"
  129. }
  130. ],
  131. "args": [],
  132. "discriminant": {
  133. "type": "u8",
  134. "value": 3
  135. }
  136. }
  137. ],
  138. "accounts": [
  139. {
  140. "name": "Car",
  141. "type": {
  142. "kind": "struct",
  143. "fields": [
  144. {
  145. "name": "year",
  146. "type": "u16"
  147. },
  148. {
  149. "name": "make",
  150. "type": "string"
  151. },
  152. {
  153. "name": "model",
  154. "type": "string"
  155. }
  156. ]
  157. }
  158. },
  159. {
  160. "name": "RentalOrder",
  161. "type": {
  162. "kind": "struct",
  163. "fields": [
  164. {
  165. "name": "car",
  166. "type": "publicKey"
  167. },
  168. {
  169. "name": "name",
  170. "type": "string"
  171. },
  172. {
  173. "name": "pickUpDate",
  174. "type": "string"
  175. },
  176. {
  177. "name": "returnDate",
  178. "type": "string"
  179. },
  180. {
  181. "name": "price",
  182. "type": "u64"
  183. },
  184. {
  185. "name": "status",
  186. "type": {
  187. "defined": "RentalOrderStatus"
  188. }
  189. }
  190. ]
  191. }
  192. }
  193. ],
  194. "types": [
  195. {
  196. "name": "AddCarArgs",
  197. "type": {
  198. "kind": "struct",
  199. "fields": [
  200. {
  201. "name": "year",
  202. "type": "u16"
  203. },
  204. {
  205. "name": "make",
  206. "type": "string"
  207. },
  208. {
  209. "name": "model",
  210. "type": "string"
  211. }
  212. ]
  213. }
  214. },
  215. {
  216. "name": "BookRentalArgs",
  217. "type": {
  218. "kind": "struct",
  219. "fields": [
  220. {
  221. "name": "name",
  222. "type": "string"
  223. },
  224. {
  225. "name": "pickUpDate",
  226. "type": "string"
  227. },
  228. {
  229. "name": "returnDate",
  230. "type": "string"
  231. },
  232. {
  233. "name": "price",
  234. "type": "u64"
  235. }
  236. ]
  237. }
  238. },
  239. {
  240. "name": "RentalOrderStatus",
  241. "type": {
  242. "kind": "enum",
  243. "variants": [
  244. {
  245. "name": "Created"
  246. },
  247. {
  248. "name": "PickedUp"
  249. },
  250. {
  251. "name": "Returned"
  252. }
  253. ]
  254. }
  255. }
  256. ],
  257. "metadata": {
  258. "origin": "shank",
  259. "address": "8avNGHVXDwsELJaWMSoUZ44CirQd4zyU9Ez4ZmP4jNjZ",
  260. "binaryVersion": "0.0.12",
  261. "libVersion": "0.0.12"
  262. }
  263. }