@taquito/taquito 11.2.0-beta-RC.0 → 12.0.0

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 (110) hide show
  1. package/README.md +138 -8
  2. package/dist/lib/batch/rpc-batch-provider.js.map +1 -1
  3. package/dist/lib/constants.js +1 -13
  4. package/dist/lib/constants.js.map +1 -1
  5. package/dist/lib/context.js +25 -45
  6. package/dist/lib/context.js.map +1 -1
  7. package/dist/lib/contract/contract-methods/contract-method-factory.js +2 -2
  8. package/dist/lib/contract/contract-methods/contract-method-factory.js.map +1 -1
  9. package/dist/lib/contract/contract-methods/contract-on-chain-view.js +8 -7
  10. package/dist/lib/contract/contract-methods/contract-on-chain-view.js.map +1 -1
  11. package/dist/lib/contract/contract.js +40 -66
  12. package/dist/lib/contract/contract.js.map +1 -1
  13. package/dist/lib/contract/errors.js +3 -1
  14. package/dist/lib/contract/errors.js.map +1 -1
  15. package/dist/lib/contract/lambda-view.js +4 -0
  16. package/dist/lib/contract/lambda-view.js.map +1 -1
  17. package/dist/lib/contract/rpc-contract-provider.js +12 -14
  18. package/dist/lib/contract/rpc-contract-provider.js.map +1 -1
  19. package/dist/lib/estimate/error.js +11 -0
  20. package/dist/lib/estimate/error.js.map +1 -0
  21. package/dist/lib/estimate/estimate-provider-interface.js +3 -0
  22. package/dist/lib/estimate/estimate-provider-interface.js.map +1 -0
  23. package/dist/lib/{contract → estimate}/estimate.js +4 -3
  24. package/dist/lib/estimate/estimate.js.map +1 -0
  25. package/dist/lib/estimate/index.js +18 -0
  26. package/dist/lib/estimate/index.js.map +1 -0
  27. package/dist/lib/{contract → estimate}/naive-estimate-provider.js +0 -0
  28. package/dist/lib/estimate/naive-estimate-provider.js.map +1 -0
  29. package/dist/lib/{contract → estimate}/rpc-estimate-provider.js +54 -35
  30. package/dist/lib/estimate/rpc-estimate-provider.js.map +1 -0
  31. package/dist/lib/forger/taquito-local-forger.js +35 -0
  32. package/dist/lib/forger/taquito-local-forger.js.map +1 -0
  33. package/dist/lib/operations/operation-emitter.js +10 -22
  34. package/dist/lib/operations/operation-emitter.js.map +1 -1
  35. package/dist/lib/operations/operations.js +11 -37
  36. package/dist/lib/operations/operations.js.map +1 -1
  37. package/dist/lib/operations/origination-operation.js +2 -2
  38. package/dist/lib/operations/origination-operation.js.map +1 -1
  39. package/dist/lib/parser/michel-codec-parser.js +5 -2
  40. package/dist/lib/parser/michel-codec-parser.js.map +1 -1
  41. package/dist/lib/{forger → read-provider}/interface.js +0 -0
  42. package/dist/lib/read-provider/interface.js.map +1 -0
  43. package/dist/lib/read-provider/rpc-read-adapter.js +199 -0
  44. package/dist/lib/read-provider/rpc-read-adapter.js.map +1 -0
  45. package/dist/lib/subscribe/create-observable-from-subscription.js +22 -0
  46. package/dist/lib/subscribe/create-observable-from-subscription.js.map +1 -0
  47. package/dist/lib/subscribe/polling-subcribe-provider.js +94 -0
  48. package/dist/lib/subscribe/polling-subcribe-provider.js.map +1 -0
  49. package/dist/lib/taquito.js +63 -26
  50. package/dist/lib/taquito.js.map +1 -1
  51. package/dist/lib/tz/rpc-tz-provider.js +2 -2
  52. package/dist/lib/tz/rpc-tz-provider.js.map +1 -1
  53. package/dist/lib/version.js +2 -2
  54. package/dist/lib/version.js.map +1 -1
  55. package/dist/lib/wallet/delegation-operation.js +2 -2
  56. package/dist/lib/wallet/delegation-operation.js.map +1 -1
  57. package/dist/lib/wallet/operation-factory.js +10 -24
  58. package/dist/lib/wallet/operation-factory.js.map +1 -1
  59. package/dist/lib/wallet/operation.js +4 -4
  60. package/dist/lib/wallet/operation.js.map +1 -1
  61. package/dist/lib/wallet/wallet.js +4 -8
  62. package/dist/lib/wallet/wallet.js.map +1 -1
  63. package/dist/taquito.es6.js +750 -667
  64. package/dist/taquito.es6.js.map +1 -1
  65. package/dist/taquito.min.js +1 -1
  66. package/dist/taquito.min.js.LICENSE.txt +0 -2
  67. package/dist/taquito.umd.js +754 -668
  68. package/dist/taquito.umd.js.map +1 -1
  69. package/dist/types/batch/rpc-batch-provider.d.ts +2 -1
  70. package/dist/types/constants.d.ts +0 -11
  71. package/dist/types/context.d.ts +16 -23
  72. package/dist/types/contract/contract-methods/contract-method-factory.d.ts +2 -1
  73. package/dist/types/contract/contract-methods/contract-on-chain-view.d.ts +3 -2
  74. package/dist/types/contract/contract.d.ts +9 -15
  75. package/dist/types/contract/errors.d.ts +3 -1
  76. package/dist/types/contract/interface.d.ts +0 -58
  77. package/dist/types/contract/lambda-view.d.ts +4 -0
  78. package/dist/types/contract/rpc-contract-provider.d.ts +2 -1
  79. package/dist/types/estimate/error.d.ts +4 -0
  80. package/dist/types/estimate/estimate-provider-interface.d.ts +60 -0
  81. package/dist/types/{contract → estimate}/estimate.d.ts +0 -0
  82. package/dist/types/estimate/index.d.ts +5 -0
  83. package/dist/types/{contract → estimate}/naive-estimate-provider.d.ts +1 -1
  84. package/dist/types/{contract → estimate}/rpc-estimate-provider.d.ts +2 -1
  85. package/dist/types/forger/composite-forger.d.ts +1 -1
  86. package/dist/types/forger/rpc-forger.d.ts +1 -1
  87. package/dist/types/forger/taquito-local-forger.d.ts +8 -0
  88. package/dist/types/operations/operation-emitter.d.ts +2 -2
  89. package/dist/types/operations/operations.d.ts +1 -4
  90. package/dist/types/operations/origination-operation.d.ts +1 -1
  91. package/dist/types/operations/types.d.ts +1 -1
  92. package/dist/types/read-provider/interface.d.ts +113 -0
  93. package/dist/types/read-provider/rpc-read-adapter.d.ts +112 -0
  94. package/dist/types/signer/interface.d.ts +1 -1
  95. package/dist/types/subscribe/create-observable-from-subscription.d.ts +4 -0
  96. package/dist/types/subscribe/interface.d.ts +2 -1
  97. package/dist/types/subscribe/polling-subcribe-provider.d.ts +22 -0
  98. package/dist/types/taquito.d.ts +23 -9
  99. package/dist/types/wallet/delegation-operation.d.ts +2 -2
  100. package/dist/types/wallet/operation-factory.d.ts +2 -3
  101. package/dist/types/wallet/operation.d.ts +2 -1
  102. package/package.json +8 -7
  103. package/dist/lib/contract/estimate.js.map +0 -1
  104. package/dist/lib/contract/naive-estimate-provider.js.map +0 -1
  105. package/dist/lib/contract/rpc-estimate-provider.js.map +0 -1
  106. package/dist/lib/forger/interface.js.map +0 -1
  107. package/dist/lib/subscribe/polling-provider.js +0 -40
  108. package/dist/lib/subscribe/polling-provider.js.map +0 -1
  109. package/dist/types/forger/interface.d.ts +0 -9
  110. package/dist/types/subscribe/polling-provider.d.ts +0 -10
@@ -0,0 +1,199 @@
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.RpcReadAdapter = void 0;
13
+ /**
14
+ * @description Converts calls from TzReadProvider into calls to the wrapped RpcClient in a format it can understand.
15
+ */
16
+ class RpcReadAdapter {
17
+ constructor(context) {
18
+ this.context = context;
19
+ }
20
+ /**
21
+ * @description Access the balance of a contract.
22
+ * @param address address from which we want to retrieve the balance
23
+ * @param block from which we want to retrieve the balance
24
+ * @returns the balance in mutez
25
+ */
26
+ getBalance(address, block) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ return this.context.rpc.getBalance(address, { block: String(block) });
29
+ });
30
+ }
31
+ /**
32
+ * @description Access the delegate of a contract, if any.
33
+ * @param address contract address from which we want to retrieve the delegate (baker)
34
+ * @param block from which we want to retrieve the delegate
35
+ * @returns the public key hash of the delegate or null if no delegate
36
+ */
37
+ getDelegate(address, block) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ return this.context.rpc.getDelegate(address, { block: String(block) });
40
+ });
41
+ }
42
+ /**
43
+ * @description Access the next protocol hash
44
+ * @param block from which we want to retrieve the next protocol hash
45
+ */
46
+ getNextProtocol(block) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const protocols = yield this.context.rpc.getProtocols({ block: String(block) });
49
+ return protocols.next_protocol;
50
+ });
51
+ }
52
+ /**
53
+ * @description Access protocol constants used in Taquito
54
+ * @param block from which we want to retrieve the constants
55
+ */
56
+ getProtocolConstants(block) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ const { time_between_blocks, minimal_block_delay, hard_gas_limit_per_operation, hard_gas_limit_per_block, hard_storage_limit_per_operation, cost_per_byte, } = yield this.context.rpc.getConstants({ block: String(block) });
59
+ return {
60
+ time_between_blocks,
61
+ minimal_block_delay,
62
+ hard_gas_limit_per_operation,
63
+ hard_gas_limit_per_block,
64
+ hard_storage_limit_per_operation,
65
+ cost_per_byte,
66
+ };
67
+ });
68
+ }
69
+ /**
70
+ * @description Access the script (code and storage) of a smart contract
71
+ * @param contract contract address from which we want to retrieve the script
72
+ * @param block from which we want to retrieve the storage value
73
+ * @returns Note: The code must be in the JSON format and not contain global constant
74
+ */
75
+ getScript(contract, block) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ return this.context.rpc.getNormalizedScript(contract, { unparsing_mode: 'Readable' }, { block: String(block) });
78
+ });
79
+ }
80
+ /**
81
+ * @description Access the storage value of a contract
82
+ * @param contract contract address from which we want to retrieve the storage
83
+ * @param block from which we want to retrieve the storage value
84
+ */
85
+ getStorage(contract, block) {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ return this.context.rpc.getStorage(contract, { block: String(block) });
88
+ });
89
+ }
90
+ /**
91
+ * @description Access the block hash
92
+ */
93
+ getBlockHash(block) {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ const { hash } = yield this.context.rpc.getBlockHeader({ block: String(block) });
96
+ return hash;
97
+ });
98
+ }
99
+ /**
100
+ * @description Access the block level
101
+ */
102
+ getBlockLevel(block) {
103
+ return __awaiter(this, void 0, void 0, function* () {
104
+ const { level } = yield this.context.rpc.getBlockHeader({ block: String(block) });
105
+ return level;
106
+ });
107
+ }
108
+ /**
109
+ * @description Access the counter of an address
110
+ * @param pkh from which we want to retrieve the counter
111
+ * @param block from which we want to retrieve the counter
112
+ */
113
+ getCounter(pkh, block) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ const { counter } = yield this.context.rpc.getContract(pkh, { block: String(block) });
116
+ return counter || '0';
117
+ });
118
+ }
119
+ /**
120
+ * @description Access the timestamp of a block
121
+ * @param block from which we want to retrieve the timestamp
122
+ * @returns date ISO format zero UTC offset ("2022-01-19T22:37:07Z")
123
+ */
124
+ getBlockTimestamp(block) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ const { timestamp } = yield this.context.rpc.getBlockHeader({ block: String(block) });
127
+ return timestamp;
128
+ });
129
+ }
130
+ /**
131
+ * @description Access the value associated with a key in a big map.
132
+ * @param bigMapQuery Big Map ID and Expression hash to query (A b58check encoded Blake2b hash of the expression)
133
+ * @param block from which we want to retrieve the big map value
134
+ */
135
+ getBigMapValue(bigMapQuery, block) {
136
+ return __awaiter(this, void 0, void 0, function* () {
137
+ return this.context.rpc.getBigMapExpr(bigMapQuery.id, bigMapQuery.expr, {
138
+ block: String(block),
139
+ });
140
+ });
141
+ }
142
+ /**
143
+ * @description Access the value associated with a sapling state ID.
144
+ * @param id Sapling state ID
145
+ * @param block from which we want to retrieve the sapling state
146
+ */
147
+ getSaplingDiffById(saplingStateQuery, block) {
148
+ return __awaiter(this, void 0, void 0, function* () {
149
+ return this.context.rpc.getSaplingDiffById(saplingStateQuery.id, { block: String(block) });
150
+ });
151
+ }
152
+ /**
153
+ * @description Return the list of entrypoints of the contract
154
+ * @param contract address of the contract we want to get the entrypoints of
155
+ */
156
+ getEntrypoints(contract) {
157
+ return __awaiter(this, void 0, void 0, function* () {
158
+ return this.context.rpc.getEntrypoints(contract);
159
+ });
160
+ }
161
+ /**
162
+ * @description Access the chain id
163
+ */
164
+ getChainId() {
165
+ return __awaiter(this, void 0, void 0, function* () {
166
+ return this.context.rpc.getChainId();
167
+ });
168
+ }
169
+ /**
170
+ * @description Indicate if an account is revealed
171
+ * @param publicKeyHash of the account
172
+ * @param block from which we want to know if the account is revealed
173
+ */
174
+ isAccountRevealed(publicKeyHash, block) {
175
+ return __awaiter(this, void 0, void 0, function* () {
176
+ const manager = yield this.context.rpc.getManagerKey(publicKeyHash, { block: String(block) });
177
+ const haveManager = manager && typeof manager === 'object' ? !!manager.key : !!manager;
178
+ return haveManager;
179
+ });
180
+ }
181
+ /**
182
+ * @description Return all the information about a block
183
+ * @param block from which we want to retrieve the information
184
+ */
185
+ getBlock(block) {
186
+ return __awaiter(this, void 0, void 0, function* () {
187
+ return this.context.rpc.getBlock({ block: String(block) });
188
+ });
189
+ }
190
+ /**
191
+ * @description Return a list of the ancestors of the given block which, if referred to as the branch in an operation header, are recent enough for that operation to be included in the current block.
192
+ * @param block from which we want to retrieve the information
193
+ */
194
+ getLiveBlocks(block) {
195
+ return this.context.rpc.getLiveBlocks({ block: String(block) });
196
+ }
197
+ }
198
+ exports.RpcReadAdapter = RpcReadAdapter;
199
+ //# sourceMappingURL=rpc-read-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpc-read-adapter.js","sourceRoot":"","sources":["../../../src/read-provider/rpc-read-adapter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAWA;;GAEG;AACH,MAAa,cAAc;IACzB,YAAoB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAG,CAAC;IAExC;;;;;OAKG;IACG,UAAU,CAAC,OAAe,EAAE,KAAsB;;YACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACxE,CAAC;KAAA;IAED;;;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;CACF;AA5LD,wCA4LC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createObservableFromSubscription = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ function createObservableFromSubscription(sub) {
6
+ return new rxjs_1.Observable((subscriber) => {
7
+ sub.on('data', (data) => {
8
+ subscriber.next(data);
9
+ });
10
+ sub.on('error', (error) => {
11
+ subscriber.error(error);
12
+ });
13
+ sub.on('close', () => {
14
+ subscriber.complete();
15
+ });
16
+ return () => {
17
+ sub.close();
18
+ };
19
+ });
20
+ }
21
+ exports.createObservableFromSubscription = createObservableFromSubscription;
22
+ //# sourceMappingURL=create-observable-from-subscription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-observable-from-subscription.js","sourceRoot":"","sources":["../../../src/subscribe/create-observable-from-subscription.ts"],"names":[],"mappings":";;;AACA,+BAAkC;AAGlC,SAAgB,gCAAgC,CAE9C,GAAoB;IACpB,OAAO,IAAI,iBAAU,CAAI,CAAC,UAAU,EAAE,EAAE;QACtC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAO,EAAE,EAAE;YACzB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE;YAC/B,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACnB,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,GAAG,CAAC,KAAK,EAAE,CAAC;QACd,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AApBD,4EAoBC"}
@@ -0,0 +1,94 @@
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.PollingSubscribeProvider = exports.defaultConfigStreamer = void 0;
13
+ const rxjs_1 = require("rxjs");
14
+ const operators_1 = require("rxjs/operators");
15
+ const filters_1 = require("./filters");
16
+ const observable_subscription_1 = require("./observable-subscription");
17
+ const bignumber_js_1 = require("bignumber.js");
18
+ exports.defaultConfigStreamer = {
19
+ shouldObservableSubscriptionRetry: false,
20
+ observableSubscriptionRetryFunction: operators_1.retry(),
21
+ };
22
+ const getLastBlock = (context) => {
23
+ return rxjs_1.from(context.rpc.getBlock()).pipe(operators_1.first());
24
+ };
25
+ const applyFilter = (filter) => operators_1.concatMap((block) => {
26
+ return new rxjs_1.Observable((sub) => {
27
+ for (const ops of block.operations) {
28
+ for (const op of ops) {
29
+ for (const content of op.contents) {
30
+ if (filters_1.evaluateFilter(Object.assign({ hash: op.hash }, content), filter)) {
31
+ sub.next(Object.assign({ hash: op.hash }, content));
32
+ }
33
+ }
34
+ }
35
+ }
36
+ sub.complete();
37
+ });
38
+ });
39
+ class PollingSubscribeProvider {
40
+ constructor(context, config = {}) {
41
+ this.context = context;
42
+ this._config$ = new rxjs_1.BehaviorSubject(Object.assign(Object.assign({}, exports.defaultConfigStreamer), config));
43
+ this.timer$ = this._config$.pipe(operators_1.pluck('pollingIntervalMilliseconds'), operators_1.switchMap((pollingIntervalMilliseconds) => {
44
+ if (!pollingIntervalMilliseconds) {
45
+ return rxjs_1.from(this.getConfirmationPollingInterval()).pipe(operators_1.switchMap((interval) => {
46
+ return rxjs_1.timer(0, interval);
47
+ }));
48
+ }
49
+ else {
50
+ return rxjs_1.timer(0, pollingIntervalMilliseconds);
51
+ }
52
+ }));
53
+ this.newBlock$ = this.timer$.pipe(operators_1.switchMap(() => getLastBlock(this.context)), operators_1.distinctUntilKeyChanged('hash'), operators_1.publish(), operators_1.refCount());
54
+ }
55
+ get config() {
56
+ return this._config$.getValue();
57
+ }
58
+ getConfirmationPollingInterval() {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ if (!this.config.pollingIntervalMilliseconds) {
61
+ const defaultIntervalTestnetsMainnet = 5000;
62
+ const defaultIntervalSandbox = 1000;
63
+ try {
64
+ const constants = yield this.context.readProvider.getProtocolConstants('head');
65
+ const blockTime = constants.minimal_block_delay
66
+ ? constants.minimal_block_delay.multipliedBy(1000)
67
+ : constants.time_between_blocks
68
+ ? constants.time_between_blocks[0].multipliedBy(1000)
69
+ : new bignumber_js_1.default(defaultIntervalTestnetsMainnet);
70
+ const confirmationPollingInterval = blockTime.dividedBy(3);
71
+ this.config.pollingIntervalMilliseconds =
72
+ confirmationPollingInterval.toNumber() === 0
73
+ ? defaultIntervalSandbox
74
+ : confirmationPollingInterval.toNumber();
75
+ }
76
+ catch (exception) {
77
+ return defaultIntervalTestnetsMainnet;
78
+ }
79
+ }
80
+ return this.config.pollingIntervalMilliseconds;
81
+ });
82
+ }
83
+ subscribeBlock(_filter) {
84
+ return new observable_subscription_1.ObservableSubscription(this.newBlock$, this.config.shouldObservableSubscriptionRetry, this.config.observableSubscriptionRetryFunction);
85
+ }
86
+ subscribe(_filter) {
87
+ return new observable_subscription_1.ObservableSubscription(this.newBlock$.pipe(operators_1.pluck('hash')), this.config.shouldObservableSubscriptionRetry, this.config.observableSubscriptionRetryFunction);
88
+ }
89
+ subscribeOperation(filter) {
90
+ return new observable_subscription_1.ObservableSubscription(this.newBlock$.pipe(applyFilter(filter)), this.config.shouldObservableSubscriptionRetry, this.config.observableSubscriptionRetryFunction);
91
+ }
92
+ }
93
+ exports.PollingSubscribeProvider = PollingSubscribeProvider;
94
+ //# sourceMappingURL=polling-subcribe-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polling-subcribe-provider.js","sourceRoot":"","sources":["../../../src/subscribe/polling-subcribe-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+BAAmG;AACnG,8CASwB;AAExB,uCAA2C;AAE3C,uEAAmE;AACnE,+CAAqC;AAQxB,QAAA,qBAAqB,GAAmC;IACnE,iCAAiC,EAAE,KAAK;IACxC,mCAAmC,EAAE,iBAAK,EAAE;CAC7C,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAE,EAAE;IACxC,OAAO,WAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAK,EAAE,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,EAAE,CACrC,qBAAS,CAAmD,CAAC,KAAK,EAAE,EAAE;IACpE,OAAO,IAAI,iBAAU,CAAmB,CAAC,GAAG,EAAE,EAAE;QAC9C,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE;YAClC,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE;gBACpB,KAAK,MAAM,OAAO,IAAI,EAAE,CAAC,QAAQ,EAAE;oBACjC,IAAI,wBAAc,iBAAG,IAAI,EAAE,EAAE,CAAC,IAAI,IAAK,OAAO,GAAI,MAAM,CAAC,EAAE;wBACzD,GAAG,CAAC,IAAI,iBAAG,IAAI,EAAE,EAAE,CAAC,IAAI,IAAK,OAAO,EAAG,CAAC;qBACzC;iBACF;aACF;SACF;QACD,GAAG,CAAC,QAAQ,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,MAAa,wBAAwB;IAOnC,YAAoB,OAAgB,EAAE,SAAkD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AM,CAAC,mCAAmC,CAChD,CAAC;IACJ,CAAC;CACF;AArFD,4DAqFC"}
@@ -14,17 +14,18 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.TezosToolkit = exports.ObservableSubscription = exports.PollingSubscribeProvider = exports.OperationBatch = exports.RpcForger = exports.CompositeForger = exports.UnitValue = exports.MichelsonMap = void 0;
17
+ exports.TezosToolkit = exports.RpcReadAdapter = exports.ObservableSubscription = exports.PollingSubscribeProvider = exports.OperationBatch = exports.RpcForger = exports.CompositeForger = exports.UnitValue = exports.MichelsonMap = void 0;
18
18
  const rpc_1 = require("@taquito/rpc");
19
19
  const context_1 = require("./context");
20
- const rpc_forger_1 = require("./forger/rpc-forger");
21
20
  const format_1 = require("./format");
22
21
  const noop_global_constants_provider_1 = require("./global-constants/noop-global-constants-provider");
23
22
  const rpc_packer_1 = require("./packer/rpc-packer");
23
+ const rpc_read_adapter_1 = require("./read-provider/rpc-read-adapter");
24
24
  const noop_1 = require("./signer/noop");
25
- const polling_provider_1 = require("./subscribe/polling-provider");
25
+ const polling_subcribe_provider_1 = require("./subscribe/polling-subcribe-provider");
26
26
  const version_1 = require("./version");
27
27
  const wallet_1 = require("./wallet");
28
+ const taquito_local_forger_1 = require("./forger/taquito-local-forger");
28
29
  var michelson_encoder_1 = require("@taquito/michelson-encoder");
29
30
  Object.defineProperty(exports, "MichelsonMap", { enumerable: true, get: function () { return michelson_encoder_1.MichelsonMap; } });
30
31
  Object.defineProperty(exports, "UnitValue", { enumerable: true, get: function () { return michelson_encoder_1.UnitValue; } });
@@ -34,16 +35,15 @@ __exportStar(require("./contract"), exports);
34
35
  __exportStar(require("./contract/big-map"), exports);
35
36
  var composite_forger_1 = require("./forger/composite-forger");
36
37
  Object.defineProperty(exports, "CompositeForger", { enumerable: true, get: function () { return composite_forger_1.CompositeForger; } });
37
- __exportStar(require("./forger/interface"), exports);
38
- var rpc_forger_2 = require("./forger/rpc-forger");
39
- Object.defineProperty(exports, "RpcForger", { enumerable: true, get: function () { return rpc_forger_2.RpcForger; } });
38
+ var rpc_forger_1 = require("./forger/rpc-forger");
39
+ Object.defineProperty(exports, "RpcForger", { enumerable: true, get: function () { return rpc_forger_1.RpcForger; } });
40
40
  __exportStar(require("./operations"), exports);
41
41
  var rpc_batch_provider_1 = require("./batch/rpc-batch-provider");
42
42
  Object.defineProperty(exports, "OperationBatch", { enumerable: true, get: function () { return rpc_batch_provider_1.OperationBatch; } });
43
43
  __exportStar(require("./signer/interface"), exports);
44
44
  __exportStar(require("./subscribe/interface"), exports);
45
- var polling_provider_2 = require("./subscribe/polling-provider");
46
- Object.defineProperty(exports, "PollingSubscribeProvider", { enumerable: true, get: function () { return polling_provider_2.PollingSubscribeProvider; } });
45
+ var polling_subcribe_provider_2 = require("./subscribe/polling-subcribe-provider");
46
+ Object.defineProperty(exports, "PollingSubscribeProvider", { enumerable: true, get: function () { return polling_subcribe_provider_2.PollingSubscribeProvider; } });
47
47
  var observable_subscription_1 = require("./subscribe/observable-subscription");
48
48
  Object.defineProperty(exports, "ObservableSubscription", { enumerable: true, get: function () { return observable_subscription_1.ObservableSubscription; } });
49
49
  __exportStar(require("./tz/interface"), exports);
@@ -57,6 +57,9 @@ __exportStar(require("./packer/rpc-packer"), exports);
57
57
  __exportStar(require("./global-constants/default-global-constants-provider"), exports);
58
58
  __exportStar(require("./global-constants/error"), exports);
59
59
  __exportStar(require("./global-constants/interface-global-constants-provider"), exports);
60
+ var rpc_read_adapter_2 = require("./read-provider/rpc-read-adapter");
61
+ Object.defineProperty(exports, "RpcReadAdapter", { enumerable: true, get: function () { return rpc_read_adapter_2.RpcReadAdapter; } });
62
+ __exportStar(require("./estimate"), exports);
60
63
  /**
61
64
  * @description Facade class that surfaces all of the libraries capability and allow it's configuration
62
65
  *
@@ -87,7 +90,7 @@ class TezosToolkit {
87
90
  * @example Tezos.setProvider({ config: { confirmationPollingTimeoutSecond: 300 }})
88
91
  *
89
92
  */
90
- setProvider({ rpc, stream, signer, protocol, config, forger, wallet, packer, globalConstantsProvider, }) {
93
+ setProvider({ rpc, stream, signer, protocol, config, forger, wallet, packer, globalConstantsProvider, readProvider, }) {
91
94
  this.setRpcProvider(rpc);
92
95
  this.setStreamProvider(stream);
93
96
  this.setSignerProvider(signer);
@@ -95,6 +98,7 @@ class TezosToolkit {
95
98
  this.setWalletProvider(wallet);
96
99
  this.setPackerProvider(packer);
97
100
  this.setGlobalConstantsProvider(globalConstantsProvider);
101
+ this.setReadProvider(readProvider);
98
102
  this._context.proto = protocol;
99
103
  if (config) {
100
104
  this._context.setPartialConfig(config);
@@ -141,16 +145,23 @@ class TezosToolkit {
141
145
  }
142
146
  /**
143
147
  * @description Sets forger provider on the Tezos Taquito instance
148
+ * The `LocalForger` from `@taquito/local-forging` is set by default.
144
149
  *
145
150
  * @param options forger to use to interact with the Tezos network
146
151
  *
147
- * @example Tezos.setForgerProvider(localForger)
152
+ * @example Tezos.setForgerProvider(this.getFactory(RpcForger)())
148
153
  *
149
154
  */
150
155
  setForgerProvider(forger) {
151
- const f = typeof forger === 'undefined' ? this.getFactory(rpc_forger_1.RpcForger)() : forger;
152
- this._options.forger = f;
153
- this._context.forger = f;
156
+ if (typeof forger !== 'undefined') {
157
+ this._options.forger = forger;
158
+ this._context.forger = forger;
159
+ }
160
+ else if (this._options.forger === undefined) {
161
+ const f = this.getFactory(taquito_local_forger_1.TaquitoLocalForger)();
162
+ this._options.forger = f;
163
+ this._context.forger = f;
164
+ }
154
165
  }
155
166
  /**
156
167
  * @description Sets stream provider on the Tezos Taquito instance
@@ -162,15 +173,19 @@ class TezosToolkit {
162
173
  */
163
174
  setStreamProvider(stream) {
164
175
  if (typeof stream === 'string') {
165
- this._stream = new polling_provider_1.PollingSubscribeProvider(new context_1.Context(new rpc_1.RpcClient(stream)));
176
+ const s = new polling_subcribe_provider_1.PollingSubscribeProvider(new context_1.Context(new rpc_1.RpcClient(stream)));
177
+ this._options.stream = s;
178
+ this._context.stream = s;
166
179
  }
167
180
  else if (typeof stream !== 'undefined') {
168
- this._stream = stream;
181
+ this._options.stream = stream;
182
+ this._context.stream = stream;
169
183
  }
170
184
  else if (this._options.stream === undefined) {
171
- this._stream = this.getFactory(polling_provider_1.PollingSubscribeProvider)();
185
+ const s = this.getFactory(polling_subcribe_provider_1.PollingSubscribeProvider)();
186
+ this._options.stream = s;
187
+ this._context.stream = s;
172
188
  }
173
- this._options.stream = stream;
174
189
  }
175
190
  /**
176
191
  * @description Sets wallet provider on the Tezos Taquito instance
@@ -200,9 +215,15 @@ class TezosToolkit {
200
215
  *
201
216
  */
202
217
  setPackerProvider(packer) {
203
- const p = typeof packer === 'undefined' ? this.getFactory(rpc_packer_1.RpcPacker)() : packer;
204
- this._options.packer = p;
205
- this._context.packer = p;
218
+ if (!this._options.packer && typeof packer === 'undefined') {
219
+ const p = this.getFactory(rpc_packer_1.RpcPacker)();
220
+ this._context.packer = p;
221
+ this._options.packer = p;
222
+ }
223
+ else if (typeof packer !== 'undefined') {
224
+ this._context.packer = packer;
225
+ this._options.packer = packer;
226
+ }
206
227
  }
207
228
  /**
208
229
  * @description Sets global constants provider on the Tezos Taquito instance
@@ -221,11 +242,27 @@ class TezosToolkit {
221
242
  *
222
243
  */
223
244
  setGlobalConstantsProvider(globalConstantsProvider) {
224
- const g = typeof globalConstantsProvider === 'undefined'
225
- ? new noop_global_constants_provider_1.NoopGlobalConstantsProvider()
226
- : globalConstantsProvider;
227
- this._options.globalConstantsProvider = g;
228
- this._context.globalConstantsProvider = g;
245
+ if (!this._options.globalConstantsProvider && typeof globalConstantsProvider === 'undefined') {
246
+ const g = new noop_global_constants_provider_1.NoopGlobalConstantsProvider();
247
+ this._context.globalConstantsProvider = g;
248
+ this._options.globalConstantsProvider = g;
249
+ }
250
+ else if (typeof globalConstantsProvider !== 'undefined') {
251
+ this._context.globalConstantsProvider = globalConstantsProvider;
252
+ this._options.globalConstantsProvider = globalConstantsProvider;
253
+ }
254
+ }
255
+ /**
256
+ * @description Sets read provider on the Tezos Taquito instance
257
+ * By default reads are done from the RPC usign the RpcReadAdapter class, this can be overridden to read from an indexer that implements the TzReadProvider interface
258
+ *
259
+ * @param options TzReadProvider to use to interact with the Tezos network
260
+ *
261
+ */
262
+ setReadProvider(readProvider) {
263
+ const readP = typeof readProvider === 'undefined' ? this.getFactory(rpc_read_adapter_1.RpcReadAdapter)() : readProvider;
264
+ this._options.readProvider = readP;
265
+ this._context.readProvider = readP;
229
266
  }
230
267
  /**
231
268
  * @description Provide access to tezos account management
@@ -255,7 +292,7 @@ class TezosToolkit {
255
292
  * @description Provide access to streaming utilities backed by an streamer implementation
256
293
  */
257
294
  get stream() {
258
- return this._stream;
295
+ return this._context.stream;
259
296
  }
260
297
  /**
261
298
  * @description Provide access to the currently used rpc client
@@ -1 +1 @@
1
- {"version":3,"file":"taquito.js","sourceRoot":"","sources":["../../src/taquito.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;AAEH,sCAA6D;AAG7D,uCAAyF;AAIzF,oDAAgD;AAChD,qCAAkC;AAElC,sGAAgG;AAEhG,oDAAgD;AAEhD,wCAA2C;AAE3C,mEAAwE;AAExE,uCAAoC;AACpC,qCAAwE;AAGxE,gEAAqE;AAA5D,iHAAA,YAAY,OAAA;AAAE,8GAAA,SAAS,OAAA;AAChC,8CAA4B;AAC5B,4CAA0B;AAE1B,6CAA2B;AAC3B,qDAAmC;AACnC,8DAA4D;AAAnD,mHAAA,eAAe,OAAA;AACxB,qDAAmC;AACnC,kDAAgD;AAAvC,uGAAA,SAAS,OAAA;AAClB,+CAA6B;AAC7B,iEAA4D;AAAnD,oHAAA,cAAc,OAAA;AACvB,qDAAmC;AACnC,wDAAsC;AAEtC,iEAAwE;AAA/D,4HAAA,wBAAwB,OAAA;AACjC,+EAA6E;AAApE,iIAAA,sBAA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C;IAChC,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACH,YAAY,CAAC,MAA+B;QAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACzB,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC1E;aAAM;YACL,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACxC;IACH,CAAC;IAED,UAAU,CAA0B,IAA2B;QAC7D,OAAO,CAAC,GAAG,IAAO,EAAE,EAAE;YACpB,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC;QAC1C,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,iBAAO,CAAC;IACjB,CAAC;CACF;AApTD,oCAoTC"}
@@ -23,7 +23,7 @@ class RpcTzProvider extends operation_emitter_1.OperationEmitter {
23
23
  if (utils_1.validateAddress(address) !== utils_1.ValidationResult.VALID) {
24
24
  throw new utils_1.InvalidAddressError(`Invalid address: ${address}`);
25
25
  }
26
- return this.rpc.getBalance(address);
26
+ return this.context.readProvider.getBalance(address, 'head');
27
27
  });
28
28
  }
29
29
  getDelegate(address) {
@@ -31,7 +31,7 @@ class RpcTzProvider extends operation_emitter_1.OperationEmitter {
31
31
  if (utils_1.validateAddress(address) !== utils_1.ValidationResult.VALID) {
32
32
  throw new utils_1.InvalidAddressError(`Invalid address: ${address}`);
33
33
  }
34
- return this.rpc.getDelegate(address);
34
+ return this.context.readProvider.getDelegate(address, 'head');
35
35
  });
36
36
  }
37
37
  activate(pkh, secret) {
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-tz-provider.js","sourceRoot":"","sources":["../../../src/tz/rpc-tz-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,uEAAmE;AACnE,yDAAqD;AAGrD,sCAAsC;AACtC,0CAA8H;AAE9H,MAAa,aAAc,SAAQ,oCAAgB;IACjD,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEK,UAAU,CAAC,OAAe;;YAC9B,IAAI,uBAAe,CAAC,OAAO,CAAC,KAAK,wBAAgB,CAAC,KAAK,EAAE;gBACvD,MAAM,IAAI,2BAAmB,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;aAC9D;YACD,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;KAAA;IAEK,WAAW,CAAC,OAAe;;YAC/B,IAAI,uBAAe,CAAC,OAAO,CAAC,KAAK,wBAAgB,CAAC,KAAK,EAAE;gBACvD,MAAM,IAAI,2BAAmB,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;aAC9D;YACD,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC;KAAA;IAEK,QAAQ,CAAC,GAAW,EAAE,MAAc;;YACxC,IAAI,uBAAe,CAAC,GAAG,CAAC,KAAK,wBAAgB,CAAC,KAAK,EAAE;gBACnD,MAAM,IAAI,2BAAmB,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;aAClE;YACD,MAAM,SAAS,GAAyB;gBACtC,IAAI,EAAE,YAAM,CAAC,UAAU;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,CAAC;aAC9D;YACD,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAChE,CAAC;KAAA;IAEK,QAAQ,CAAC,GAAW,EAAE,MAAc;;YACxC,IAAI,uBAAe,CAAC,GAAG,CAAC,KAAK,wBAAgB,CAAC,KAAK,EAAE;gBACnD,MAAM,IAAI,2BAAmB,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;aAClE;YACD,MAAM,SAAS,GAAyB;gBACtC,IAAI,EAAE,YAAM,CAAC,UAAU;gBACvB,GAAG;gBACH,MAAM;aACP,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;YACtF,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC/C,MAAM,KAAK,GAAG,GAAG,WAAW,CAAC,OAAO,kIAAkI,CAAC;YACvK,OAAO,IAAI,sBAAS,CAClB,MAAM,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,kCAChC,WAAW,KAAE,OAAO,EAAE,KAAK,KAChC,EAAE,EACF,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CACrB,CAAC;QACJ,CAAC;KAAA;CACF;AAvCD,sCAuCC"}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
5
5
  exports.VERSION = {
6
- "commitHash": "e03d983c780c7f96d8291ddd1251ea82f4581858",
7
- "version": "11.2.0-beta-RC.0"
6
+ "commitHash": "222db56e9550fff784a819406d8bdc1110787440",
7
+ "version": "12.0.0"
8
8
  };
9
9
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AACA,2EAA2E;AAC9D,QAAA,OAAO,GAAG;IACnB,YAAY,EAAE,0CAA0C;IACxD,SAAS,EAAE,kBAAkB;CAChC,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AACA,2EAA2E;AAC9D,QAAA,OAAO,GAAG;IACnB,YAAY,EAAE,0CAA0C;IACxD,SAAS,EAAE,QAAQ;CACtB,CAAC"}
@@ -21,13 +21,13 @@ class DelegationWalletOperation extends operation_1.WalletOperation {
21
21
  revealOperation() {
22
22
  return __awaiter(this, void 0, void 0, function* () {
23
23
  const operationResult = yield this.operationResults();
24
- return operationResult.find(x => x.kind === rpc_1.OpKind.REVEAL);
24
+ return operationResult.find((x) => x.kind === rpc_1.OpKind.REVEAL);
25
25
  });
26
26
  }
27
27
  delegationOperation() {
28
28
  return __awaiter(this, void 0, void 0, function* () {
29
29
  const operationResult = yield this.operationResults();
30
- return operationResult.find(x => x.kind === rpc_1.OpKind.DELEGATION);
30
+ return operationResult.find((x) => x.kind === rpc_1.OpKind.DELEGATION);
31
31
  });
32
32
  }
33
33
  status() {
@@ -1 +1 @@
1
- {"version":3,"file":"delegation-operation.js","sourceRoot":"","sources":["../../../src/wallet/delegation-operation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAAuF;AAGvF,2CAA+D;AAE/D,MAAa,yBAA0B,SAAQ,2BAAe;IAC5D,YACkB,MAAc,EACX,OAAgB,EACnC,QAAmC;QAEnC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QAJjB,WAAM,GAAN,MAAM,CAAQ;QACX,YAAO,GAAP,OAAO,CAAS;IAIrC,CAAC;IAEY,eAAe;;YAC1B,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtD,OAAO,eAAe,CAAC,IAAI,CA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