@superfluid-finance/sdk-core 0.5.1-dev.bba2a88.0 → 0.5.2-dev.f39efb8.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 (59) hide show
  1. package/CHANGELOG.md +27 -4
  2. package/dist/index.umd.js +82 -41
  3. package/dist/main/BatchCall.d.ts +5 -3
  4. package/dist/main/BatchCall.d.ts.map +1 -1
  5. package/dist/main/BatchCall.js +17 -9
  6. package/dist/main/BatchCall.js.map +1 -1
  7. package/dist/main/ConstantFlowAgreementV1.d.ts +1 -1
  8. package/dist/main/ConstantFlowAgreementV1.js +10 -10
  9. package/dist/main/ConstantFlowAgreementV1.js.map +1 -1
  10. package/dist/main/Framework.d.ts +8 -1
  11. package/dist/main/Framework.d.ts.map +1 -1
  12. package/dist/main/Framework.js +10 -0
  13. package/dist/main/Framework.js.map +1 -1
  14. package/dist/main/Governance.js +2 -2
  15. package/dist/main/Host.d.ts +11 -1
  16. package/dist/main/Host.d.ts.map +1 -1
  17. package/dist/main/Host.js +12 -1
  18. package/dist/main/Host.js.map +1 -1
  19. package/dist/main/InstantDistributionAgreementV1.d.ts +3 -3
  20. package/dist/main/InstantDistributionAgreementV1.js +11 -11
  21. package/dist/main/InstantDistributionAgreementV1.js.map +1 -1
  22. package/dist/main/Operation.d.ts +3 -3
  23. package/dist/main/Operation.js +3 -3
  24. package/dist/main/SFError.d.ts.map +1 -1
  25. package/dist/main/SFError.js +12 -2
  26. package/dist/main/SFError.js.map +1 -1
  27. package/dist/main/index.d.ts +2 -0
  28. package/dist/main/index.d.ts.map +1 -1
  29. package/dist/main/index.js +3 -1
  30. package/dist/main/index.js.map +1 -1
  31. package/dist/module/BatchCall.d.ts +5 -3
  32. package/dist/module/BatchCall.d.ts.map +1 -1
  33. package/dist/module/BatchCall.js +17 -9
  34. package/dist/module/BatchCall.js.map +1 -1
  35. package/dist/module/ConstantFlowAgreementV1.d.ts +1 -1
  36. package/dist/module/ConstantFlowAgreementV1.js +10 -10
  37. package/dist/module/ConstantFlowAgreementV1.js.map +1 -1
  38. package/dist/module/Framework.d.ts +8 -1
  39. package/dist/module/Framework.d.ts.map +1 -1
  40. package/dist/module/Framework.js +10 -0
  41. package/dist/module/Framework.js.map +1 -1
  42. package/dist/module/Governance.js +2 -2
  43. package/dist/module/Host.d.ts +11 -1
  44. package/dist/module/Host.d.ts.map +1 -1
  45. package/dist/module/Host.js +12 -1
  46. package/dist/module/Host.js.map +1 -1
  47. package/dist/module/InstantDistributionAgreementV1.d.ts +3 -3
  48. package/dist/module/InstantDistributionAgreementV1.js +11 -11
  49. package/dist/module/InstantDistributionAgreementV1.js.map +1 -1
  50. package/dist/module/Operation.d.ts +3 -3
  51. package/dist/module/Operation.js +3 -3
  52. package/dist/module/SFError.d.ts.map +1 -1
  53. package/dist/module/SFError.js +12 -2
  54. package/dist/module/SFError.js.map +1 -1
  55. package/dist/module/index.d.ts +2 -0
  56. package/dist/module/index.d.ts.map +1 -1
  57. package/dist/module/index.js +2 -0
  58. package/dist/module/index.js.map +1 -1
  59. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -5,24 +5,46 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ### Added
9
+ - Support for `isNativeAssetSuperToken` property on SuperToken entity queries
10
+ - `callAppAction` Operation creator added to `Host` class
11
+
12
+ ### Breaking
13
+ - `BatchCall.getCallDataFunctionArgs` deprecates the old `BatchCall.getCallAgreementFunctionArgs`
14
+ - Migration:
15
+ - Replace `getCallAgreementFunctionArgs` with `getCallDataFunctionArgs` and pass in the fragment/ABI as the first argument, whilst keeping the same `callData` argument.
16
+ - `Host.populateCallAgreementTxnAndReturnOperation` is replaced by `Host.callAgreement`
17
+ - Migration:
18
+ - Replace instances of `populateCallAgreementTxnAndReturnOperation` with `callAgreement`
19
+
20
+ ### Fixes
21
+ - Handle `CALL_APP_ACTION` operation type correctly in SDK-Core when doing a batch call
22
+
23
+ ## [0.5.1] - 2022-07-26
24
+
25
+ ## Fixes
26
+ - Patch fix serializeError strange serialization
27
+
8
28
  ## [0.5.0] - 2022-07-14
9
29
 
10
- ## Added
30
+ ### Added
11
31
  - Support for SetEvent and Subgraph v1.4.4
32
+ - `Framework.operation` method for easily creating `Operation` instances
12
33
 
13
- ## Fixes
34
+ ### Fixes
14
35
  - Compile AJV validations to prevent unsafe-eval and did not allow SDK-Core usage inside Google Chrome extension due to unsafe-eval CSP
15
36
 
16
37
  ### Changed
17
38
  - `SFError` refactor to be more conventional. It inherits `Error` and uses `cause` to wrap internal errors.
18
39
  - Use `serialize-error` for serializing error object inside the message.
40
+ - Export Operation & OperationType
19
41
 
20
42
  ### Breaking
21
43
  - `SFError.errorObject` renamed to `SFError.cause`
22
44
 
23
45
  ## [0.4.4] - 2022-06-30
24
46
 
25
- ## Added
47
+ ### Added
26
48
  - Support for new event properties for Subgraph v1.4.1
27
49
 
28
50
  ### Breaking
@@ -167,7 +189,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
167
189
  - New `SuperToken` class with `SuperToken` CRUD functionality and an underlying `Token` class with basic `ERC20` functionality
168
190
  - New `BatchCall` class for creating and executing batch calls with supported `Operation's`
169
191
 
170
- [Unreleased]: https://github.com/superfluid-finance/protocol-monorepo/compare/sdk-core%40v0.5.0...HEAD
192
+ [Unreleased]: https://github.com/superfluid-finance/protocol-monorepo/compare/sdk-core%40v0.5.1...HEAD
193
+ [0.5.1]: https://github.com/superfluid-finance/protocol-monorepo/compare/sdk-core%40v0.5.0...sdk-core%40v0.5.1
171
194
  [0.5.0]: https://github.com/superfluid-finance/protocol-monorepo/compare/sdk-core%40v0.4.4...sdk-core%40v0.5.0
172
195
  [0.4.4]: https://github.com/superfluid-finance/protocol-monorepo/compare/sdk-core%40v0.4.3...sdk-core%40v0.4.4
173
196
  [0.4.3]: https://github.com/superfluid-finance/protocol-monorepo/compare/sdk-core%40v0.4.2...sdk-core%40v0.4.3
package/dist/index.umd.js CHANGED
@@ -73869,11 +73869,12 @@ const operationTypeStringToTypeMap = new Map([
73869
73869
  class BatchCall {
73870
73870
  constructor(options) {
73871
73871
  /**
73872
- * Gets the call agreement function arguments.
73873
- * @param callData callData of the function
73872
+ * Gets function arguments given an ABI and callData.
73873
+ * @param abi the abi fragments of a contract/function
73874
+ * @param callData call data of the function
73874
73875
  * @returns {ethers.utils.Result} call agreement function arguments
73875
73876
  */
73876
- this.getCallAgreementFunctionArgs = (callData) => (0, utils_1.getTransactionDescription)(Superfluid_json_1.default.abi, callData).args;
73877
+ this.getCallDataFunctionArgs = (abi, callData) => (0, utils_1.getTransactionDescription)(abi, callData).args;
73877
73878
  /**
73878
73879
  * Given an `Operation` object, gets the `OperationStruct` object.
73879
73880
  * @param operation an `Operation` object
@@ -73896,12 +73897,10 @@ class BatchCall {
73896
73897
  message: "The transaction is missing the to or data property.",
73897
73898
  });
73898
73899
  }
73899
- // Handles the Superfluid Call Agreement
73900
- // The only operation which has a target that is not the
73901
- // same as the to property of the transaction.
73900
+ const encoder = ethers_1.ethers.utils.defaultAbiCoder;
73901
+ // Handles Superfluid.callAgreement
73902
73902
  if (operation.type === "SUPERFLUID_CALL_AGREEMENT") {
73903
- const encoder = ethers_1.ethers.utils.defaultAbiCoder;
73904
- const functionArgs = this.getCallAgreementFunctionArgs(populatedTransaction.data);
73903
+ const functionArgs = this.getCallDataFunctionArgs(Superfluid_json_1.default.abi, populatedTransaction.data);
73905
73904
  const data = encoder.encode(["bytes", "bytes"], [functionArgs["callData"], functionArgs["userData"]]);
73906
73905
  return {
73907
73906
  operationType,
@@ -73909,7 +73908,16 @@ class BatchCall {
73909
73908
  data,
73910
73909
  };
73911
73910
  }
73912
- // Handles other cases which are not call agreeement operation
73911
+ // Handles Superfluid.callAppAction
73912
+ if (operation.type === "CALL_APP_ACTION") {
73913
+ const functionArgs = this.getCallDataFunctionArgs(Superfluid_json_1.default.abi, populatedTransaction.data);
73914
+ return {
73915
+ operationType,
73916
+ target: functionArgs["app"],
73917
+ data: functionArgs["callData"],
73918
+ };
73919
+ }
73920
+ // Handles remaining ERC20/SuperToken Operations
73913
73921
  return {
73914
73922
  operationType,
73915
73923
  target: populatedTransaction.to,
@@ -74135,7 +74143,7 @@ class ConstantFlowAgreementV1 {
74135
74143
  params.flowRate,
74136
74144
  "0x",
74137
74145
  ]);
74138
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74146
+ return this.host.callAgreement(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74139
74147
  };
74140
74148
  /**
74141
74149
  * Update a flow.
@@ -74155,7 +74163,7 @@ class ConstantFlowAgreementV1 {
74155
74163
  params.flowRate,
74156
74164
  "0x",
74157
74165
  ]);
74158
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74166
+ return this.host.callAgreement(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74159
74167
  };
74160
74168
  /**
74161
74169
  * Delete a flow.
@@ -74176,7 +74184,7 @@ class ConstantFlowAgreementV1 {
74176
74184
  normalizedReceiver,
74177
74185
  "0x",
74178
74186
  ]);
74179
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74187
+ return this.host.callAgreement(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74180
74188
  };
74181
74189
  /**
74182
74190
  * Create a flow as an operator
@@ -74199,7 +74207,7 @@ class ConstantFlowAgreementV1 {
74199
74207
  params.flowRate,
74200
74208
  "0x",
74201
74209
  ]);
74202
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74210
+ return this.host.callAgreement(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74203
74211
  };
74204
74212
  /**
74205
74213
  * Update a flow as an operator.
@@ -74222,7 +74230,7 @@ class ConstantFlowAgreementV1 {
74222
74230
  params.flowRate,
74223
74231
  "0x",
74224
74232
  ]);
74225
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74233
+ return this.host.callAgreement(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74226
74234
  };
74227
74235
  /**
74228
74236
  * Delete a flow as an operator.
@@ -74238,7 +74246,7 @@ class ConstantFlowAgreementV1 {
74238
74246
  const normalizedSender = (0, utils_1.normalizeAddress)(params.sender);
74239
74247
  const normalizedReceiver = (0, utils_1.normalizeAddress)(params.receiver);
74240
74248
  const callData = cfaInterface.encodeFunctionData("deleteFlowByOperator", [normalizedToken, normalizedSender, normalizedReceiver, "0x"]);
74241
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74249
+ return this.host.callAgreement(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74242
74250
  };
74243
74251
  /** ### Private Functions ### */
74244
74252
  /**
@@ -74246,7 +74254,7 @@ class ConstantFlowAgreementV1 {
74246
74254
  * @param timestamp last updated timestamp of flow
74247
74255
  * @param flowRate the current flow rate
74248
74256
  * @param deposit the deposit amount
74249
- * @param owedDeposit any owed depsit
74257
+ * @param owedDeposit any owed deposit
74250
74258
  * @returns {IWeb3FlowInfo} sanitized web3 flow info
74251
74259
  */
74252
74260
  this._sanitizeFlowInfo = (params) => {
@@ -74308,7 +74316,7 @@ class ConstantFlowAgreementV1 {
74308
74316
  params.flowRateAllowance,
74309
74317
  "0x",
74310
74318
  ]);
74311
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74319
+ return this.host.callAgreement(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74312
74320
  }
74313
74321
  /**
74314
74322
  * Give flow operator full control - max flow rate and create/update/delete permissions.
@@ -74321,7 +74329,7 @@ class ConstantFlowAgreementV1 {
74321
74329
  const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
74322
74330
  const normalizedFlowOperator = (0, utils_1.normalizeAddress)(params.flowOperator);
74323
74331
  const callData = cfaInterface.encodeFunctionData("authorizeFlowOperatorWithFullControl", [normalizedToken, normalizedFlowOperator, "0x"]);
74324
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74332
+ return this.host.callAgreement(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74325
74333
  }
74326
74334
  /**
74327
74335
  * Revoke flow operator control - set flow rate to 0 with no permissions.
@@ -74334,7 +74342,7 @@ class ConstantFlowAgreementV1 {
74334
74342
  const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
74335
74343
  const normalizedFlowOperator = (0, utils_1.normalizeAddress)(params.flowOperator);
74336
74344
  const callData = cfaInterface.encodeFunctionData("revokeFlowOperatorWithFullControl", [normalizedToken, normalizedFlowOperator, "0x"]);
74337
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74345
+ return this.host.callAgreement(this.options.config.cfaV1Address, callData, params.userData, params.overrides);
74338
74346
  }
74339
74347
  }
74340
74348
  exports.default = ConstantFlowAgreementV1;
@@ -74515,6 +74523,7 @@ const ConstantFlowAgreementV1_1 = __importDefault(require("./ConstantFlowAgreeme
74515
74523
  const Governance_1 = __importDefault(require("./Governance"));
74516
74524
  const Host_1 = __importDefault(require("./Host"));
74517
74525
  const InstantDistributionAgreementV1_1 = __importDefault(require("./InstantDistributionAgreementV1"));
74526
+ const Operation_1 = __importDefault(require("./Operation"));
74518
74527
  const Query_1 = __importDefault(require("./Query"));
74519
74528
  const SFError_1 = require("./SFError");
74520
74529
  const SuperToken_1 = __importDefault(require("./SuperToken"));
@@ -74581,6 +74590,15 @@ class Framework {
74581
74590
  hostAddress: this.settings.config.hostAddress,
74582
74591
  });
74583
74592
  };
74593
+ /**
74594
+ * Create an `Operation` class from the `Framework`.
74595
+ * @param txn the populated transaction to execute
74596
+ * @param type the operation type
74597
+ * @returns `Operation` class
74598
+ */
74599
+ this.operation = (txn, type) => {
74600
+ return new Operation_1.default(txn, type);
74601
+ };
74584
74602
  /**
74585
74603
  * Loads `NativeAssetSuperToken` class from the `Framework`. Will throw if token is not NativeAssetSuperToken.
74586
74604
  * @param tokenAddressOrSymbol
@@ -74777,7 +74795,7 @@ Framework.create = async (options) => {
74777
74795
  }
74778
74796
  };
74779
74797
 
74780
- },{"./BatchCall":312,"./ConstantFlowAgreementV1":313,"./Governance":316,"./Host":317,"./InstantDistributionAgreementV1":318,"./Query":320,"./SFError":321,"./SuperToken":322,"./abi/IResolver.json":326,"./abi/SuperfluidLoader.json":331,"./constants":333,"./frameworkHelpers":336,"./utils":382,"ethers":148}],316:[function(require,module,exports){
74798
+ },{"./BatchCall":312,"./ConstantFlowAgreementV1":313,"./Governance":316,"./Host":317,"./InstantDistributionAgreementV1":318,"./Operation":319,"./Query":320,"./SFError":321,"./SuperToken":322,"./abi/IResolver.json":326,"./abi/SuperfluidLoader.json":331,"./constants":333,"./frameworkHelpers":336,"./utils":382,"ethers":148}],316:[function(require,module,exports){
74781
74799
  "use strict";
74782
74800
  var __importDefault = (this && this.__importDefault) || function (mod) {
74783
74801
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -74834,7 +74852,7 @@ class Governance {
74834
74852
  */
74835
74853
  this.getGovernanceParameters = async ({ providerOrSigner, token = ethers_1.ethers.constants.AddressZero, }) => {
74836
74854
  const pppPromise = this.getPPPConfig({ providerOrSigner, token });
74837
- const rewardPromose = this.getRewardAddress({
74855
+ const rewardPromise = this.getRewardAddress({
74838
74856
  providerOrSigner,
74839
74857
  token,
74840
74858
  });
@@ -74844,7 +74862,7 @@ class Governance {
74844
74862
  });
74845
74863
  const data = await Promise.all([
74846
74864
  pppPromise,
74847
- rewardPromose,
74865
+ rewardPromise,
74848
74866
  minimumDepositPromise,
74849
74867
  ]);
74850
74868
  return {
@@ -74883,10 +74901,21 @@ class Host {
74883
74901
  * @param overrides ethers overrides object for more control over the transaction sent.
74884
74902
  * @returns {Operation} an `Operation` class
74885
74903
  */
74886
- this.populateCallAgreementTxnAndReturnOperation = (agreementAddress, callData, userData, overrides) => {
74904
+ this.callAgreement = (agreementAddress, callData, userData, overrides) => {
74887
74905
  const txn = this.contract.populateTransaction.callAgreement(agreementAddress, callData, userData || "0x", overrides || {});
74888
74906
  return new Operation_1.default(txn, "SUPERFLUID_CALL_AGREEMENT");
74889
74907
  };
74908
+ /**
74909
+ * Creates an Operation of the `callAppAction` function on the host contract.
74910
+ * @param app the address of the Super App you are calling
74911
+ * @param callData the encoded callData for the function
74912
+ * @param overrides ethers overrides object for more control over the transaction sent.
74913
+ * @returns {Operation} an `Operation` class
74914
+ */
74915
+ this.callAppAction = (app, callData, overrides) => {
74916
+ const txn = this.contract.populateTransaction.callAppAction(app, callData, overrides || {});
74917
+ return new Operation_1.default(txn, "CALL_APP_ACTION");
74918
+ };
74890
74919
  this.contract = new ethers_1.ethers.Contract(hostAddress, Superfluid_json_1.default.abi);
74891
74920
  }
74892
74921
  }
@@ -74989,7 +75018,7 @@ class InstantDistributionAgreementV1 {
74989
75018
  params.indexId,
74990
75019
  "0x",
74991
75020
  ]);
74992
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75021
+ return this.host.callAgreement(this.options.config.idaV1Address, callData, params.userData, params.overrides);
74993
75022
  };
74994
75023
  /**
74995
75024
  * Distributes `amount` of `superToken` to an index
@@ -75008,7 +75037,7 @@ class InstantDistributionAgreementV1 {
75008
75037
  params.amount,
75009
75038
  "0x",
75010
75039
  ]);
75011
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75040
+ return this.host.callAgreement(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75012
75041
  };
75013
75042
  /**
75014
75043
  * Updates the `indexValue` of an index.
@@ -75028,7 +75057,7 @@ class InstantDistributionAgreementV1 {
75028
75057
  params.indexValue,
75029
75058
  "0x",
75030
75059
  ]);
75031
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75060
+ return this.host.callAgreement(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75032
75061
  };
75033
75062
  /**
75034
75063
  * Updates the `units` allocated to a Subscription.
@@ -75050,7 +75079,7 @@ class InstantDistributionAgreementV1 {
75050
75079
  params.units,
75051
75080
  "0x",
75052
75081
  ]);
75053
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75082
+ return this.host.callAgreement(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75054
75083
  };
75055
75084
  /**
75056
75085
  * Approves a Subscription, so the Subscriber won't need to claim tokens when the Publisher distributes.
@@ -75065,10 +75094,10 @@ class InstantDistributionAgreementV1 {
75065
75094
  const normalizedPublisher = (0, utils_1.normalizeAddress)(params.publisher);
75066
75095
  const normalizedToken = (0, utils_1.normalizeAddress)(params.superToken);
75067
75096
  const callData = idaInterface.encodeFunctionData("approveSubscription", [normalizedToken, normalizedPublisher, params.indexId, "0x"]);
75068
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75097
+ return this.host.callAgreement(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75069
75098
  };
75070
75099
  /**
75071
- * Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributres.
75100
+ * Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributes.
75072
75101
  * @param indexId The id of the index.
75073
75102
  * @param superToken The superToken of the index.
75074
75103
  * @param subscriber The subscriber address whose subscription you want to revoke.
@@ -75085,14 +75114,14 @@ class InstantDistributionAgreementV1 {
75085
75114
  params.indexId,
75086
75115
  "0x",
75087
75116
  ]);
75088
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75117
+ return this.host.callAgreement(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75089
75118
  };
75090
75119
  /**
75091
75120
  * Deletes a Subscription by setting the `units` allocated to the Subscriber to 0.
75092
75121
  * @param indexId The id of the index.
75093
75122
  * @param superToken The superToken of the index.
75094
75123
  * @param subscriber The subscriber address whose subscription you want to delete.
75095
- * @param publisher The publisher address of the index you are targetting.
75124
+ * @param publisher The publisher address of the index you are targeting.
75096
75125
  * @param userData Extra user data provided.
75097
75126
  * @param overrides ethers overrides object for more control over the transaction sent.
75098
75127
  * @returns {Operation} An instance of Operation which can be executed or batched.
@@ -75108,14 +75137,14 @@ class InstantDistributionAgreementV1 {
75108
75137
  normalizedSubscriber,
75109
75138
  "0x",
75110
75139
  ]);
75111
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75140
+ return this.host.callAgreement(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75112
75141
  };
75113
75142
  /**
75114
75143
  * Claims any pending tokens allocated to the Subscription (unapproved).
75115
75144
  * @param indexId The id of the index.
75116
75145
  * @param superToken The superToken of the index.
75117
75146
  * @param subscriber The subscriber address whose subscription you want to delete.
75118
- * @param publisher The publisher address of the index you are targetting.
75147
+ * @param publisher The publisher address of the index you are targeting.
75119
75148
  * @param userData Extra user data provided.
75120
75149
  * @param overrides ethers overrides object for more control over the transaction sent.
75121
75150
  * @returns {Operation} An instance of Operation which can be executed or batched.
@@ -75131,7 +75160,7 @@ class InstantDistributionAgreementV1 {
75131
75160
  normalizedSubscriber,
75132
75161
  "0x",
75133
75162
  ]);
75134
- return this.host.populateCallAgreementTxnAndReturnOperation(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75163
+ return this.host.callAgreement(this.options.config.idaV1Address, callData, params.userData, params.overrides);
75135
75164
  };
75136
75165
  this.options = options;
75137
75166
  this.host = new Host_1.default(options.config.hostAddress);
@@ -75154,7 +75183,7 @@ class Operation {
75154
75183
  /**
75155
75184
  * Executes the operation via the provided signer.
75156
75185
  * @description Populates all fields of the transaction, signs it and sends it to the network.
75157
- * @param signer The signer of the transacation
75186
+ * @param signer The signer of the transaction
75158
75187
  * @returns {ethers.providers.TransactionResponse} A TransactionResponse object which can be awaited
75159
75188
  */
75160
75189
  this.exec = async (signer) => {
@@ -75191,7 +75220,7 @@ class Operation {
75191
75220
  };
75192
75221
  /**
75193
75222
  * Signs the populated transaction via the provided signer (what you intend on sending to the network).
75194
- * @param signer The signer of the transacation
75223
+ * @param signer The signer of the transaction
75195
75224
  * @returns {Promise<string>} Fully serialized, signed transaction
75196
75225
  */
75197
75226
  this.getSignedTransaction = async (signer) => {
@@ -75211,7 +75240,7 @@ class Operation {
75211
75240
  /**
75212
75241
  * Gets the transaction hash of the transaction.
75213
75242
  * @description Calculates this by getting the keccak256 hash of the signedTxn.
75214
- * @param signer The signer of the transacation
75243
+ * @param signer The signer of the transaction
75215
75244
  * @returns {Promise<string>} The transaction hash of the transaction
75216
75245
  */
75217
75246
  this.getTransactionHash = async (signer) => {
@@ -75525,15 +75554,25 @@ const errorTypeToTitleMap = new Map([
75525
75554
  ["UNCLEAN_PERMISSIONS", "Unclean Permissions"],
75526
75555
  ["NEGATIVE_FLOW_ALLOWANCE", "Negative Flow Rate Allowance"],
75527
75556
  ]);
75557
+ // NOTE: this is a temporary solution to fix serializeError
75558
+ // which throws a weird JSON error
75559
+ const stringifyCause = (cause) => {
75560
+ try {
75561
+ return JSON.stringify((0, serialize_error_1.serializeError)(cause), null, 2);
75562
+ }
75563
+ catch (err) {
75564
+ return JSON.stringify(cause, null, 2);
75565
+ }
75566
+ };
75528
75567
  class SFError extends Error {
75529
75568
  constructor({ type, message, cause }) {
75530
75569
  const fullMessage = `${errorTypeToTitleMap.get(type)} Error: ${message}${cause
75531
75570
  ? `
75532
- Caused by: ${JSON.stringify((0, serialize_error_1.serializeError)(cause), null, 2)}`
75571
+ Caused by: ${stringifyCause(cause)}`
75533
75572
  : ""}`;
75534
75573
  super(fullMessage, cause
75535
75574
  ? {
75536
- cause: cause, // Currently "unknown" is not compatible with "cause" (because it expectes "Error" and that's why we cast) but this was recently changed and merged to also allow "unknown": https://github.com/microsoft/TypeScript/pull/49639
75575
+ cause: cause, // Currently "unknown" is not compatible with "cause" (because it expects "Error" and that's why we cast) but this was recently changed and merged to also allow "unknown": https://github.com/microsoft/TypeScript/pull/49639
75537
75576
  }
75538
75577
  : {});
75539
75578
  // Fallback back environments where `Error.cause` is now yet natively supported
@@ -84376,7 +84415,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
84376
84415
  return (mod && mod.__esModule) ? mod : { "default": mod };
84377
84416
  };
84378
84417
  Object.defineProperty(exports, "__esModule", { value: true });
84379
- exports.WrapperSuperToken = exports.SuperToken = exports.Query = exports.PureSuperToken = exports.NativeAssetSuperToken = exports.InstantDistributionAgreementV1 = exports.Host = exports.Governance = exports.Framework = exports.ERC20Token = exports.ConstantFlowAgreementV1 = exports.BatchCall = void 0;
84418
+ exports.WrapperSuperToken = exports.SuperToken = exports.Query = exports.PureSuperToken = exports.NativeAssetSuperToken = exports.InstantDistributionAgreementV1 = exports.Host = exports.Governance = exports.Framework = exports.ERC20Token = exports.ConstantFlowAgreementV1 = exports.BatchCall = exports.Operation = void 0;
84380
84419
  __exportStar(require("./subgraph/schema.generated"), exports);
84381
84420
  const BatchCall_1 = __importDefault(require("./BatchCall"));
84382
84421
  exports.BatchCall = BatchCall_1.default;
@@ -84392,6 +84431,8 @@ const Host_1 = __importDefault(require("./Host"));
84392
84431
  exports.Host = Host_1.default;
84393
84432
  const InstantDistributionAgreementV1_1 = __importDefault(require("./InstantDistributionAgreementV1"));
84394
84433
  exports.InstantDistributionAgreementV1 = InstantDistributionAgreementV1_1.default;
84434
+ const Operation_1 = __importDefault(require("./Operation"));
84435
+ exports.Operation = Operation_1.default;
84395
84436
  const Query_1 = __importDefault(require("./Query"));
84396
84437
  exports.Query = Query_1.default;
84397
84438
  const SuperToken_1 = __importStar(require("./SuperToken"));
@@ -84426,7 +84467,7 @@ __exportStar(require("./subgraph/mappedSubgraphTypes"), exports);
84426
84467
  __exportStar(require("./SFError"), exports);
84427
84468
  __exportStar(require("./subgraph/subgraphQueryHandler"), exports);
84428
84469
 
84429
- },{"./BatchCall":312,"./ConstantFlowAgreementV1":313,"./ERC20Token":314,"./Framework":315,"./Governance":316,"./Host":317,"./InstantDistributionAgreementV1":318,"./Query":320,"./SFError":321,"./SuperToken":322,"./constants":333,"./events":335,"./interfaces":338,"./ordering":340,"./pagination":341,"./subgraph/entities/account/account":343,"./subgraph/entities/accountTokenSnapshot/accountTokenSnapshot":345,"./subgraph/entities/accountTokenSnapshotLog/accountTokenSnapshotLog":347,"./subgraph/entities/index/index":349,"./subgraph/entities/indexSubscription/indexSubscription":351,"./subgraph/entities/stream/stream":353,"./subgraph/entities/streamPeriod/streamPeriod":355,"./subgraph/entities/token/token":357,"./subgraph/entities/tokenStatistic/tokenStatistic":359,"./subgraph/entities/tokenStatisticLog/tokenStatisticLog":361,"./subgraph/events/events":364,"./subgraph/events/flowUpdatedEvent":365,"./subgraph/events/indexUpdatedEvent":366,"./subgraph/events/subscriptionUnitsUpdatedEvents":367,"./subgraph/events/transferEvents":368,"./subgraph/mappedSubgraphTypes":369,"./subgraph/meta/meta":371,"./subgraph/schema.generated":379,"./subgraph/subgraphQueryHandler":380,"./types":381,"./utils":382}],338:[function(require,module,exports){
84470
+ },{"./BatchCall":312,"./ConstantFlowAgreementV1":313,"./ERC20Token":314,"./Framework":315,"./Governance":316,"./Host":317,"./InstantDistributionAgreementV1":318,"./Operation":319,"./Query":320,"./SFError":321,"./SuperToken":322,"./constants":333,"./events":335,"./interfaces":338,"./ordering":340,"./pagination":341,"./subgraph/entities/account/account":343,"./subgraph/entities/accountTokenSnapshot/accountTokenSnapshot":345,"./subgraph/entities/accountTokenSnapshotLog/accountTokenSnapshotLog":347,"./subgraph/entities/index/index":349,"./subgraph/entities/indexSubscription/indexSubscription":351,"./subgraph/entities/stream/stream":353,"./subgraph/entities/streamPeriod/streamPeriod":355,"./subgraph/entities/token/token":357,"./subgraph/entities/tokenStatistic/tokenStatistic":359,"./subgraph/entities/tokenStatisticLog/tokenStatisticLog":361,"./subgraph/events/events":364,"./subgraph/events/flowUpdatedEvent":365,"./subgraph/events/indexUpdatedEvent":366,"./subgraph/events/subscriptionUnitsUpdatedEvents":367,"./subgraph/events/transferEvents":368,"./subgraph/mappedSubgraphTypes":369,"./subgraph/meta/meta":371,"./subgraph/schema.generated":379,"./subgraph/subgraphQueryHandler":380,"./types":381,"./utils":382}],338:[function(require,module,exports){
84430
84471
  "use strict";
84431
84472
  Object.defineProperty(exports, "__esModule", { value: true });
84432
84473
 
@@ -1,3 +1,4 @@
1
+ import { JsonFragment } from "@ethersproject/abi";
1
2
  import { ethers } from "ethers";
2
3
  import Host from "./Host";
3
4
  import Operation from "./Operation";
@@ -19,11 +20,12 @@ export default class BatchCall {
19
20
  host: Host;
20
21
  constructor(options: IBatchCallOptions);
21
22
  /**
22
- * Gets the call agreement function arguments.
23
- * @param callData callData of the function
23
+ * Gets function arguments given an ABI and callData.
24
+ * @param abi the abi fragments of a contract/function
25
+ * @param callData call data of the function
24
26
  * @returns {ethers.utils.Result} call agreement function arguments
25
27
  */
26
- getCallAgreementFunctionArgs: (callData: string) => ethers.utils.Result;
28
+ getCallDataFunctionArgs: (abi: string | readonly (string | ethers.utils.Fragment | JsonFragment)[], callData: string) => ethers.utils.Result;
27
29
  /**
28
30
  * Given an `Operation` object, gets the `OperationStruct` object.
29
31
  * @param operation an `Operation` object
@@ -1 +1 @@
1
- {"version":3,"file":"BatchCall.d.ts","sourceRoot":"","sources":["../../src/BatchCall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,SAA4B,MAAM,aAAa,CAAC;AAKvD,UAAU,iBAAiB;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,aAAa,CAAC,SAAS,CAA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zB;AAWD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAC1B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE,IAAI,CAAC;gBAEC,OAAO,EAAE,iBAAiB;IAKtC;;;;;OAKG;IACH,uBAAuB,QAEb,MAAM,GACN,SAAS,CAAC,MAAM,GAAG,OAAO,KAAK,CAAC,QAAQ,GAAG,YAAY,CAAC,EAAE,YACtD,MAAM,KACjB,OAAO,KAAK,CAAC,MAAM,CAAkD;IAExE;;;;;OAKG;IACH,kBAAkB,cACH,SAAS,SACb,MAAM,KACd,QAAQ,eAAe,CAAC,CA0DzB;IAEF;;;OAGG;IACH,IAAI,+BAA+B,IAAI,OAAO,CAAC,eAAe,CAAC,EAAE,CAIhE;IAED;;;;OAIG;IACH,IAAI,WACQ,OAAO,MAAM,KACtB,QAAQ,OAAO,mBAAmB,CAAC,CAepC;IAKF;;;;OAIG;IACH,WAAW,WACC,OAAO,MAAM,KACtB,QAAQ,OAAO,mBAAmB,CAAC,CAepC;CACL"}
@@ -23,11 +23,12 @@ const operationTypeStringToTypeMap = new Map([
23
23
  class BatchCall {
24
24
  constructor(options) {
25
25
  /**
26
- * Gets the call agreement function arguments.
27
- * @param callData callData of the function
26
+ * Gets function arguments given an ABI and callData.
27
+ * @param abi the abi fragments of a contract/function
28
+ * @param callData call data of the function
28
29
  * @returns {ethers.utils.Result} call agreement function arguments
29
30
  */
30
- this.getCallAgreementFunctionArgs = (callData) => (0, utils_1.getTransactionDescription)(Superfluid_json_1.default.abi, callData).args;
31
+ this.getCallDataFunctionArgs = (abi, callData) => (0, utils_1.getTransactionDescription)(abi, callData).args;
31
32
  /**
32
33
  * Given an `Operation` object, gets the `OperationStruct` object.
33
34
  * @param operation an `Operation` object
@@ -50,12 +51,10 @@ class BatchCall {
50
51
  message: "The transaction is missing the to or data property.",
51
52
  });
52
53
  }
53
- // Handles the Superfluid Call Agreement
54
- // The only operation which has a target that is not the
55
- // same as the to property of the transaction.
54
+ const encoder = ethers_1.ethers.utils.defaultAbiCoder;
55
+ // Handles Superfluid.callAgreement
56
56
  if (operation.type === "SUPERFLUID_CALL_AGREEMENT") {
57
- const encoder = ethers_1.ethers.utils.defaultAbiCoder;
58
- const functionArgs = this.getCallAgreementFunctionArgs(populatedTransaction.data);
57
+ const functionArgs = this.getCallDataFunctionArgs(Superfluid_json_1.default.abi, populatedTransaction.data);
59
58
  const data = encoder.encode(["bytes", "bytes"], [functionArgs["callData"], functionArgs["userData"]]);
60
59
  return {
61
60
  operationType,
@@ -63,7 +62,16 @@ class BatchCall {
63
62
  data,
64
63
  };
65
64
  }
66
- // Handles other cases which are not call agreeement operation
65
+ // Handles Superfluid.callAppAction
66
+ if (operation.type === "CALL_APP_ACTION") {
67
+ const functionArgs = this.getCallDataFunctionArgs(Superfluid_json_1.default.abi, populatedTransaction.data);
68
+ return {
69
+ operationType,
70
+ target: functionArgs["app"],
71
+ data: functionArgs["callData"],
72
+ };
73
+ }
74
+ // Handles remaining ERC20/SuperToken Operations
67
75
  return {
68
76
  operationType,
69
77
  target: populatedTransaction.to,
@@ -1 +1 @@
1
- {"version":3,"file":"BatchCall.js","sourceRoot":"","sources":["../../src/BatchCall.ts"],"names":[],"mappings":";;;;;AAAA,mCAAgC;AAEhC,kDAA0B;AAE1B,uCAAoC;AACpC,4EAAkD;AAClD,mCAA+E;AAa/E,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAwB;IAChE,CAAC,eAAe,EAAE,CAAC,CAAC;IACpB,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAC1B,CAAC,oBAAoB,EAAE,GAAG,CAAC;IAC3B,CAAC,sBAAsB,EAAE,GAAG,CAAC;IAC7B,CAAC,2BAA2B,EAAE,GAAG,CAAC;IAClC,CAAC,iBAAiB,EAAE,GAAG,CAAC;CAC3B,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAqB,SAAS;IAI1B,YAAY,OAA0B;QAKtC;;;;WAIG;QACH,iCAA4B,GA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,CAAC,EAAE,CAAC,EAAE,EAAE,CACxC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAChC,CAAC;IACN,CAAC;CAoDJ;AAvJD,4BAuJC"}
@@ -151,7 +151,7 @@ export default class ConstantFlowAgreementV1 {
151
151
  * @param timestamp last updated timestamp of flow
152
152
  * @param flowRate the current flow rate
153
153
  * @param deposit the deposit amount
154
- * @param owedDeposit any owed depsit
154
+ * @param owedDeposit any owed deposit
155
155
  * @returns {IWeb3FlowInfo} sanitized web3 flow info
156
156
  */
157
157
  _sanitizeFlowInfo: (params: IWeb3FlowInfoParams) => IWeb3FlowInfo;