@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,333 lines (1,332 loc) • 209 kB
JSON
{
"type": "File",
"start": 0,
"end": 1793,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 78,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 1793,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 78,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ExportDefaultDeclaration",
"start": 39,
"end": 1792,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 77,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 54,
"end": 1792,
"loc": {
"start": {
"line": 4,
"column": 15
},
"end": {
"line": 77,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 60,
"end": 73,
"loc": {
"start": {
"line": 4,
"column": 21
},
"end": {
"line": 4,
"column": 34
},
"identifierName": "PagedResponse"
},
"name": "PagedResponse",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 74,
"end": 1792,
"loc": {
"start": {
"line": 4,
"column": 35
},
"end": {
"line": 77,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 320,
"end": 570,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 18,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 320,
"end": 331,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor",
"leadingComments": null
},
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 332,
"end": 336,
"loc": {
"start": {
"line": 11,
"column": 16
},
"end": {
"line": 11,
"column": 20
},
"identifierName": "data"
},
"name": "data"
},
{
"type": "Identifier",
"start": 338,
"end": 341,
"loc": {
"start": {
"line": 11,
"column": 22
},
"end": {
"line": 11,
"column": 25
},
"identifierName": "url"
},
"name": "url"
},
{
"type": "Identifier",
"start": 343,
"end": 348,
"loc": {
"start": {
"line": 11,
"column": 27
},
"end": {
"line": 11,
"column": 32
},
"identifierName": "simba"
},
"name": "simba"
}
],
"body": {
"type": "BlockStatement",
"start": 349,
"end": 570,
"loc": {
"start": {
"line": 11,
"column": 33
},
"end": {
"line": 18,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 359,
"end": 383,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 32
}
},
"expression": {
"type": "AssignmentExpression",
"start": 359,
"end": 382,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 31
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 359,
"end": 367,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 16
}
},
"object": {
"type": "ThisExpression",
"start": 359,
"end": 363,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 364,
"end": 367,
"loc": {
"start": {
"line": 12,
"column": 13
},
"end": {
"line": 12,
"column": 16
},
"identifierName": "url"
},
"name": "url"
},
"computed": false
},
"right": {
"type": "NewExpression",
"start": 370,
"end": 382,
"loc": {
"start": {
"line": 12,
"column": 19
},
"end": {
"line": 12,
"column": 31
}
},
"callee": {
"type": "Identifier",
"start": 374,
"end": 377,
"loc": {
"start": {
"line": 12,
"column": 23
},
"end": {
"line": 12,
"column": 26
},
"identifierName": "URL"
},
"name": "URL"
},
"arguments": [
{
"type": "Identifier",
"start": 378,
"end": 381,
"loc": {
"start": {
"line": 12,
"column": 27
},
"end": {
"line": 12,
"column": 30
},
"identifierName": "url"
},
"name": "url"
}
]
}
}
},
{
"type": "ExpressionStatement",
"start": 392,
"end": 417,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 33
}
},
"expression": {
"type": "AssignmentExpression",
"start": 392,
"end": 416,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 32
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 392,
"end": 403,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 19
}
},
"object": {
"type": "ThisExpression",
"start": 392,
"end": 396,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 397,
"end": 403,
"loc": {
"start": {
"line": 13,
"column": 13
},
"end": {
"line": 13,
"column": 19
},
"identifierName": "_count"
},
"name": "_count"
},
"computed": false
},
"right": {
"type": "MemberExpression",
"start": 406,
"end": 416,
"loc": {
"start": {
"line": 13,
"column": 22
},
"end": {
"line": 13,
"column": 32
}
},
"object": {
"type": "Identifier",
"start": 406,
"end": 410,
"loc": {
"start": {
"line": 13,
"column": 22
},
"end": {
"line": 13,
"column": 26
},
"identifierName": "data"
},
"name": "data"
},
"property": {
"type": "Identifier",
"start": 411,
"end": 416,
"loc": {
"start": {
"line": 13,
"column": 27
},
"end": {
"line": 13,
"column": 32
},
"identifierName": "count"
},
"name": "count"
},
"computed": false
}
}
},
{
"type": "ExpressionStatement",
"start": 426,
"end": 454,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 36
}
},
"expression": {
"type": "AssignmentExpression",
"start": 426,
"end": 453,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 35
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 426,
"end": 441,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 23
}
},
"object": {
"type": "ThisExpression",
"start": 426,
"end": 430,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 431,
"end": 441,
"loc": {
"start": {
"line": 14,
"column": 13
},
"end": {
"line": 14,
"column": 23
},
"identifierName": "_next_page"
},
"name": "_next_page"
},
"computed": false
},
"right": {
"type": "MemberExpression",
"start": 444,
"end": 453,
"loc": {
"start": {
"line": 14,
"column": 26
},
"end": {
"line": 14,
"column": 35
}
},
"object": {
"type": "Identifier",
"start": 444,
"end": 448,
"loc": {
"start": {
"line": 14,
"column": 26
},
"end": {
"line": 14,
"column": 30
},
"identifierName": "data"
},
"name": "data"
},
"property": {
"type": "Identifier",
"start": 449,
"end": 453,
"loc": {
"start": {
"line": 14,
"column": 31
},
"end": {
"line": 14,
"column": 35
},
"identifierName": "next"
},
"name": "next"
},
"computed": false
}
}
},
{
"type": "ExpressionStatement",
"start": 463,
"end": 499,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 44
}
},
"expression": {
"type": "AssignmentExpression",
"start": 463,
"end": 498,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 43
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 463,
"end": 482,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 27
}
},
"object": {
"type": "ThisExpression",
"start": 463,
"end": 467,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 468,
"end": 482,
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 15,
"column": 27
},
"identifierName": "_previous_page"
},
"name": "_previous_page"
},
"computed": false
},
"right": {
"type": "MemberExpression",
"start": 485,
"end": 498,
"loc": {
"start": {
"line": 15,
"column": 30
},
"end": {
"line": 15,
"column": 43
}
},
"object": {
"type": "Identifier",
"start": 485,
"end": 489,
"loc": {
"start": {
"line": 15,
"column": 30
},
"end": {
"line": 15,
"column": 34
},
"identifierName": "data"
},
"name": "data"
},
"property": {
"type": "Identifier",
"start": 490,
"end": 498,
"loc": {
"start": {
"line": 15,
"column": 35
},
"end": {
"line": 15,
"column": 43
},
"identifierName": "previous"
},
"name": "previous"
},
"computed": false
}
}
},
{
"type": "ExpressionStatement",
"start": 508,
"end": 536,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 36
}
},
"expression": {
"type": "AssignmentExpression",
"start": 508,
"end": 535,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 35
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 508,
"end": 520,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 20
}
},
"object": {
"type": "ThisExpression",
"start": 508,
"end": 512,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 513,
"end": 520,
"loc": {
"start": {
"line": 16,
"column": 13
},
"end": {
"line": 16,
"column": 20
},
"identifierName": "results"
},
"name": "results"
},
"computed": false
},
"right": {
"type": "MemberExpression",
"start": 523,
"end": 535,
"loc": {
"start": {
"line": 16,
"column": 23
},
"end": {
"line": 16,
"column": 35
}
},
"object": {
"type": "Identifier",
"start": 523,
"end": 527,
"loc": {
"start": {
"line": 16,
"column": 23
},
"end": {
"line": 16,
"column": 27
},
"identifierName": "data"
},
"name": "data"
},
"property": {
"type": "Identifier",
"start": 528,
"end": 535,
"loc": {
"start": {
"line": 16,
"column": 28
},
"end": {
"line": 16,
"column": 35
},
"identifierName": "results"
},
"name": "results"
},
"computed": false
}
}
},
{
"type": "ExpressionStatement",
"start": 545,
"end": 564,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 27
}
},
"expression": {
"type": "AssignmentExpression",
"start": 545,
"end": 563,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 26
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 545,
"end": 555,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 18
}
},
"object": {
"type": "ThisExpression",
"start": 545,
"end": 549,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 550,
"end": 555,
"loc": {
"start": {
"line": 17,
"column": 13
},
"end": {
"line": 17,
"column": 18
},
"identifierName": "simba"
},
"name": "simba"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 558,
"end": 563,
"loc": {
"start": {
"line": 17,
"column": 21
},
"end": {
"line": 17,
"column": 26
},
"identifierName": "simba"
},
"name": "simba"
}
}
}
],
"directives": [],
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * Wrapper for paged responses\n * @param {Object} data - The response\n * @param {URL} url - The URL that provided the response\n * @param {SimbaBase} simba - The SimbaBase instance that requested the response\n ",
"start": 80,
"end": 315,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 10,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * Grab the next page\n * @returns {Promise<PagedResponse> | null} - Null if there's no next page\n ",
"start": 576,
"end": 692,
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 23,
"column": 7
}
}
}
]
},
{
"type": "ClassMethod",
"start": 697,
"end": 834,
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 27,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 703,
"end": 707,
"loc": {
"start": {
"line": 24,
"column": 10
},
"end": {
"line": 24,
"column": 14
},
"identifierName": "next"
},
"name": "next"
},
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": true,
"params": [],
"body": {
"type": "BlockStatement",
"start": 709,
"end": 834,
"loc": {
"start": {
"line": 24,
"column": 16
},
"end": {
"line": 27,
"column": 5
}
},
"body": [
{
"type": "IfStatement",
"start": 719,
"end": 752,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 41
}
},
"test": {
"type": "UnaryExpression",
"start": 722,
"end": 738,
"loc": {
"start": {
"line": 25,
"column": 11
},
"end": {
"line": 25,
"column": 27
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "MemberExpression",
"start": 723,
"end": 738,
"loc": {
"start": {
"line": 25,
"column": 12
},
"end": {
"line": 25,
"column": 27
}
},
"object": {
"type": "ThisExpression",
"start": 723,
"end": 727,
"loc": {
"start": {
"line": 25,
"column": 12
},
"end": {
"line": 25,
"column": 16
}
}
},
"property": {
"type": "Identifier",
"start": 728,
"end": 738,
"loc": {
"start": {
"line": 25,
"column": 17
},
"end": {
"line": 25,
"column": 27
},
"identifierName": "_next_page"
},
"name": "_next_page"
},
"computed": false
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "ReturnStatement",
"start": 740,
"end": 752,
"loc": {
"start": {
"line": 25,
"column": 29
},
"end": {
"line": 25,
"column": 41
}
},
"argument": {
"type": "NullLiteral",
"start": 747,
"end": 751,
"loc": {
"start": {
"line": 25,
"column": 36
},
"end": {
"line": 25,
"column": 40
}
}
}
},
"alternate": null
},
{
"type": "ReturnStatement",
"start": 761,
"end": 828,
"loc": {
"start": {
"line": 26,
"column": 8
},
"end": {
"line": 26,
"column": 75
}
},
"argument": {
"type": "CallExpression",
"start": 768,
"end": 827,
"loc": {
"start": {
"line": 26,
"column": 15
},
"end": {
"line": 26,
"column": 74
}
},
"callee": {
"type": "MemberExpression",
"start": 768,
"end": 801,
"loc": {
"start": {
"line": 26,
"column": 15
},
"end": {
"line": 26,
"column": 48
}
},
"object": {
"type": "MemberExpression",
"start": 768,
"end": 778,
"loc": {
"start": {
"line": 26,
"column": 15
},
"end": {
"line": 26,
"column": 25
}
},
"object": {
"type": "ThisExpression",
"start": 768,
"end": 772,
"loc": {
"start": {
"line": 26,
"column": 15
},
"end": {
"line": 26,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"start": 773,
"end": 778,
"loc": {
"start": {
"line": 26,
"column": 20
},
"end": {
"line": 26,
"column": 25
},
"identifierName": "simba"
},
"name": "simba"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 779,
"end": 801,
"loc": {
"start": {
"line": 26,
"column": 26
},
"end": {
"line": 26,
"column": 48
},
"identifierName": "sendTransactionRequest"
},
"name": "sendTransactionRequest"
},
"computed": false
},
"arguments": [
{
"type": "NewExpression",
"start": 802,
"end": 826,
"loc": {
"start": {
"line": 26,
"column": 49
},
"end": {
"line": 26,
"column": 73
}
},
"callee": {
"type": "Identifier",
"start": 806,
"end": 809,
"loc": {
"start": {
"line": 26,
"column": 53
},
"end": {
"line": 26,
"column": 56
},
"identifierName": "URL"
},
"name": "URL"
},
"arguments": [
{
"type": "MemberExpression",
"start": 810,
"end": 825,
"loc": {
"start": {
"line": 26,
"column": 57
},
"end": {
"line": 26,
"column": 72
}
},
"object": {
"type": "ThisExpression",
"start": 810,
"end": 814,
"loc": {
"start": {
"line": 26,
"column": 57
},
"end": {
"line": 26,
"column": 61
}
}
},
"property": {
"type": "Identifier",
"start": 815,
"end": 825,
"loc": {
"start": {
"line": 26,
"column": 62
},
"end": {
"line": 26,