@superfluid-finance/sdk-core 1.0.1-dev.0846cd5.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 (147) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +487 -0
  3. package/dist/main/BatchCall.d.ts +53 -0
  4. package/dist/main/ConstantFlowAgreementV1.d.ts +74 -0
  5. package/dist/main/Framework.d.ts +75 -0
  6. package/dist/main/Host.d.ts +18 -0
  7. package/dist/main/InstantDistributionAgreementV1.d.ts +107 -0
  8. package/dist/main/Operation.d.ts +38 -0
  9. package/dist/main/Query.d.ts +24 -0
  10. package/dist/main/SFError.d.ts +13 -0
  11. package/dist/main/SuperToken.d.ts +191 -0
  12. package/dist/main/Token.d.ts +76 -0
  13. package/dist/main/constants.d.ts +10 -0
  14. package/dist/main/events.d.ts +254 -0
  15. package/dist/main/frameworkHelpers.d.ts +20 -0
  16. package/dist/main/index.d.ts +19 -0
  17. package/dist/main/index.js +10780 -0
  18. package/dist/main/interfaces.d.ts +309 -0
  19. package/dist/main/mapGetAllEventsQueryEvents.d.ts +3 -0
  20. package/dist/main/pagination.d.ts +31 -0
  21. package/dist/main/scripts/setup.d.ts +22 -0
  22. package/dist/main/subgraph/SubgraphClient.d.ts +16 -0
  23. package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.d.ts +41 -0
  24. package/dist/main/subgraph/queries/getAllEvents.generated.d.ts +578 -0
  25. package/dist/main/subgraph/queries/getIndexSubscriptions.generated.d.ts +42 -0
  26. package/dist/main/subgraph/queries/getIndexes.generated.d.ts +40 -0
  27. package/dist/main/subgraph/queries/getStreams.generated.d.ts +54 -0
  28. package/dist/main/subgraph/queries/getTokens.generated.d.ts +23 -0
  29. package/dist/main/subgraph/schema.generated.d.ts +6907 -0
  30. package/dist/main/typechain/ERC20WithTokenInfo.d.ts +159 -0
  31. package/dist/main/typechain/IConstantFlowAgreementV1.d.ts +305 -0
  32. package/dist/main/typechain/IInstantDistributionAgreementV1.d.ts +585 -0
  33. package/dist/main/typechain/IResolver.d.ts +57 -0
  34. package/dist/main/typechain/SuperToken.d.ts +1011 -0
  35. package/dist/main/typechain/Superfluid.d.ts +780 -0
  36. package/dist/main/typechain/SuperfluidLoader.d.ts +55 -0
  37. package/dist/main/typechain/TestToken.d.ts +207 -0
  38. package/dist/main/typechain/common.d.ts +21 -0
  39. package/dist/main/typechain/factories/ERC20WithTokenInfo__factory.d.ts +35 -0
  40. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.d.ts +35 -0
  41. package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts +35 -0
  42. package/dist/main/typechain/factories/IResolver__factory.d.ts +22 -0
  43. package/dist/main/typechain/factories/SuperToken__factory.d.ts +46 -0
  44. package/dist/main/typechain/factories/SuperfluidLoader__factory.d.ts +37 -0
  45. package/dist/main/typechain/factories/Superfluid__factory.d.ts +82 -0
  46. package/dist/main/typechain/factories/TestToken__factory.d.ts +46 -0
  47. package/dist/main/typechain/index.d.ts +16 -0
  48. package/dist/main/types.d.ts +2 -0
  49. package/dist/main/utils.d.ts +89 -0
  50. package/dist/main/validation.d.ts +8 -0
  51. package/dist/module/BatchCall.d.ts +53 -0
  52. package/dist/module/ConstantFlowAgreementV1.d.ts +74 -0
  53. package/dist/module/Framework.d.ts +75 -0
  54. package/dist/module/Host.d.ts +18 -0
  55. package/dist/module/InstantDistributionAgreementV1.d.ts +107 -0
  56. package/dist/module/Operation.d.ts +38 -0
  57. package/dist/module/Query.d.ts +24 -0
  58. package/dist/module/SFError.d.ts +13 -0
  59. package/dist/module/SuperToken.d.ts +191 -0
  60. package/dist/module/Token.d.ts +76 -0
  61. package/dist/module/constants.d.ts +10 -0
  62. package/dist/module/events.d.ts +254 -0
  63. package/dist/module/frameworkHelpers.d.ts +20 -0
  64. package/dist/module/index.d.ts +19 -0
  65. package/dist/module/index.js +10749 -0
  66. package/dist/module/interfaces.d.ts +309 -0
  67. package/dist/module/mapGetAllEventsQueryEvents.d.ts +3 -0
  68. package/dist/module/pagination.d.ts +31 -0
  69. package/dist/module/scripts/setup.d.ts +22 -0
  70. package/dist/module/subgraph/SubgraphClient.d.ts +16 -0
  71. package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.d.ts +41 -0
  72. package/dist/module/subgraph/queries/getAllEvents.generated.d.ts +578 -0
  73. package/dist/module/subgraph/queries/getIndexSubscriptions.generated.d.ts +42 -0
  74. package/dist/module/subgraph/queries/getIndexes.generated.d.ts +40 -0
  75. package/dist/module/subgraph/queries/getStreams.generated.d.ts +54 -0
  76. package/dist/module/subgraph/queries/getTokens.generated.d.ts +23 -0
  77. package/dist/module/subgraph/schema.generated.d.ts +6907 -0
  78. package/dist/module/typechain/ERC20WithTokenInfo.d.ts +159 -0
  79. package/dist/module/typechain/IConstantFlowAgreementV1.d.ts +305 -0
  80. package/dist/module/typechain/IInstantDistributionAgreementV1.d.ts +585 -0
  81. package/dist/module/typechain/IResolver.d.ts +57 -0
  82. package/dist/module/typechain/SuperToken.d.ts +1011 -0
  83. package/dist/module/typechain/Superfluid.d.ts +780 -0
  84. package/dist/module/typechain/SuperfluidLoader.d.ts +55 -0
  85. package/dist/module/typechain/TestToken.d.ts +207 -0
  86. package/dist/module/typechain/common.d.ts +21 -0
  87. package/dist/module/typechain/factories/ERC20WithTokenInfo__factory.d.ts +35 -0
  88. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.d.ts +35 -0
  89. package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts +35 -0
  90. package/dist/module/typechain/factories/IResolver__factory.d.ts +22 -0
  91. package/dist/module/typechain/factories/SuperToken__factory.d.ts +46 -0
  92. package/dist/module/typechain/factories/SuperfluidLoader__factory.d.ts +37 -0
  93. package/dist/module/typechain/factories/Superfluid__factory.d.ts +82 -0
  94. package/dist/module/typechain/factories/TestToken__factory.d.ts +46 -0
  95. package/dist/module/typechain/index.d.ts +16 -0
  96. package/dist/module/types.d.ts +2 -0
  97. package/dist/module/utils.d.ts +89 -0
  98. package/dist/module/validation.d.ts +8 -0
  99. package/dist/umd/BatchCall.d.ts +53 -0
  100. package/dist/umd/ConstantFlowAgreementV1.d.ts +74 -0
  101. package/dist/umd/Framework.d.ts +75 -0
  102. package/dist/umd/Host.d.ts +18 -0
  103. package/dist/umd/InstantDistributionAgreementV1.d.ts +107 -0
  104. package/dist/umd/Operation.d.ts +38 -0
  105. package/dist/umd/Query.d.ts +24 -0
  106. package/dist/umd/SFError.d.ts +13 -0
  107. package/dist/umd/SuperToken.d.ts +191 -0
  108. package/dist/umd/Token.d.ts +76 -0
  109. package/dist/umd/constants.d.ts +10 -0
  110. package/dist/umd/events.d.ts +254 -0
  111. package/dist/umd/frameworkHelpers.d.ts +20 -0
  112. package/dist/umd/index.d.ts +19 -0
  113. package/dist/umd/index.js +10782 -0
  114. package/dist/umd/interfaces.d.ts +309 -0
  115. package/dist/umd/mapGetAllEventsQueryEvents.d.ts +3 -0
  116. package/dist/umd/pagination.d.ts +31 -0
  117. package/dist/umd/scripts/setup.d.ts +22 -0
  118. package/dist/umd/subgraph/SubgraphClient.d.ts +16 -0
  119. package/dist/umd/subgraph/queries/getAccountTokenSnapshots.generated.d.ts +41 -0
  120. package/dist/umd/subgraph/queries/getAllEvents.generated.d.ts +578 -0
  121. package/dist/umd/subgraph/queries/getIndexSubscriptions.generated.d.ts +42 -0
  122. package/dist/umd/subgraph/queries/getIndexes.generated.d.ts +40 -0
  123. package/dist/umd/subgraph/queries/getStreams.generated.d.ts +54 -0
  124. package/dist/umd/subgraph/queries/getTokens.generated.d.ts +23 -0
  125. package/dist/umd/subgraph/schema.generated.d.ts +6907 -0
  126. package/dist/umd/typechain/ERC20WithTokenInfo.d.ts +159 -0
  127. package/dist/umd/typechain/IConstantFlowAgreementV1.d.ts +305 -0
  128. package/dist/umd/typechain/IInstantDistributionAgreementV1.d.ts +585 -0
  129. package/dist/umd/typechain/IResolver.d.ts +57 -0
  130. package/dist/umd/typechain/SuperToken.d.ts +1011 -0
  131. package/dist/umd/typechain/Superfluid.d.ts +780 -0
  132. package/dist/umd/typechain/SuperfluidLoader.d.ts +55 -0
  133. package/dist/umd/typechain/TestToken.d.ts +207 -0
  134. package/dist/umd/typechain/common.d.ts +21 -0
  135. package/dist/umd/typechain/factories/ERC20WithTokenInfo__factory.d.ts +35 -0
  136. package/dist/umd/typechain/factories/IConstantFlowAgreementV1__factory.d.ts +35 -0
  137. package/dist/umd/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts +35 -0
  138. package/dist/umd/typechain/factories/IResolver__factory.d.ts +22 -0
  139. package/dist/umd/typechain/factories/SuperToken__factory.d.ts +46 -0
  140. package/dist/umd/typechain/factories/SuperfluidLoader__factory.d.ts +37 -0
  141. package/dist/umd/typechain/factories/Superfluid__factory.d.ts +82 -0
  142. package/dist/umd/typechain/factories/TestToken__factory.d.ts +46 -0
  143. package/dist/umd/typechain/index.d.ts +16 -0
  144. package/dist/umd/types.d.ts +2 -0
  145. package/dist/umd/utils.d.ts +89 -0
  146. package/dist/umd/validation.d.ts +8 -0
  147. package/package.json +76 -0
@@ -0,0 +1,191 @@
1
+ import { ethers } from "ethers";
2
+ import { IConfig, IRealtimeBalanceOfParams, ISuperTokenBaseIDAParams, ISuperTokenCreateFlowParams, ISuperTokenDeleteFlowParams, ISuperTokenDistributeParams, ISuperTokenGetFlowInfoParams, ISuperTokenGetFlowParams, ISuperTokenGetIndexParams, ISuperTokenGetSubscriptionParams, ISuperTokenPublisherOperationParams, ISuperTokenPubSubParams, ISuperTokenUpdateFlowParams, ISuperTokenUpdateIndexValueParams, ISuperTokenUpdateSubscriptionUnitsParams, IWeb3FlowInfo, IWeb3Index, IWeb3RealTimeBalanceOf, IWeb3Subscription } from "./interfaces";
3
+ import Operation from "./Operation";
4
+ import ConstantFlowAgreementV1 from "./ConstantFlowAgreementV1";
5
+ import InstantDistributionAgreementV1 from "./InstantDistributionAgreementV1";
6
+ import Token from "./Token";
7
+ export interface ITokenSettings {
8
+ readonly address: string;
9
+ readonly config: IConfig;
10
+ readonly chainId: number;
11
+ readonly networkName: string;
12
+ readonly underlyingTokenAddress: string;
13
+ }
14
+ export interface ITokenOptions {
15
+ readonly address: string;
16
+ readonly config: IConfig;
17
+ readonly provider: ethers.providers.Provider;
18
+ readonly chainId?: number;
19
+ readonly networkName?: string;
20
+ }
21
+ /**
22
+ * @dev SuperToken Helper Class
23
+ * @description A helper class to create `SuperToken` objects which can interact with the `SuperToken` contract as well as the CFAV1 and IDAV1 contracts of the desired `SuperToken`.
24
+ */
25
+ export default class SuperToken extends Token {
26
+ readonly options: ITokenOptions;
27
+ readonly settings: ITokenSettings;
28
+ readonly cfaV1: ConstantFlowAgreementV1;
29
+ readonly idaV1: InstantDistributionAgreementV1;
30
+ readonly underlyingToken: Token;
31
+ private constructor();
32
+ static create: (options: ITokenOptions) => Promise<SuperToken>;
33
+ private get superTokenContract();
34
+ /**
35
+ * @dev Returns the real time balance of `address`.
36
+ * @param account the target address
37
+ * @param timestamp the timestamp you'd like to see the data
38
+ * @param providerOrSigner a provider or signer for executing a web3 call
39
+ * @returns {Promise<IWeb3RealTimeBalanceOf>} real time balance of data
40
+ */
41
+ realtimeBalanceOf: ({ providerOrSigner, account, timestamp, }: IRealtimeBalanceOfParams) => Promise<IWeb3RealTimeBalanceOf>;
42
+ /**
43
+ * @dev Downgrade `amount` SuperToken's.
44
+ * @param amount The amount to be downgraded.
45
+ * @returns {Operation} An instance of Operation which can be executed or batched.
46
+ */
47
+ downgrade: ({ amount }: {
48
+ amount: string;
49
+ }) => Operation;
50
+ /**
51
+ * @dev Upgrade `amount` SuperToken's.
52
+ * @param amount The amount to be upgraded.
53
+ * @returns {Operation} An instance of Operation which can be executed or batched.
54
+ */
55
+ upgrade: ({ amount }: {
56
+ amount: string;
57
+ }) => Operation;
58
+ /**
59
+ * @dev Get the details of a flow.
60
+ * @param sender the sender of the flow
61
+ * @param receiver the receiver of the flow
62
+ * @param providerOrSigner a provider or signer object
63
+ * @returns {Promise<IWeb3FlowInfo>} Web3 Flow info object
64
+ */
65
+ getFlow: ({ sender, receiver, providerOrSigner, }: ISuperTokenGetFlowParams) => Promise<IWeb3FlowInfo>;
66
+ /**
67
+ * @dev Get the flow info of an account (net flow).
68
+ * @param account the account we're querying
69
+ * @param providerOrSigner a provider or signer object
70
+ * @returns {Promise<IWeb3FlowInfo>} Web3 Flow info object
71
+ */
72
+ getAccountFlowInfo: ({ account, providerOrSigner, }: ISuperTokenGetFlowInfoParams) => Promise<IWeb3FlowInfo>;
73
+ /**
74
+ * @dev Get the net flow of an account.
75
+ * @param account the account we're querying
76
+ * @param providerOrSigner a provider or signer object
77
+ * @returns {Promise<string>} Web3 Flow info object
78
+ */
79
+ getNetFlow: ({ account, providerOrSigner, }: ISuperTokenGetFlowInfoParams) => Promise<string>;
80
+ /**
81
+ * @dev Create a flow of the token of this class.
82
+ * @param sender The sender of the flow.
83
+ * @param receiver The receiver of the flow.
84
+ * @param flowRate The specified flow rate.
85
+ * @param userData Extra user data provided.
86
+ * @returns {Operation} An instance of Operation which can be executed or batched.
87
+ */
88
+ createFlow: ({ sender, receiver, flowRate, userData, }: ISuperTokenCreateFlowParams) => Operation;
89
+ /**
90
+ * @dev Update a flow of the token of this class.
91
+ * @param sender The sender of the flow.
92
+ * @param receiver The receiver of the flow.
93
+ * @param flowRate The specified flow rate.
94
+ * @param userData Extra user data provided.
95
+ * @returns {Operation} An instance of Operation which can be executed or batched.
96
+ */
97
+ updateFlow: ({ sender, receiver, flowRate, userData, }: ISuperTokenUpdateFlowParams) => Operation;
98
+ /**
99
+ * @dev Delete a flow of the token of this class.
100
+ * @param sender The sender of the flow.
101
+ * @param receiver The receiver of the flow.
102
+ * @param userData Extra user data provided.
103
+ * @returns {Operation} An instance of Operation which can be executed or batched.
104
+ */
105
+ deleteFlow: ({ sender, receiver, userData, }: ISuperTokenDeleteFlowParams) => Operation;
106
+ /**
107
+ * @dev Get the details of a `Subscription`.
108
+ * @param publisher the address of the publisher of the index
109
+ * @param indexId the index id
110
+ * @param subscriber the subscriber's address
111
+ * @param providerOrSigner a provider or signer object
112
+ * @returns {Promise<IWeb3Subscription>} Web3 Subscription object
113
+ */
114
+ getSubscription: ({ publisher, indexId, subscriber, providerOrSigner, }: ISuperTokenGetSubscriptionParams) => Promise<IWeb3Subscription>;
115
+ /**
116
+ * @dev Get the details of an `Index`.
117
+ * @param publisher the address of the publisher of the index
118
+ * @param indexId the index id
119
+ * @param providerOrSigner a provider or signer object
120
+ * @returns {Promise<IWeb3Index>} Web3 Index object
121
+ */
122
+ getIndex: ({ publisher, indexId, providerOrSigner, }: ISuperTokenGetIndexParams) => Promise<IWeb3Index>;
123
+ /**
124
+ * @dev Creates an IDA Index.
125
+ * @param indexId The id of the index.
126
+ * @param userData Extra user data provided.
127
+ * @returns {Operation} An instance of Operation which can be executed or batched.
128
+ */
129
+ createIndex: ({ indexId, userData, }: ISuperTokenBaseIDAParams) => Operation;
130
+ /**
131
+ * @dev Distributes `amount` of token to an index
132
+ * @param indexId The id of the index.
133
+ * @param amount The amount of tokens to be distributed.
134
+ * @param userData Extra user data provided.
135
+ * @returns {Operation} An instance of Operation which can be executed or batched.
136
+ */
137
+ distribute: ({ indexId, amount, userData, }: ISuperTokenDistributeParams) => Operation;
138
+ /**
139
+ * @dev Updates the `IndexValue` field of an index.
140
+ * @param indexId The id of the index.
141
+ * @param indexValue The new indexValue.
142
+ * @param userData Extra user data provided.
143
+ * @returns {Operation} An instance of Operation which can be executed or batched.
144
+ *
145
+ * NOTE: It has the same effect as `distribute`, but is closer to the low level data structure of the index.
146
+ */
147
+ updateIndexValue: ({ indexId, indexValue, userData, }: ISuperTokenUpdateIndexValueParams) => Operation;
148
+ /**
149
+ * @dev Updates the `units` allocated to a Subscription.
150
+ * @param indexId The id of the index.
151
+ * @param subscriber The subscriber address whose units you want to update.
152
+ * @param units The amount of units you want to update to.
153
+ * @param userData Extra user data provided.
154
+ * @returns {Operation} An instance of Operation which can be executed or batched.
155
+ */
156
+ updateSubscriptionUnits: ({ indexId, subscriber, units, userData, }: ISuperTokenUpdateSubscriptionUnitsParams) => Operation;
157
+ /**
158
+ * @dev Approves a Subscription, so the Subscriber won't need to claim tokens when the Publisher distributes.
159
+ * @param indexId The id of the index.
160
+ * @param publisher The publisher address whose subscription you want to approve.
161
+ * @param userData Extra user data provided.
162
+ * @returns {Operation} An instance of Operation which can be executed or batched.
163
+ */
164
+ approveSubscription: ({ indexId, publisher, userData, }: ISuperTokenPublisherOperationParams) => Operation;
165
+ /**
166
+ * @dev Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributes.
167
+ * @param indexId The id of the index.
168
+ * @param publisher The index publisher address you want to revoke for the subscriber.
169
+ * @param userData Extra user data provided.
170
+ * @returns {Operation} An instance of Operation which can be executed or batched.
171
+ */
172
+ revokeSubscription: ({ indexId, publisher, userData, }: ISuperTokenPublisherOperationParams) => Operation;
173
+ /**
174
+ * @dev Deletes a Subscription by setting the `units` allocated to the Subscriber to 0.
175
+ * @param indexId The id of the index.
176
+ * @param subscriber The subscriber address whose subscription you want to delete.
177
+ * @param publisher The publisher address of the index you are targeting.
178
+ * @param userData Extra user data provided.
179
+ * @returns {Operation} An instance of Operation which can be executed or batched.
180
+ */
181
+ deleteSubscription: ({ indexId, subscriber, publisher, userData, }: ISuperTokenPubSubParams) => Operation;
182
+ /**
183
+ * @dev Claims any pending tokens allocated to the Subscription (unapproved).
184
+ * @param indexId The id of the index.
185
+ * @param subscriber The subscriber address who you are claiming for.
186
+ * @param publisher The publisher address of the index you are targeting.
187
+ * @param userData Extra user data provided.
188
+ * @returns {Operation} An instance of Operation which can be executed or batched.
189
+ */
190
+ claim: ({ indexId, subscriber, publisher, userData, }: ISuperTokenPubSubParams) => Operation;
191
+ }
@@ -0,0 +1,76 @@
1
+ import { ethers } from "ethers";
2
+ import { IBaseSuperTokenParams, ITransferFromParams } from "./interfaces";
3
+ import Operation from "./Operation";
4
+ export default class Token {
5
+ readonly address: string;
6
+ constructor(address: string);
7
+ private get tokenContract();
8
+ /**
9
+ * @dev Returns the allowance the `owner` has granted the `spender`.
10
+ * @param owner the owner who has allotted the allowance
11
+ * @param spender the spender who has received the allowance
12
+ * @param providerOrSigner a provider or signer for executing a web3 call
13
+ * @returns {Promise<string>} the allowance amount
14
+ */
15
+ allowance: ({ owner, spender, providerOrSigner, }: {
16
+ owner: string;
17
+ spender: string;
18
+ providerOrSigner: ethers.providers.Provider | ethers.Signer;
19
+ }) => Promise<string>;
20
+ /**
21
+ * @dev Returns the ERC20 balanceOf the `account`, this can't be negative and will just display 0.
22
+ * @param account the account you would like to query
23
+ * @param providerOrSigner a provider or signer for executing a web3 call
24
+ * @returns {Promise<string>} the token balance of `account`
25
+ */
26
+ balanceOf: ({ account, providerOrSigner, }: {
27
+ account: string;
28
+ providerOrSigner: ethers.providers.Provider | ethers.Signer;
29
+ }) => Promise<string>;
30
+ /**
31
+ * @dev Returns the token name
32
+ * @param providerOrSigner a provider or signer for executing a web3 call
33
+ * @returns {string} the token name
34
+ */
35
+ name: ({ providerOrSigner, }: {
36
+ providerOrSigner: ethers.providers.Provider | ethers.Signer;
37
+ }) => Promise<string>;
38
+ /**
39
+ * @dev Returns the token symbol
40
+ * @param providerOrSigner a provider or signer for executing a web3 call
41
+ * @returns {string} the token symbol
42
+ */
43
+ symbol: ({ providerOrSigner, }: {
44
+ providerOrSigner: ethers.providers.Provider | ethers.Signer;
45
+ }) => Promise<string>;
46
+ /**
47
+ * @dev Returns the total supply of the token.
48
+ * @param providerOrSigner a provider or signer for executing a web3 call
49
+ * @returns {Promise<string>} the total supply of the token
50
+ */
51
+ totalSupply: ({ providerOrSigner, }: {
52
+ providerOrSigner: ethers.providers.Provider | ethers.Signer;
53
+ }) => Promise<string>;
54
+ /**
55
+ * @dev Approve `receiver` to spend `amount` tokens.
56
+ * @param receiver The receiver approved.
57
+ * @param amount The amount approved.
58
+ * @returns {Operation} An instance of Operation which can be executed or batched.
59
+ */
60
+ approve: ({ receiver, amount }: IBaseSuperTokenParams) => Operation;
61
+ /**
62
+ * @dev Transfer `receiver` `amount` tokens.
63
+ * @param receiver The receiver of the transfer.
64
+ * @param amount The amount to be transferred.
65
+ * @returns {Operation} An instance of Operation which can be executed or batched.
66
+ */
67
+ transfer: ({ receiver, amount }: IBaseSuperTokenParams) => Operation;
68
+ /**
69
+ * @dev Transfer from `sender` to `receiver` `amount` tokens.
70
+ * @param sender The sender of the transfer.
71
+ * @param receiver The receiver of the transfer.
72
+ * @param amount The amount to be transferred.
73
+ * @returns {Operation} An instance of Operation which can be executed or batched.
74
+ */
75
+ transferFrom: ({ sender, receiver, amount, }: ITransferFromParams) => Operation;
76
+ }
@@ -0,0 +1,10 @@
1
+ import { IResolverData } from "./interfaces";
2
+ export declare const MONTHS_PER_YEAR = 12;
3
+ export declare const DAYS_PER_MONTH = 30;
4
+ export declare const HOURS_PER_DAY = 24;
5
+ export declare const MINUTES_PER_HOUR = 60;
6
+ export declare const SECONDS_PER_MINUTE = 60;
7
+ export declare const chainIds: number[];
8
+ export declare const networkNames: string[];
9
+ export declare const chainIdToDataMap: Map<number, IResolverData>;
10
+ export declare const networkNameToChainIdMap: Map<string, number>;
@@ -0,0 +1,254 @@
1
+ export declare type EventBase = {
2
+ blockNumber: number;
3
+ transactionHash: string;
4
+ timestamp: number;
5
+ };
6
+ export interface IEventFilter {
7
+ readonly account?: string;
8
+ readonly timestamp_gte?: number;
9
+ }
10
+ export declare type AccountEvents = FlowUpdatedEvent | IndexCreatedEvent | IndexDistributionClaimedEvent | IndexSubscribedEvent | IndexUnitsUpdatedEvent | IndexUnsubscribedEvent | IndexUpdatedEvent | TokenDowngradedEvent | TransferEvent | TokenUpgradedEvent | SubscriptionApprovedEvent | SubscriptionDistributionClaimedEvent | SubscriptionRevokedEvent | SubscriptionUnitsUpdatedEvent;
11
+ export declare type OtherEvents = AgreementClassRegisteredEvent | AgreementClassUpdatedEvent | AgreementLiquidatedByEvent | AppRegisteredEvent | BurnedEvent | CFAv1LiquidationPeriodChangedEvent | ConfigChangedEvent | CustomSuperTokenCreatedEvent | GovernanceReplacedEvent | JailEvent | MintedEvent | RewardAddressChangedEvent | RoleAdminChangedEvent | RoleGrantedEvent | RoleRevokedEvent | SentEvent | SuperTokenCreatedEvent | SuperTokenFactoryUpdatedEvent | SuperTokenLogicCreatedEvent | SuperTokenLogicUpdatedEvent | TrustedForwarderChangedEvent;
12
+ export declare type AllEvents = AccountEvents | OtherEvents;
13
+ export interface FlowUpdatedEvent extends EventBase {
14
+ name: "FlowUpdated";
15
+ token: string;
16
+ sender: string;
17
+ receiver: string;
18
+ flowRate: string;
19
+ }
20
+ export interface IndexCreatedEvent extends EventBase {
21
+ name: "IndexCreated";
22
+ token: string;
23
+ publisher: string;
24
+ indexId: string;
25
+ userData: string;
26
+ }
27
+ export interface IndexDistributionClaimedEvent extends EventBase {
28
+ name: "IndexDistributionClaimed";
29
+ token: string;
30
+ publisher: string;
31
+ indexId: string;
32
+ subscriber: string;
33
+ amount: string;
34
+ }
35
+ export interface IndexSubscribedEvent extends EventBase {
36
+ name: "IndexSubscribed";
37
+ token: string;
38
+ publisher: string;
39
+ indexId: string;
40
+ subscriber: string;
41
+ }
42
+ export interface IndexUnitsUpdatedEvent extends EventBase {
43
+ name: "IndexUnitsUpdated";
44
+ token: string;
45
+ publisher: string;
46
+ indexId: string;
47
+ subscriber: string;
48
+ units: string;
49
+ userData: string;
50
+ oldUnits: string;
51
+ }
52
+ export interface IndexUnsubscribedEvent extends EventBase {
53
+ name: "IndexUnsubscribed";
54
+ token: string;
55
+ publisher: string;
56
+ indexId: string;
57
+ subscriber: string;
58
+ userData: string;
59
+ }
60
+ export interface IndexUpdatedEvent extends EventBase {
61
+ name: "IndexUpdated";
62
+ token: string;
63
+ publisher: string;
64
+ indexId: string;
65
+ oldIndexValue: string;
66
+ newIndexValue: string;
67
+ totalUnitsPending: string;
68
+ totalUnitsApproved: string;
69
+ userData: string;
70
+ }
71
+ export interface TokenDowngradedEvent extends EventBase {
72
+ name: "TokenDowngraded";
73
+ token: string;
74
+ amount: string;
75
+ account: string;
76
+ }
77
+ export interface TokenUpgradedEvent extends EventBase {
78
+ name: "TokenUpgraded";
79
+ token: string;
80
+ amount: string;
81
+ account: string;
82
+ }
83
+ export interface TransferEvent extends EventBase {
84
+ name: "Transfer";
85
+ from: string;
86
+ to: string;
87
+ value: string;
88
+ token: string;
89
+ }
90
+ export interface AgreementClassRegisteredEvent extends EventBase {
91
+ name: "AgreementClassRegistered";
92
+ agreementType: string;
93
+ code: string;
94
+ }
95
+ export interface AgreementClassUpdatedEvent extends EventBase {
96
+ name: "AgreementClassUpdated";
97
+ agreementType: string;
98
+ code: string;
99
+ }
100
+ export interface AgreementLiquidatedByEvent extends EventBase {
101
+ name: "AgreementLiquidatedBy";
102
+ agreementClass: string;
103
+ agreementId: string;
104
+ bailoutAmount: string;
105
+ bondAccount: string;
106
+ liquidatorAccount: string;
107
+ penaltyAccount: string;
108
+ rewardAmount: string;
109
+ token: string;
110
+ }
111
+ export interface AppRegisteredEvent extends EventBase {
112
+ name: "AppRegistered";
113
+ app: string;
114
+ }
115
+ export interface BurnedEvent extends EventBase {
116
+ name: "Burned";
117
+ amount: string;
118
+ data: string;
119
+ from: string;
120
+ operator: string;
121
+ operatorData: string;
122
+ }
123
+ export interface CFAv1LiquidationPeriodChangedEvent extends EventBase {
124
+ name: "CFAv1LiquidationPeriodChanged";
125
+ host: string;
126
+ isSet: boolean;
127
+ liquidationPeriod: number;
128
+ superToken: string;
129
+ }
130
+ export interface ConfigChangedEvent extends EventBase {
131
+ name: "ConfigChanged";
132
+ host: string;
133
+ isSet: boolean;
134
+ key: string;
135
+ superToken: string;
136
+ value: string;
137
+ }
138
+ export interface CustomSuperTokenCreatedEvent extends EventBase {
139
+ name: "CustomSuperTokenCreated";
140
+ token: string;
141
+ }
142
+ export interface GovernanceReplacedEvent extends EventBase {
143
+ name: "GovernanceReplaced";
144
+ oldGovernance: string;
145
+ newGovernance: string;
146
+ }
147
+ export interface JailEvent extends EventBase {
148
+ name: "Jail";
149
+ app: string;
150
+ reason: string;
151
+ }
152
+ export interface MintedEvent extends EventBase {
153
+ name: "Minted";
154
+ operator: string;
155
+ to: string;
156
+ amount: string;
157
+ data: string;
158
+ operatorData: string;
159
+ }
160
+ export interface RewardAddressChangedEvent extends EventBase {
161
+ name: "RewardAddressChanged";
162
+ host: string;
163
+ superToken: string;
164
+ isSet: boolean;
165
+ rewardAddress: string;
166
+ }
167
+ export interface RoleAdminChangedEvent extends EventBase {
168
+ name: "RoleAdminChanged";
169
+ role: string;
170
+ previousAdminRole: string;
171
+ newAdminRole: string;
172
+ }
173
+ export interface RoleGrantedEvent extends EventBase {
174
+ name: "RoleGranted";
175
+ role: string;
176
+ account: string;
177
+ sender: string;
178
+ }
179
+ export interface RoleRevokedEvent extends EventBase {
180
+ name: "RoleRevoked";
181
+ role: string;
182
+ account: string;
183
+ sender: string;
184
+ }
185
+ export interface SentEvent extends EventBase {
186
+ name: "Sent";
187
+ operator: string;
188
+ to: string;
189
+ amount: string;
190
+ data: string;
191
+ operatorData: string;
192
+ }
193
+ export interface SubscriptionApprovedEvent extends EventBase {
194
+ name: "SubscriptionApproved";
195
+ token: string;
196
+ subscriber: string;
197
+ publisher: string;
198
+ indexId: string;
199
+ userData: string;
200
+ subscription: string;
201
+ }
202
+ export interface SubscriptionDistributionClaimedEvent extends EventBase {
203
+ name: "SubscriptionDistributionClaimed";
204
+ token: string;
205
+ subscriber: string;
206
+ publisher: string;
207
+ indexId: string;
208
+ amount: string;
209
+ subscription: string;
210
+ }
211
+ export interface SubscriptionRevokedEvent extends EventBase {
212
+ name: "SubscriptionRevoked";
213
+ token: string;
214
+ subscriber: string;
215
+ publisher: string;
216
+ indexId: string;
217
+ userData: string;
218
+ subscription: string;
219
+ }
220
+ export interface SubscriptionUnitsUpdatedEvent extends EventBase {
221
+ name: "SubscriptionUnitsUpdated";
222
+ token: string;
223
+ subscriber: string;
224
+ publisher: string;
225
+ indexId: string;
226
+ units: string;
227
+ userData: string;
228
+ subscription: string;
229
+ }
230
+ export interface SuperTokenCreatedEvent extends EventBase {
231
+ name: "SuperTokenCreated";
232
+ token: string;
233
+ }
234
+ export interface SuperTokenFactoryUpdatedEvent extends EventBase {
235
+ name: "SuperTokenFactoryUpdated";
236
+ newFactory: string;
237
+ }
238
+ export interface SuperTokenLogicCreatedEvent extends EventBase {
239
+ name: "SuperTokenLogicCreated";
240
+ tokenLogic: string;
241
+ }
242
+ export interface SuperTokenLogicUpdatedEvent extends EventBase {
243
+ name: "SuperTokenLogicUpdated";
244
+ token: string;
245
+ code: string;
246
+ }
247
+ export interface TrustedForwarderChangedEvent extends EventBase {
248
+ name: "TrustedForwarderChanged";
249
+ host: string;
250
+ superToken: string;
251
+ isSet: boolean;
252
+ forwarder: string;
253
+ enabled: boolean;
254
+ }
@@ -0,0 +1,20 @@
1
+ import { IFrameworkOptions } from "./Framework";
2
+ export declare const validateFrameworkConstructorOptions: (options: IFrameworkOptions) => void;
3
+ /**
4
+ * @dev options.networkName is casted as not null as we check to ensure chainId or networkName is not null.
5
+ * @param options
6
+ * @returns SubgraphQueriesEndpoint which is a custom endpoint or based on selected network
7
+ */
8
+ export declare const getSubgraphQueriesEndpoint: (options: IFrameworkOptions) => string;
9
+ interface INetworkNameParams {
10
+ readonly chainId?: number;
11
+ readonly networkName?: string;
12
+ }
13
+ /**
14
+ * @dev We check that the user has input a networkName or chainId and that they are both supported.
15
+ * @param options.chainId the chainId of the desired network
16
+ * @param options.networkName the name of the desired network
17
+ * @returns the network name
18
+ */
19
+ export declare const getNetworkName: (options: INetworkNameParams) => string;
20
+ export {};
@@ -0,0 +1,19 @@
1
+ import Framework from "./Framework";
2
+ import SuperToken from "./SuperToken";
3
+ import Query from "./Query";
4
+ import ConstantFlowAgreementV1 from "./ConstantFlowAgreementV1";
5
+ import InstantDistributionAgreementV1 from "./InstantDistributionAgreementV1";
6
+ import Host from "./Host";
7
+ import BatchCall from "./BatchCall";
8
+ export * from "./interfaces";
9
+ export * from "./utils";
10
+ export * from "./pagination";
11
+ export * from "./events";
12
+ export * from "./types";
13
+ export { Framework };
14
+ export { SuperToken };
15
+ export { Query };
16
+ export { ConstantFlowAgreementV1 };
17
+ export { InstantDistributionAgreementV1 };
18
+ export { Host };
19
+ export { BatchCall };