@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,471 lines (1,470 loc) • 1.39 MB
JSON
{
"type": "File",
"start": 0,
"end": 18020,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 469,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 18020,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 469,
"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": 38,
"end": 233,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 8,
"column": 23
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 52,
"end": 76,
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 28
}
},
"imported": {
"type": "Identifier",
"start": 52,
"end": 76,
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 28
},
"identifierName": "MissingMetadataException"
},
"name": "MissingMetadataException"
},
"local": {
"type": "Identifier",
"start": 52,
"end": 76,
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 28
},
"identifierName": "MissingMetadataException"
},
"name": "MissingMetadataException"
}
},
{
"type": "ImportSpecifier",
"start": 83,
"end": 106,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 27
}
},
"imported": {
"type": "Identifier",
"start": 83,
"end": 106,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 27
},
"identifierName": "NotImplementedException"
},
"name": "NotImplementedException"
},
"local": {
"type": "Identifier",
"start": 83,
"end": 106,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 27
},
"identifierName": "NotImplementedException"
},
"name": "NotImplementedException"
}
},
{
"type": "ImportSpecifier",
"start": 113,
"end": 133,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 24
}
},
"imported": {
"type": "Identifier",
"start": 113,
"end": 133,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 24
},
"identifierName": "BadMetadataException"
},
"name": "BadMetadataException"
},
"local": {
"type": "Identifier",
"start": 113,
"end": 133,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 24
},
"identifierName": "BadMetadataException"
},
"name": "BadMetadataException"
}
},
{
"type": "ImportSpecifier",
"start": 140,
"end": 177,
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 6,
"column": 41
}
},
"imported": {
"type": "Identifier",
"start": 140,
"end": 177,
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 6,
"column": 41
},
"identifierName": "MethodCallValidationMetadataException"
},
"name": "MethodCallValidationMetadataException"
},
"local": {
"type": "Identifier",
"start": 140,
"end": 177,
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 6,
"column": 41
},
"identifierName": "MethodCallValidationMetadataException"
},
"name": "MethodCallValidationMetadataException"
}
},
{
"type": "ImportSpecifier",
"start": 184,
"end": 208,
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 28
}
},
"imported": {
"type": "Identifier",
"start": 184,
"end": 208,
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 28
},
"identifierName": "GetTransactionsException"
},
"name": "GetTransactionsException"
},
"local": {
"type": "Identifier",
"start": 184,
"end": 208,
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 28
},
"identifierName": "GetTransactionsException"
},
"name": "GetTransactionsException"
}
}
],
"source": {
"type": "StringLiteral",
"start": 217,
"end": 232,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 22
}
},
"extra": {
"rawValue": "../exceptions",
"raw": "'../exceptions'"
},
"value": "../exceptions"
}
},
{
"type": "ImportDeclaration",
"start": 235,
"end": 279,
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 9,
"column": 44
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 242,
"end": 255,
"loc": {
"start": {
"line": 9,
"column": 7
},
"end": {
"line": 9,
"column": 20
}
},
"local": {
"type": "Identifier",
"start": 242,
"end": 255,
"loc": {
"start": {
"line": 9,
"column": 7
},
"end": {
"line": 9,
"column": 20
},
"identifierName": "PagedResponse"
},
"name": "PagedResponse"
}
}
],
"source": {
"type": "StringLiteral",
"start": 261,
"end": 278,
"loc": {
"start": {
"line": 9,
"column": 26
},
"end": {
"line": 9,
"column": 43
}
},
"extra": {
"rawValue": "./pagedresponse",
"raw": "\"./pagedresponse\""
},
"value": "./pagedresponse"
},
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * @interface\r\n * Base class for libsimba API Interaction implementations\r\n ",
"start": 283,
"end": 366,
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 14,
"column": 3
}
}
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 368,
"end": 18018,
"loc": {
"start": {
"line": 15,
"column": 0
},
"end": {
"line": 468,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 383,
"end": 18018,
"loc": {
"start": {
"line": 15,
"column": 15
},
"end": {
"line": 468,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 389,
"end": 398,
"loc": {
"start": {
"line": 15,
"column": 21
},
"end": {
"line": 15,
"column": 30
},
"identifierName": "SimbaBase"
},
"name": "SimbaBase",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 399,
"end": 18018,
"loc": {
"start": {
"line": 15,
"column": 31
},
"end": {
"line": 468,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 618,
"end": 4385,
"loc": {
"start": {
"line": 21,
"column": 4
},
"end": {
"line": 99,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 618,
"end": 629,
"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": 630,
"end": 638,
"loc": {
"start": {
"line": 21,
"column": 16
},
"end": {
"line": 21,
"column": 24
},
"identifierName": "endpoint"
},
"name": "endpoint"
},
{
"type": "Identifier",
"start": 640,
"end": 646,
"loc": {
"start": {
"line": 21,
"column": 26
},
"end": {
"line": 21,
"column": 32
},
"identifierName": "wallet"
},
"name": "wallet"
}
],
"body": {
"type": "BlockStatement",
"start": 648,
"end": 4385,
"loc": {
"start": {
"line": 21,
"column": 34
},
"end": {
"line": 99,
"column": 5
}
},
"body": [
{
"type": "IfStatement",
"start": 659,
"end": 802,
"loc": {
"start": {
"line": 22,
"column": 8
},
"end": {
"line": 26,
"column": 9
}
},
"test": {
"type": "UnaryExpression",
"start": 663,
"end": 686,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 22,
"column": 35
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "CallExpression",
"start": 664,
"end": 686,
"loc": {
"start": {
"line": 22,
"column": 13
},
"end": {
"line": 22,
"column": 35
}
},
"callee": {
"type": "MemberExpression",
"start": 664,
"end": 681,
"loc": {
"start": {
"line": 22,
"column": 13
},
"end": {
"line": 22,
"column": 30
}
},
"object": {
"type": "Identifier",
"start": 664,
"end": 672,
"loc": {
"start": {
"line": 22,
"column": 13
},
"end": {
"line": 22,
"column": 21
},
"identifierName": "endpoint"
},
"name": "endpoint"
},
"property": {
"type": "Identifier",
"start": 673,
"end": 681,
"loc": {
"start": {
"line": 22,
"column": 22
},
"end": {
"line": 22,
"column": 30
},
"identifierName": "endsWith"
},
"name": "endsWith"
},
"computed": false
},
"arguments": [
{
"type": "StringLiteral",
"start": 682,
"end": 685,
"loc": {
"start": {
"line": 22,
"column": 31
},
"end": {
"line": 22,
"column": 34
}
},
"extra": {
"rawValue": "/",
"raw": "'/'"
},
"value": "/"
}
]
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "BlockStatement",
"start": 688,
"end": 745,
"loc": {
"start": {
"line": 22,
"column": 37
},
"end": {
"line": 24,
"column": 9
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 703,
"end": 734,
"loc": {
"start": {
"line": 23,
"column": 12
},
"end": {
"line": 23,
"column": 43
}
},
"expression": {
"type": "AssignmentExpression",
"start": 703,
"end": 733,
"loc": {
"start": {
"line": 23,
"column": 12
},
"end": {
"line": 23,
"column": 42
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 703,
"end": 716,
"loc": {
"start": {
"line": 23,
"column": 12
},
"end": {
"line": 23,
"column": 25
}
},
"object": {
"type": "ThisExpression",
"start": 703,
"end": 707,
"loc": {
"start": {
"line": 23,
"column": 12
},
"end": {
"line": 23,
"column": 16
}
}
},
"property": {
"type": "Identifier",
"start": 708,
"end": 716,
"loc": {
"start": {
"line": 23,
"column": 17
},
"end": {
"line": 23,
"column": 25
},
"identifierName": "endpoint"
},
"name": "endpoint"
},
"computed": false
},
"right": {
"type": "TemplateLiteral",
"start": 719,
"end": 733,
"loc": {
"start": {
"line": 23,
"column": 28
},
"end": {
"line": 23,
"column": 42
}
},
"expressions": [
{
"type": "Identifier",
"start": 722,
"end": 730,
"loc": {
"start": {
"line": 23,
"column": 31
},
"end": {
"line": 23,
"column": 39
},
"identifierName": "endpoint"
},
"name": "endpoint"
}
],
"quasis": [
{
"type": "TemplateElement",
"start": 720,
"end": 720,
"loc": {
"start": {
"line": 23,
"column": 29
},
"end": {
"line": 23,
"column": 29
}
},
"value": {
"raw": "",
"cooked": ""
},
"tail": false
},
{
"type": "TemplateElement",
"start": 731,
"end": 732,
"loc": {
"start": {
"line": 23,
"column": 40
},
"end": {
"line": 23,
"column": 41
}
},
"value": {
"raw": "/",
"cooked": "/"
},
"tail": true
}
]
}
}
}
],
"directives": []
},
"alternate": {
"type": "BlockStatement",
"start": 751,
"end": 802,
"loc": {
"start": {
"line": 24,
"column": 15
},
"end": {
"line": 26,
"column": 9
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 766,
"end": 791,
"loc": {
"start": {
"line": 25,
"column": 12
},
"end": {
"line": 25,
"column": 37
}
},
"expression": {
"type": "AssignmentExpression",
"start": 766,
"end": 790,
"loc": {
"start": {
"line": 25,
"column": 12
},
"end": {
"line": 25,
"column": 36
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 766,
"end": 779,
"loc": {
"start": {
"line": 25,
"column": 12
},
"end": {
"line": 25,
"column": 25
}
},
"object": {
"type": "ThisExpression",
"start": 766,
"end": 770,
"loc": {
"start": {
"line": 25,
"column": 12
},
"end": {
"line": 25,
"column": 16
}
}
},
"property": {
"type": "Identifier",
"start": 771,
"end": 779,
"loc": {
"start": {
"line": 25,
"column": 17
},
"end": {
"line": 25,
"column": 25
},
"identifierName": "endpoint"
},
"name": "endpoint"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 782,
"end": 790,
"loc": {
"start": {
"line": 25,
"column": 28
},
"end": {
"line": 25,
"column": 36
},
"identifierName": "endpoint"
},
"name": "endpoint"
}
}
}
],
"directives": []
}
},
{
"type": "ExpressionStatement",
"start": 812,
"end": 833,
"loc": {
"start": {
"line": 27,
"column": 8
},
"end": {
"line": 27,
"column": 29
}
},
"expression": {
"type": "AssignmentExpression",
"start": 812,
"end": 832,
"loc": {
"start": {
"line": 27,
"column": 8
},
"end": {
"line": 27,
"column": 28
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 812,
"end": 823,
"loc": {
"start": {
"line": 27,
"column": 8
},
"end": {
"line": 27,
"column": 19
}
},
"object": {
"type": "ThisExpression",
"start": 812,
"end": 816,
"loc": {
"start": {
"line": 27,
"column": 8
},
"end": {
"line": 27,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 817,
"end": 823,
"loc": {
"start": {
"line": 27,
"column": 13
},
"end": {
"line": 27,
"column": 19
},
"identifierName": "wallet"
},
"name": "wallet"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 826,
"end": 832,
"loc": {
"start": {
"line": 27,
"column": 22
},
"end": {
"line": 27,
"column": 28
},
"identifierName": "wallet"
},
"name": "wallet"
}
}
},
{
"type": "ExpressionStatement",
"start": 845,
"end": 864,
"loc": {
"start": {
"line": 29,
"column": 8
},
"end": {
"line": 29,
"column": 27
}
},
"expression": {
"type": "AssignmentExpression",
"start": 845,
"end": 863,
"loc": {
"start": {
"line": 29,
"column": 8
},
"end": {
"line": 29,
"column": 26
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 845,
"end": 858,
"loc": {
"start": {
"line": 29,
"column": 8
},
"end": {
"line": 29,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 845,
"end": 849,
"loc": {
"start": {
"line": 29,
"column": 8
},
"end": {
"line": 29,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 850,
"end": 858,
"loc": {
"start": {
"line": 29,
"column": 13
},
"end": {
"line": 29,
"column": 21
},
"identifierName": "metadata"
},
"name": "metadata"
},
"computed": false
},
"right": {
"type": "ObjectExpression",
"start": 861,
"end": 863,
"loc": {
"start": {
"line": 29,
"column": 24
},
"end": {
"line": 29,
"column": 26
}
},
"properties": []
}
}
},
{
"type": "IfStatement",
"start": 876,
"end": 1064,
"loc": {
"start": {
"line": 31,
"column": 8
},
"end": {
"line": 34,
"column": 9
}
},
"test": {
"type": "BinaryExpression",
"start": 880,
"end": 910,
"loc": {
"start": {
"line": 31,
"column": 12
},
"end": {
"line": 31,
"column": 42
}
},
"left": {
"type": "MemberExpression",
"start": 880,
"end": 896,
"loc": {
"start": {
"line": 31,
"column": 12
},
"end": {
"line": 31,
"column": 28
}
},
"object": {
"type": "ThisExpression",
"start": 880,
"end": 884,
"loc": {
"start": {
"line": 31,
"column": 12
},
"end": {
"line": 31,
"column": 16
}
}
},
"property": {
"type": "Identifier",
"start": 885,
"end": 896,
"loc": {
"start": {
"line": 31,
"column": 17
},
"end": {
"line": 31,
"column": 28
},
"identifierName": "constructor"
},
"name": "constructor"
},
"computed": false
},
"operator": "===",
"right": {
"type": "Identifier",
"start": 901,
"end": 910,
"loc": {
"start": {
"line": 31,
"column": 33
},
"end": {
"line": 31,
"column": 42
},
"identifierName": "SimbaBase"
},
"name": "SimbaBase"
}
},
"consequent": {
"type": "BlockStatement",
"start": 912,
"end": 1064,
"loc": {
"start": {
"line": 31,
"column": 44
},
"end": {
"line": 34,
"column": 9
}
},
"body": [
{
"type": "ThrowStatement",
"start": 996,
"end": 1053,
"loc": {
"start": {
"line": 33,
"column": 12
},
"end": {
"line": 33,
"column": 69
}
},
"argument": {
"type": "NewExpression",
"start": 1002,
"end": 1052,
"loc": {
"start": {
"line": 33,
"column": 18
},
"end": {
"line": 33,
"column": 68
}
},
"callee": {
"type": "Identifier",
"start": 1006,
"end": 1015,
"loc": {
"start": {
"line": 33,
"column": 22
},
"end": {
"line": 33,
"column": 31
},
"identifierName": "TypeError"
},
"name": "TypeError"
},
"arguments": [
{
"type": "StringLiteral",
"start": 1016,
"end": 1051,
"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": 927,
"end": 982,
"loc": {
"start": {
"line": 32,
"column": 12
},
"end": {
"line": 32,
"column": 67
}
}
}
]
}
],
"directives": []
},
"alternate": null
},
{
"type": "IfStatement",
"start": 1076,
"end": 1240,
"loc": {
"start": {
"line": 36,
"column": 8
},
"end": {
"line": 38,
"column": 9
}
},
"test": {
"type": "BinaryExpression",
"start": 1080,
"end": 1130,
"loc": {
"start": {
"line": 36,
"column": 12
},
"end": {
"line": 36,
"column": 62
}
},
"left": {
"type": "MemberExpression",