spec/APIProperties.js

  1. /*
  2. * Copyright (C) 2021-2022 Algodex VASP (BVI) Corp.
  3. *
  4. * This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  7. */
  8. /**
  9. * API Properties Specification
  10. *
  11. * @typedef {Object} APIProperties
  12. * @property {Config} config Configuration
  13. * @property {Asset} asset Asset
  14. * @property {Wallet} wallet Wallet
  15. * @namespace APIProperties
  16. */
  17. /**
  18. * JSON Schema Specification
  19. * @type {Schema}
  20. * @name APIPropertiesSchema
  21. * @memberOf Schema
  22. */
  23. module.exports = {
  24. '$schema': 'http://json-schema.org/draft-07/schema',
  25. '$id': 'https://schemas.algodex.com/v1/Algodex.json',
  26. 'title': 'API',
  27. 'type': 'object',
  28. 'examples': [
  29. {
  30. 'type': 'API',
  31. 'config': {
  32. 'algod': {
  33. 'uri': 'https://testnet.algoexplorerapi.io',
  34. 'token': '',
  35. },
  36. 'indexer': {
  37. 'uri': 'https://algoindexer.testnet.algoexplorerapi.io',
  38. 'token': '',
  39. },
  40. 'dexd': {
  41. 'uri': 'https://testnet.algodex.com/algodex-backend',
  42. 'token': '',
  43. },
  44. },
  45. 'asset': {
  46. 'id': 224234,
  47. },
  48. 'wallet': {
  49. 'address': 'WYWRYK42XADLY3O62N52BOLT27DMPRA3WNBT2OBRT65N6OEZQWD4OSH6PI',
  50. 'type': 'my-algo-wallet',
  51. 'assets': {224234: {'balance': 9, 'name': 'Amazing'}},
  52. },
  53. },
  54. ],
  55. 'properties': {
  56. 'type': {
  57. 'const': 'API',
  58. },
  59. 'config': {
  60. '$ref': 'https://schemas.algodex.com/v1/Config.json',
  61. },
  62. 'asset': {
  63. '$ref': 'https://schemas.algodex.com/v1/Asset.json',
  64. },
  65. 'wallet': {
  66. '$ref': 'https://schemas.algodex.com/v1/Wallet.json',
  67. },
  68. },
  69. 'required': ['config'],
  70. };
  71. JAVASCRIPT
    Copied!