@superfluid-finance/sdk-core 0.5.6-dev.fc916ff.0 → 0.5.6
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.
- package/CHANGELOG.md +14 -1
- package/dist/index.umd.js +8498 -26189
- package/dist/main/BatchCall.d.ts.map +1 -1
- package/dist/main/BatchCall.js +8 -26
- package/dist/main/BatchCall.js.map +1 -1
- package/dist/main/ConstantFlowAgreementV1.d.ts +1 -1
- package/dist/main/ConstantFlowAgreementV1.js +1 -1
- package/dist/main/Governance.js +2 -2
- package/dist/main/InstantDistributionAgreementV1.d.ts +3 -3
- package/dist/main/InstantDistributionAgreementV1.js +3 -3
- package/dist/main/Operation.d.ts +3 -3
- package/dist/main/Operation.d.ts.map +1 -1
- package/dist/main/Operation.js +10 -39
- package/dist/main/Operation.js.map +1 -1
- package/dist/main/SFError.d.ts +1 -1
- package/dist/main/SFError.d.ts.map +1 -1
- package/dist/main/SFError.js +12 -19
- package/dist/main/SFError.js.map +1 -1
- package/dist/main/abi/Superfluid.json +18 -13
- package/dist/main/constants.d.ts.map +1 -1
- package/dist/main/constants.js +5 -2
- package/dist/main/constants.js.map +1 -1
- package/dist/main/defaultSubgraphReleaseTag.json +1 -1
- package/dist/main/interfaces.d.ts +0 -1
- package/dist/main/interfaces.d.ts.map +1 -1
- package/dist/main/miniSerializeError.d.ts +14 -0
- package/dist/main/miniSerializeError.d.ts.map +1 -0
- package/dist/main/miniSerializeError.js +29 -0
- package/dist/main/miniSerializeError.js.map +1 -0
- package/dist/main/subgraph/SubgraphClient.d.ts.map +1 -1
- package/dist/main/subgraph/SubgraphClient.js +1 -17
- package/dist/main/subgraph/SubgraphClient.js.map +1 -1
- package/dist/main/subgraph/entities/token/tokens.generated.d.ts +0 -1
- package/dist/main/subgraph/entities/token/tokens.generated.d.ts.map +1 -1
- package/dist/main/subgraph/entities/token/tokens.generated.js +1 -1
- package/dist/main/subgraph/entities/token/tokens.generated.js.map +1 -1
- package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.d.ts +0 -1
- package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.d.ts.map +1 -1
- package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.js +1 -1
- package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.js.map +1 -1
- package/dist/main/subgraph/queries/getIndexSubscriptions.generated.d.ts +0 -1
- package/dist/main/subgraph/queries/getIndexSubscriptions.generated.d.ts.map +1 -1
- package/dist/main/subgraph/queries/getIndexSubscriptions.generated.js +1 -1
- package/dist/main/subgraph/queries/getIndexSubscriptions.generated.js.map +1 -1
- package/dist/main/subgraph/queries/getIndexes.generated.d.ts +0 -1
- package/dist/main/subgraph/queries/getIndexes.generated.d.ts.map +1 -1
- package/dist/main/subgraph/queries/getIndexes.generated.js +1 -1
- package/dist/main/subgraph/queries/getIndexes.generated.js.map +1 -1
- package/dist/main/subgraph/queries/getStreams.generated.d.ts +0 -1
- package/dist/main/subgraph/queries/getStreams.generated.d.ts.map +1 -1
- package/dist/main/subgraph/queries/getStreams.generated.js +1 -1
- package/dist/main/subgraph/queries/getStreams.generated.js.map +1 -1
- package/dist/main/subgraph/queries/getTokens.generated.d.ts +0 -1
- package/dist/main/subgraph/queries/getTokens.generated.d.ts.map +1 -1
- package/dist/main/subgraph/queries/getTokens.generated.js +1 -1
- package/dist/main/subgraph/queries/getTokens.generated.js.map +1 -1
- package/dist/main/typechain/Superfluid.d.ts +49 -45
- package/dist/main/typechain/Superfluid.d.ts.map +1 -1
- package/dist/main/typechain/factories/Superfluid__factory.d.ts.map +1 -1
- package/dist/main/typechain/factories/Superfluid__factory.js +18 -13
- package/dist/main/typechain/factories/Superfluid__factory.js.map +1 -1
- package/dist/module/BatchCall.d.ts.map +1 -1
- package/dist/module/BatchCall.js +8 -26
- package/dist/module/BatchCall.js.map +1 -1
- package/dist/module/ConstantFlowAgreementV1.d.ts +1 -1
- package/dist/module/ConstantFlowAgreementV1.js +1 -1
- package/dist/module/Governance.js +2 -2
- package/dist/module/InstantDistributionAgreementV1.d.ts +3 -3
- package/dist/module/InstantDistributionAgreementV1.js +3 -3
- package/dist/module/Operation.d.ts +3 -3
- package/dist/module/Operation.d.ts.map +1 -1
- package/dist/module/Operation.js +10 -39
- package/dist/module/Operation.js.map +1 -1
- package/dist/module/SFError.d.ts +1 -1
- package/dist/module/SFError.d.ts.map +1 -1
- package/dist/module/SFError.js +12 -19
- package/dist/module/SFError.js.map +1 -1
- package/dist/module/abi/Superfluid.json +18 -13
- package/dist/module/constants.d.ts.map +1 -1
- package/dist/module/constants.js +5 -2
- package/dist/module/constants.js.map +1 -1
- package/dist/module/defaultSubgraphReleaseTag.json +1 -1
- package/dist/module/interfaces.d.ts +0 -1
- package/dist/module/interfaces.d.ts.map +1 -1
- package/dist/module/miniSerializeError.d.ts +14 -0
- package/dist/module/miniSerializeError.d.ts.map +1 -0
- package/dist/module/miniSerializeError.js +25 -0
- package/dist/module/miniSerializeError.js.map +1 -0
- package/dist/module/subgraph/SubgraphClient.d.ts.map +1 -1
- package/dist/module/subgraph/SubgraphClient.js +1 -17
- package/dist/module/subgraph/SubgraphClient.js.map +1 -1
- package/dist/module/subgraph/entities/token/tokens.generated.d.ts +0 -1
- package/dist/module/subgraph/entities/token/tokens.generated.d.ts.map +1 -1
- package/dist/module/subgraph/entities/token/tokens.generated.js +1 -1
- package/dist/module/subgraph/entities/token/tokens.generated.js.map +1 -1
- package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.d.ts +0 -1
- package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.d.ts.map +1 -1
- package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.js +1 -1
- package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.js.map +1 -1
- package/dist/module/subgraph/queries/getIndexSubscriptions.generated.d.ts +0 -1
- package/dist/module/subgraph/queries/getIndexSubscriptions.generated.d.ts.map +1 -1
- package/dist/module/subgraph/queries/getIndexSubscriptions.generated.js +1 -1
- package/dist/module/subgraph/queries/getIndexSubscriptions.generated.js.map +1 -1
- package/dist/module/subgraph/queries/getIndexes.generated.d.ts +0 -1
- package/dist/module/subgraph/queries/getIndexes.generated.d.ts.map +1 -1
- package/dist/module/subgraph/queries/getIndexes.generated.js +1 -1
- package/dist/module/subgraph/queries/getIndexes.generated.js.map +1 -1
- package/dist/module/subgraph/queries/getStreams.generated.d.ts +0 -1
- package/dist/module/subgraph/queries/getStreams.generated.d.ts.map +1 -1
- package/dist/module/subgraph/queries/getStreams.generated.js +1 -1
- package/dist/module/subgraph/queries/getStreams.generated.js.map +1 -1
- package/dist/module/subgraph/queries/getTokens.generated.d.ts +0 -1
- package/dist/module/subgraph/queries/getTokens.generated.d.ts.map +1 -1
- package/dist/module/subgraph/queries/getTokens.generated.js +1 -1
- package/dist/module/subgraph/queries/getTokens.generated.js.map +1 -1
- package/dist/module/typechain/Superfluid.d.ts +49 -45
- package/dist/module/typechain/Superfluid.d.ts.map +1 -1
- package/dist/module/typechain/factories/Superfluid__factory.d.ts.map +1 -1
- package/dist/module/typechain/factories/Superfluid__factory.js +18 -13
- package/dist/module/typechain/factories/Superfluid__factory.js.map +1 -1
- package/package.json +2 -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;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AC;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,CAOpC;IAKF;;;;OAIG;IACH,WAAW,WACC,OAAO,MAAM,KACtB,QAAQ,OAAO,mBAAmB,CAAC,CAOpC;CACL"}
|
package/dist/main/BatchCall.js
CHANGED
|
@@ -84,19 +84,10 @@ class BatchCall {
|
|
|
84
84
|
* @returns {Promise<ethers.ContractTransaction>} ContractTransaction object
|
|
85
85
|
*/
|
|
86
86
|
this.exec = async (signer) => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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,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;;;;;WAKG;QACH,4BAAuB,GAAG,CACtB,GAEgE,EAChE,QAAgB,EACG,EAAE,CAAC,IAAA,iCAAyB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC;QAExE;;;;;WAKG;QACH,uBAAkB,GAAG,KAAK,EACtB,SA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,CAAC,EAAE;gBAC/B,IAAI,EAAE,IAAA,iCAAyB,EAAC,oBAAoB,CAAC,IAAI,CAAC;aAC7D,CAAC;QACN,CAAC,CAAC;QAYF;;;;WAIG;QACH,SAAI,GAAG,KAAK,EACR,MAAqB,EACc,EAAE;YACrC,MAAM,oBAAoB,GAAG,MAAM,OAAO,CAAC,GAAG,CAC1C,IAAI,CAAC,+BAA+B,CACvC,CAAC;YACF,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ;iBAC1B,OAAO,CAAC,MAAM,CAAC;iBACf,SAAS,CAAC,oBAAoB,CAAC,CAAC;QACzC,CAAC,CAAC;QAEF,0BAA0B;QAC1B,oEAAoE;QACpE,6CAA6C;QAC7C;;;;WAIG;QACH,gBAAW,GAAG,KAAK,EACf,MAAqB,EACc,EAAE;YACrC,MAAM,oBAAoB,GAAG,MAAM,OAAO,CAAC,GAAG,CAC1C,IAAI,CAAC,+BAA+B,CACvC,CAAC;YACF,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ;iBAC1B,OAAO,CAAC,MAAM,CAAC;iBACf,gBAAgB,CAAC,oBAAoB,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
|
|
154
|
+
* @param owedDeposit any owed depsit
|
|
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
|
|
274
|
+
* @param owedDeposit any owed depsit
|
|
275
275
|
* @returns {IWeb3FlowInfo} sanitized web3 flow info
|
|
276
276
|
*/
|
|
277
277
|
this._sanitizeFlowInfo = (params) => {
|
package/dist/main/Governance.js
CHANGED
|
@@ -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
|
|
57
|
+
const rewardPromose = 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
|
-
|
|
67
|
+
rewardPromose,
|
|
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
|
|
87
|
+
* Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributres.
|
|
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
|
|
101
|
+
* @param publisher The publisher address of the index you are targetting.
|
|
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
|
|
112
|
+
* @param publisher The publisher address of the index you are targetting.
|
|
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
|
|
176
|
+
* Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributres.
|
|
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
|
|
200
|
+
* @param publisher The publisher address of the index you are targetting.
|
|
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
|
|
223
|
+
* @param publisher The publisher address of the index you are targetting.
|
|
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.
|
package/dist/main/Operation.d.ts
CHANGED
|
@@ -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
|
|
15
|
+
* @param signer The signer of the transacation
|
|
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
|
|
27
|
+
* @param signer The signer of the transacation
|
|
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
|
|
34
|
+
* @param signer The signer of the transacation
|
|
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;
|
|
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"}
|
package/dist/main/Operation.js
CHANGED
|
@@ -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
|
|
13
|
+
* @param signer The signer of the transacation
|
|
15
14
|
* @returns {ethers.providers.TransactionResponse} A TransactionResponse object which can be awaited
|
|
16
15
|
*/
|
|
17
16
|
this.exec = async (signer) => {
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
37
|
-
|
|
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
|
|
31
|
+
* @param signer The signer of the transacation
|
|
52
32
|
* @returns {Promise<string>} Fully serialized, signed transaction
|
|
53
33
|
*/
|
|
54
34
|
this.getSignedTransaction = async (signer) => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
|
42
|
+
* @param signer The signer of the transacation
|
|
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;
|
|
1
|
+
{"version":3,"file":"Operation.js","sourceRoot":"","sources":["../../src/Operation.ts"],"names":[],"m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ERTOKEN_INITIALIZATION" | "CREATE_SIGNER" | "SUPERTOKEN_READ" | "
|
|
1
|
+
export declare type ErrorType = "FRAMEWORK_INITIALIZATION" | "SUPERTOKEN_INITIALIZATION" | "CREATE_SIGNER" | "SUPERTOKEN_READ" | "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,
|
|
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,YAAY,GACZ,YAAY,GACZ,iBAAiB,GACjB,gBAAgB,GAChB,qBAAqB,GACrB,yBAAyB,GACzB,uBAAuB,GACvB,gCAAgC,GAChC,kBAAkB,GAClB,kBAAkB,CAAC;AAmBzB,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"}
|
package/dist/main/SFError.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SFError = void 0;
|
|
4
|
-
const
|
|
4
|
+
const miniSerializeError_1 = require("./miniSerializeError");
|
|
5
5
|
const errorTypeToTitleMap = new Map([
|
|
6
6
|
["FRAMEWORK_INITIALIZATION", "Framework Initialization"],
|
|
7
7
|
["SUPERTOKEN_INITIALIZATION", "SuperToken Initialization"],
|
|
8
8
|
["CREATE_SIGNER", "Create Signer"],
|
|
9
9
|
["SUPERTOKEN_READ", "SuperToken Read"],
|
|
10
|
-
["SUBGRAPH_ERROR", "Subgraph"],
|
|
11
10
|
["CFAV1_READ", "ConstantFlowAgreementV1 Read"],
|
|
12
11
|
["IDAV1_READ", "InstantDistributionAgreementV1 Read"],
|
|
13
12
|
["INVALID_ADDRESS", "Invalid Address"],
|
|
14
13
|
["INVALID_OBJECT", "Invalid Object"],
|
|
15
|
-
["POPULATE_TRANSACTION", "Populate Transaction"],
|
|
16
|
-
["EXECUTE_TRANSACTION", "Execute Transaction"],
|
|
17
|
-
["SIGN_TRANSACTION", "Sign Transaction"],
|
|
18
14
|
["UNSUPPORTED_OPERATION", "Unsupported Batch Call Operation"],
|
|
19
15
|
["MISSING_TRANSACTION_PROPERTIES", "Missing Transaction Properties"],
|
|
20
16
|
["BATCH_CALL_ERROR", "Batch Call"],
|
|
@@ -22,31 +18,27 @@ const errorTypeToTitleMap = new Map([
|
|
|
22
18
|
["UNCLEAN_PERMISSIONS", "Unclean Permissions"],
|
|
23
19
|
["NEGATIVE_FLOW_ALLOWANCE", "Negative Flow Rate Allowance"],
|
|
24
20
|
]);
|
|
25
|
-
|
|
26
|
-
// which throws a weird JSON error
|
|
27
|
-
const stringifyCause = (cause) => {
|
|
21
|
+
const miniStringifyCause = (cause) => {
|
|
28
22
|
try {
|
|
29
|
-
|
|
23
|
+
const serializedError = (0, miniSerializeError_1.miniSerializeError)(cause);
|
|
24
|
+
const stringifiedError = JSON.stringify(serializedError, null, 2);
|
|
25
|
+
return stringifiedError.replace(/\\"/g, '"'); // Get rid of escaping of quotes.
|
|
30
26
|
}
|
|
31
|
-
catch
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
catch {
|
|
36
|
-
console.error("Caused by: ", cause);
|
|
37
|
-
return "[Couldn't serialize error. Error logged to console.]";
|
|
38
|
-
}
|
|
27
|
+
catch {
|
|
28
|
+
// `miniSerializeError` is safe enough that this should never occur.
|
|
29
|
+
console.error("SFError caused by: ", cause);
|
|
30
|
+
return "[Couldn't serialize internal error. Error logged to console instead.]";
|
|
39
31
|
}
|
|
40
32
|
};
|
|
41
33
|
class SFError extends Error {
|
|
42
34
|
constructor({ type, message, cause }) {
|
|
43
35
|
const fullMessage = `${errorTypeToTitleMap.get(type)} Error: ${message}${cause
|
|
44
36
|
? `
|
|
45
|
-
Caused by: ${
|
|
37
|
+
Caused by: ${miniStringifyCause(cause)}`
|
|
46
38
|
: ""}`;
|
|
47
39
|
super(fullMessage, cause
|
|
48
40
|
? {
|
|
49
|
-
cause: cause, // Currently "unknown" is not compatible with "cause" (because it
|
|
41
|
+
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
|
|
50
42
|
}
|
|
51
43
|
: {});
|
|
52
44
|
// Fallback back environments where `Error.cause` is now yet natively supported
|
|
@@ -54,6 +46,7 @@ Caused by: ${stringifyCause(cause)}`
|
|
|
54
46
|
this.cause = cause;
|
|
55
47
|
}
|
|
56
48
|
this.type = type;
|
|
49
|
+
this.name = "SFError";
|
|
57
50
|
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
51
|
}
|
|
59
52
|
}
|
package/dist/main/SFError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SFError.js","sourceRoot":"","sources":["../../src/SFError.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"SFError.js","sourceRoot":"","sources":["../../src/SFError.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAkB1D,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,YAAY,EAAE,8BAA8B,CAAC;IAC9C,CAAC,YAAY,EAAE,qCAAqC,CAAC;IACrD,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IACtC,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACpC,CAAC,uBAAuB,EAAE,kCAAkC,CAAC;IAC7D,CAAC,gCAAgC,EAAE,gCAAgC,CAAC;IACpE,CAAC,kBAAkB,EAAE,YAAY,CAAC;IAClC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IACxC,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IAC9C,CAAC,yBAAyB,EAAE,8BAA8B,CAAC;CAC9D,CAAC,CAAC;AAQH,MAAM,kBAAkB,GAAG,CAAC,KAAuB,EAAE,EAAE;IACnD,IAAI;QACA,MAAM,eAAe,GAAG,IAAA,uCAAkB,EAAC,KAAK,CAAC,CAAC;QAClD,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,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,+NAA+N;aACzP;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": "
|
|
199
|
+
"name": "MAX_APP_LEVEL",
|
|
200
200
|
"outputs": [
|
|
201
201
|
{
|
|
202
202
|
"internalType": "uint256",
|
|
@@ -596,7 +596,7 @@
|
|
|
596
596
|
"type": "address"
|
|
597
597
|
}
|
|
598
598
|
],
|
|
599
|
-
"name": "
|
|
599
|
+
"name": "getAppLevel",
|
|
600
600
|
"outputs": [
|
|
601
601
|
{
|
|
602
602
|
"internalType": "uint8",
|
|
@@ -774,17 +774,17 @@
|
|
|
774
774
|
},
|
|
775
775
|
{
|
|
776
776
|
"internalType": "uint256",
|
|
777
|
-
"name": "
|
|
777
|
+
"name": "appAllowanceGranted",
|
|
778
778
|
"type": "uint256"
|
|
779
779
|
},
|
|
780
780
|
{
|
|
781
781
|
"internalType": "int256",
|
|
782
|
-
"name": "
|
|
782
|
+
"name": "appAllowanceUsed",
|
|
783
783
|
"type": "int256"
|
|
784
784
|
},
|
|
785
785
|
{
|
|
786
786
|
"internalType": "contract ISuperfluidToken",
|
|
787
|
-
"name": "
|
|
787
|
+
"name": "appAllowanceToken",
|
|
788
788
|
"type": "address"
|
|
789
789
|
}
|
|
790
790
|
],
|
|
@@ -808,7 +808,7 @@
|
|
|
808
808
|
},
|
|
809
809
|
{
|
|
810
810
|
"internalType": "int256",
|
|
811
|
-
"name": "
|
|
811
|
+
"name": "appAllowanceUsedDelta",
|
|
812
812
|
"type": "int256"
|
|
813
813
|
}
|
|
814
814
|
],
|
|
@@ -830,13 +830,18 @@
|
|
|
830
830
|
"name": "ctx",
|
|
831
831
|
"type": "bytes"
|
|
832
832
|
},
|
|
833
|
+
{
|
|
834
|
+
"internalType": "uint256",
|
|
835
|
+
"name": "appAllowanceWantedMore",
|
|
836
|
+
"type": "uint256"
|
|
837
|
+
},
|
|
833
838
|
{
|
|
834
839
|
"internalType": "int256",
|
|
835
|
-
"name": "
|
|
840
|
+
"name": "appAllowanceUsedDelta",
|
|
836
841
|
"type": "int256"
|
|
837
842
|
}
|
|
838
843
|
],
|
|
839
|
-
"name": "
|
|
844
|
+
"name": "ctxUseAllowance",
|
|
840
845
|
"outputs": [
|
|
841
846
|
{
|
|
842
847
|
"internalType": "bytes",
|
|
@@ -1011,7 +1016,7 @@
|
|
|
1011
1016
|
"components": [
|
|
1012
1017
|
{
|
|
1013
1018
|
"internalType": "uint8",
|
|
1014
|
-
"name": "
|
|
1019
|
+
"name": "appLevel",
|
|
1015
1020
|
"type": "uint8"
|
|
1016
1021
|
},
|
|
1017
1022
|
{
|
|
@@ -1041,17 +1046,17 @@
|
|
|
1041
1046
|
},
|
|
1042
1047
|
{
|
|
1043
1048
|
"internalType": "uint256",
|
|
1044
|
-
"name": "
|
|
1049
|
+
"name": "appAllowanceGranted",
|
|
1045
1050
|
"type": "uint256"
|
|
1046
1051
|
},
|
|
1047
1052
|
{
|
|
1048
1053
|
"internalType": "uint256",
|
|
1049
|
-
"name": "
|
|
1054
|
+
"name": "appAllowanceWanted",
|
|
1050
1055
|
"type": "uint256"
|
|
1051
1056
|
},
|
|
1052
1057
|
{
|
|
1053
1058
|
"internalType": "int256",
|
|
1054
|
-
"name": "
|
|
1059
|
+
"name": "appAllowanceUsed",
|
|
1055
1060
|
"type": "int256"
|
|
1056
1061
|
},
|
|
1057
1062
|
{
|
|
@@ -1061,7 +1066,7 @@
|
|
|
1061
1066
|
},
|
|
1062
1067
|
{
|
|
1063
1068
|
"internalType": "contract ISuperfluidToken",
|
|
1064
|
-
"name": "
|
|
1069
|
+
"name": "appAllowanceToken",
|
|
1065
1070
|
"type": "address"
|
|
1066
1071
|
}
|
|
1067
1072
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,gCAAgC;AAChC,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,eAAe,QAAuC,CAAC;AACpE,eAAO,MAAM,cAAc,QAAkC,CAAC;AAC9D,eAAO,MAAM,eAAe,QAAiC,CAAC;AAC9D,eAAO,MAAM,gBAAgB,QAAkC,CAAC;AAChE,eAAO,MAAM,eAAe,QAAqC,CAAC;AAClE,eAAO,MAAM,OAAO,sBAAO,CAAC;AAE5B,eAAO,MAAM,QAAQ,UAA0C,CAAC;AAEhE,kDAAkD;AAClD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,eAAO,MAAM,sBAAsB,QAGD,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,gCAAgC;AAChC,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,eAAe,QAAuC,CAAC;AACpE,eAAO,MAAM,cAAc,QAAkC,CAAC;AAC9D,eAAO,MAAM,eAAe,QAAiC,CAAC;AAC9D,eAAO,MAAM,gBAAgB,QAAkC,CAAC;AAChE,eAAO,MAAM,eAAe,QAAqC,CAAC;AAClE,eAAO,MAAM,OAAO,sBAAO,CAAC;AAE5B,eAAO,MAAM,QAAQ,UAA0C,CAAC;AAEhE,kDAAkD;AAClD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,eAAO,MAAM,sBAAsB,QAGD,CAAC;AA2BnC,eAAO,MAAM,wBAAwB,4BAEpC,CAAC;AAEF,eAAO,MAAM,uBAAuB,qBAEnC,CAAC"}
|
package/dist/main/constants.js
CHANGED
|
@@ -29,7 +29,6 @@ exports.AUTHORIZE_FULL_CONTROL = exports.AUTHORIZE_FLOW_OPERATOR_CREATE |
|
|
|
29
29
|
exports.AUTHORIZE_FLOW_OPERATOR_DELETE;
|
|
30
30
|
const subgraphReleaseTag = (globalThis.process && globalThis.process.env.SUBGRAPH_RELEASE_TAG) ||
|
|
31
31
|
defaultSubgraphReleaseTag_json_1.default.value;
|
|
32
|
-
const baseUrl = `https://api.thegraph.com/subgraphs/name/superfluid-finance/protocol-${subgraphReleaseTag}`;
|
|
33
32
|
const getResolverData = (chainId) => {
|
|
34
33
|
const networkData = metadata_1.default.networks.find((x) => x.chainId === chainId);
|
|
35
34
|
if (!networkData)
|
|
@@ -39,8 +38,12 @@ const getResolverData = (chainId) => {
|
|
|
39
38
|
resolverAddress: "",
|
|
40
39
|
nativeTokenSymbol: "",
|
|
41
40
|
};
|
|
41
|
+
const hostedEndpoint = networkData.subgraphV1.hostedEndpoint;
|
|
42
|
+
const subgraphAPIEndpoint = subgraphReleaseTag
|
|
43
|
+
? hostedEndpoint.replace("v1", subgraphReleaseTag)
|
|
44
|
+
: hostedEndpoint;
|
|
42
45
|
return {
|
|
43
|
-
subgraphAPIEndpoint
|
|
46
|
+
subgraphAPIEndpoint,
|
|
44
47
|
networkName: networkData.name,
|
|
45
48
|
resolverAddress: networkData.contractsV1.resolver,
|
|
46
49
|
nativeTokenSymbol: networkData.nativeTokenSymbol,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;;;;AAAA,4EAAoD;AAEpD,sGAAyE;AAGzE,gCAAgC;AACnB,QAAA,eAAe,GAAG,EAAE,CAAC;AACrB,QAAA,cAAc,GAAG,EAAE,CAAC;AACpB,QAAA,aAAa,GAAG,CAAC,CAAC;AAClB,QAAA,aAAa,GAAG,EAAE,CAAC;AACnB,QAAA,gBAAgB,GAAG,EAAE,CAAC;AACtB,QAAA,iBAAiB,GAAG,EAAE,CAAC;AACvB,QAAA,eAAe,GAAG,yBAAiB,GAAG,wBAAgB,CAAC;AACvD,QAAA,cAAc,GAAG,uBAAe,GAAG,qBAAa,CAA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WAAW,CAAC,IAAI;QAC7B,eAAe,EAAE,WAAW,CAAC,WAAW,CAAC,QAAQ;QACjD,iBAAiB,EAAE,WAAW,CAAC,iBAAiB;KACnD,CAAC;AACN,CAAC,CAAC;AAEW,QAAA,wBAAwB,GAAG,IAAI,GAAG,CAC3C,kBAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACxE,CAAC;AAEW,QAAA,uBAAuB,GAAG,IAAI,GAAG,CAC1C,kBAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CACpD,CAAC"}
|
|
@@ -368,7 +368,6 @@ export interface ISuperToken extends IHOLEntityBase {
|
|
|
368
368
|
readonly name: string;
|
|
369
369
|
readonly symbol: string;
|
|
370
370
|
readonly isListed: boolean;
|
|
371
|
-
readonly isNativeAssetSuperToken: boolean;
|
|
372
371
|
readonly underlyingAddress: string;
|
|
373
372
|
}
|
|
374
373
|
export interface IAggregateEntityBase {
|