dop-wallet-v6 1.1.5

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 (206) hide show
  1. package/.eslintrc.js +73 -0
  2. package/.prettierrc.js +21 -0
  3. package/LICENSE +21 -0
  4. package/README.md +2 -0
  5. package/dist/index.d.ts +4 -0
  6. package/dist/index.js +20 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/services/artifacts/artifact-downloader.d.ts +13 -0
  9. package/dist/services/artifacts/artifact-downloader.js +131 -0
  10. package/dist/services/artifacts/artifact-downloader.js.map +1 -0
  11. package/dist/services/artifacts/artifact-hash.d.ts +4 -0
  12. package/dist/services/artifacts/artifact-hash.js +54 -0
  13. package/dist/services/artifacts/artifact-hash.js.map +1 -0
  14. package/dist/services/artifacts/artifact-store.d.ts +12 -0
  15. package/dist/services/artifacts/artifact-store.js +12 -0
  16. package/dist/services/artifacts/artifact-store.js.map +1 -0
  17. package/dist/services/artifacts/artifact-util.d.ts +7 -0
  18. package/dist/services/artifacts/artifact-util.js +83 -0
  19. package/dist/services/artifacts/artifact-util.js.map +1 -0
  20. package/dist/services/artifacts/index.d.ts +2 -0
  21. package/dist/services/artifacts/index.js +19 -0
  22. package/dist/services/artifacts/index.js.map +1 -0
  23. package/dist/services/artifacts/json/artifact-v2-hashes.json +337 -0
  24. package/dist/services/dop/core/artifacts.d.ts +10 -0
  25. package/dist/services/dop/core/artifacts.js +69 -0
  26. package/dist/services/dop/core/artifacts.js.map +1 -0
  27. package/dist/services/dop/core/engine.d.ts +25 -0
  28. package/dist/services/dop/core/engine.js +103 -0
  29. package/dist/services/dop/core/engine.js.map +1 -0
  30. package/dist/services/dop/core/index.d.ts +5 -0
  31. package/dist/services/dop/core/index.js +22 -0
  32. package/dist/services/dop/core/index.js.map +1 -0
  33. package/dist/services/dop/core/prover.d.ts +3 -0
  34. package/dist/services/dop/core/prover.js +14 -0
  35. package/dist/services/dop/core/prover.js.map +1 -0
  36. package/dist/services/dop/core/providers.d.ts +18 -0
  37. package/dist/services/dop/core/providers.js +162 -0
  38. package/dist/services/dop/core/providers.js.map +1 -0
  39. package/dist/services/dop/core/shields.d.ts +7 -0
  40. package/dist/services/dop/core/shields.js +20 -0
  41. package/dist/services/dop/core/shields.js.map +1 -0
  42. package/dist/services/dop/history/transaction-history.d.ts +4 -0
  43. package/dist/services/dop/history/transaction-history.js +166 -0
  44. package/dist/services/dop/history/transaction-history.js.map +1 -0
  45. package/dist/services/dop/index.d.ts +4 -0
  46. package/dist/services/dop/index.js +21 -0
  47. package/dist/services/dop/index.js.map +1 -0
  48. package/dist/services/dop/process/extract-first-note.d.ts +6 -0
  49. package/dist/services/dop/process/extract-first-note.js +163 -0
  50. package/dist/services/dop/process/extract-first-note.js.map +1 -0
  51. package/dist/services/dop/process/index.d.ts +1 -0
  52. package/dist/services/dop/process/index.js +18 -0
  53. package/dist/services/dop/process/index.js.map +1 -0
  54. package/dist/services/dop/quick-sync/empty-events.d.ts +2 -0
  55. package/dist/services/dop/quick-sync/empty-events.js +9 -0
  56. package/dist/services/dop/quick-sync/empty-events.js.map +1 -0
  57. package/dist/services/dop/quick-sync/graph-type-formatters.d.ts +13 -0
  58. package/dist/services/dop/quick-sync/graph-type-formatters.js +168 -0
  59. package/dist/services/dop/quick-sync/graph-type-formatters.js.map +1 -0
  60. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/arbitrum-goerli/introspectionSchema.d.ts +2 -0
  61. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/arbitrum-goerli/introspectionSchema.js +24081 -0
  62. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/arbitrum-goerli/introspectionSchema.js.map +1 -0
  63. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/arbitrum-goerli/types.d.ts +1628 -0
  64. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/arbitrum-goerli/types.js +4 -0
  65. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/arbitrum-goerli/types.js.map +1 -0
  66. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/arbitrum-one/introspectionSchema.d.ts +2 -0
  67. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/arbitrum-one/introspectionSchema.js +24081 -0
  68. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/arbitrum-one/introspectionSchema.js.map +1 -0
  69. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/arbitrum-one/types.d.ts +1628 -0
  70. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/arbitrum-one/types.js +4 -0
  71. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/arbitrum-one/types.js.map +1 -0
  72. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/bsc/introspectionSchema.d.ts +2 -0
  73. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/bsc/introspectionSchema.js +24081 -0
  74. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/bsc/introspectionSchema.js.map +1 -0
  75. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/bsc/types.d.ts +1628 -0
  76. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/bsc/types.js +4 -0
  77. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/bsc/types.js.map +1 -0
  78. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/ethereum/introspectionSchema.d.ts +2 -0
  79. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/ethereum/introspectionSchema.js +24081 -0
  80. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/ethereum/introspectionSchema.js.map +1 -0
  81. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/ethereum/types.d.ts +1628 -0
  82. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/ethereum/types.js +4 -0
  83. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/ethereum/types.js.map +1 -0
  84. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/goerli/introspectionSchema.d.ts +2 -0
  85. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/goerli/introspectionSchema.js +24081 -0
  86. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/goerli/introspectionSchema.js.map +1 -0
  87. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/goerli/types.d.ts +1628 -0
  88. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/goerli/types.js +4 -0
  89. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/goerli/types.js.map +1 -0
  90. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/matic/introspectionSchema.d.ts +2 -0
  91. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/matic/introspectionSchema.js +24081 -0
  92. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/matic/introspectionSchema.js.map +1 -0
  93. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/matic/types.d.ts +1628 -0
  94. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/matic/types.js +4 -0
  95. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/matic/types.js.map +1 -0
  96. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/mumbai/introspectionSchema.d.ts +2 -0
  97. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/mumbai/introspectionSchema.js +24081 -0
  98. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/mumbai/introspectionSchema.js.map +1 -0
  99. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/mumbai/types.d.ts +1628 -0
  100. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/mumbai/types.js +4 -0
  101. package/dist/services/dop/quick-sync/graphql/.graphclient/sources/mumbai/types.js.map +1 -0
  102. package/dist/services/dop/quick-sync/graphql/index.d.ts +1976 -0
  103. package/dist/services/dop/quick-sync/graphql/index.js +512 -0
  104. package/dist/services/dop/quick-sync/graphql/index.js.map +1 -0
  105. package/dist/services/dop/quick-sync/quick-sync-graph.d.ts +2 -0
  106. package/dist/services/dop/quick-sync/quick-sync-graph.js +150 -0
  107. package/dist/services/dop/quick-sync/quick-sync-graph.js.map +1 -0
  108. package/dist/services/dop/util/bytes.d.ts +5 -0
  109. package/dist/services/dop/util/bytes.js +21 -0
  110. package/dist/services/dop/util/bytes.js.map +1 -0
  111. package/dist/services/dop/util/commitment.d.ts +2 -0
  112. package/dist/services/dop/util/commitment.js +17 -0
  113. package/dist/services/dop/util/commitment.js.map +1 -0
  114. package/dist/services/dop/util/crypto.d.ts +14 -0
  115. package/dist/services/dop/util/crypto.js +79 -0
  116. package/dist/services/dop/util/crypto.js.map +1 -0
  117. package/dist/services/dop/util/db.d.ts +2 -0
  118. package/dist/services/dop/util/db.js +6 -0
  119. package/dist/services/dop/util/db.js.map +1 -0
  120. package/dist/services/dop/util/index.d.ts +4 -0
  121. package/dist/services/dop/util/index.js +21 -0
  122. package/dist/services/dop/util/index.js.map +1 -0
  123. package/dist/services/dop/wallets/balance-update.d.ts +8 -0
  124. package/dist/services/dop/wallets/balance-update.js +90 -0
  125. package/dist/services/dop/wallets/balance-update.js.map +1 -0
  126. package/dist/services/dop/wallets/balances.d.ts +6 -0
  127. package/dist/services/dop/wallets/balances.js +57 -0
  128. package/dist/services/dop/wallets/balances.js.map +1 -0
  129. package/dist/services/dop/wallets/index.d.ts +4 -0
  130. package/dist/services/dop/wallets/index.js +21 -0
  131. package/dist/services/dop/wallets/index.js.map +1 -0
  132. package/dist/services/dop/wallets/wallets.d.ts +19 -0
  133. package/dist/services/dop/wallets/wallets.js +226 -0
  134. package/dist/services/dop/wallets/wallets.js.map +1 -0
  135. package/dist/services/ethers/ethers-util.d.ts +1 -0
  136. package/dist/services/ethers/ethers-util.js +9 -0
  137. package/dist/services/ethers/ethers-util.js.map +1 -0
  138. package/dist/services/ethers/index.d.ts +1 -0
  139. package/dist/services/ethers/index.js +18 -0
  140. package/dist/services/ethers/index.js.map +1 -0
  141. package/dist/services/index.d.ts +4 -0
  142. package/dist/services/index.js +21 -0
  143. package/dist/services/index.js.map +1 -0
  144. package/dist/services/transactions/index.d.ts +13 -0
  145. package/dist/services/transactions/index.js +30 -0
  146. package/dist/services/transactions/index.js.map +1 -0
  147. package/dist/services/transactions/proof-cache.d.ts +27 -0
  148. package/dist/services/transactions/proof-cache.js +128 -0
  149. package/dist/services/transactions/proof-cache.js.map +1 -0
  150. package/dist/services/transactions/tx-cross-contract-calls.d.ts +9 -0
  151. package/dist/services/transactions/tx-cross-contract-calls.js +386 -0
  152. package/dist/services/transactions/tx-cross-contract-calls.js.map +1 -0
  153. package/dist/services/transactions/tx-gas-details.d.ts +5 -0
  154. package/dist/services/transactions/tx-gas-details.js +120 -0
  155. package/dist/services/transactions/tx-gas-details.js.map +1 -0
  156. package/dist/services/transactions/tx-gas-relayer-fee-estimator.d.ts +2 -0
  157. package/dist/services/transactions/tx-gas-relayer-fee-estimator.js +209 -0
  158. package/dist/services/transactions/tx-gas-relayer-fee-estimator.js.map +1 -0
  159. package/dist/services/transactions/tx-generator.d.ts +9 -0
  160. package/dist/services/transactions/tx-generator.js +205 -0
  161. package/dist/services/transactions/tx-generator.js.map +1 -0
  162. package/dist/services/transactions/tx-notes.d.ts +10 -0
  163. package/dist/services/transactions/tx-notes.js +154 -0
  164. package/dist/services/transactions/tx-notes.js.map +1 -0
  165. package/dist/services/transactions/tx-nullifiers.d.ts +2 -0
  166. package/dist/services/transactions/tx-nullifiers.js +17 -0
  167. package/dist/services/transactions/tx-nullifiers.js.map +1 -0
  168. package/dist/services/transactions/tx-proof-transfer.d.ts +4 -0
  169. package/dist/services/transactions/tx-proof-transfer.js +49 -0
  170. package/dist/services/transactions/tx-proof-transfer.js.map +1 -0
  171. package/dist/services/transactions/tx-proof-unshield.d.ts +3 -0
  172. package/dist/services/transactions/tx-proof-unshield.js +183 -0
  173. package/dist/services/transactions/tx-proof-unshield.js.map +1 -0
  174. package/dist/services/transactions/tx-shield-base-token.d.ts +3 -0
  175. package/dist/services/transactions/tx-shield-base-token.js +61 -0
  176. package/dist/services/transactions/tx-shield-base-token.js.map +1 -0
  177. package/dist/services/transactions/tx-shield.d.ts +6 -0
  178. package/dist/services/transactions/tx-shield.js +84 -0
  179. package/dist/services/transactions/tx-shield.js.map +1 -0
  180. package/dist/services/transactions/tx-transfer.d.ts +2 -0
  181. package/dist/services/transactions/tx-transfer.js +78 -0
  182. package/dist/services/transactions/tx-transfer.js.map +1 -0
  183. package/dist/services/transactions/tx-unshield.d.ts +3 -0
  184. package/dist/services/transactions/tx-unshield.js +174 -0
  185. package/dist/services/transactions/tx-unshield.js.map +1 -0
  186. package/dist/utils/blocked-address.d.ts +2 -0
  187. package/dist/utils/blocked-address.js +21 -0
  188. package/dist/utils/blocked-address.js.map +1 -0
  189. package/dist/utils/error.d.ts +1 -0
  190. package/dist/utils/error.js +20 -0
  191. package/dist/utils/error.js.map +1 -0
  192. package/dist/utils/gas-price.d.ts +6 -0
  193. package/dist/utils/gas-price.js +31 -0
  194. package/dist/utils/gas-price.js.map +1 -0
  195. package/dist/utils/index.d.ts +3 -0
  196. package/dist/utils/index.js +20 -0
  197. package/dist/utils/index.js.map +1 -0
  198. package/dist/utils/logger.d.ts +3 -0
  199. package/dist/utils/logger.js +21 -0
  200. package/dist/utils/logger.js.map +1 -0
  201. package/dist/utils/utils.d.ts +3 -0
  202. package/dist/utils/utils.js +47 -0
  203. package/dist/utils/utils.js.map +1 -0
  204. package/package.json +85 -0
  205. package/postinstall.js +52 -0
  206. package/react-native-shims.js +42 -0
@@ -0,0 +1,512 @@
1
+ "use strict";
2
+ /**
3
+ * TO UPDATE:
4
+ * 1. Find all places that are "MODIFIED", move them into the new built index.ts (in .graphclient)
5
+ * 2. add these comments (including eslint disables)
6
+ * 3. move the modified index file to quick-sync/graphql/
7
+ */
8
+ /* eslint-disable @typescript-eslint/no-unused-vars */
9
+ /* eslint-disable @typescript-eslint/no-explicit-any */
10
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
11
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
12
+ /* eslint-disable @typescript-eslint/ban-types */
13
+ // @ts-nocheck
14
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ var desc = Object.getOwnPropertyDescriptor(m, k);
17
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
+ desc = { enumerable: true, get: function() { return m[k]; } };
19
+ }
20
+ Object.defineProperty(o, k2, desc);
21
+ }) : (function(o, m, k, k2) {
22
+ if (k2 === undefined) k2 = k;
23
+ o[k2] = m[k];
24
+ }));
25
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
27
+ }) : function(o, v) {
28
+ o["default"] = v;
29
+ });
30
+ var __importStar = (this && this.__importStar) || function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ var __importDefault = (this && this.__importDefault) || function (mod) {
38
+ return (mod && mod.__esModule) ? mod : { "default": mod };
39
+ };
40
+ Object.defineProperty(exports, "__esModule", { value: true });
41
+ exports.getSdk = exports.CommitmentsDocument = exports.UnshieldsDocument = exports.NullifiersDocument = exports.getBuiltGraphSDK = exports.subscribe = exports.execute = exports.getBuiltGraphClient = exports.createBuiltMeshHTTPHandler = exports.getMeshOptions = exports.rawServeConfig = void 0;
42
+ const utils_1 = require("@graphql-mesh/utils");
43
+ const cache_localforage_1 = __importDefault(require("@graphql-mesh/cache-localforage"));
44
+ const fetch_1 = require("@whatwg-node/fetch");
45
+ const runtime_1 = require("@graphql-mesh/runtime");
46
+ const graphql_1 = __importDefault(require("@graphql-mesh/graphql"));
47
+ const merger_stitching_1 = __importDefault(require("@graphql-mesh/merger-stitching"));
48
+ const http_1 = require("@graphql-mesh/http");
49
+ const store_1 = require("@graphql-mesh/store");
50
+ const cross_helpers_1 = require("@graphql-mesh/cross-helpers");
51
+ const baseDir = cross_helpers_1.path.join(typeof __dirname === 'string' ? __dirname : '/', '..');
52
+ const importFn = (moduleId) => {
53
+ const relativeModuleId = (cross_helpers_1.path.isAbsolute(moduleId)
54
+ ? cross_helpers_1.path.relative(baseDir, moduleId)
55
+ : moduleId)
56
+ .split('\\')
57
+ .join('/');
58
+ // .replace(`${baseDir}/`, ''); // MODIFIED
59
+ switch (relativeModuleId) {
60
+ case '.graphclient/sources/goerli/introspectionSchema':
61
+ return Promise.resolve().then(() => __importStar(require('./.graphclient/sources/goerli/introspectionSchema')));
62
+ case '.graphclient/sources/arbitrum-goerli/introspectionSchema':
63
+ return Promise.resolve().then(() => __importStar(require('./.graphclient/sources/arbitrum-goerli/introspectionSchema')));
64
+ case '.graphclient/sources/mumbai/introspectionSchema':
65
+ return Promise.resolve().then(() => __importStar(require('./.graphclient/sources/mumbai/introspectionSchema')));
66
+ case '.graphclient/sources/ethereum/introspectionSchema':
67
+ return Promise.resolve().then(() => __importStar(require('./.graphclient/sources/ethereum/introspectionSchema')));
68
+ case '.graphclient/sources/matic/introspectionSchema':
69
+ return Promise.resolve().then(() => __importStar(require('./.graphclient/sources/matic/introspectionSchema')));
70
+ case '.graphclient/sources/bsc/introspectionSchema':
71
+ return Promise.resolve().then(() => __importStar(require('./.graphclient/sources/bsc/introspectionSchema')));
72
+ case '.graphclient/sources/arbitrum-one/introspectionSchema':
73
+ return Promise.resolve().then(() => __importStar(require('./.graphclient/sources/arbitrum-one/introspectionSchema')));
74
+ default:
75
+ return Promise.reject(new Error(`Cannot find module '${relativeModuleId}'.`));
76
+ }
77
+ };
78
+ const rootStore = new store_1.MeshStore('.graphclient', new store_1.FsStoreStorageAdapter({
79
+ cwd: baseDir,
80
+ importFn,
81
+ fileType: 'ts',
82
+ }), {
83
+ readonly: true,
84
+ validate: false,
85
+ });
86
+ exports.rawServeConfig = undefined;
87
+ async function getMeshOptions() {
88
+ const pubsub = new utils_1.PubSub();
89
+ const sourcesStore = rootStore.child('sources');
90
+ const logger = new utils_1.DefaultLogger('GraphClient');
91
+ const cache = new cache_localforage_1.default({
92
+ ...{},
93
+ importFn,
94
+ store: rootStore.child('cache'),
95
+ pubsub,
96
+ logger,
97
+ });
98
+ const sources = [];
99
+ const transforms = [];
100
+ const additionalEnvelopPlugins = [];
101
+ const ethereumTransforms = [];
102
+ const goerliTransforms = [];
103
+ const bscTransforms = [];
104
+ const maticTransforms = [];
105
+ const mumbaiTransforms = [];
106
+ const arbitrumOneTransforms = [];
107
+ const arbitrumGoerliTransforms = [];
108
+ const xlayerTransforms = [];
109
+ const xlayerTestnetransforms = [];
110
+ const additionalTypeDefs = [];
111
+ const ethereumHandler = new graphql_1.default({
112
+ name: 'ethereum',
113
+ config: {
114
+ endpoint: 'https://subgraph.satsuma-prod.com/323ce71d2cc0/usman--186639/dopmainnetethv2/api',
115
+ },
116
+ baseDir,
117
+ cache,
118
+ pubsub,
119
+ store: sourcesStore.child('ethereum'),
120
+ logger: logger.child('ethereum'),
121
+ importFn,
122
+ });
123
+ // 'https://api.thegraph.com/subgraphs/name/dop-community/dop-v2-goerli',
124
+ const goerliHandler = new graphql_1.default({
125
+ name: 'goerli',
126
+ config: {
127
+ endpoint: 'https://api.thegraph.com/subgraphs/name/waleed-shafiq/dop-goerli',
128
+ },
129
+ baseDir,
130
+ cache,
131
+ pubsub,
132
+ store: sourcesStore.child('goerli'),
133
+ logger: logger.child('goerli'),
134
+ importFn,
135
+ });
136
+ const bscHandler = new graphql_1.default({
137
+ name: 'bsc',
138
+ config: {
139
+ endpoint: 'https://api.thegraph.com/subgraphs/name/dop-community/dop-v2-bsc',
140
+ },
141
+ baseDir,
142
+ cache,
143
+ pubsub,
144
+ store: sourcesStore.child('bsc'),
145
+ logger: logger.child('bsc'),
146
+ importFn,
147
+ });
148
+ const maticHandler = new graphql_1.default({
149
+ name: 'matic',
150
+ config: {
151
+ endpoint: 'https://subgraph.satsuma-prod.com/323ce71d2cc0/usman--186639/dopmainnetpolygonv2/api',
152
+ },
153
+ baseDir,
154
+ cache,
155
+ pubsub,
156
+ store: sourcesStore.child('matic'),
157
+ logger: logger.child('matic'),
158
+ importFn,
159
+ });
160
+ const mumbaiHandler = new graphql_1.default({
161
+ name: 'mumbai',
162
+ config: {
163
+ endpoint: 'https://subgraph.satsuma-prod.com/323ce71d2cc0/usman--186639/dopmainnetpolygonv2/api',
164
+ },
165
+ baseDir,
166
+ cache,
167
+ pubsub,
168
+ store: sourcesStore.child('mumbai'),
169
+ logger: logger.child('mumbai'),
170
+ importFn,
171
+ });
172
+ const arbitrumOneHandler = new graphql_1.default({
173
+ name: 'arbitrum-one',
174
+ config: {
175
+ endpoint: 'https://api.thegraph.com/subgraphs/name/dop-community/dop-v2-arbitrum',
176
+ },
177
+ baseDir,
178
+ cache,
179
+ pubsub,
180
+ store: sourcesStore.child('arbitrum-one'),
181
+ logger: logger.child('arbitrum-one'),
182
+ importFn,
183
+ });
184
+ const arbitrumGoerliHandler = new graphql_1.default({
185
+ name: 'arbitrum-goerli',
186
+ config: {
187
+ endpoint: 'https://api.thegraph.com/subgraphs/name/dop-community/dop-v2-arbitrum-goerli',
188
+ },
189
+ baseDir,
190
+ cache,
191
+ pubsub,
192
+ store: sourcesStore.child('arbitrum-goerli'),
193
+ logger: logger.child('arbitrum-goerli'),
194
+ importFn,
195
+ });
196
+ const xlayerHandler = new graphql_1.default({
197
+ name: 'xlayer',
198
+ config: {
199
+ endpoint: 'https://api.studio.thegraph.com/query/75971/xlayermainnetv2/version/latest',
200
+ },
201
+ baseDir,
202
+ cache,
203
+ pubsub,
204
+ store: sourcesStore.child('xlayer'),
205
+ logger: logger.child('xlayer'),
206
+ importFn,
207
+ });
208
+ const xlayerTestnetHandler = new graphql_1.default({
209
+ name: 'xlayer-testnet',
210
+ config: {
211
+ endpoint: 'https://api.studio.thegraph.com/query/75971/xlayermainnetv2/version/latest',
212
+ },
213
+ baseDir,
214
+ cache,
215
+ pubsub,
216
+ store: sourcesStore.child('xlayer-testnet'),
217
+ logger: logger.child('xlayer-testnet'),
218
+ importFn,
219
+ });
220
+ sources[0] = {
221
+ name: 'ethereum',
222
+ handler: ethereumHandler,
223
+ transforms: ethereumTransforms,
224
+ };
225
+ sources[1] = {
226
+ name: 'goerli',
227
+ handler: goerliHandler,
228
+ transforms: goerliTransforms,
229
+ };
230
+ sources[2] = {
231
+ name: 'bsc',
232
+ handler: bscHandler,
233
+ transforms: bscTransforms,
234
+ };
235
+ sources[3] = {
236
+ name: 'matic',
237
+ handler: maticHandler,
238
+ transforms: maticTransforms,
239
+ };
240
+ sources[4] = {
241
+ name: 'mumbai',
242
+ handler: mumbaiHandler,
243
+ transforms: mumbaiTransforms,
244
+ };
245
+ sources[5] = {
246
+ name: 'arbitrum-one',
247
+ handler: arbitrumOneHandler,
248
+ transforms: arbitrumOneTransforms,
249
+ };
250
+ sources[6] = {
251
+ name: 'arbitrum-goerli',
252
+ handler: arbitrumGoerliHandler,
253
+ transforms: arbitrumGoerliTransforms,
254
+ };
255
+ sources[7] = {
256
+ name: 'xlayer',
257
+ handler: xlayerHandler,
258
+ transforms: xlayerTransforms,
259
+ };
260
+ sources[8] = {
261
+ name: 'xlayer-testnet',
262
+ handler: xlayerTestnetHandler,
263
+ transforms: xlayerTestnetransforms,
264
+ };
265
+ const additionalResolvers = [];
266
+ const merger = new merger_stitching_1.default({
267
+ cache,
268
+ pubsub,
269
+ logger: logger.child('stitchingMerger'),
270
+ store: rootStore.child('stitchingMerger'),
271
+ });
272
+ return {
273
+ sources,
274
+ transforms,
275
+ additionalTypeDefs,
276
+ additionalResolvers,
277
+ cache,
278
+ pubsub,
279
+ merger,
280
+ logger,
281
+ additionalEnvelopPlugins,
282
+ get documents() {
283
+ return [
284
+ {
285
+ document: exports.NullifiersDocument,
286
+ get rawSDL() {
287
+ return (0, utils_1.printWithCache)(exports.NullifiersDocument);
288
+ },
289
+ location: 'NullifiersDocument.graphql',
290
+ },
291
+ {
292
+ document: exports.UnshieldsDocument,
293
+ get rawSDL() {
294
+ return (0, utils_1.printWithCache)(exports.UnshieldsDocument);
295
+ },
296
+ location: 'UnshieldsDocument.graphql',
297
+ },
298
+ {
299
+ document: exports.CommitmentsDocument,
300
+ get rawSDL() {
301
+ return (0, utils_1.printWithCache)(exports.CommitmentsDocument);
302
+ },
303
+ location: 'CommitmentsDocument.graphql',
304
+ },
305
+ ];
306
+ },
307
+ fetchFn: fetch_1.fetch,
308
+ };
309
+ }
310
+ exports.getMeshOptions = getMeshOptions;
311
+ function createBuiltMeshHTTPHandler() {
312
+ return (0, http_1.createMeshHTTPHandler)({
313
+ baseDir,
314
+ getBuiltMesh: getBuiltGraphClient,
315
+ rawServeConfig: undefined,
316
+ });
317
+ }
318
+ exports.createBuiltMeshHTTPHandler = createBuiltMeshHTTPHandler;
319
+ let meshInstance$;
320
+ function getBuiltGraphClient() {
321
+ if (meshInstance$ == null) {
322
+ meshInstance$ = getMeshOptions()
323
+ .then(meshOptions => (0, runtime_1.getMesh)(meshOptions))
324
+ .then(mesh => {
325
+ const id = mesh.pubsub.subscribe('destroy', () => {
326
+ meshInstance$ = undefined;
327
+ mesh.pubsub.unsubscribe(id);
328
+ });
329
+ return mesh;
330
+ });
331
+ }
332
+ return meshInstance$;
333
+ }
334
+ exports.getBuiltGraphClient = getBuiltGraphClient;
335
+ const execute = (...args) => getBuiltGraphClient().then(({ execute }) => execute(...args));
336
+ exports.execute = execute;
337
+ const subscribe = (...args) => getBuiltGraphClient().then(({ subscribe }) => subscribe(...args));
338
+ exports.subscribe = subscribe;
339
+ function getBuiltGraphSDK(globalContext) {
340
+ const sdkRequester$ = getBuiltGraphClient().then(({ sdkRequesterFactory }) => sdkRequesterFactory(globalContext));
341
+ return getSdk((...args) => sdkRequester$.then(sdkRequester => sdkRequester(...args)));
342
+ }
343
+ exports.getBuiltGraphSDK = getBuiltGraphSDK;
344
+ exports.NullifiersDocument = (0, utils_1.gql) `
345
+ query Nullifiers($blockNumber: BigInt = 0) {
346
+ nullifiers(
347
+ orderBy: blockNumber
348
+ where: { blockNumber_gte: $blockNumber }
349
+ first: 1000
350
+ ) {
351
+ id
352
+ blockNumber
353
+ nullifier
354
+ transactionHash
355
+ blockTimestamp
356
+ treeNumber
357
+ }
358
+ }
359
+ `;
360
+ // TODO change Unshields to Decrypts
361
+ exports.UnshieldsDocument = (0, utils_1.gql) `
362
+ query Decrypts($blockNumber: BigInt = 0) {
363
+ decrypts(
364
+ orderBy: blockNumber
365
+ where: { blockNumber_gte: $blockNumber }
366
+ first: 1000
367
+ ) {
368
+ id
369
+ blockNumber
370
+ to
371
+ transactionHash
372
+ fee
373
+ blockTimestamp
374
+ amount
375
+ eventLogIndex
376
+ token {
377
+ id
378
+ tokenType
379
+ tokenSubID
380
+ tokenAddress
381
+ }
382
+ }
383
+ }
384
+ `;
385
+ exports.CommitmentsDocument = (0, utils_1.gql) `
386
+ query Commitments($blockNumber: BigInt = 0) {
387
+ commitments(
388
+ orderBy: blockNumber
389
+ where: { blockNumber_gte: $blockNumber }
390
+ first: 1000
391
+ ) {
392
+ id
393
+ treeNumber
394
+ batchStartTreePosition
395
+ treePosition
396
+ blockNumber
397
+ transactionHash
398
+ blockTimestamp
399
+ commitmentType
400
+ hash
401
+ ... on LegacyGeneratedCommitment {
402
+ id
403
+ treeNumber
404
+ batchStartTreePosition
405
+ treePosition
406
+ blockNumber
407
+ transactionHash
408
+ blockTimestamp
409
+ commitmentType
410
+ hash
411
+ encryptedRandom
412
+ preimage {
413
+ id
414
+ npk
415
+ value
416
+ token {
417
+ id
418
+ tokenType
419
+ tokenSubID
420
+ tokenAddress
421
+ }
422
+ }
423
+ }
424
+ ... on LegacyEncryptedCommitment {
425
+ id
426
+ blockNumber
427
+ blockTimestamp
428
+ transactionHash
429
+ treeNumber
430
+ batchStartTreePosition
431
+ treePosition
432
+ commitmentType
433
+ hash
434
+ legacyCiphertext: ciphertext {
435
+ id
436
+ ciphertext {
437
+ id
438
+ iv
439
+ tag
440
+ data
441
+ }
442
+ ephemeralKeys
443
+ memo
444
+ }
445
+ }
446
+ ... on EncryptCommitment {
447
+ id
448
+ blockNumber
449
+ blockTimestamp
450
+ transactionHash
451
+ treeNumber
452
+ batchStartTreePosition
453
+ treePosition
454
+ commitmentType
455
+ hash
456
+ encryptKey
457
+ fee
458
+ encryptedBundle
459
+ preimage {
460
+ id
461
+ npk
462
+ value
463
+ token {
464
+ id
465
+ tokenType
466
+ tokenSubID
467
+ tokenAddress
468
+ }
469
+ }
470
+ }
471
+ ... on TransactCommitment {
472
+ id
473
+ blockNumber
474
+ blockTimestamp
475
+ transactionHash
476
+ treeNumber
477
+ batchStartTreePosition
478
+ treePosition
479
+ commitmentType
480
+ hash
481
+ ciphertext {
482
+ id
483
+ ciphertext {
484
+ id
485
+ iv
486
+ tag
487
+ data
488
+ }
489
+ blindedSenderViewingKey
490
+ blindedReceiverViewingKey
491
+ annotationData
492
+ memo
493
+ }
494
+ }
495
+ }
496
+ }
497
+ `;
498
+ function getSdk(requester) {
499
+ return {
500
+ Nullifiers(variables, options) {
501
+ return requester(exports.NullifiersDocument, variables, options);
502
+ },
503
+ Unshields(variables, options) {
504
+ return requester(exports.UnshieldsDocument, variables, options);
505
+ },
506
+ Commitments(variables, options) {
507
+ return requester(exports.CommitmentsDocument, variables, options);
508
+ },
509
+ };
510
+ }
511
+ exports.getSdk = getSdk;
512
+ //# sourceMappingURL=index.js.map