@bosonprotocol/core-sdk 1.16.0-alpha.22 → 1.16.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +104 -3
  2. package/dist/cjs/core-sdk.d.ts +1 -38
  3. package/dist/cjs/core-sdk.d.ts.map +1 -1
  4. package/dist/cjs/core-sdk.js +1 -80
  5. package/dist/cjs/core-sdk.js.map +1 -1
  6. package/dist/cjs/exchanges/handler.d.ts +0 -3
  7. package/dist/cjs/exchanges/handler.d.ts.map +1 -1
  8. package/dist/cjs/exchanges/handler.js +11 -34
  9. package/dist/cjs/exchanges/handler.js.map +1 -1
  10. package/dist/cjs/exchanges/interface.d.ts +0 -1
  11. package/dist/cjs/exchanges/interface.d.ts.map +1 -1
  12. package/dist/cjs/exchanges/interface.js +1 -7
  13. package/dist/cjs/exchanges/interface.js.map +1 -1
  14. package/dist/cjs/index.d.ts +1 -1
  15. package/dist/cjs/index.d.ts.map +1 -1
  16. package/dist/cjs/index.js.map +1 -1
  17. package/dist/cjs/meta-tx/handler.d.ts +1 -20
  18. package/dist/cjs/meta-tx/handler.d.ts.map +1 -1
  19. package/dist/cjs/meta-tx/handler.js +1 -61
  20. package/dist/cjs/meta-tx/handler.js.map +1 -1
  21. package/dist/cjs/subgraph.d.ts +265 -2833
  22. package/dist/cjs/subgraph.d.ts.map +1 -1
  23. package/dist/cjs/subgraph.js +41 -287
  24. package/dist/cjs/subgraph.js.map +1 -1
  25. package/dist/cjs/utils/graphql.d.ts +0 -43
  26. package/dist/cjs/utils/graphql.d.ts.map +1 -1
  27. package/dist/esm/core-sdk.d.ts +1 -38
  28. package/dist/esm/core-sdk.d.ts.map +1 -1
  29. package/dist/esm/core-sdk.js +1 -77
  30. package/dist/esm/core-sdk.js.map +1 -1
  31. package/dist/esm/exchanges/handler.d.ts +0 -3
  32. package/dist/esm/exchanges/handler.d.ts.map +1 -1
  33. package/dist/esm/exchanges/handler.js +12 -32
  34. package/dist/esm/exchanges/handler.js.map +1 -1
  35. package/dist/esm/exchanges/interface.d.ts +0 -1
  36. package/dist/esm/exchanges/interface.d.ts.map +1 -1
  37. package/dist/esm/exchanges/interface.js +0 -5
  38. package/dist/esm/exchanges/interface.js.map +1 -1
  39. package/dist/esm/index.d.ts +1 -1
  40. package/dist/esm/index.d.ts.map +1 -1
  41. package/dist/esm/index.js.map +1 -1
  42. package/dist/esm/meta-tx/handler.d.ts +1 -20
  43. package/dist/esm/meta-tx/handler.d.ts.map +1 -1
  44. package/dist/esm/meta-tx/handler.js +0 -56
  45. package/dist/esm/meta-tx/handler.js.map +1 -1
  46. package/dist/esm/subgraph.d.ts +265 -2833
  47. package/dist/esm/subgraph.d.ts.map +1 -1
  48. package/dist/esm/subgraph.js +39 -284
  49. package/dist/esm/subgraph.js.map +1 -1
  50. package/dist/esm/utils/graphql.d.ts +0 -43
  51. package/dist/esm/utils/graphql.d.ts.map +1 -1
  52. package/package.json +3 -3
  53. package/src/accounts/queries.graphql +0 -63
  54. package/src/core-sdk.ts +2 -117
  55. package/src/disputes/queries.graphql +9 -9
  56. package/src/exchanges/handler.ts +20 -50
  57. package/src/exchanges/interface.ts +0 -6
  58. package/src/exchanges/queries.graphql +9 -9
  59. package/src/index.ts +1 -2
  60. package/src/meta-tx/handler.ts +2 -84
  61. package/src/metadata/base.graphql +0 -2
  62. package/src/metadata/product-v1.graphql +1 -2
  63. package/src/offers/queries.graphql +0 -3
  64. package/src/subgraph.ts +258 -2621
  65. package/dist/cjs/event-logs/index.d.ts +0 -2
  66. package/dist/cjs/event-logs/index.d.ts.map +0 -1
  67. package/dist/cjs/event-logs/index.js +0 -28
  68. package/dist/cjs/event-logs/index.js.map +0 -1
  69. package/dist/cjs/event-logs/subgraph.d.ts +0 -3
  70. package/dist/cjs/event-logs/subgraph.d.ts.map +0 -1
  71. package/dist/cjs/event-logs/subgraph.js +0 -22
  72. package/dist/cjs/event-logs/subgraph.js.map +0 -1
  73. package/dist/cjs/meta-tx/biconomy.d.ts +0 -45
  74. package/dist/cjs/meta-tx/biconomy.d.ts.map +0 -1
  75. package/dist/cjs/meta-tx/biconomy.js +0 -76
  76. package/dist/cjs/meta-tx/biconomy.js.map +0 -1
  77. package/dist/cjs/utils/errors.d.ts +0 -5
  78. package/dist/cjs/utils/errors.d.ts.map +0 -1
  79. package/dist/cjs/utils/errors.js +0 -11
  80. package/dist/cjs/utils/errors.js.map +0 -1
  81. package/dist/esm/event-logs/index.d.ts +0 -2
  82. package/dist/esm/event-logs/index.d.ts.map +0 -1
  83. package/dist/esm/event-logs/index.js +0 -2
  84. package/dist/esm/event-logs/index.js.map +0 -1
  85. package/dist/esm/event-logs/subgraph.d.ts +0 -3
  86. package/dist/esm/event-logs/subgraph.d.ts.map +0 -1
  87. package/dist/esm/event-logs/subgraph.js +0 -7
  88. package/dist/esm/event-logs/subgraph.js.map +0 -1
  89. package/dist/esm/meta-tx/biconomy.d.ts +0 -45
  90. package/dist/esm/meta-tx/biconomy.d.ts.map +0 -1
  91. package/dist/esm/meta-tx/biconomy.js +0 -60
  92. package/dist/esm/meta-tx/biconomy.js.map +0 -1
  93. package/dist/esm/utils/errors.d.ts +0 -5
  94. package/dist/esm/utils/errors.d.ts.map +0 -1
  95. package/dist/esm/utils/errors.js +0 -8
  96. package/dist/esm/utils/errors.js.map +0 -1
  97. package/src/event-logs/index.ts +0 -1
  98. package/src/event-logs/queries.graphql +0 -53
  99. package/src/event-logs/subgraph.ts +0 -14
  100. package/src/meta-tx/biconomy.ts +0 -129
  101. package/src/utils/errors.ts +0 -5
@@ -1,2 +0,0 @@
1
- export * as subgraph from "./subgraph";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/event-logs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.subgraph = void 0;
27
- exports.subgraph = __importStar(require("./subgraph"));
28
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/event-logs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAuC"}
@@ -1,3 +0,0 @@
1
- import { GetEventLogsQueryQueryVariables, BaseEventLogFieldsFragment } from "../subgraph";
2
- export declare function getEventLogs(subgraphUrl: string, queryVars?: GetEventLogsQueryQueryVariables): Promise<BaseEventLogFieldsFragment[]>;
3
- //# sourceMappingURL=subgraph.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subgraph.d.ts","sourceRoot":"","sources":["../../../src/event-logs/subgraph.ts"],"names":[],"mappings":"AACA,OAAO,EACL,+BAA+B,EAC/B,0BAA0B,EAC3B,MAAM,aAAa,CAAC;AAErB,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,SAAS,GAAE,+BAAoC,GAC9C,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAIvC"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getEventLogs = void 0;
13
- const graphql_1 = require("../utils/graphql");
14
- function getEventLogs(subgraphUrl, queryVars = {}) {
15
- return __awaiter(this, void 0, void 0, function* () {
16
- const subgraphSdk = (0, graphql_1.getSubgraphSdk)(subgraphUrl);
17
- const { eventLogs = [] } = yield subgraphSdk.getEventLogsQuery(queryVars);
18
- return eventLogs;
19
- });
20
- }
21
- exports.getEventLogs = getEventLogs;
22
- //# sourceMappingURL=subgraph.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subgraph.js","sourceRoot":"","sources":["../../../src/event-logs/subgraph.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAAkD;AAMlD,SAAsB,YAAY,CAChC,WAAmB,EACnB,YAA6C,EAAE;;QAE/C,MAAM,WAAW,GAAG,IAAA,wBAAc,EAAC,WAAW,CAAC,CAAC;QAChD,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,MAAM,WAAW,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAC1E,OAAO,SAAS,CAAC;IACnB,CAAC;CAAA;AAPD,oCAOC"}
@@ -1,45 +0,0 @@
1
- export declare type RelayTransactionResponse = {
2
- txHash: string;
3
- log: string;
4
- retryDuration: number;
5
- flag: number;
6
- };
7
- export declare type RelayTransactionArgs = {
8
- to: string;
9
- params: unknown[];
10
- from: string;
11
- };
12
- export declare type RelayOverrides = {
13
- relayerUrl: string;
14
- apiKey: string;
15
- apiId: string;
16
- };
17
- export declare type GetRetriedHashesResponse = {
18
- code: number;
19
- message: string;
20
- data: {
21
- oldHash: string;
22
- newHash: string;
23
- oldGasPrice: string;
24
- newGasPrice: string;
25
- timestamp: number;
26
- retryCount: number;
27
- relayerAddress: string;
28
- newStatus: string;
29
- };
30
- events?: unknown[];
31
- };
32
- export declare type GetRetriedHashesArgs = {
33
- networkId: number;
34
- transactionHash: string;
35
- };
36
- export declare class Biconomy {
37
- private _relayerUrl;
38
- private _apiKey;
39
- private _apiId;
40
- constructor(_relayerUrl: string, _apiKey: string, _apiId: string);
41
- relayTransaction(args: RelayTransactionArgs, overrides?: Partial<RelayOverrides>): Promise<RelayTransactionResponse>;
42
- getResubmitted(args: GetRetriedHashesArgs, overrides?: Partial<RelayOverrides>): Promise<GetRetriedHashesResponse>;
43
- wait(args: GetRetriedHashesArgs, overrides?: Partial<RelayOverrides>): Promise<GetRetriedHashesResponse>;
44
- }
45
- //# sourceMappingURL=biconomy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"biconomy.d.ts","sourceRoot":"","sources":["../../../src/meta-tx/biconomy.ts"],"names":[],"mappings":"AAIA,oBAAY,wBAAwB,GAAG;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;CACpB,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,qBAAa,QAAQ;IAEjB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,MAAM;gBAFN,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM;IAGX,gBAAgB,CAC3B,IAAI,EAAE,oBAAoB,EAC1B,SAAS,GAAE,OAAO,CAAC,cAAc,CAAM,GACtC,OAAO,CAAC,wBAAwB,CAAC;IA2BvB,cAAc,CACzB,IAAI,EAAE,oBAAoB,EAC1B,SAAS,GAAE,OAAO,CAAC,cAAc,CAAM,GACtC,OAAO,CAAC,wBAAwB,CAAC;IAwBvB,IAAI,CACf,IAAI,EAAE,oBAAoB,EAC1B,SAAS,GAAE,OAAO,CAAC,cAAc,CAAM,GACtC,OAAO,CAAC,wBAAwB,CAAC;CAiBrC"}
@@ -1,76 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.Biconomy = void 0;
16
- const cross_fetch_1 = __importDefault(require("cross-fetch"));
17
- const errors_1 = require("../utils/errors");
18
- class Biconomy {
19
- constructor(_relayerUrl, _apiKey, _apiId) {
20
- this._relayerUrl = _relayerUrl;
21
- this._apiKey = _apiKey;
22
- this._apiId = _apiId;
23
- }
24
- relayTransaction(args, overrides = {}) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- const url = `${overrides.relayerUrl || this._relayerUrl}/api/v2/meta-tx/native`;
27
- const response = yield (0, cross_fetch_1.default)(url, {
28
- method: "POST",
29
- headers: {
30
- "x-api-key": overrides.apiKey || this._apiKey,
31
- "content-type": "application/json;charset=UTF-8",
32
- "Access-Control-Allow-Origin": "*"
33
- },
34
- body: JSON.stringify(Object.assign(Object.assign({}, args), { apiId: overrides.apiId || this._apiId }))
35
- });
36
- if (!response.ok) {
37
- throw new errors_1.ApiError(response.status, `Failed to relay tx: ${response.statusText}`);
38
- }
39
- return response.json();
40
- });
41
- }
42
- getResubmitted(args, overrides = {}) {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- const url = `${overrides.relayerUrl || this._relayerUrl}/api/v1/meta-tx/resubmitted?networkId=${args.networkId}&transactionHash=${args.transactionHash}`;
45
- const response = yield (0, cross_fetch_1.default)(url, {
46
- method: "GET",
47
- headers: {
48
- "content-type": "application/json;charset=UTF-8",
49
- "Access-Control-Allow-Origin": "*"
50
- }
51
- });
52
- if (!response.ok) {
53
- throw new errors_1.ApiError(response.status, `Failed to get resubmitted tx: ${response.statusText}`);
54
- }
55
- return response.json();
56
- });
57
- }
58
- wait(args, overrides = {}) {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- let pending = true;
61
- let resubmittedResponse;
62
- while (pending) {
63
- resubmittedResponse = yield this.getResubmitted(args, overrides);
64
- pending = resubmittedResponse.data.newStatus === "PENDING";
65
- if (pending) {
66
- yield new Promise((resolve) => {
67
- setTimeout(resolve, 1000);
68
- });
69
- }
70
- }
71
- return resubmittedResponse;
72
- });
73
- }
74
- }
75
- exports.Biconomy = Biconomy;
76
- //# sourceMappingURL=biconomy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"biconomy.js","sourceRoot":"","sources":["../../../src/meta-tx/biconomy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8DAAgC;AAEhC,4CAA2C;AA0C3C,MAAa,QAAQ;IACnB,YACU,WAAmB,EACnB,OAAe,EACf,MAAc;QAFd,gBAAW,GAAX,WAAW,CAAQ;QACnB,YAAO,GAAP,OAAO,CAAQ;QACf,WAAM,GAAN,MAAM,CAAQ;IACrB,CAAC;IAES,gBAAgB,CAC3B,IAA0B,EAC1B,YAAqC,EAAE;;YAEvC,MAAM,GAAG,GAAG,GACV,SAAS,CAAC,UAAU,IAAI,IAAI,CAAC,WAC/B,wBAAwB,CAAC;YACzB,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAK,EAAC,GAAG,EAAE;gBAChC,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,WAAW,EAAE,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO;oBAC7C,cAAc,EAAE,gCAAgC;oBAChD,6BAA6B,EAAE,GAAG;iBACnC;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,iCACf,IAAI,KACP,KAAK,EAAE,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,IACrC;aACH,CAAC,CAAC;YAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;gBAChB,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CAAC;KAAA;CACF;AApFD,4BAoFC"}
@@ -1,5 +0,0 @@
1
- export declare class ApiError extends Error {
2
- status: number;
3
- constructor(status: number, message: string);
4
- }
5
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAS,SAAQ,KAAK;IACd,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAGnD"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApiError = void 0;
4
- class ApiError extends Error {
5
- constructor(status, message) {
6
- super(message);
7
- this.status = status;
8
- }
9
- }
10
- exports.ApiError = ApiError;
11
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,QAAS,SAAQ,KAAK;IACjC,YAAmB,MAAc,EAAE,OAAe;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,WAAM,GAAN,MAAM,CAAQ;IAEjC,CAAC;CACF;AAJD,4BAIC"}
@@ -1,2 +0,0 @@
1
- export * as subgraph from "./subgraph";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/event-logs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC"}
@@ -1,2 +0,0 @@
1
- export * as subgraph from "./subgraph";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/event-logs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC"}
@@ -1,3 +0,0 @@
1
- import { GetEventLogsQueryQueryVariables, BaseEventLogFieldsFragment } from "../subgraph";
2
- export declare function getEventLogs(subgraphUrl: string, queryVars?: GetEventLogsQueryQueryVariables): Promise<BaseEventLogFieldsFragment[]>;
3
- //# sourceMappingURL=subgraph.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subgraph.d.ts","sourceRoot":"","sources":["../../../src/event-logs/subgraph.ts"],"names":[],"mappings":"AACA,OAAO,EACL,+BAA+B,EAC/B,0BAA0B,EAC3B,MAAM,aAAa,CAAC;AAErB,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,SAAS,GAAE,+BAAoC,GAC9C,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAIvC"}
@@ -1,7 +0,0 @@
1
- import { getSubgraphSdk } from "../utils/graphql";
2
- export async function getEventLogs(subgraphUrl, queryVars = {}) {
3
- const subgraphSdk = getSubgraphSdk(subgraphUrl);
4
- const { eventLogs = [] } = await subgraphSdk.getEventLogsQuery(queryVars);
5
- return eventLogs;
6
- }
7
- //# sourceMappingURL=subgraph.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subgraph.js","sourceRoot":"","sources":["../../../src/event-logs/subgraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,WAAmB,EACnB,YAA6C,EAAE;IAE/C,MAAM,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IAChD,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,MAAM,WAAW,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC1E,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -1,45 +0,0 @@
1
- export declare type RelayTransactionResponse = {
2
- txHash: string;
3
- log: string;
4
- retryDuration: number;
5
- flag: number;
6
- };
7
- export declare type RelayTransactionArgs = {
8
- to: string;
9
- params: unknown[];
10
- from: string;
11
- };
12
- export declare type RelayOverrides = {
13
- relayerUrl: string;
14
- apiKey: string;
15
- apiId: string;
16
- };
17
- export declare type GetRetriedHashesResponse = {
18
- code: number;
19
- message: string;
20
- data: {
21
- oldHash: string;
22
- newHash: string;
23
- oldGasPrice: string;
24
- newGasPrice: string;
25
- timestamp: number;
26
- retryCount: number;
27
- relayerAddress: string;
28
- newStatus: string;
29
- };
30
- events?: unknown[];
31
- };
32
- export declare type GetRetriedHashesArgs = {
33
- networkId: number;
34
- transactionHash: string;
35
- };
36
- export declare class Biconomy {
37
- private _relayerUrl;
38
- private _apiKey;
39
- private _apiId;
40
- constructor(_relayerUrl: string, _apiKey: string, _apiId: string);
41
- relayTransaction(args: RelayTransactionArgs, overrides?: Partial<RelayOverrides>): Promise<RelayTransactionResponse>;
42
- getResubmitted(args: GetRetriedHashesArgs, overrides?: Partial<RelayOverrides>): Promise<GetRetriedHashesResponse>;
43
- wait(args: GetRetriedHashesArgs, overrides?: Partial<RelayOverrides>): Promise<GetRetriedHashesResponse>;
44
- }
45
- //# sourceMappingURL=biconomy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"biconomy.d.ts","sourceRoot":"","sources":["../../../src/meta-tx/biconomy.ts"],"names":[],"mappings":"AAIA,oBAAY,wBAAwB,GAAG;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;CACpB,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,qBAAa,QAAQ;IAEjB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,MAAM;gBAFN,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM;IAGX,gBAAgB,CAC3B,IAAI,EAAE,oBAAoB,EAC1B,SAAS,GAAE,OAAO,CAAC,cAAc,CAAM,GACtC,OAAO,CAAC,wBAAwB,CAAC;IA2BvB,cAAc,CACzB,IAAI,EAAE,oBAAoB,EAC1B,SAAS,GAAE,OAAO,CAAC,cAAc,CAAM,GACtC,OAAO,CAAC,wBAAwB,CAAC;IAwBvB,IAAI,CACf,IAAI,EAAE,oBAAoB,EAC1B,SAAS,GAAE,OAAO,CAAC,cAAc,CAAM,GACtC,OAAO,CAAC,wBAAwB,CAAC;CAiBrC"}
@@ -1,60 +0,0 @@
1
- import fetch from "cross-fetch";
2
- import { ApiError } from "../utils/errors";
3
- export class Biconomy {
4
- _relayerUrl;
5
- _apiKey;
6
- _apiId;
7
- constructor(_relayerUrl, _apiKey, _apiId) {
8
- this._relayerUrl = _relayerUrl;
9
- this._apiKey = _apiKey;
10
- this._apiId = _apiId;
11
- }
12
- async relayTransaction(args, overrides = {}) {
13
- const url = `${overrides.relayerUrl || this._relayerUrl}/api/v2/meta-tx/native`;
14
- const response = await fetch(url, {
15
- method: "POST",
16
- headers: {
17
- "x-api-key": overrides.apiKey || this._apiKey,
18
- "content-type": "application/json;charset=UTF-8",
19
- "Access-Control-Allow-Origin": "*"
20
- },
21
- body: JSON.stringify({
22
- ...args,
23
- apiId: overrides.apiId || this._apiId
24
- })
25
- });
26
- if (!response.ok) {
27
- throw new ApiError(response.status, `Failed to relay tx: ${response.statusText}`);
28
- }
29
- return response.json();
30
- }
31
- async getResubmitted(args, overrides = {}) {
32
- const url = `${overrides.relayerUrl || this._relayerUrl}/api/v1/meta-tx/resubmitted?networkId=${args.networkId}&transactionHash=${args.transactionHash}`;
33
- const response = await fetch(url, {
34
- method: "GET",
35
- headers: {
36
- "content-type": "application/json;charset=UTF-8",
37
- "Access-Control-Allow-Origin": "*"
38
- }
39
- });
40
- if (!response.ok) {
41
- throw new ApiError(response.status, `Failed to get resubmitted tx: ${response.statusText}`);
42
- }
43
- return response.json();
44
- }
45
- async wait(args, overrides = {}) {
46
- let pending = true;
47
- let resubmittedResponse;
48
- while (pending) {
49
- resubmittedResponse = await this.getResubmitted(args, overrides);
50
- pending = resubmittedResponse.data.newStatus === "PENDING";
51
- if (pending) {
52
- await new Promise((resolve) => {
53
- setTimeout(resolve, 1000);
54
- });
55
- }
56
- }
57
- return resubmittedResponse;
58
- }
59
- }
60
- //# sourceMappingURL=biconomy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"biconomy.js","sourceRoot":"","sources":["../../../src/meta-tx/biconomy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,aAAa,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AA0C3C,MAAM,OAAO,QAAQ;IAET;IACA;IACA;IAHV,YACU,WAAmB,EACnB,OAAe,EACf,MAAc;QAFd,gBAAW,GAAX,WAAW,CAAQ;QACnB,YAAO,GAAP,OAAO,CAAQ;QACf,WAAM,GAAN,MAA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UAAU,EAAE,CACvD,CAAC;SACH;QAED,OAAO,QAAQ,CAAC,IAAI,EAAuC,CAAC;IAC9D,CAAC;IAEM,KAAK,CAAC,IAAI,CACf,IAA0B,EAC1B,YAAqC,EAAE;QAEvC,IAAI,OAAO,GAAG,IAAI,CAAC;QACnB,IAAI,mBAA6C,CAAC;QAElD,OAAO,OAAO,EAAE;YACd,mBAAmB,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YAEjE,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC;YAC3D,IAAI,OAAO,EAAE;gBACX,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;oBAC5B,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;gBAC5B,CAAC,CAAC,CAAC;aACJ;SACF;QAED,OAAO,mBAAmB,CAAC;IAC7B,CAAC;CACF"}
@@ -1,5 +0,0 @@
1
- export declare class ApiError extends Error {
2
- status: number;
3
- constructor(status: number, message: string);
4
- }
5
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAS,SAAQ,KAAK;IACd,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAGnD"}
@@ -1,8 +0,0 @@
1
- export class ApiError extends Error {
2
- status;
3
- constructor(status, message) {
4
- super(message);
5
- this.status = status;
6
- }
7
- }
8
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/utils/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,QAAS,SAAQ,KAAK;IACd;IAAnB,YAAmB,MAAc,EAAE,OAAe;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,WAAM,GAAN,MAAM,CAAQ;IAEjC,CAAC;CACF"}
@@ -1 +0,0 @@
1
- export * as subgraph from "./subgraph";
@@ -1,53 +0,0 @@
1
- query getEventLogsQuery(
2
- $logsSkip: Int
3
- $logsFirst: Int
4
- $logsOrderBy: EventLog_orderBy
5
- $logsOrderDirection: OrderDirection
6
- $logsFilter: EventLog_filter
7
- ) {
8
- eventLogs(
9
- skip: $logsSkip
10
- first: $logsFirst
11
- orderBy: $logsOrderBy
12
- orderDirection: $logsOrderDirection
13
- where: $logsFilter
14
- ) {
15
- ...BaseEventLogFields
16
- }
17
- }
18
-
19
- fragment BaseEventLogFields on EventLog {
20
- id
21
- hash
22
- type
23
- timestamp
24
- executedBy
25
-
26
- account {
27
- id
28
- }
29
-
30
- ... on OfferEventLog {
31
- offer {
32
- id
33
- }
34
- }
35
-
36
- ... on ExchangeEventLog {
37
- exchange {
38
- id
39
- }
40
- }
41
-
42
- ... on FundsEventLog {
43
- funds {
44
- id
45
- }
46
- }
47
-
48
- ... on DisputeEventLog {
49
- dispute {
50
- id
51
- }
52
- }
53
- }
@@ -1,14 +0,0 @@
1
- import { getSubgraphSdk } from "../utils/graphql";
2
- import {
3
- GetEventLogsQueryQueryVariables,
4
- BaseEventLogFieldsFragment
5
- } from "../subgraph";
6
-
7
- export async function getEventLogs(
8
- subgraphUrl: string,
9
- queryVars: GetEventLogsQueryQueryVariables = {}
10
- ): Promise<BaseEventLogFieldsFragment[]> {
11
- const subgraphSdk = getSubgraphSdk(subgraphUrl);
12
- const { eventLogs = [] } = await subgraphSdk.getEventLogsQuery(queryVars);
13
- return eventLogs;
14
- }
@@ -1,129 +0,0 @@
1
- import fetch from "cross-fetch";
2
-
3
- import { ApiError } from "../utils/errors";
4
-
5
- export type RelayTransactionResponse = {
6
- txHash: string;
7
- log: string;
8
- retryDuration: number;
9
- flag: number;
10
- };
11
-
12
- export type RelayTransactionArgs = {
13
- to: string;
14
- params: unknown[];
15
- from: string;
16
- };
17
-
18
- export type RelayOverrides = {
19
- relayerUrl: string;
20
- apiKey: string;
21
- apiId: string;
22
- };
23
-
24
- export type GetRetriedHashesResponse = {
25
- code: number;
26
- message: string;
27
- data: {
28
- oldHash: string;
29
- newHash: string;
30
- oldGasPrice: string;
31
- newGasPrice: string;
32
- timestamp: number;
33
- retryCount: number;
34
- relayerAddress: string;
35
- newStatus: string;
36
- };
37
- events?: unknown[];
38
- };
39
-
40
- export type GetRetriedHashesArgs = {
41
- networkId: number;
42
- transactionHash: string;
43
- };
44
-
45
- export class Biconomy {
46
- public constructor(
47
- private _relayerUrl: string,
48
- private _apiKey: string,
49
- private _apiId: string
50
- ) {}
51
-
52
- public async relayTransaction(
53
- args: RelayTransactionArgs,
54
- overrides: Partial<RelayOverrides> = {}
55
- ): Promise<RelayTransactionResponse> {
56
- const url = `${
57
- overrides.relayerUrl || this._relayerUrl
58
- }/api/v2/meta-tx/native`;
59
- const response = await fetch(url, {
60
- method: "POST",
61
- headers: {
62
- "x-api-key": overrides.apiKey || this._apiKey,
63
- "content-type": "application/json;charset=UTF-8",
64
- "Access-Control-Allow-Origin": "*"
65
- },
66
- body: JSON.stringify({
67
- ...args,
68
- apiId: overrides.apiId || this._apiId
69
- })
70
- });
71
-
72
- if (!response.ok) {
73
- throw new ApiError(
74
- response.status,
75
- `Failed to relay tx: ${response.statusText}`
76
- );
77
- }
78
-
79
- return response.json() as Promise<RelayTransactionResponse>;
80
- }
81
-
82
- public async getResubmitted(
83
- args: GetRetriedHashesArgs,
84
- overrides: Partial<RelayOverrides> = {}
85
- ): Promise<GetRetriedHashesResponse> {
86
- const url = `${
87
- overrides.relayerUrl || this._relayerUrl
88
- }/api/v1/meta-tx/resubmitted?networkId=${args.networkId}&transactionHash=${
89
- args.transactionHash
90
- }`;
91
- const response = await fetch(url, {
92
- method: "GET",
93
- headers: {
94
- "content-type": "application/json;charset=UTF-8",
95
- "Access-Control-Allow-Origin": "*"
96
- }
97
- });
98
-
99
- if (!response.ok) {
100
- throw new ApiError(
101
- response.status,
102
- `Failed to get resubmitted tx: ${response.statusText}`
103
- );
104
- }
105
-
106
- return response.json() as Promise<GetRetriedHashesResponse>;
107
- }
108
-
109
- public async wait(
110
- args: GetRetriedHashesArgs,
111
- overrides: Partial<RelayOverrides> = {}
112
- ): Promise<GetRetriedHashesResponse> {
113
- let pending = true;
114
- let resubmittedResponse: GetRetriedHashesResponse;
115
-
116
- while (pending) {
117
- resubmittedResponse = await this.getResubmitted(args, overrides);
118
-
119
- pending = resubmittedResponse.data.newStatus === "PENDING";
120
- if (pending) {
121
- await new Promise((resolve) => {
122
- setTimeout(resolve, 1000);
123
- });
124
- }
125
- }
126
-
127
- return resubmittedResponse;
128
- }
129
- }
@@ -1,5 +0,0 @@
1
- export class ApiError extends Error {
2
- constructor(public status: number, message: string) {
3
- super(message);
4
- }
5
- }