UNPKG

@simbachain/libsimba-js

Version:

libsimba-js is a library simplifying the use of SIMBAChain APIs. We aim to abstract away the various blockchain concepts, reducing the necessary time needed to get to working code.

1,430 lines (1,429 loc) 1.34 MB
{ "type": "File", "start": 0, "end": 17000, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 460, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 17000, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 460, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 36, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 36 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 8, "end": 19, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 19 } }, "imported": { "type": "Identifier", "start": 8, "end": 19, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 19 }, "identifierName": "pollWrapper" }, "name": "pollWrapper" }, "local": { "type": "Identifier", "start": 8, "end": 19, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 19 }, "identifierName": "pollWrapper" }, "name": "pollWrapper" } } ], "source": { "type": "StringLiteral", "start": 26, "end": 35, "loc": { "start": { "line": 1, "column": 26 }, "end": { "line": 1, "column": 35 } }, "extra": { "rawValue": "poll-js", "raw": "\"poll-js\"" }, "value": "poll-js" } }, { "type": "ImportDeclaration", "start": 37, "end": 226, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 8, "column": 23 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 50, "end": 74, "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 28 } }, "imported": { "type": "Identifier", "start": 50, "end": 74, "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 28 }, "identifierName": "MissingMetadataException" }, "name": "MissingMetadataException" }, "local": { "type": "Identifier", "start": 50, "end": 74, "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 28 }, "identifierName": "MissingMetadataException" }, "name": "MissingMetadataException" } }, { "type": "ImportSpecifier", "start": 80, "end": 103, "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 27 } }, "imported": { "type": "Identifier", "start": 80, "end": 103, "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 27 }, "identifierName": "NotImplementedException" }, "name": "NotImplementedException" }, "local": { "type": "Identifier", "start": 80, "end": 103, "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 27 }, "identifierName": "NotImplementedException" }, "name": "NotImplementedException" } }, { "type": "ImportSpecifier", "start": 109, "end": 129, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 24 } }, "imported": { "type": "Identifier", "start": 109, "end": 129, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 24 }, "identifierName": "BadMetadataException" }, "name": "BadMetadataException" }, "local": { "type": "Identifier", "start": 109, "end": 129, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 24 }, "identifierName": "BadMetadataException" }, "name": "BadMetadataException" } }, { "type": "ImportSpecifier", "start": 135, "end": 172, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 41 } }, "imported": { "type": "Identifier", "start": 135, "end": 172, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 41 }, "identifierName": "MethodCallValidationMetadataException" }, "name": "MethodCallValidationMetadataException" }, "local": { "type": "Identifier", "start": 135, "end": 172, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 41 }, "identifierName": "MethodCallValidationMetadataException" }, "name": "MethodCallValidationMetadataException" } }, { "type": "ImportSpecifier", "start": 178, "end": 202, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 28 } }, "imported": { "type": "Identifier", "start": 178, "end": 202, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 28 }, "identifierName": "GetTransactionsException" }, "name": "GetTransactionsException" }, "local": { "type": "Identifier", "start": 178, "end": 202, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 28 }, "identifierName": "GetTransactionsException" }, "name": "GetTransactionsException" } } ], "source": { "type": "StringLiteral", "start": 210, "end": 225, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 22 } }, "extra": { "rawValue": "../exceptions", "raw": "'../exceptions'" }, "value": "../exceptions" } }, { "type": "ImportDeclaration", "start": 227, "end": 271, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 44 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 234, "end": 247, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 20 } }, "local": { "type": "Identifier", "start": 234, "end": 247, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 20 }, "identifierName": "PagedResponse" }, "name": "PagedResponse" } } ], "source": { "type": "StringLiteral", "start": 253, "end": 270, "loc": { "start": { "line": 9, "column": 26 }, "end": { "line": 9, "column": 43 } }, "extra": { "rawValue": "./pagedresponse", "raw": "\"./pagedresponse\"" }, "value": "./pagedresponse" }, "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @interface\n * Base class for libsimba API Interaction implementations\n ", "start": 273, "end": 353, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 14, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 354, "end": 16999, "loc": { "start": { "line": 15, "column": 0 }, "end": { "line": 459, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 369, "end": 16999, "loc": { "start": { "line": 15, "column": 15 }, "end": { "line": 459, "column": 1 } }, "id": { "type": "Identifier", "start": 375, "end": 384, "loc": { "start": { "line": 15, "column": 21 }, "end": { "line": 15, "column": 30 }, "identifierName": "SimbaBase" }, "name": "SimbaBase", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 385, "end": 16999, "loc": { "start": { "line": 15, "column": 31 }, "end": { "line": 459, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 598, "end": 4287, "loc": { "start": { "line": 21, "column": 4 }, "end": { "line": 99, "column": 5 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 598, "end": 609, "loc": { "start": { "line": 21, "column": 4 }, "end": { "line": 21, "column": 15 }, "identifierName": "constructor" }, "name": "constructor", "leadingComments": null }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 610, "end": 618, "loc": { "start": { "line": 21, "column": 16 }, "end": { "line": 21, "column": 24 }, "identifierName": "endpoint" }, "name": "endpoint" }, { "type": "Identifier", "start": 620, "end": 626, "loc": { "start": { "line": 21, "column": 26 }, "end": { "line": 21, "column": 32 }, "identifierName": "wallet" }, "name": "wallet" } ], "body": { "type": "BlockStatement", "start": 628, "end": 4287, "loc": { "start": { "line": 21, "column": 34 }, "end": { "line": 99, "column": 5 } }, "body": [ { "type": "IfStatement", "start": 638, "end": 777, "loc": { "start": { "line": 22, "column": 8 }, "end": { "line": 26, "column": 9 } }, "test": { "type": "UnaryExpression", "start": 642, "end": 665, "loc": { "start": { "line": 22, "column": 12 }, "end": { "line": 22, "column": 35 } }, "operator": "!", "prefix": true, "argument": { "type": "CallExpression", "start": 643, "end": 665, "loc": { "start": { "line": 22, "column": 13 }, "end": { "line": 22, "column": 35 } }, "callee": { "type": "MemberExpression", "start": 643, "end": 660, "loc": { "start": { "line": 22, "column": 13 }, "end": { "line": 22, "column": 30 } }, "object": { "type": "Identifier", "start": 643, "end": 651, "loc": { "start": { "line": 22, "column": 13 }, "end": { "line": 22, "column": 21 }, "identifierName": "endpoint" }, "name": "endpoint" }, "property": { "type": "Identifier", "start": 652, "end": 660, "loc": { "start": { "line": 22, "column": 22 }, "end": { "line": 22, "column": 30 }, "identifierName": "endsWith" }, "name": "endsWith" }, "computed": false }, "arguments": [ { "type": "StringLiteral", "start": 661, "end": 664, "loc": { "start": { "line": 22, "column": 31 }, "end": { "line": 22, "column": 34 } }, "extra": { "rawValue": "/", "raw": "'/'" }, "value": "/" } ] }, "extra": { "parenthesizedArgument": false } }, "consequent": { "type": "BlockStatement", "start": 667, "end": 722, "loc": { "start": { "line": 22, "column": 37 }, "end": { "line": 24, "column": 9 } }, "body": [ { "type": "ExpressionStatement", "start": 681, "end": 712, "loc": { "start": { "line": 23, "column": 12 }, "end": { "line": 23, "column": 43 } }, "expression": { "type": "AssignmentExpression", "start": 681, "end": 711, "loc": { "start": { "line": 23, "column": 12 }, "end": { "line": 23, "column": 42 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 681, "end": 694, "loc": { "start": { "line": 23, "column": 12 }, "end": { "line": 23, "column": 25 } }, "object": { "type": "ThisExpression", "start": 681, "end": 685, "loc": { "start": { "line": 23, "column": 12 }, "end": { "line": 23, "column": 16 } } }, "property": { "type": "Identifier", "start": 686, "end": 694, "loc": { "start": { "line": 23, "column": 17 }, "end": { "line": 23, "column": 25 }, "identifierName": "endpoint" }, "name": "endpoint" }, "computed": false }, "right": { "type": "TemplateLiteral", "start": 697, "end": 711, "loc": { "start": { "line": 23, "column": 28 }, "end": { "line": 23, "column": 42 } }, "expressions": [ { "type": "Identifier", "start": 700, "end": 708, "loc": { "start": { "line": 23, "column": 31 }, "end": { "line": 23, "column": 39 }, "identifierName": "endpoint" }, "name": "endpoint" } ], "quasis": [ { "type": "TemplateElement", "start": 698, "end": 698, "loc": { "start": { "line": 23, "column": 29 }, "end": { "line": 23, "column": 29 } }, "value": { "raw": "", "cooked": "" }, "tail": false }, { "type": "TemplateElement", "start": 709, "end": 710, "loc": { "start": { "line": 23, "column": 40 }, "end": { "line": 23, "column": 41 } }, "value": { "raw": "/", "cooked": "/" }, "tail": true } ] } } } ], "directives": [] }, "alternate": { "type": "BlockStatement", "start": 728, "end": 777, "loc": { "start": { "line": 24, "column": 15 }, "end": { "line": 26, "column": 9 } }, "body": [ { "type": "ExpressionStatement", "start": 742, "end": 767, "loc": { "start": { "line": 25, "column": 12 }, "end": { "line": 25, "column": 37 } }, "expression": { "type": "AssignmentExpression", "start": 742, "end": 766, "loc": { "start": { "line": 25, "column": 12 }, "end": { "line": 25, "column": 36 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 742, "end": 755, "loc": { "start": { "line": 25, "column": 12 }, "end": { "line": 25, "column": 25 } }, "object": { "type": "ThisExpression", "start": 742, "end": 746, "loc": { "start": { "line": 25, "column": 12 }, "end": { "line": 25, "column": 16 } } }, "property": { "type": "Identifier", "start": 747, "end": 755, "loc": { "start": { "line": 25, "column": 17 }, "end": { "line": 25, "column": 25 }, "identifierName": "endpoint" }, "name": "endpoint" }, "computed": false }, "right": { "type": "Identifier", "start": 758, "end": 766, "loc": { "start": { "line": 25, "column": 28 }, "end": { "line": 25, "column": 36 }, "identifierName": "endpoint" }, "name": "endpoint" } } } ], "directives": [] } }, { "type": "ExpressionStatement", "start": 786, "end": 807, "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 29 } }, "expression": { "type": "AssignmentExpression", "start": 786, "end": 806, "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 28 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 786, "end": 797, "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 19 } }, "object": { "type": "ThisExpression", "start": 786, "end": 790, "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 12 } } }, "property": { "type": "Identifier", "start": 791, "end": 797, "loc": { "start": { "line": 27, "column": 13 }, "end": { "line": 27, "column": 19 }, "identifierName": "wallet" }, "name": "wallet" }, "computed": false }, "right": { "type": "Identifier", "start": 800, "end": 806, "loc": { "start": { "line": 27, "column": 22 }, "end": { "line": 27, "column": 28 }, "identifierName": "wallet" }, "name": "wallet" } } }, { "type": "ExpressionStatement", "start": 817, "end": 836, "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 27 } }, "expression": { "type": "AssignmentExpression", "start": 817, "end": 835, "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 26 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 817, "end": 830, "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 21 } }, "object": { "type": "ThisExpression", "start": 817, "end": 821, "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 12 } } }, "property": { "type": "Identifier", "start": 822, "end": 830, "loc": { "start": { "line": 29, "column": 13 }, "end": { "line": 29, "column": 21 }, "identifierName": "metadata" }, "name": "metadata" }, "computed": false }, "right": { "type": "ObjectExpression", "start": 833, "end": 835, "loc": { "start": { "line": 29, "column": 24 }, "end": { "line": 29, "column": 26 } }, "properties": [] } } }, { "type": "IfStatement", "start": 846, "end": 1031, "loc": { "start": { "line": 31, "column": 8 }, "end": { "line": 34, "column": 9 } }, "test": { "type": "BinaryExpression", "start": 850, "end": 880, "loc": { "start": { "line": 31, "column": 12 }, "end": { "line": 31, "column": 42 } }, "left": { "type": "MemberExpression", "start": 850, "end": 866, "loc": { "start": { "line": 31, "column": 12 }, "end": { "line": 31, "column": 28 } }, "object": { "type": "ThisExpression", "start": 850, "end": 854, "loc": { "start": { "line": 31, "column": 12 }, "end": { "line": 31, "column": 16 } } }, "property": { "type": "Identifier", "start": 855, "end": 866, "loc": { "start": { "line": 31, "column": 17 }, "end": { "line": 31, "column": 28 }, "identifierName": "constructor" }, "name": "constructor" }, "computed": false }, "operator": "===", "right": { "type": "Identifier", "start": 871, "end": 880, "loc": { "start": { "line": 31, "column": 33 }, "end": { "line": 31, "column": 42 }, "identifierName": "SimbaBase" }, "name": "SimbaBase" } }, "consequent": { "type": "BlockStatement", "start": 882, "end": 1031, "loc": { "start": { "line": 31, "column": 44 }, "end": { "line": 34, "column": 9 } }, "body": [ { "type": "ThrowStatement", "start": 964, "end": 1021, "loc": { "start": { "line": 33, "column": 12 }, "end": { "line": 33, "column": 69 } }, "argument": { "type": "NewExpression", "start": 970, "end": 1020, "loc": { "start": { "line": 33, "column": 18 }, "end": { "line": 33, "column": 68 } }, "callee": { "type": "Identifier", "start": 974, "end": 983, "loc": { "start": { "line": 33, "column": 22 }, "end": { "line": 33, "column": 31 }, "identifierName": "TypeError" }, "name": "TypeError" }, "arguments": [ { "type": "StringLiteral", "start": 984, "end": 1019, "loc": { "start": { "line": 33, "column": 32 }, "end": { "line": 33, "column": 67 } }, "extra": { "rawValue": "Can not construct abstract class.", "raw": "'Can not construct abstract class.'" }, "value": "Can not construct abstract class." } ], "leadingComments": null }, "leadingComments": [ { "type": "CommentLine", "value": " Error Type 1. Abstract class can not be constructed.", "start": 896, "end": 951, "loc": { "start": { "line": 32, "column": 12 }, "end": { "line": 32,