@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,449 lines (1,448 loc) • 502 kB
JSON
{
"type": "File",
"start": 0,
"end": 4502,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 176,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 4502,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 176,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ExportNamedDeclaration",
"start": 62,
"end": 661,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 21,
"column": 1
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "ClassDeclaration",
"start": 69,
"end": 661,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 21,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 75,
"end": 88,
"loc": {
"start": {
"line": 4,
"column": 13
},
"end": {
"line": 4,
"column": 26
},
"identifierName": "BaseException"
},
"name": "BaseException",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 97,
"end": 102,
"loc": {
"start": {
"line": 4,
"column": 35
},
"end": {
"line": 4,
"column": 40
},
"identifierName": "Error"
},
"name": "Error"
},
"body": {
"type": "ClassBody",
"start": 102,
"end": 661,
"loc": {
"start": {
"line": 4,
"column": 40
},
"end": {
"line": 21,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 306,
"end": 659,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 20,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 306,
"end": 317,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor",
"leadingComments": null
},
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 318,
"end": 325,
"loc": {
"start": {
"line": 10,
"column": 16
},
"end": {
"line": 10,
"column": 23
},
"identifierName": "message"
},
"name": "message"
},
{
"type": "Identifier",
"start": 327,
"end": 332,
"loc": {
"start": {
"line": 10,
"column": 25
},
"end": {
"line": 10,
"column": 30
},
"identifierName": "cause"
},
"name": "cause"
}
],
"body": {
"type": "BlockStatement",
"start": 333,
"end": 659,
"loc": {
"start": {
"line": 10,
"column": 31
},
"end": {
"line": 20,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 343,
"end": 351,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 16
}
},
"expression": {
"type": "CallExpression",
"start": 343,
"end": 350,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 15
}
},
"callee": {
"type": "Super",
"start": 343,
"end": 348,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 13
}
}
},
"arguments": []
}
},
{
"type": "ExpressionStatement",
"start": 360,
"end": 388,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 36
}
},
"expression": {
"type": "AssignmentExpression",
"start": 360,
"end": 387,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 35
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 360,
"end": 369,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 17
}
},
"object": {
"type": "ThisExpression",
"start": 360,
"end": 364,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 365,
"end": 369,
"loc": {
"start": {
"line": 12,
"column": 13
},
"end": {
"line": 12,
"column": 17
},
"identifierName": "name"
},
"name": "name"
},
"computed": false
},
"right": {
"type": "StringLiteral",
"start": 372,
"end": 387,
"loc": {
"start": {
"line": 12,
"column": 20
},
"end": {
"line": 12,
"column": 35
}
},
"extra": {
"rawValue": "BaseException",
"raw": "'BaseException'"
},
"value": "BaseException"
}
}
},
{
"type": "ExpressionStatement",
"start": 397,
"end": 420,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 31
}
},
"expression": {
"type": "AssignmentExpression",
"start": 397,
"end": 419,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 30
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 397,
"end": 409,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 20
}
},
"object": {
"type": "ThisExpression",
"start": 397,
"end": 401,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 402,
"end": 409,
"loc": {
"start": {
"line": 13,
"column": 13
},
"end": {
"line": 13,
"column": 20
},
"identifierName": "message"
},
"name": "message"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 412,
"end": 419,
"loc": {
"start": {
"line": 13,
"column": 23
},
"end": {
"line": 13,
"column": 30
},
"identifierName": "message"
},
"name": "message"
}
}
},
{
"type": "ExpressionStatement",
"start": 429,
"end": 448,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 27
}
},
"expression": {
"type": "AssignmentExpression",
"start": 429,
"end": 447,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 26
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 429,
"end": 439,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 18
}
},
"object": {
"type": "ThisExpression",
"start": 429,
"end": 433,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 434,
"end": 439,
"loc": {
"start": {
"line": 14,
"column": 13
},
"end": {
"line": 14,
"column": 18
},
"identifierName": "cause"
},
"name": "cause"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 442,
"end": 447,
"loc": {
"start": {
"line": 14,
"column": 21
},
"end": {
"line": 14,
"column": 26
},
"identifierName": "cause"
},
"name": "cause"
}
},
"trailingComments": [
{
"type": "CommentLine",
"value": " Maintains proper stack trace for where our error was thrown (only available on V8)",
"start": 458,
"end": 543,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 93
}
}
}
]
},
{
"type": "IfStatement",
"start": 552,
"end": 653,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 19,
"column": 9
}
},
"test": {
"type": "MemberExpression",
"start": 556,
"end": 579,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 35
}
},
"object": {
"type": "Identifier",
"start": 556,
"end": 561,
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 17
},
"identifierName": "Error"
},
"name": "Error",
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 562,
"end": 579,
"loc": {
"start": {
"line": 17,
"column": 18
},
"end": {
"line": 17,
"column": 35
},
"identifierName": "captureStackTrace"
},
"name": "captureStackTrace"
},
"computed": false,
"leadingComments": null
},
"consequent": {
"type": "BlockStatement",
"start": 581,
"end": 653,
"loc": {
"start": {
"line": 17,
"column": 37
},
"end": {
"line": 19,
"column": 9
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 595,
"end": 643,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 60
}
},
"expression": {
"type": "CallExpression",
"start": 595,
"end": 642,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 59
}
},
"callee": {
"type": "MemberExpression",
"start": 595,
"end": 618,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 35
}
},
"object": {
"type": "Identifier",
"start": 595,
"end": 600,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 17
},
"identifierName": "Error"
},
"name": "Error"
},
"property": {
"type": "Identifier",
"start": 601,
"end": 618,
"loc": {
"start": {
"line": 18,
"column": 18
},
"end": {
"line": 18,
"column": 35
},
"identifierName": "captureStackTrace"
},
"name": "captureStackTrace"
},
"computed": false
},
"arguments": [
{
"type": "ThisExpression",
"start": 619,
"end": 623,
"loc": {
"start": {
"line": 18,
"column": 36
},
"end": {
"line": 18,
"column": 40
}
}
},
{
"type": "MemberExpression",
"start": 625,
"end": 641,
"loc": {
"start": {
"line": 18,
"column": 42
},
"end": {
"line": 18,
"column": 58
}
},
"object": {
"type": "ThisExpression",
"start": 625,
"end": 629,
"loc": {
"start": {
"line": 18,
"column": 42
},
"end": {
"line": 18,
"column": 46
}
}
},
"property": {
"type": "Identifier",
"start": 630,
"end": 641,
"loc": {
"start": {
"line": 18,
"column": 47
},
"end": {
"line": 18,
"column": 58
},
"identifierName": "constructor"
},
"name": "constructor"
},
"computed": false
}
]
}
}
],
"directives": []
},
"alternate": null,
"leadingComments": [
{
"type": "CommentLine",
"value": " Maintains proper stack trace for where our error was thrown (only available on V8)",
"start": 458,
"end": 543,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 93
}
}
}
]
}
],
"directives": []
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * Base exception that all libsimba Exceptions extend\n * @param {string} message - the error message\n * @param {Error|string} [cause] - (Optional) wrap an existing error\n ",
"start": 108,
"end": 301,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 9,
"column": 7
}
}
}
]
}
],
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * Base exception that all libsimba Exceptions extend\n ",
"start": 0,
"end": 61,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * Thrown when a method that should be implemented is not\n ",
"start": 663,
"end": 728,
"loc": {
"start": {
"line": 23,
"column": 0
},
"end": {
"line": 25,
"column": 3
}
}
}
]
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * Base exception that all libsimba Exceptions extend\n ",
"start": 0,
"end": 61,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * Thrown when a method that should be implemented is not\n ",
"start": 663,
"end": 728,
"loc": {
"start": {
"line": 23,
"column": 0
},
"end": {
"line": 25,
"column": 3
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"start": 729,
"end": 893,
"loc": {
"start": {
"line": 26,
"column": 0
},
"end": {
"line": 31,
"column": 1
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "ClassDeclaration",
"start": 736,
"end": 893,
"loc": {
"start": {
"line": 26,
"column": 7
},
"end": {
"line": 31,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 742,
"end": 765,
"loc": {
"start": {
"line": 26,
"column": 13
},
"end": {
"line": 26,
"column": 36
},
"identifierName": "NotImplementedException"
},
"name": "NotImplementedException",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 774,
"end": 787,
"loc": {
"start": {
"line": 26,
"column": 45
},
"end": {
"line": 26,
"column": 58
},
"identifierName": "BaseException"
},
"name": "BaseException"
},
"body": {
"type": "ClassBody",
"start": 787,
"end": 893,
"loc": {
"start": {
"line": 26,
"column": 58
},
"end": {
"line": 31,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 793,
"end": 891,
"loc": {
"start": {
"line": 27,
"column": 4
},
"end": {
"line": 30,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 793,
"end": 804,
"loc": {
"start": {
"line": 27,
"column": 4
},
"end": {
"line": 27,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor"
},
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "RestElement",
"start": 805,
"end": 812,
"loc": {
"start": {
"line": 27,
"column": 16
},
"end": {
"line": 27,
"column": 23
}
},
"argument": {
"type": "Identifier",
"start": 808,
"end": 812,
"loc": {
"start": {
"line": 27,
"column": 19
},
"end": {
"line": 27,
"column": 23
},
"identifierName": "args"
},
"name": "args"
}
}
],
"body": {
"type": "BlockStatement",
"start": 813,
"end": 891,
"loc": {
"start": {
"line": 27,
"column": 24
},
"end": {
"line": 30,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 823,
"end": 838,
"loc": {
"start": {
"line": 28,
"column": 8
},
"end": {
"line": 28,
"column": 23
}
},
"expression": {
"type": "CallExpression",
"start": 823,
"end": 837,
"loc": {
"start": {
"line": 28,
"column": 8
},
"end": {
"line": 28,
"column": 22
}
},
"callee": {
"type": "Super",
"start": 823,
"end": 828,
"loc": {
"start": {
"line": 28,
"column": 8
},
"end": {
"line": 28,
"column": 13
}
}
},
"arguments": [
{
"type": "SpreadElement",
"start": 829,
"end": 836,
"loc": {
"start": {
"line": 28,
"column": 14
},
"end": {
"line": 28,
"column": 21
}
},
"argument": {
"type": "Identifier",
"start": 832,
"end": 836,
"loc": {
"start": {
"line": 28,
"column": 17
},
"end": {
"line": 28,
"column": 21
},
"identifierName": "args"
},
"name": "args"
}
}
]
}
},
{
"type": "ExpressionStatement",
"start": 847,
"end": 885,
"loc": {
"start": {
"line": 29,
"column": 8
},
"end": {
"line": 29,
"column": 46
}
},
"expression": {
"type": "AssignmentExpression",
"start": 847,
"end": 884,
"loc": {
"start": {
"line": 29,
"column": 8
},
"end": {
"line": 29,
"column": 45
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 847,
"end": 856,
"loc": {
"start": {
"line": 29,
"column": 8
},
"end": {
"line": 29,
"column": 17
}
},
"object": {
"type": "ThisExpression",
"start": 847,
"end": 851,
"loc": {
"start": {
"line": 29,
"column": 8
},
"end": {
"line": 29,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 852,
"end": 856,
"loc": {
"start": {
"line": 29,
"column": 13
},
"end": {
"line": 29,
"column": 17
},
"identifierName": "name"
},
"name": "name"
},
"computed": false
},
"right": {
"type": "StringLiteral",
"start": 859,
"end": 884,
"loc": {
"start": {
"line": 29,
"column": 20
},
"end": {
"line": 29,
"column": 45
}
},
"extra": {
"rawValue": "NotImplementedException",
"raw": "'NotImplementedException'"
},
"value": "NotImplementedException"
}
}
}
],
"directives": []
}
}
],
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * Thrown when a method that should be implemented is not\n ",
"start": 663,
"end": 728,
"loc": {
"start": {
"line": 23,
"column": 0
},
"end": {
"line": 25,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * Thrown when a method on a class inheriting [SimbaBase]{@link SimbaBase} is called before\n * metadata is retrieved.\n ",
"start": 895,
"end": 1020,
"loc": {
"start": {
"line": 33,
"column": 0
},
"end": {
"line": 36,
"column": 3
}
}
}
]
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * Thrown when a method that should be implemented is not\n ",
"start": 663,
"end": 728,
"loc": {
"start": {
"line": 23,
"column": 0
},
"end": {
"line": 25,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * Thrown when a method on a class inheriting [SimbaBase]{@link SimbaBase} is called before\n * metadata is retrieved.\n ",
"start": 895,
"end": 1020,
"loc": {
"start": {
"line": 33,
"column": 0
},
"end": {
"line": 36,
"column": 3
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"start": 1021,
"end": 1187,
"loc": {
"start": {
"line": 37,
"column": 0
},
"end": {
"line": 42,
"column": 1
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "ClassDeclaration",
"start": 1028,
"end": 1187,
"loc": {
"start": {
"line": 37,
"column": 7
},
"end": {
"line": 42,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 1034,
"end": 1058,
"loc": {
"start": {
"line": 37,
"column": 13
},
"end": {
"line": 37,
"column": 37
},
"identifierName": "MissingMetadataException"
},
"name": "MissingMetadataException",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 1067,
"end": 1080,
"loc": {
"start": {
"line": 37,
"column": 46
},
"end": {
"line": 37,
"column": 59
},
"identifierName": "BaseException"
},
"name": "BaseException"
},
"body": {
"type": "ClassBody",
"start": 1080,
"end": 1187,
"loc": {
"start": {
"line": 37,
"column": 59
},
"end": {
"line": 42,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 1086,
"end": 1185,
"loc": {
"start": {
"line": 38,
"column": 4
},
"end": {
"line": 41,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 1086,
"end": 1097,
"loc": {
"start": {
"line": 38,
"column": 4
},
"end": {
"line": 38,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor"
},
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [