forked from Peersyst/near-mobile-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi-spec.json
1 lines (1 loc) · 6.56 KB
/
openapi-spec.json
1
{"openapi":"3.0.0","paths":{"/api/signer-request":{"post":{"operationId":"createSignerRequest","summary":"Create signer request","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSignerRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignerRequestDto"}}}}},"tags":["signer-request"]}},"/api/signer-request/{id}/status":{"get":{"operationId":"getSignerRequestStatus","summary":"Get signer request status","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignerRequestStatusDto"}}}}},"tags":["signer-request"]}},"/api/signer-request/{id}/approve":{"post":{"operationId":"approveSignerRequest","summary":"Approve signer request","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignerRequestDto"}}}}},"tags":["signer-request"]}},"/api/signer-request/{id}/reject":{"post":{"operationId":"rejectSignerRequest","summary":"Reject signer request","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignerRequestDto"}}}}},"tags":["signer-request"]}},"/api/signer-request/{id}":{"get":{"operationId":"getSignerRequest","summary":"Get signer request","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignerRequestDto"}}}}},"tags":["signer-request"]}},"/api/signer-request/message":{"post":{"operationId":"createSignMessageRequest","summary":"Send message to signer","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSignMessageRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignMessageRequestDto"}}}}},"tags":["signer-request"]}},"/api/signer-request/message/{id}":{"get":{"operationId":"getSignMessageRequest","summary":"Get signer message request","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignMessageRequestDto"}}}}},"tags":["signer-request"]}},"/api/signer-request/message/{id}/sign":{"post":{"operationId":"signMessageRequest","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignMessageRequestPayload"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignMessageRequestDto"}}}}},"tags":["signer-request"]}},"/api/signer-request/message/{id}/reject":{"post":{"operationId":"rejectMessageRequest","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignMessageRequestDto"}}}}},"tags":["signer-request"]}}},"info":{"title":"backend","description":"Base backend API","version":"0.0.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"SignerTransactionDto":{"type":"object","properties":{"signerId":{"type":"string"},"receiverId":{"type":"string"},"actions":{"type":"array","items":{"type":"object"}}},"required":["actions"]},"DAppMetadatRequest":{"type":"object","properties":{}},"CreateSignerRequest":{"type":"object","properties":{"network":{"type":"string","enum":["mainnet","testnet"]},"transactions":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/SignerTransactionDto"}]}},"dAppMetadata":{"$ref":"#/components/schemas/DAppMetadatRequest"}},"required":["network","transactions"]},"DAppMetadataDto":{"type":"object","properties":{"name":{"type":"string"},"logoUrl":{"type":"string"},"url":{"type":"string"}},"required":["name","logoUrl"]},"SignerRequestDto":{"type":"object","properties":{"id":{"type":"string"},"status":{"enum":["pending","approved","rejected"],"type":"string"},"network":{"enum":["mainnet","testnet"],"type":"string"},"signerAccountId":{"type":"string"},"requests":{"type":"array","items":{"type":"object"}},"dAppMetadata":{"$ref":"#/components/schemas/DAppMetadataDto"},"txHash":{"type":"array","items":{"type":"string"}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","status","network","signerAccountId","requests","createdAt","updatedAt"]},"SignerRequestStatusDto":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected"]}},"required":["id","status"]},"SignRequest":{"type":"object","properties":{"signerAccountId":{"type":"string"},"txHash":{"type":"array","items":{"type":"string"}}},"required":["signerAccountId","txHash"]},"CreateSignMessageRequest":{"type":"object","properties":{"network":{"type":"string","enum":["mainnet","testnet"],"example":"testnet"},"message":{"type":"string","example":"Hello World"},"receiver":{"type":"string","example":"receiver"},"nonce":{"type":"array","items":{"type":"number"}},"callbackUrl":{"type":"string","example":"https://callback.url"},"receiverMetadata":{"$ref":"#/components/schemas/DAppMetadatRequest"}},"required":["network","message","receiver","nonce"]},"SignMessageRequestDto":{"type":"object","properties":{"id":{"type":"string"},"message":{"type":"string"},"receiver":{"type":"string"},"nonce":{"type":"array","items":{"type":"number"}},"callbackUrl":{"type":"string"},"network":{"enum":["mainnet","testnet"],"type":"string"},"response":{"type":"object"},"receiverMetadata":{"$ref":"#/components/schemas/DAppMetadataDto"},"status":{"enum":["pending","approved","rejected"],"type":"string"}},"required":["id","message","receiver","nonce","network","response","status"]},"SignMessageRequestPayload":{"type":"object","properties":{"accountId":{"type":"string","example":"near.testnet"},"signature":{"type":"string","example":"signature"},"publicKey":{"type":"string","example":"publicKey"}},"required":["accountId","signature","publicKey"]}}}}