Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✅ Acceptance: Add JSON Schema for Transaction types #25

Open
atrefonas opened this issue Mar 4, 2022 · 2 comments
Open

✅ Acceptance: Add JSON Schema for Transaction types #25

atrefonas opened this issue Mar 4, 2022 · 2 comments
Assignees

Comments

@atrefonas
Copy link
Contributor

ℹ Overview

Add the following schema and validation with ajv. Use https://www.jsonschema.net/home to generate the schema.

The objects should look like:


  const Transaction = {
    type: 'sendToMailbox',
    assetId: 224234,
    fromWallet: 'WYWRYK42XADLY3O62N52BOLT27DMPRA3WNBT2OBRT65N6OEZQWD4OSH6PI',
    destinationWallets: [
        {
          toAddress: 'WYWRYK42XADLY3O62N52BOLT27DMPRA3WNBT2OBRT65N6OEZQWD4OSH6PI',
          amount: 123231
         },
        {
          toAddress: 'OOU3O5OSZGVFE5C3KZKH33TSD77UFB445OWVHDBYI6BB542HWU3A6ZLFHI',
          amount: 4242
         }
    ]
    /*          {
            "pattern": "[A-Z0-9]{58}",
            "type": "string",
            "description": "An account public key",
            "name": "address",
            "in": "path",
            "required": true
          },*/
  };

  const Transaction2 = {
    type: 'redeemFromMailbox',
    assetId: 224234,
    ownerWallet: 'WYWRYK42XADLY3O62N52BOLT27DMPRA3WNBT2OBRT65N6OEZQWD4OSH6PI',
    
  };

@PhearZero PhearZero self-assigned this Mar 7, 2022
@create-issue-branch
Copy link

@atrefonas
Copy link
Contributor Author

This should also flag the first validation error it finds and print that to the screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants