@superfluid-finance/sdk-core 0.5.4 → 0.5.6-dev.32db5c3.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 (129) hide show
  1. package/CHANGELOG.md +15 -1
  2. package/dist/index.umd.js +794 -2727
  3. package/dist/main/BatchCall.d.ts.map +1 -1
  4. package/dist/main/BatchCall.js +8 -26
  5. package/dist/main/BatchCall.js.map +1 -1
  6. package/dist/main/ConstantFlowAgreementV1.d.ts +1 -1
  7. package/dist/main/ConstantFlowAgreementV1.js +1 -1
  8. package/dist/main/Governance.js +2 -2
  9. package/dist/main/InstantDistributionAgreementV1.d.ts +3 -3
  10. package/dist/main/InstantDistributionAgreementV1.js +3 -3
  11. package/dist/main/Operation.d.ts +3 -3
  12. package/dist/main/Operation.d.ts.map +1 -1
  13. package/dist/main/Operation.js +10 -39
  14. package/dist/main/Operation.js.map +1 -1
  15. package/dist/main/SFError.d.ts +1 -1
  16. package/dist/main/SFError.d.ts.map +1 -1
  17. package/dist/main/SFError.js +12 -18
  18. package/dist/main/SFError.js.map +1 -1
  19. package/dist/main/abi/Superfluid.json +13 -18
  20. package/dist/main/abi/SuperfluidGovernanceII.json +135 -17
  21. package/dist/main/constants.d.ts +0 -30
  22. package/dist/main/constants.d.ts.map +1 -1
  23. package/dist/main/constants.js +21 -191
  24. package/dist/main/constants.js.map +1 -1
  25. package/dist/main/defaultSubgraphReleaseTag.json +1 -1
  26. package/dist/main/interfaces.d.ts +1 -0
  27. package/dist/main/interfaces.d.ts.map +1 -1
  28. package/dist/main/miniSerializeError.d.ts +14 -0
  29. package/dist/main/miniSerializeError.d.ts.map +1 -0
  30. package/dist/main/miniSerializeError.js +29 -0
  31. package/dist/main/miniSerializeError.js.map +1 -0
  32. package/dist/main/subgraph/entities/token/tokens.generated.d.ts +1 -0
  33. package/dist/main/subgraph/entities/token/tokens.generated.d.ts.map +1 -1
  34. package/dist/main/subgraph/entities/token/tokens.generated.js +1 -1
  35. package/dist/main/subgraph/entities/token/tokens.generated.js.map +1 -1
  36. package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.d.ts +1 -0
  37. package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.d.ts.map +1 -1
  38. package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.js +1 -1
  39. package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.js.map +1 -1
  40. package/dist/main/subgraph/queries/getIndexSubscriptions.generated.d.ts +1 -0
  41. package/dist/main/subgraph/queries/getIndexSubscriptions.generated.d.ts.map +1 -1
  42. package/dist/main/subgraph/queries/getIndexSubscriptions.generated.js +1 -1
  43. package/dist/main/subgraph/queries/getIndexSubscriptions.generated.js.map +1 -1
  44. package/dist/main/subgraph/queries/getIndexes.generated.d.ts +1 -0
  45. package/dist/main/subgraph/queries/getIndexes.generated.d.ts.map +1 -1
  46. package/dist/main/subgraph/queries/getIndexes.generated.js +1 -1
  47. package/dist/main/subgraph/queries/getIndexes.generated.js.map +1 -1
  48. package/dist/main/subgraph/queries/getStreams.generated.d.ts +1 -0
  49. package/dist/main/subgraph/queries/getStreams.generated.d.ts.map +1 -1
  50. package/dist/main/subgraph/queries/getStreams.generated.js +1 -1
  51. package/dist/main/subgraph/queries/getStreams.generated.js.map +1 -1
  52. package/dist/main/subgraph/queries/getTokens.generated.d.ts +1 -0
  53. package/dist/main/subgraph/queries/getTokens.generated.d.ts.map +1 -1
  54. package/dist/main/subgraph/queries/getTokens.generated.js +1 -1
  55. package/dist/main/subgraph/queries/getTokens.generated.js.map +1 -1
  56. package/dist/main/typechain/Superfluid.d.ts +45 -49
  57. package/dist/main/typechain/Superfluid.d.ts.map +1 -1
  58. package/dist/main/typechain/SuperfluidGovernanceII.d.ts +104 -21
  59. package/dist/main/typechain/SuperfluidGovernanceII.d.ts.map +1 -1
  60. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.d.ts.map +1 -1
  61. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.js +135 -17
  62. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.js.map +1 -1
  63. package/dist/main/typechain/factories/Superfluid__factory.d.ts.map +1 -1
  64. package/dist/main/typechain/factories/Superfluid__factory.js +13 -18
  65. package/dist/main/typechain/factories/Superfluid__factory.js.map +1 -1
  66. package/dist/module/BatchCall.d.ts.map +1 -1
  67. package/dist/module/BatchCall.js +8 -26
  68. package/dist/module/BatchCall.js.map +1 -1
  69. package/dist/module/ConstantFlowAgreementV1.d.ts +1 -1
  70. package/dist/module/ConstantFlowAgreementV1.js +1 -1
  71. package/dist/module/Governance.js +2 -2
  72. package/dist/module/InstantDistributionAgreementV1.d.ts +3 -3
  73. package/dist/module/InstantDistributionAgreementV1.js +3 -3
  74. package/dist/module/Operation.d.ts +3 -3
  75. package/dist/module/Operation.d.ts.map +1 -1
  76. package/dist/module/Operation.js +10 -39
  77. package/dist/module/Operation.js.map +1 -1
  78. package/dist/module/SFError.d.ts +1 -1
  79. package/dist/module/SFError.d.ts.map +1 -1
  80. package/dist/module/SFError.js +12 -18
  81. package/dist/module/SFError.js.map +1 -1
  82. package/dist/module/abi/Superfluid.json +13 -18
  83. package/dist/module/abi/SuperfluidGovernanceII.json +135 -17
  84. package/dist/module/constants.d.ts +0 -30
  85. package/dist/module/constants.d.ts.map +1 -1
  86. package/dist/module/constants.js +20 -190
  87. package/dist/module/constants.js.map +1 -1
  88. package/dist/module/defaultSubgraphReleaseTag.json +1 -1
  89. package/dist/module/interfaces.d.ts +1 -0
  90. package/dist/module/interfaces.d.ts.map +1 -1
  91. package/dist/module/miniSerializeError.d.ts +14 -0
  92. package/dist/module/miniSerializeError.d.ts.map +1 -0
  93. package/dist/module/miniSerializeError.js +25 -0
  94. package/dist/module/miniSerializeError.js.map +1 -0
  95. package/dist/module/subgraph/entities/token/tokens.generated.d.ts +1 -0
  96. package/dist/module/subgraph/entities/token/tokens.generated.d.ts.map +1 -1
  97. package/dist/module/subgraph/entities/token/tokens.generated.js +1 -1
  98. package/dist/module/subgraph/entities/token/tokens.generated.js.map +1 -1
  99. package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.d.ts +1 -0
  100. package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.d.ts.map +1 -1
  101. package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.js +1 -1
  102. package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.js.map +1 -1
  103. package/dist/module/subgraph/queries/getIndexSubscriptions.generated.d.ts +1 -0
  104. package/dist/module/subgraph/queries/getIndexSubscriptions.generated.d.ts.map +1 -1
  105. package/dist/module/subgraph/queries/getIndexSubscriptions.generated.js +1 -1
  106. package/dist/module/subgraph/queries/getIndexSubscriptions.generated.js.map +1 -1
  107. package/dist/module/subgraph/queries/getIndexes.generated.d.ts +1 -0
  108. package/dist/module/subgraph/queries/getIndexes.generated.d.ts.map +1 -1
  109. package/dist/module/subgraph/queries/getIndexes.generated.js +1 -1
  110. package/dist/module/subgraph/queries/getIndexes.generated.js.map +1 -1
  111. package/dist/module/subgraph/queries/getStreams.generated.d.ts +1 -0
  112. package/dist/module/subgraph/queries/getStreams.generated.d.ts.map +1 -1
  113. package/dist/module/subgraph/queries/getStreams.generated.js +1 -1
  114. package/dist/module/subgraph/queries/getStreams.generated.js.map +1 -1
  115. package/dist/module/subgraph/queries/getTokens.generated.d.ts +1 -0
  116. package/dist/module/subgraph/queries/getTokens.generated.d.ts.map +1 -1
  117. package/dist/module/subgraph/queries/getTokens.generated.js +1 -1
  118. package/dist/module/subgraph/queries/getTokens.generated.js.map +1 -1
  119. package/dist/module/typechain/Superfluid.d.ts +45 -49
  120. package/dist/module/typechain/Superfluid.d.ts.map +1 -1
  121. package/dist/module/typechain/SuperfluidGovernanceII.d.ts +104 -21
  122. package/dist/module/typechain/SuperfluidGovernanceII.d.ts.map +1 -1
  123. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.d.ts.map +1 -1
  124. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.js +135 -17
  125. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.js.map +1 -1
  126. package/dist/module/typechain/factories/Superfluid__factory.d.ts.map +1 -1
  127. package/dist/module/typechain/factories/Superfluid__factory.js +13 -18
  128. package/dist/module/typechain/factories/Superfluid__factory.js.map +1 -1
  129. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"BatchCall.d.ts","sourceRoot":"","sources":["../../src/BatchCall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,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,CAAC,CAAC;CACxC;AAED,UAAU,eAAe;IACrB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;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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ACH,WAAW,WACC,OAAO,MAAM,KACtB,QAAQ,OAAO,mBAAmB,CAAC,CAOpC;CACL"}
@@ -84,19 +84,10 @@ class BatchCall {
84
84
  * @returns {Promise<ethers.ContractTransaction>} ContractTransaction object
85
85
  */
86
86
  this.exec = async (signer) => {
87
- try {
88
- const operationStructArray = await Promise.all(this.getOperationStructArrayPromises);
89
- return await this.host.contract
90
- .connect(signer)
91
- .batchCall(operationStructArray);
92
- }
93
- catch (err) {
94
- throw new SFError_1.SFError({
95
- type: "BATCH_CALL_ERROR",
96
- message: "There was an error executing your batch call:",
97
- cause: err,
98
- });
99
- }
87
+ const operationStructArray = await Promise.all(this.getOperationStructArrayPromises);
88
+ return await this.host.contract
89
+ .connect(signer)
90
+ .batchCall(operationStructArray);
100
91
  };
101
92
  /* istanbul ignore next */
102
93
  // TODO: user signs the transaction they'd like to execute and gives
@@ -107,19 +98,10 @@ class BatchCall {
107
98
  * @returns {Promise<ethers.ContractTransaction>} ContractTransaction object
108
99
  */
109
100
  this.execForward = async (signer) => {
110
- try {
111
- const operationStructArray = await Promise.all(this.getOperationStructArrayPromises);
112
- return await this.host.contract
113
- .connect(signer)
114
- .forwardBatchCall(operationStructArray);
115
- }
116
- catch (err) {
117
- throw new SFError_1.SFError({
118
- type: "BATCH_CALL_ERROR",
119
- message: "There was an error executing your batch call:",
120
- cause: err,
121
- });
122
- }
101
+ const operationStructArray = await Promise.all(this.getOperationStructArrayPromises);
102
+ return await this.host.contract
103
+ .connect(signer)
104
+ .forwardBatchCall(operationStructArray);
123
105
  };
124
106
  this.options = options;
125
107
  this.host = new Host_1.default(options.hostAddress);
@@ -1 +1 @@
1
- {"version":3,"file":"BatchCall.js","sourceRoot":"","sources":["../../src/BatchCall.ts"],"names":[],"mappings":";;;;;AACA,mCAAgC;AAEhC,kDAA0B;AAE1B,uCAAoC;AACpC,4EAAkD;AAClD,mCAA+E;AAa/E,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAwB;IAChE,CAAC,eAA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oB,CAAC,CAAC;QAChD,CAAC,CAAC;QAjIE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9C,CAAC;IAoFD;;;OAGG;IACH,IAAI,+BAA+B;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACxC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAChC,CAAC;IACN,CAAC;CAoCJ;AAvID,4BAuIC"}
@@ -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;
@@ -271,7 +271,7 @@ class ConstantFlowAgreementV1 {
271
271
  * @param timestamp last updated timestamp of flow
272
272
  * @param flowRate the current flow rate
273
273
  * @param deposit the deposit amount
274
- * @param owedDeposit any owed depsit
274
+ * @param owedDeposit any owed deposit
275
275
  * @returns {IWeb3FlowInfo} sanitized web3 flow info
276
276
  */
277
277
  this._sanitizeFlowInfo = (params) => {
@@ -54,7 +54,7 @@ class Governance {
54
54
  */
55
55
  this.getGovernanceParameters = async ({ providerOrSigner, token = ethers_1.ethers.constants.AddressZero, }) => {
56
56
  const pppPromise = this.getPPPConfig({ providerOrSigner, token });
57
- const rewardPromose = this.getRewardAddress({
57
+ const rewardPromise = this.getRewardAddress({
58
58
  providerOrSigner,
59
59
  token,
60
60
  });
@@ -64,7 +64,7 @@ class Governance {
64
64
  });
65
65
  const data = await Promise.all([
66
66
  pppPromise,
67
- rewardPromose,
67
+ rewardPromise,
68
68
  minimumDepositPromise,
69
69
  ]);
70
70
  return {
@@ -84,7 +84,7 @@ export default class InstantDistributionAgreementV1 {
84
84
  */
85
85
  approveSubscription: (params: IApproveSubscriptionParams) => Operation;
86
86
  /**
87
- * Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributres.
87
+ * Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributes.
88
88
  * @param indexId The id of the index.
89
89
  * @param superToken The superToken of the index.
90
90
  * @param subscriber The subscriber address whose subscription you want to revoke.
@@ -98,7 +98,7 @@ export default class InstantDistributionAgreementV1 {
98
98
  * @param indexId The id of the index.
99
99
  * @param superToken The superToken of the index.
100
100
  * @param subscriber The subscriber address whose subscription you want to delete.
101
- * @param publisher The publisher address of the index you are targetting.
101
+ * @param publisher The publisher address of the index you are targeting.
102
102
  * @param userData Extra user data provided.
103
103
  * @param overrides ethers overrides object for more control over the transaction sent.
104
104
  * @returns {Operation} An instance of Operation which can be executed or batched.
@@ -109,7 +109,7 @@ export default class InstantDistributionAgreementV1 {
109
109
  * @param indexId The id of the index.
110
110
  * @param superToken The superToken of the index.
111
111
  * @param subscriber The subscriber address whose subscription you want to delete.
112
- * @param publisher The publisher address of the index you are targetting.
112
+ * @param publisher The publisher address of the index you are targeting.
113
113
  * @param userData Extra user data provided.
114
114
  * @param overrides ethers overrides object for more control over the transaction sent.
115
115
  * @returns {Operation} An instance of Operation which can be executed or batched.
@@ -173,7 +173,7 @@ class InstantDistributionAgreementV1 {
173
173
  return this.host.callAgreement(this.options.config.idaV1Address, callData, params.userData, params.overrides);
174
174
  };
175
175
  /**
176
- * Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributres.
176
+ * Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributes.
177
177
  * @param indexId The id of the index.
178
178
  * @param superToken The superToken of the index.
179
179
  * @param subscriber The subscriber address whose subscription you want to revoke.
@@ -197,7 +197,7 @@ class InstantDistributionAgreementV1 {
197
197
  * @param indexId The id of the index.
198
198
  * @param superToken The superToken of the index.
199
199
  * @param subscriber The subscriber address whose subscription you want to delete.
200
- * @param publisher The publisher address of the index you are targetting.
200
+ * @param publisher The publisher address of the index you are targeting.
201
201
  * @param userData Extra user data provided.
202
202
  * @param overrides ethers overrides object for more control over the transaction sent.
203
203
  * @returns {Operation} An instance of Operation which can be executed or batched.
@@ -220,7 +220,7 @@ class InstantDistributionAgreementV1 {
220
220
  * @param indexId The id of the index.
221
221
  * @param superToken The superToken of the index.
222
222
  * @param subscriber The subscriber address whose subscription you want to delete.
223
- * @param publisher The publisher address of the index you are targetting.
223
+ * @param publisher The publisher address of the index you are targeting.
224
224
  * @param userData Extra user data provided.
225
225
  * @param overrides ethers overrides object for more control over the transaction sent.
226
226
  * @returns {Operation} An instance of Operation which can be executed or batched.
@@ -12,7 +12,7 @@ export default class Operation {
12
12
  /**
13
13
  * Executes the operation via the provided signer.
14
14
  * @description Populates all fields of the transaction, signs it and sends it to the network.
15
- * @param signer The signer of the transacation
15
+ * @param signer The signer of the transaction
16
16
  * @returns {ethers.providers.TransactionResponse} A TransactionResponse object which can be awaited
17
17
  */
18
18
  exec: (signer: ethers.Signer) => Promise<ethers.providers.TransactionResponse>;
@@ -24,14 +24,14 @@ export default class Operation {
24
24
  getPopulatedTransactionRequest: (signer: ethers.Signer) => Promise<TransactionRequest>;
25
25
  /**
26
26
  * Signs the populated transaction via the provided signer (what you intend on sending to the network).
27
- * @param signer The signer of the transacation
27
+ * @param signer The signer of the transaction
28
28
  * @returns {Promise<string>} Fully serialized, signed transaction
29
29
  */
30
30
  getSignedTransaction: (signer: ethers.Signer) => Promise<string>;
31
31
  /**
32
32
  * Gets the transaction hash of the transaction.
33
33
  * @description Calculates this by getting the keccak256 hash of the signedTxn.
34
- * @param signer The signer of the transacation
34
+ * @param signer The signer of the transaction
35
35
  * @returns {Promise<string>} The transaction hash of the transaction
36
36
  */
37
37
  getTransactionHash: (signer: ethers.Signer) => Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.d.ts","sourceRoot":"","sources":["../../src/Operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,oBAAY,aAAa,GACnB,aAAa,GACb,eAAe,GACf,qBAAqB,GACrB,oBAAoB,GACpB,sBAAsB,GACtB,2BAA2B,GAC3B,iBAAiB,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAC1B,QAAQ,CAAC,0BAA0B,EAAE,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAC1E,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;gBAGzB,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC,EACzC,IAAI,EAAE,aAAa;IAMvB;;;;;OAKG;IACH,IAAI,WACQ,OAAO,MAAM,KACtB,QAAQ,OAAO,SAAS,CAAC,mBAAmB,CAAC,CAY9C;IAEF;;;;OAIG;IACH,8BAA8B,WAClB,OAAO,MAAM,KACtB,QAAQ,kBAAkB,CAAC,CAY5B;IACF;;;;OAIG;IACH,oBAAoB,WAAkB,OAAO,MAAM,KAAG,QAAQ,MAAM,CAAC,CAenE;IAEF;;;;;OAKG;IACH,kBAAkB,WAAkB,OAAO,MAAM,KAAG,QAAQ,MAAM,CAAC,CAGjE;CACL"}
1
+ {"version":3,"file":"Operation.d.ts","sourceRoot":"","sources":["../../src/Operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,oBAAY,aAAa,GACnB,aAAa,GACb,eAAe,GACf,qBAAqB,GACrB,oBAAoB,GACpB,sBAAsB,GACtB,2BAA2B,GAC3B,iBAAiB,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAC1B,QAAQ,CAAC,0BAA0B,EAAE,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAC1E,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;gBAGzB,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC,EACzC,IAAI,EAAE,aAAa;IAMvB;;;;;OAKG;IACH,IAAI,WACQ,OAAO,MAAM,KACtB,QAAQ,OAAO,SAAS,CAAC,mBAAmB,CAAC,CAK9C;IAEF;;;;OAIG;IACH,8BAA8B,WAClB,OAAO,MAAM,KACtB,QAAQ,kBAAkB,CAAC,CAG5B;IACF;;;;OAIG;IACH,oBAAoB,WAAkB,OAAO,MAAM,KAAG,QAAQ,MAAM,CAAC,CAMnE;IAEF;;;;;OAKG;IACH,kBAAkB,WAAkB,OAAO,MAAM,KAAG,QAAQ,MAAM,CAAC,CAGjE;CACL"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const ethers_1 = require("ethers");
4
- const SFError_1 = require("./SFError");
5
4
  /**
6
5
  * Operation Helper Class
7
6
  * @description A helper class to create `Operation` objects which can be executed or batched.
@@ -11,21 +10,12 @@ class Operation {
11
10
  /**
12
11
  * Executes the operation via the provided signer.
13
12
  * @description Populates all fields of the transaction, signs it and sends it to the network.
14
- * @param signer The signer of the transacation
13
+ * @param signer The signer of the transaction
15
14
  * @returns {ethers.providers.TransactionResponse} A TransactionResponse object which can be awaited
16
15
  */
17
16
  this.exec = async (signer) => {
18
- try {
19
- const populatedTransaction = await this.getPopulatedTransactionRequest(signer);
20
- return await signer.sendTransaction(populatedTransaction);
21
- }
22
- catch (err) {
23
- throw new SFError_1.SFError({
24
- type: "EXECUTE_TRANSACTION",
25
- message: "There was an error executing the transaction",
26
- cause: err,
27
- });
28
- }
17
+ const populatedTransaction = await this.getPopulatedTransactionRequest(signer);
18
+ return await signer.sendTransaction(populatedTransaction);
29
19
  };
30
20
  /**
31
21
  * Get the populated transaction by awaiting `populateTransactionPromise`.
@@ -33,42 +23,23 @@ class Operation {
33
23
  * @returns {Promise<TransactionRequest>}
34
24
  */
35
25
  this.getPopulatedTransactionRequest = async (signer) => {
36
- try {
37
- const prePopulated = await this.populateTransactionPromise;
38
- return await signer.populateTransaction(prePopulated);
39
- }
40
- catch (err) {
41
- /* istanbul ignore next */
42
- throw new SFError_1.SFError({
43
- type: "POPULATE_TRANSACTION",
44
- message: "There was an error populating the transaction",
45
- cause: err,
46
- });
47
- }
26
+ const prePopulated = await this.populateTransactionPromise;
27
+ return await signer.populateTransaction(prePopulated);
48
28
  };
49
29
  /**
50
30
  * Signs the populated transaction via the provided signer (what you intend on sending to the network).
51
- * @param signer The signer of the transacation
31
+ * @param signer The signer of the transaction
52
32
  * @returns {Promise<string>} Fully serialized, signed transaction
53
33
  */
54
34
  this.getSignedTransaction = async (signer) => {
55
- try {
56
- const populatedTransaction = await this.getPopulatedTransactionRequest(signer);
57
- const signedTxn = await signer.signTransaction(populatedTransaction);
58
- return signedTxn;
59
- }
60
- catch (err) {
61
- throw new SFError_1.SFError({
62
- type: "SIGN_TRANSACTION",
63
- message: "There was an error signing the transaction",
64
- cause: err,
65
- });
66
- }
35
+ const populatedTransaction = await this.getPopulatedTransactionRequest(signer);
36
+ const signedTxn = await signer.signTransaction(populatedTransaction);
37
+ return signedTxn;
67
38
  };
68
39
  /**
69
40
  * Gets the transaction hash of the transaction.
70
41
  * @description Calculates this by getting the keccak256 hash of the signedTxn.
71
- * @param signer The signer of the transacation
42
+ * @param signer The signer of the transaction
72
43
  * @returns {Promise<string>} The transaction hash of the transaction
73
44
  */
74
45
  this.getTransactionHash = async (signer) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.js","sourceRoot":"","sources":["../../src/Operation.ts"],"names":[],"mappings":";;AACA,mCAAgC;AAEhC,uCAAoC;AAWpC;;;GAGG;AACH,MAAqB,SAAS;IAI1B,YACI,GAAyC,EACzC,IAAmB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KAAK,EAAE,MAAqB,EAAmB,EAAE;YAClE,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;YAC1D,OAAO,eAAM,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC7C,CAAC,CAAC;QApDE,IAAI,CAAC,0BAA0B,GAAG,GAAG,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;CAmDJ;AA7DD,4BA6DC"}
@@ -1,4 +1,4 @@
1
- export declare type ErrorType = "FRAMEWORK_INITIALIZATION" | "SUPERTOKEN_INITIALIZATION" | "CREATE_SIGNER" | "SUPERTOKEN_READ" | "SUBGRAPH_ERROR" | "CFAV1_READ" | "IDAV1_READ" | "INVALID_ADDRESS" | "INVALID_OBJECT" | "UNCLEAN_PERMISSIONS" | "NEGATIVE_FLOW_ALLOWANCE" | "EXECUTE_TRANSACTION" | "POPULATE_TRANSACTION" | "SIGN_TRANSACTION" | "UNSUPPORTED_OPERATION" | "MISSING_TRANSACTION_PROPERTIES" | "BATCH_CALL_ERROR" | "NETWORK_MISMATCH";
1
+ export declare type ErrorType = "FRAMEWORK_INITIALIZATION" | "SUPERTOKEN_INITIALIZATION" | "CREATE_SIGNER" | "SUPERTOKEN_READ" | "SUBGRAPH_ERROR" | "CFAV1_READ" | "IDAV1_READ" | "INVALID_ADDRESS" | "INVALID_OBJECT" | "UNCLEAN_PERMISSIONS" | "NEGATIVE_FLOW_ALLOWANCE" | "UNSUPPORTED_OPERATION" | "MISSING_TRANSACTION_PROPERTIES" | "BATCH_CALL_ERROR" | "NETWORK_MISMATCH";
2
2
  interface ErrorProps {
3
3
  type: ErrorType;
4
4
  message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"SFError.d.ts","sourceRoot":"","sources":["../../src/SFError.ts"],"names":[],"mappings":"AAEA,oBAAY,SAAS,GACf,0BAA0B,GAC1B,2BAA2B,GAC3B,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,YAAY,GACZ,iBAAiB,GACjB,gBAAgB,GAChB,qBAAqB,GACrB,yBAAyB,GACzB,qBAAqB,GACrB,sBAAsB,GACtB,kBAAkB,GAClB,uBAAuB,GACvB,gCAAgC,GAChC,kBAAkB,GAClB,kBAAkB,CAAC;AAuBzB,UAAU,UAAU;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;CAC3B;AAiBD,qBAAa,OAAQ,SAAQ,KAAK;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,SAAkB,KAAK,CAAC,EAAE,KAAK,CAAC;gBAEpB,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU;CAwBnD"}
1
+ {"version":3,"file":"SFError.d.ts","sourceRoot":"","sources":["../../src/SFError.ts"],"names":[],"mappings":"AAEA,oBAAY,SAAS,GACf,0BAA0B,GAC1B,2BAA2B,GAC3B,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,YAAY,GACZ,iBAAiB,GACjB,gBAAgB,GAChB,qBAAqB,GACrB,yBAAyB,GACzB,uBAAuB,GACvB,gCAAgC,GAChC,kBAAkB,GAClB,kBAAkB,CAAC;AAoBzB,UAAU,UAAU;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;CAC3B;AAcD,qBAAa,OAAQ,SAAQ,KAAK;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,SAAkB,KAAK,CAAC,EAAE,KAAK,CAAC;gBAEpB,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU;CAyBnD"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SFError = void 0;
4
- const serialize_error_1 = require("serialize-error");
4
+ const miniSerializeError_1 = require("./miniSerializeError");
5
5
  const errorTypeToTitleMap = new Map([
6
6
  ["FRAMEWORK_INITIALIZATION", "Framework Initialization"],
7
7
  ["SUPERTOKEN_INITIALIZATION", "SuperToken Initialization"],
@@ -12,9 +12,6 @@ const errorTypeToTitleMap = new Map([
12
12
  ["IDAV1_READ", "InstantDistributionAgreementV1 Read"],
13
13
  ["INVALID_ADDRESS", "Invalid Address"],
14
14
  ["INVALID_OBJECT", "Invalid Object"],
15
- ["POPULATE_TRANSACTION", "Populate Transaction"],
16
- ["EXECUTE_TRANSACTION", "Execute Transaction"],
17
- ["SIGN_TRANSACTION", "Sign Transaction"],
18
15
  ["UNSUPPORTED_OPERATION", "Unsupported Batch Call Operation"],
19
16
  ["MISSING_TRANSACTION_PROPERTIES", "Missing Transaction Properties"],
20
17
  ["BATCH_CALL_ERROR", "Batch Call"],
@@ -22,31 +19,27 @@ const errorTypeToTitleMap = new Map([
22
19
  ["UNCLEAN_PERMISSIONS", "Unclean Permissions"],
23
20
  ["NEGATIVE_FLOW_ALLOWANCE", "Negative Flow Rate Allowance"],
24
21
  ]);
25
- // NOTE: this is a temporary solution to fix serializeError
26
- // which throws a weird JSON error
27
- const stringifyCause = (cause) => {
22
+ const miniStringifyCause = (cause) => {
28
23
  try {
29
- return JSON.stringify((0, serialize_error_1.serializeError)(cause), null, 2);
24
+ const serializedError = (0, miniSerializeError_1.miniSerializeError)(cause);
25
+ const stringifiedError = JSON.stringify(serializedError, null, 2);
26
+ return stringifiedError.replace(/\\"/g, '"'); // Get rid of escaping of quotes.
30
27
  }
31
- catch (err) {
32
- try {
33
- return JSON.stringify(cause, null, 2);
34
- }
35
- catch {
36
- console.error("Caused by: ", cause);
37
- return "[Couldn't serialize error. Error logged to console.]";
38
- }
28
+ catch {
29
+ // `miniSerializeError` is safe enough that this should never occur.
30
+ console.error("SFError caused by: ", cause);
31
+ return "[Couldn't serialize internal error. Error logged to console instead.]";
39
32
  }
40
33
  };
41
34
  class SFError extends Error {
42
35
  constructor({ type, message, cause }) {
43
36
  const fullMessage = `${errorTypeToTitleMap.get(type)} Error: ${message}${cause
44
37
  ? `
45
- Caused by: ${stringifyCause(cause)}`
38
+ Caused by: ${miniStringifyCause(cause)}`
46
39
  : ""}`;
47
40
  super(fullMessage, cause
48
41
  ? {
49
- 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
42
+ 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
50
43
  }
51
44
  : {});
52
45
  // Fallback back environments where `Error.cause` is now yet natively supported
@@ -54,6 +47,7 @@ Caused by: ${stringifyCause(cause)}`
54
47
  this.cause = cause;
55
48
  }
56
49
  this.type = type;
50
+ this.name = "SFError";
57
51
  Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#support-for-newtarget
58
52
  }
59
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SFError.js","sourceRoot":"","sources":["../../src/SFError.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AAsBjD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAoB;IACnD,CAAC,0BAA0B,EAAE,0BAA0B,CAAC;IACxD,CAAC,2BAA2B,EAAE,2BAA2B,CAAC;IAC1D,CAAC,eAAe,EAAE,eAAe,CAAC;IAClC,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IACtC,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAC9B,CAAC,YAAY,EAAE,8BAA8B,CAAC;IAC9C,CAAC,YAAY,EAAE,qCAAqC,CAAC;IACrD,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IACtC,CAAC,gBAAgB,EAAE,gBAAg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eAAe,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAClE,OAAO,gBAAgB,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,iCAAiC;KAClF;IAAC,MAAM;QACJ,oEAAoE;QACpE,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;QAC5C,OAAO,uEAAuE,CAAC;KAClF;AACL,CAAC,CAAC;AAEF,MAAa,OAAQ,SAAQ,KAAK;IAI9B,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAc;QAC5C,MAAM,WAAW,GAAG,GAAG,mBAAmB,CAAC,GAAG,CAC1C,IAAI,CACP,WAAW,OAAO,GACf,KAAK;YACD,CAAC,CAAC;aACL,kBAAkB,CAAC,KAAK,CAAC,EAAE;YACxB,CAAC,CAAC,EACV,EAAE,CAAC;QACH,KAAK,CACD,WAAW,EACX,KAAK;YACD,CAAC,CAAC;gBACI,KAAK,EAAE,KAAc,EAAE,8NAA8N;aACxP;YACH,CAAC,CAAC,EAAE,CACX,CAAC;QACF,+EAA+E;QAC/E,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACtB,IAAI,CAAC,KAAK,GAAG,KAAc,CAAC;SAC/B;QACD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACtB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,gIAAgI;IACvL,CAAC;CACJ;AA7BD,0BA6BC"}
@@ -196,7 +196,7 @@
196
196
  },
197
197
  {
198
198
  "inputs": [],
199
- "name": "MAX_APP_LEVEL",
199
+ "name": "MAX_APP_CALLBACK_LEVEL",
200
200
  "outputs": [
201
201
  {
202
202
  "internalType": "uint256",
@@ -596,7 +596,7 @@
596
596
  "type": "address"
597
597
  }
598
598
  ],
599
- "name": "getAppLevel",
599
+ "name": "getAppCallbackLevel",
600
600
  "outputs": [
601
601
  {
602
602
  "internalType": "uint8",
@@ -774,17 +774,17 @@
774
774
  },
775
775
  {
776
776
  "internalType": "uint256",
777
- "name": "appAllowanceGranted",
777
+ "name": "appCreditGranted",
778
778
  "type": "uint256"
779
779
  },
780
780
  {
781
781
  "internalType": "int256",
782
- "name": "appAllowanceUsed",
782
+ "name": "appCreditUsed",
783
783
  "type": "int256"
784
784
  },
785
785
  {
786
786
  "internalType": "contract ISuperfluidToken",
787
- "name": "appAllowanceToken",
787
+ "name": "appCreditToken",
788
788
  "type": "address"
789
789
  }
790
790
  ],
@@ -808,7 +808,7 @@
808
808
  },
809
809
  {
810
810
  "internalType": "int256",
811
- "name": "appAllowanceUsedDelta",
811
+ "name": "appCreditUsedDelta",
812
812
  "type": "int256"
813
813
  }
814
814
  ],
@@ -830,18 +830,13 @@
830
830
  "name": "ctx",
831
831
  "type": "bytes"
832
832
  },
833
- {
834
- "internalType": "uint256",
835
- "name": "appAllowanceWantedMore",
836
- "type": "uint256"
837
- },
838
833
  {
839
834
  "internalType": "int256",
840
- "name": "appAllowanceUsedDelta",
835
+ "name": "appCreditUsedMore",
841
836
  "type": "int256"
842
837
  }
843
838
  ],
844
- "name": "ctxUseAllowance",
839
+ "name": "ctxUseCredit",
845
840
  "outputs": [
846
841
  {
847
842
  "internalType": "bytes",
@@ -1016,7 +1011,7 @@
1016
1011
  "components": [
1017
1012
  {
1018
1013
  "internalType": "uint8",
1019
- "name": "appLevel",
1014
+ "name": "appCallbackLevel",
1020
1015
  "type": "uint8"
1021
1016
  },
1022
1017
  {
@@ -1046,17 +1041,17 @@
1046
1041
  },
1047
1042
  {
1048
1043
  "internalType": "uint256",
1049
- "name": "appAllowanceGranted",
1044
+ "name": "appCreditGranted",
1050
1045
  "type": "uint256"
1051
1046
  },
1052
1047
  {
1053
1048
  "internalType": "uint256",
1054
- "name": "appAllowanceWanted",
1049
+ "name": "appCreditWantedDeprecated",
1055
1050
  "type": "uint256"
1056
1051
  },
1057
1052
  {
1058
1053
  "internalType": "int256",
1059
- "name": "appAllowanceUsed",
1054
+ "name": "appCreditUsed",
1060
1055
  "type": "int256"
1061
1056
  },
1062
1057
  {
@@ -1066,7 +1061,7 @@
1066
1061
  },
1067
1062
  {
1068
1063
  "internalType": "contract ISuperfluidToken",
1069
- "name": "appAllowanceToken",
1064
+ "name": "appCreditToken",
1070
1065
  "type": "address"
1071
1066
  }
1072
1067
  ],