{"components":{"responses":{},"schemas":{"AccumulateParams":{"description":"Parameters for the PVM Accumulate function.\n","example":{"input":"Hello, PVM!"},"properties":{"input":{"description":"Text input to accumulate in the PVM.","type":"string"}},"required":["input"],"title":"AccumulateParams","type":"object"},"AccumulateResponse":{"description":"Response from the PVM Accumulate function.\n","example":{"data":{"output":"Accumulated: Hello, PVM!"}},"properties":{"data":{"properties":{"output":{"description":"The output result from the PVM accumulator.","type":"string"}},"type":"object"}},"title":"AccumulateResponse","type":"object"},"Arbitrary":{"description":"An arbitrary but valid instance of a specific type.\n","example":{"codec":"0x66ce79ce829d0c80590356df94f6e958864ed7ac6661b688fe20e6f19f8b4ad48fb9fc0a814d2f71de2e84e7c43fd57bcbd31256d039e00bb08529c940173a03d2eaa7802aa688b35f8a82714b04cd36dff723b781ce61e8cddc98553090a0f068849c1af9e9759948f278f42aa0636b3e5c815d930aec18074205c8c30b221e42260e0f285b91ae7516b00d4c8c2c9f724f912da1def39fe4c45ff3b0caef3c4d18bb2a9f6879224bfa044505e2e3dd55200a4b4e4311505b6fd9953c78652b2ad978c04ef60043af294f81329b4364b5103cff71ec34a7166a18183ad32534ef9ad951d96ce1ec673eedc6f0bb4a55802800a2b9d49db7dd392d5e70e0cd8f5b4f9ee3aab227b61a286ed73a1e7f3f0eb08538657e4f2a683829c83b148405f21cb947443857956afc5b30db8a24d1cf154e9f4ee99e066caaa901571003a97178adf85fed49ef36a99380cd244502","json":"{\"bandersnatch\": \"0x66ce79ce829d0c80590356df94f6e958864ed7ac6661b688fe20e6f19f8b4ad4\", \"ed25519\": \"0x8fb9fc0a814d2f71de2e84e7c43fd57bcbd31256d039e00bb08529c940173a03\", \"bls\": \"0xd2eaa7802aa688b35f8a82714b04cd36dff723b781ce61e8cddc98553090a0f068849c1af9e9759948f278f42aa0636b3e5c815d930aec18074205c8c30b221e42260e0f285b91ae7516b00d4c8c2c9f724f912da1def39fe4c45ff3b0caef3c4d18bb2a9f6879224bfa044505e2e3dd55200a4b4e4311505b6fd9953c78652b2ad978c04ef60043af294f81329b4364\", \"metadata\": \"0xb5103cff71ec34a7166a18183ad32534ef9ad951d96ce1ec673eedc6f0bb4a55802800a2b9d49db7dd392d5e70e0cd8f5b4f9ee3aab227b61a286ed73a1e7f3f0eb08538657e4f2a683829c83b148405f21cb947443857956afc5b30db8a24d1cf154e9f4ee99e066caaa901571003a97178adf85fed49ef36a99380cd244502\"}"},"properties":{"codec":{"description":"CODEC hex value","pattern":"0x([a-f0-9][a-f0-9])+","type":"string"},"json":{"description":"JSON escaped string","type":"string"}},"title":"Arbitrary","type":"object"},"ArbitraryResponse":{"description":"An arbitrary instance of a specific type.\n","example":{"data":{"codec":"0x66ce79ce829d0c80590356df94f6e958864ed7ac6661b688fe20e6f19f8b4ad48fb9fc0a814d2f71de2e84e7c43fd57bcbd31256d039e00bb08529c940173a03d2eaa7802aa688b35f8a82714b04cd36dff723b781ce61e8cddc98553090a0f068849c1af9e9759948f278f42aa0636b3e5c815d930aec18074205c8c30b221e42260e0f285b91ae7516b00d4c8c2c9f724f912da1def39fe4c45ff3b0caef3c4d18bb2a9f6879224bfa044505e2e3dd55200a4b4e4311505b6fd9953c78652b2ad978c04ef60043af294f81329b4364b5103cff71ec34a7166a18183ad32534ef9ad951d96ce1ec673eedc6f0bb4a55802800a2b9d49db7dd392d5e70e0cd8f5b4f9ee3aab227b61a286ed73a1e7f3f0eb08538657e4f2a683829c83b148405f21cb947443857956afc5b30db8a24d1cf154e9f4ee99e066caaa901571003a97178adf85fed49ef36a99380cd244502","json":"{\"bandersnatch\": \"0x66ce79ce829d0c80590356df94f6e958864ed7ac6661b688fe20e6f19f8b4ad4\", \"ed25519\": \"0x8fb9fc0a814d2f71de2e84e7c43fd57bcbd31256d039e00bb08529c940173a03\", \"bls\": \"0xd2eaa7802aa688b35f8a82714b04cd36dff723b781ce61e8cddc98553090a0f068849c1af9e9759948f278f42aa0636b3e5c815d930aec18074205c8c30b221e42260e0f285b91ae7516b00d4c8c2c9f724f912da1def39fe4c45ff3b0caef3c4d18bb2a9f6879224bfa044505e2e3dd55200a4b4e4311505b6fd9953c78652b2ad978c04ef60043af294f81329b4364\", \"metadata\": \"0xb5103cff71ec34a7166a18183ad32534ef9ad951d96ce1ec673eedc6f0bb4a55802800a2b9d49db7dd392d5e70e0cd8f5b4f9ee3aab227b61a286ed73a1e7f3f0eb08538657e4f2a683829c83b148405f21cb947443857956afc5b30db8a24d1cf154e9f4ee99e066caaa901571003a97178adf85fed49ef36a99380cd244502\"}"}},"properties":{"data":{"$ref":"#/components/schemas/Arbitrary"}},"title":"ArbitraryResponse","type":"object"},"CodecParams":{"description":"Parameters for decoding a CODEC value to JSON.\n","example":{"codec":"0x66ce79ce829d0c80590356df94f6e958864ed7ac6661b688fe20e6f19f8b4ad48fb9fc0a814d2f71de2e84e7c43fd57bcbd31256d039e00bb08529c940173a03d2eaa7802aa688b35f8a82714b04cd36dff723b781ce61e8cddc98553090a0f068849c1af9e9759948f278f42aa0636b3e5c815d930aec18074205c8c30b221e42260e0f285b91ae7516b00d4c8c2c9f724f912da1def39fe4c45ff3b0caef3c4d18bb2a9f6879224bfa044505e2e3dd55200a4b4e4311505b6fd9953c78652b2ad978c04ef60043af294f81329b4364b5103cff71ec34a7166a18183ad32534ef9ad951d96ce1ec673eedc6f0bb4a55802800a2b9d49db7dd392d5e70e0cd8f5b4f9ee3aab227b61a286ed73a1e7f3f0eb08538657e4f2a683829c83b148405f21cb947443857956afc5b30db8a24d1cf154e9f4ee99e066caaa901571003a97178adf85fed49ef36a99380cd244502"},"properties":{"codec":{"description":"CODEC Hex value (0x prefixed)","pattern":"0x([a-f0-9][a-f0-9])+","type":"string"}},"required":["codec"],"title":"CodecParams","type":"object"},"CodecResponse":{"description":"A CODEC value.\n","example":{"data":{"codec":"0x66ce79ce829d0c80590356df94f6e958864ed7ac6661b688fe20e6f19f8b4ad48fb9fc0a814d2f71de2e84e7c43fd57bcbd31256d039e00bb08529c940173a03d2eaa7802aa688b35f8a82714b04cd36dff723b781ce61e8cddc98553090a0f068849c1af9e9759948f278f42aa0636b3e5c815d930aec18074205c8c30b221e42260e0f285b91ae7516b00d4c8c2c9f724f912da1def39fe4c45ff3b0caef3c4d18bb2a9f6879224bfa044505e2e3dd55200a4b4e4311505b6fd9953c78652b2ad978c04ef60043af294f81329b4364b5103cff71ec34a7166a18183ad32534ef9ad951d96ce1ec673eedc6f0bb4a55802800a2b9d49db7dd392d5e70e0cd8f5b4f9ee3aab227b61a286ed73a1e7f3f0eb08538657e4f2a683829c83b148405f21cb947443857956afc5b30db8a24d1cf154e9f4ee99e066caaa901571003a97178adf85fed49ef36a99380cd244502"}},"properties":{"data":{"properties":{"codec":{"description":"CODEC hex value (0x prefixed)","pattern":"0x([a-f0-9][a-f0-9])+","type":"string"}},"type":"object"}},"title":"CodecResponse","type":"object"},"JsonErrorResponse":{"properties":{"errors":{"items":{"properties":{"detail":{"example":"null value where string expected","type":"string"},"source":{"properties":{"pointer":{"example":"/data/attributes/petName","type":"string"}},"required":["pointer"],"type":"object"},"title":{"example":"Invalid value","type":"string"}},"required":["title","source","detail"],"type":"object"},"type":"array"}},"required":["errors"],"title":"JsonErrorResponse","type":"object"},"JsonParams":{"description":"Parameters for encoding a JSON value to CODEC.\n","example":{"json":"{\"bandersnatch\": \"0x66ce79ce829d0c80590356df94f6e958864ed7ac6661b688fe20e6f19f8b4ad4\", \"ed25519\": \"0x8fb9fc0a814d2f71de2e84e7c43fd57bcbd31256d039e00bb08529c940173a03\", \"bls\": \"0xd2eaa7802aa688b35f8a82714b04cd36dff723b781ce61e8cddc98553090a0f068849c1af9e9759948f278f42aa0636b3e5c815d930aec18074205c8c30b221e42260e0f285b91ae7516b00d4c8c2c9f724f912da1def39fe4c45ff3b0caef3c4d18bb2a9f6879224bfa044505e2e3dd55200a4b4e4311505b6fd9953c78652b2ad978c04ef60043af294f81329b4364\", \"metadata\": \"0xb5103cff71ec34a7166a18183ad32534ef9ad951d96ce1ec673eedc6f0bb4a55802800a2b9d49db7dd392d5e70e0cd8f5b4f9ee3aab227b61a286ed73a1e7f3f0eb08538657e4f2a683829c83b148405f21cb947443857956afc5b30db8a24d1cf154e9f4ee99e066caaa901571003a97178adf85fed49ef36a99380cd244502\"}"},"properties":{"json":{"description":"JSON escaped value","type":"string"}},"required":["json"],"title":"JsonParams","type":"object"},"JsonResponse":{"description":"A JSON value.\n","example":{"data":{"json":"{\"bandersnatch\": \"0x66ce79ce829d0c80590356df94f6e958864ed7ac6661b688fe20e6f19f8b4ad4\", \"ed25519\": \"0x8fb9fc0a814d2f71de2e84e7c43fd57bcbd31256d039e00bb08529c940173a03\", \"bls\": \"0xd2eaa7802aa688b35f8a82714b04cd36dff723b781ce61e8cddc98553090a0f068849c1af9e9759948f278f42aa0636b3e5c815d930aec18074205c8c30b221e42260e0f285b91ae7516b00d4c8c2c9f724f912da1def39fe4c45ff3b0caef3c4d18bb2a9f6879224bfa044505e2e3dd55200a4b4e4311505b6fd9953c78652b2ad978c04ef60043af294f81329b4364\", \"metadata\": \"0xb5103cff71ec34a7166a18183ad32534ef9ad951d96ce1ec673eedc6f0bb4a55802800a2b9d49db7dd392d5e70e0cd8f5b4f9ee3aab227b61a286ed73a1e7f3f0eb08538657e4f2a683829c83b148405f21cb947443857956afc5b30db8a24d1cf154e9f4ee99e066caaa901571003a97178adf85fed49ef36a99380cd244502\"}"}},"properties":{"data":{"properties":{"json":{"description":"JSON escaped value","type":"string"}},"type":"object"}},"title":"JsonResponse","type":"object"},"SequenceResponse":{"description":"A random integer sequence.\n","example":{"sequence":[1,2,6,0,7,4,3,5]},"properties":{"data":{"properties":{"sequence":{"description":"The generated sequence.","items":{"type":"integer"},"type":"array"}},"type":"object"}},"title":"SequenceResponse","type":"object"},"SequenceSeededParams":{"description":"Params for generating a random sequence from a 256-bit seed.\n","example":{"length":8,"seed":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"},"properties":{"length":{"description":"The length of the sequence to generate.","maximum":256,"minimum":0,"type":"integer"},"seed":{"description":"The seed to generate the sequence from. Must be a 256-bit hex string (0x prefixed).","pattern":"0x([a-f0-9][a-f0-9]){32}","type":"string"}},"required":["length","seed"],"title":"SequenceSeededParams","type":"object"},"ShuffleParams":{"description":"Parameters for the Fisher-Yates shuffle function.\n","example":{"indices":[1,1,4,0,7,3,2,5],"sequence":[0,1,2,3,4,5,6,7]},"properties":{"indices":{"description":"The indices to shuffle the sequence with. Called 'r' in the GrayPaper.","items":{"type":"integer"},"type":"array"},"sequence":{"description":"The input sequence to be shuffled. Called 's' in the GrayPaper.","items":{"type":"integer"},"type":"array"}},"required":["sequence","indices"],"title":"ShuffleParams","type":"object"},"ShuffleResponse":{"description":"A shuffled sequence.\n","example":{"sequence":[1,2,6,0,7,4,3,5]},"properties":{"data":{"properties":{"sequence":{"description":"The shuffled sequence.","items":{"type":"integer"},"type":"array"}},"type":"object"}},"title":"ShuffleResponse","type":"object"},"ShuffleSeededParams":{"description":"Parameters for the seeded Fisher-Yates shuffle function.\n","example":{"seed":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","sequence":[0,1,2,3,4,5,6,7]},"properties":{"seed":{"description":"Seed for the shuffle function. Must be a 256-bit hex string. Called 'h' in the GrayPaper.","pattern":"0x([a-f0-9][a-f0-9])+","type":"string"},"sequence":{"description":"The input sequence to be shuffled. Called 's' in the GrayPaper.","items":{"type":"integer"},"type":"array"}},"required":["sequence","seed"],"title":"ShuffleSeededParams","type":"object"},"Type":{"description":"A type as defined in the Graypaper.\n","example":{"id":"Header"},"properties":{"id":{"description":"Unique type name","pattern":"[a-zA-Z ]+","type":"string"}},"title":"Type","type":"object"},"TypesResponse":{"description":"A list of types as defined in the Graypaper.\n","example":{"data":[{"id":"ValidatorKeyTuple"},{"id":"AvailabilitySpec"}]},"properties":{"data":{"description":"Type list","items":{"$ref":"#/components/schemas/Type"},"type":"array"}},"title":"TypesResponse","type":"object"}}},"info":{"description":"Developer API of the GrayMatter JAM client.\n\nThis playground is intended to help implementor teams compare their encoding of data structures.  \nIt mainly focuses on CODEC, but should also work for JSON. The JSON names are the same as from the W3F test vectors.\n\nThe data here is our best guess as to what it **should** be, please open issues if you think otherwise: <https://github.com/JamBrains/jam-chain/issues>  \nLast updated: 2025-10-13\n","title":"JAM Dev API","version":"0.1.0-03b623"},"openapi":"3.0.0","paths":{"/api/v1/functions/fisher_yates":{"post":{"callbacks":{},"operationId":"Gm.OpenApiWeb.FunctionsController.fisher_yates","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShuffleParams"}}},"description":"Shuffle Params","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShuffleResponse"}}},"description":"Sequence"}},"summary":"Fisher-Yates shuffle function without seed.","tags":["Functions"]}},"/api/v1/functions/fisher_yates_seeded":{"post":{"callbacks":{},"operationId":"Gm.OpenApiWeb.FunctionsController.fisher_yates_seeded","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShuffleSeededParams"}}},"description":"Shuffle Seed Params","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShuffleResponse"}}},"description":"Sequence"}},"summary":"Fisher-Yates shuffle function with entropy seed.","tags":["Functions"]}},"/api/v1/functions/sequence_from_seed":{"post":{"callbacks":{},"operationId":"Gm.OpenApiWeb.FunctionsController.sequence_from_seed","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SequenceSeededParams"}}},"description":"Sequence Seed Params","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SequenceResponse"}}},"description":"Sequence"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonErrorResponse"}}},"description":"Unprocessable Entity"}},"summary":"Generate a random sequence from a 256-bit seed.","tags":["Functions"]}},"/api/v1/pvm/accumulate":{"post":{"callbacks":{},"description":"Can be used to prototype JAM services by using the [SDK by JamBrains](https://github.com/JamBrains/service-sdk)\n\nRun it with the Hello World example:\n\n```bash\ncurl -X POST http://127.0.0.1:4000/api/v1/pvm/accumulate \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json\" \\\n  -d \"$(curl -s https://raw.githubusercontent.com/JamBrains/service-sdk/5916acf8b6a6f866a8574c20e7f9ceefad2338d1/examples/01-hello-world.c | jq -Rs '{input: .}')\"\n```\n\nOr with a local `service.c` file:\n\n```bash\ncurl -X POST http://127.0.0.1:4000/api/v1/pvm/accumulate \\\n-H \"Content-Type: application/json\" \\\n-H \"Accept: application/json\" \\\n-d \"$(jq -n --rawfile input service.c '{input: $input}')\"\n```\n","operationId":"Gm.OpenApiWeb.PvmController.accumulate","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccumulateParams"}}},"description":"Accumulate Params","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccumulateResponse"}}},"description":"Success"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonErrorResponse"}}},"description":"Unprocessable Entity"}},"summary":"Compile and execute C Service SDK code with its accumulate entry point.","tags":["PVM"]}},"/api/v1/types":{"get":{"callbacks":{},"description":"An overview of all available types. Only a subset of types is exposed here for testing. More will follow.","operationId":"Gm.OpenApiWeb.TypesController.index","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TypesResponse"}}},"description":"Type list"}},"summary":"List all types.","tags":["Codec"]}},"/api/v1/types/{id}/arbitrary":{"get":{"callbacks":{},"description":"Return an arbitrary instance of the given type, encoded as CODEC and escaped JSON.","operationId":"Gm.OpenApiWeb.TypesController.arbitrary","parameters":[{"description":"Type name","example":"ValidatorKeyTuple","in":"path","name":"id","required":true,"schema":{"enum":["AvailabilitySpec","Bool","Credential","Culprit","CurrentValidators","Fault","General_int","PreviousValidators","RefinementContext","U16","U32","U64","U8","UncheckedTicket","ValidatorKeyTuple","ValidatorQueue","Verdict","Vote","WorkDigest","WorkReport"],"type":"string"}},{"description":"Seed for the random generator","in":"query","name":"seed","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArbitraryResponse"}}},"description":"success"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonErrorResponse"}}},"description":"Unprocessable Entity"}},"summary":"Generate an arbitrary and valid instance of a type.","tags":["Codec"]}},"/api/v1/types/{id}/codec_to_json":{"post":{"callbacks":{},"description":"This decodes the CODEC value into the given type and then re-encodes it as JSON.","operationId":"Gm.OpenApiWeb.TypesController.codec_to_json","parameters":[{"description":"Type name","example":"ValidatorKeyTuple","in":"path","name":"id","required":true,"schema":{"enum":["AvailabilitySpec","Bool","Credential","Culprit","CurrentValidators","Fault","General_int","PreviousValidators","RefinementContext","U16","U32","U64","U8","UncheckedTicket","ValidatorKeyTuple","ValidatorQueue","Verdict","Vote","WorkDigest","WorkReport"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodecParams"}}},"description":"Type Decode Params","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonResponse"}}},"description":"Type"}},"summary":"Convert a CODEC value to a JSON value.","tags":["Codec"]}},"/api/v1/types/{id}/json_to_codec":{"post":{"callbacks":{},"description":"This decodes the JSON value into the given type and then re-encodes it as CODEC.","operationId":"Gm.OpenApiWeb.TypesController.json_to_codec","parameters":[{"description":"Type name","example":"ValidatorKeyTuple","in":"path","name":"id","required":true,"schema":{"enum":["AvailabilitySpec","Bool","Credential","Culprit","CurrentValidators","Fault","General_int","PreviousValidators","RefinementContext","U16","U32","U64","U8","UncheckedTicket","ValidatorKeyTuple","ValidatorQueue","Verdict","Vote","WorkDigest","WorkReport"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonParams"}}},"description":"Type Decode Params","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodecResponse"}}},"description":"Type"}},"summary":"Convert a JSON value to a CODEC value.","tags":["Codec"]}}},"security":[],"servers":[{"url":"https://dev.jamcha.in","variables":{}}],"tags":[]}