@superfluid-finance/sdk-core 0.4.4-dev.ff4f866.0 → 0.4.5-dev.53e1b83.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 (141) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/dist/index.umd.js +44451 -37460
  3. package/dist/main/Framework.d.ts +1 -1
  4. package/dist/main/Framework.d.ts.map +1 -1
  5. package/dist/main/Host.d.ts +4 -4
  6. package/dist/main/Host.d.ts.map +1 -1
  7. package/dist/main/abi/SuperToken.json +13 -0
  8. package/dist/main/abi/Superfluid.json +13 -0
  9. package/dist/main/abi/SuperfluidGovernanceII.json +13 -0
  10. package/dist/main/subgraph/subgraphQueryHandler.js +3 -3
  11. package/dist/main/subgraph/subgraphQueryHandler.js.map +1 -1
  12. package/dist/main/typechain/ERC20WithTokenInfo.d.ts +67 -60
  13. package/dist/main/typechain/ERC20WithTokenInfo.d.ts.map +1 -1
  14. package/dist/main/typechain/IConstantFlowAgreementV1.d.ts +251 -185
  15. package/dist/main/typechain/IConstantFlowAgreementV1.d.ts.map +1 -1
  16. package/dist/main/typechain/IInstantDistributionAgreementV1.d.ts +256 -185
  17. package/dist/main/typechain/IInstantDistributionAgreementV1.d.ts.map +1 -1
  18. package/dist/main/typechain/IResolver.d.ts +26 -27
  19. package/dist/main/typechain/IResolver.d.ts.map +1 -1
  20. package/dist/main/typechain/ISETH.d.ts +609 -527
  21. package/dist/main/typechain/ISETH.d.ts.map +1 -1
  22. package/dist/main/typechain/SuperToken.d.ts +612 -520
  23. package/dist/main/typechain/SuperToken.d.ts.map +1 -1
  24. package/dist/main/typechain/Superfluid.d.ts +458 -402
  25. package/dist/main/typechain/Superfluid.d.ts.map +1 -1
  26. package/dist/main/typechain/SuperfluidGovernanceII.d.ts +396 -315
  27. package/dist/main/typechain/SuperfluidGovernanceII.d.ts.map +1 -1
  28. package/dist/main/typechain/SuperfluidLoader.d.ts +28 -23
  29. package/dist/main/typechain/SuperfluidLoader.d.ts.map +1 -1
  30. package/dist/main/typechain/TestToken.d.ts +97 -90
  31. package/dist/main/typechain/TestToken.d.ts.map +1 -1
  32. package/dist/main/typechain/common.d.ts +1 -0
  33. package/dist/main/typechain/common.d.ts.map +1 -1
  34. package/dist/main/typechain/factories/ERC20WithTokenInfo__factory.d.ts +1 -1
  35. package/dist/main/typechain/factories/ERC20WithTokenInfo__factory.d.ts.map +1 -1
  36. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.d.ts +1 -1
  37. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.d.ts.map +1 -1
  38. package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts +1 -1
  39. package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts.map +1 -1
  40. package/dist/main/typechain/factories/IResolver__factory.d.ts +1 -1
  41. package/dist/main/typechain/factories/IResolver__factory.d.ts.map +1 -1
  42. package/dist/main/typechain/factories/ISETH__factory.d.ts +1 -1
  43. package/dist/main/typechain/factories/ISETH__factory.d.ts.map +1 -1
  44. package/dist/main/typechain/factories/SuperToken__factory.d.ts +1 -1
  45. package/dist/main/typechain/factories/SuperToken__factory.d.ts.map +1 -1
  46. package/dist/main/typechain/factories/SuperToken__factory.js +13 -0
  47. package/dist/main/typechain/factories/SuperToken__factory.js.map +1 -1
  48. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.d.ts +1 -1
  49. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.d.ts.map +1 -1
  50. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.js +13 -0
  51. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.js.map +1 -1
  52. package/dist/main/typechain/factories/SuperfluidLoader__factory.d.ts +1 -1
  53. package/dist/main/typechain/factories/SuperfluidLoader__factory.d.ts.map +1 -1
  54. package/dist/main/typechain/factories/Superfluid__factory.d.ts +1 -1
  55. package/dist/main/typechain/factories/Superfluid__factory.d.ts.map +1 -1
  56. package/dist/main/typechain/factories/Superfluid__factory.js +13 -0
  57. package/dist/main/typechain/factories/Superfluid__factory.js.map +1 -1
  58. package/dist/main/typechain/factories/TestToken__factory.d.ts +1 -1
  59. package/dist/main/typechain/factories/TestToken__factory.d.ts.map +1 -1
  60. package/dist/main/typechain/factories/index.d.ts +11 -0
  61. package/dist/main/typechain/factories/index.d.ts.map +1 -0
  62. package/dist/main/typechain/factories/index.js +27 -0
  63. package/dist/main/typechain/factories/index.js.map +1 -0
  64. package/dist/main/typechain/index.d.ts +2 -1
  65. package/dist/main/typechain/index.d.ts.map +1 -1
  66. package/dist/main/typechain/index.js +25 -1
  67. package/dist/main/typechain/index.js.map +1 -1
  68. package/dist/main/utils.d.ts +9 -8
  69. package/dist/main/utils.d.ts.map +1 -1
  70. package/dist/main/utils.js +24 -21
  71. package/dist/main/utils.js.map +1 -1
  72. package/dist/module/Framework.d.ts +1 -1
  73. package/dist/module/Framework.d.ts.map +1 -1
  74. package/dist/module/Host.d.ts +4 -4
  75. package/dist/module/Host.d.ts.map +1 -1
  76. package/dist/module/abi/SuperToken.json +13 -0
  77. package/dist/module/abi/Superfluid.json +13 -0
  78. package/dist/module/abi/SuperfluidGovernanceII.json +13 -0
  79. package/dist/module/subgraph/subgraphQueryHandler.js +3 -3
  80. package/dist/module/subgraph/subgraphQueryHandler.js.map +1 -1
  81. package/dist/module/typechain/ERC20WithTokenInfo.d.ts +67 -60
  82. package/dist/module/typechain/ERC20WithTokenInfo.d.ts.map +1 -1
  83. package/dist/module/typechain/IConstantFlowAgreementV1.d.ts +251 -185
  84. package/dist/module/typechain/IConstantFlowAgreementV1.d.ts.map +1 -1
  85. package/dist/module/typechain/IInstantDistributionAgreementV1.d.ts +256 -185
  86. package/dist/module/typechain/IInstantDistributionAgreementV1.d.ts.map +1 -1
  87. package/dist/module/typechain/IResolver.d.ts +26 -27
  88. package/dist/module/typechain/IResolver.d.ts.map +1 -1
  89. package/dist/module/typechain/ISETH.d.ts +609 -527
  90. package/dist/module/typechain/ISETH.d.ts.map +1 -1
  91. package/dist/module/typechain/SuperToken.d.ts +612 -520
  92. package/dist/module/typechain/SuperToken.d.ts.map +1 -1
  93. package/dist/module/typechain/Superfluid.d.ts +458 -402
  94. package/dist/module/typechain/Superfluid.d.ts.map +1 -1
  95. package/dist/module/typechain/SuperfluidGovernanceII.d.ts +396 -315
  96. package/dist/module/typechain/SuperfluidGovernanceII.d.ts.map +1 -1
  97. package/dist/module/typechain/SuperfluidLoader.d.ts +28 -23
  98. package/dist/module/typechain/SuperfluidLoader.d.ts.map +1 -1
  99. package/dist/module/typechain/TestToken.d.ts +97 -90
  100. package/dist/module/typechain/TestToken.d.ts.map +1 -1
  101. package/dist/module/typechain/common.d.ts +1 -0
  102. package/dist/module/typechain/common.d.ts.map +1 -1
  103. package/dist/module/typechain/factories/ERC20WithTokenInfo__factory.d.ts +1 -1
  104. package/dist/module/typechain/factories/ERC20WithTokenInfo__factory.d.ts.map +1 -1
  105. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.d.ts +1 -1
  106. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.d.ts.map +1 -1
  107. package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts +1 -1
  108. package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts.map +1 -1
  109. package/dist/module/typechain/factories/IResolver__factory.d.ts +1 -1
  110. package/dist/module/typechain/factories/IResolver__factory.d.ts.map +1 -1
  111. package/dist/module/typechain/factories/ISETH__factory.d.ts +1 -1
  112. package/dist/module/typechain/factories/ISETH__factory.d.ts.map +1 -1
  113. package/dist/module/typechain/factories/SuperToken__factory.d.ts +1 -1
  114. package/dist/module/typechain/factories/SuperToken__factory.d.ts.map +1 -1
  115. package/dist/module/typechain/factories/SuperToken__factory.js +13 -0
  116. package/dist/module/typechain/factories/SuperToken__factory.js.map +1 -1
  117. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.d.ts +1 -1
  118. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.d.ts.map +1 -1
  119. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.js +13 -0
  120. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.js.map +1 -1
  121. package/dist/module/typechain/factories/SuperfluidLoader__factory.d.ts +1 -1
  122. package/dist/module/typechain/factories/SuperfluidLoader__factory.d.ts.map +1 -1
  123. package/dist/module/typechain/factories/Superfluid__factory.d.ts +1 -1
  124. package/dist/module/typechain/factories/Superfluid__factory.d.ts.map +1 -1
  125. package/dist/module/typechain/factories/Superfluid__factory.js +13 -0
  126. package/dist/module/typechain/factories/Superfluid__factory.js.map +1 -1
  127. package/dist/module/typechain/factories/TestToken__factory.d.ts +1 -1
  128. package/dist/module/typechain/factories/TestToken__factory.d.ts.map +1 -1
  129. package/dist/module/typechain/factories/index.d.ts +11 -0
  130. package/dist/module/typechain/factories/index.d.ts.map +1 -0
  131. package/dist/module/typechain/factories/index.js +14 -0
  132. package/dist/module/typechain/factories/index.js.map +1 -0
  133. package/dist/module/typechain/index.d.ts +2 -1
  134. package/dist/module/typechain/index.d.ts.map +1 -1
  135. package/dist/module/typechain/index.js +1 -0
  136. package/dist/module/typechain/index.js.map +1 -1
  137. package/dist/module/utils.d.ts +9 -8
  138. package/dist/module/utils.d.ts.map +1 -1
  139. package/dist/module/utils.js +21 -19
  140. package/dist/module/utils.js.map +1 -1
  141. package/package.json +13 -9
@@ -0,0 +1,14 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ export { ERC20WithTokenInfo__factory } from "./ERC20WithTokenInfo__factory";
5
+ export { IConstantFlowAgreementV1__factory } from "./IConstantFlowAgreementV1__factory";
6
+ export { IInstantDistributionAgreementV1__factory } from "./IInstantDistributionAgreementV1__factory";
7
+ export { IResolver__factory } from "./IResolver__factory";
8
+ export { ISETH__factory } from "./ISETH__factory";
9
+ export { SuperToken__factory } from "./SuperToken__factory";
10
+ export { Superfluid__factory } from "./Superfluid__factory";
11
+ export { SuperfluidGovernanceII__factory } from "./SuperfluidGovernanceII__factory";
12
+ export { SuperfluidLoader__factory } from "./SuperfluidLoader__factory";
13
+ export { TestToken__factory } from "./TestToken__factory";
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/typechain/factories/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;AACpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,wCAAwC,EAAE,MAAM,4CAA4C,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -3,11 +3,12 @@ export type { IConstantFlowAgreementV1 } from "./IConstantFlowAgreementV1";
3
3
  export type { IInstantDistributionAgreementV1 } from "./IInstantDistributionAgreementV1";
4
4
  export type { IResolver } from "./IResolver";
5
5
  export type { ISETH } from "./ISETH";
6
+ export type { SuperToken } from "./SuperToken";
6
7
  export type { Superfluid } from "./Superfluid";
7
8
  export type { SuperfluidGovernanceII } from "./SuperfluidGovernanceII";
8
9
  export type { SuperfluidLoader } from "./SuperfluidLoader";
9
- export type { SuperToken } from "./SuperToken";
10
10
  export type { TestToken } from "./TestToken";
11
+ export * as factories from "./factories";
11
12
  export { ERC20WithTokenInfo__factory } from "./factories/ERC20WithTokenInfo__factory";
12
13
  export { IConstantFlowAgreementV1__factory } from "./factories/IConstantFlowAgreementV1__factory";
13
14
  export { IInstantDistributionAgreementV1__factory } from "./factories/IInstantDistributionAgreementV1__factory";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/typechain/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,YAAY,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACzF,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,iCAAiC,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,wCAAwC,EAAE,MAAM,sDAAsD,CAAC;AAChH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE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+ export * as factories from "./factories";
1
2
  export { ERC20WithTokenInfo__factory } from "./factories/ERC20WithTokenInfo__factory";
2
3
  export { IConstantFlowAgreementV1__factory } from "./factories/IConstantFlowAgreementV1__factory";
3
4
  export { IInstantDistributionAgreementV1__factory } from "./factories/IInstantDistributionAgreementV1__factory";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/typechain/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,iCAAiC,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,wCAAwC,EAAE,MAAM,sDAAsD,CAAC;AAChH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/typechain/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,iCAAiC,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,wCAAwC,EAAE,MAAM,sDAAsD,CAAC;AAChH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC"}
@@ -8,9 +8,10 @@ import { IIndexSubscription } from "./interfaces";
8
8
  * @param address
9
9
  * @returns The normalized address.
10
10
  */
11
- export declare const normalizeAddress: (address?: string | undefined) => string;
11
+ export declare const normalizeAddress: (address?: string) => string;
12
12
  export declare const isPermissionsClean: (permissions: number) => boolean;
13
13
  export declare const isNullOrEmpty: (str: string | null | undefined) => boolean;
14
+ export declare function toBN(num: any): ethers.BigNumber;
14
15
  /**
15
16
  * Removes the 8-character signature hash from `callData`.
16
17
  * @param callData
@@ -24,7 +25,7 @@ export declare const removeSigHashFromCallData: (callData: string) => string;
24
25
  * @param value amount of ether sent
25
26
  * @returns ethers.TransactionDescription object
26
27
  */
27
- export declare const getTransactionDescription: (fragments: string | readonly (string | ethers.utils.Fragment | JsonFragment)[], data: string, value?: string | undefined) => ethers.utils.TransactionDescription;
28
+ export declare const getTransactionDescription: (fragments: string | readonly (string | ethers.utils.Fragment | JsonFragment)[], data: string, value?: string) => ethers.utils.TransactionDescription;
28
29
  /**
29
30
  * Gets the per second flow rate given an `amountPerYear` value.
30
31
  * @param amountPerYear the amount you want to stream per year
@@ -71,25 +72,25 @@ export declare const flowedAmountSinceUpdatedAt: ({ netFlowRate, currentTimestam
71
72
  netFlowRate: string;
72
73
  currentTimestamp: string;
73
74
  updatedAtTimestamp: string;
74
- }) => number;
75
+ }) => ethers.BigNumber;
75
76
  /**
76
77
  * The formula for calculating the total amount distributed to the subscriber (pending or received).
77
78
  * @param indexSubscriptions the index subscriptions of a single token from an account.
78
79
  * @returns the total amount received since updated at (both pending and actually distributed)
79
80
  */
80
- export declare const subscriptionTotalAmountDistributedSinceUpdated: (indexSubscriptions: IIndexSubscription[]) => number;
81
+ export declare const subscriptionTotalAmountDistributedSinceUpdated: (indexSubscriptions: IIndexSubscription[]) => ethers.BigNumber;
81
82
  /**
82
83
  * The formula for calculating the total amount received (approved subscriptions).
83
84
  * @param indexSubscriptions the index subscriptions of a single token from an account.
84
85
  * @returns the total amount received since updated at (actually distributed into wallet)
85
86
  */
86
- export declare const subscriptionTotalAmountReceivedSinceUpdated: (indexSubscriptions: IIndexSubscription[]) => number;
87
+ export declare const subscriptionTotalAmountReceivedSinceUpdated: (indexSubscriptions: IIndexSubscription[]) => ethers.BigNumber;
87
88
  /**
88
89
  * The formula for calculating the total amount that is claimable.
89
90
  * @param indexSubscriptions the index subscriptions of a single token from an account.
90
91
  * @returns the total amount that can be claimed since updated at
91
92
  */
92
- export declare const subscriptionTotalAmountClaimableSinceUpdatedAt: (indexSubscriptions: IIndexSubscription[]) => number;
93
+ export declare const subscriptionTotalAmountClaimableSinceUpdatedAt: (indexSubscriptions: IIndexSubscription[]) => ethers.BigNumber;
93
94
  export declare const getStringCurrentTimeInSeconds: () => number;
94
95
  export declare const getSanitizedTimestamp: (timestamp: ethers.BigNumberish) => Date;
95
96
  /**
@@ -100,13 +101,13 @@ export declare const getSanitizedTimestamp: (timestamp: ethers.BigNumberish) =>
100
101
  * @param updatedAtTimestamp the updated at timestamp of the `AccountTokenSnapshot` entity
101
102
  * @returns the balance since the updated at timestamp
102
103
  */
103
- export declare const getBalance: ({ currentBalance, netFlowRate, currentTimestamp, updatedAtTimestamp, indexSubscriptions, }: {
104
+ export declare const calculateAvailableBalance: ({ currentBalance, netFlowRate, currentTimestamp, updatedAtTimestamp, indexSubscriptions, }: {
104
105
  currentBalance: string;
105
106
  netFlowRate: string;
106
107
  currentTimestamp: string;
107
108
  updatedAtTimestamp: string;
108
109
  indexSubscriptions: IIndexSubscription[];
109
- }) => number;
110
+ }) => ethers.BigNumber;
110
111
  export declare const isEthersProvider: (provider: any) => provider is ethers.providers.Provider;
111
112
  export declare const isInjectedWeb3: (provider: any) => provider is Web3;
112
113
  export declare const isInjectedEthers: (provider: any) => provider is typeof ethers & HardhatEthersHelpers;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,IAAI,MAAM,MAAM,CAAC;AAaxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAIlD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,oCAAuB,MAWnD,CAAC;AAEF,eAAO,MAAM,kBAAkB,gBAAiB,MAAM,KAAG,OAUxD,CAAC;AAEF,eAAO,MAAM,aAAa,QAAS,MAAM,GAAG,IAAI,GAAG,SAAS,YAE3D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,aAAc,MAAM,WACtB,CAAC;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,cAE5B,MAAM,GACN,SAAS,CAAC,MAAM,GAAG,OAAO,KAAK,CAAC,QAAQ,GAAG,YAAY,CAAC,EAAE,QAC1D,MAAM,oEAMf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,kBAAmB,MAAM,WAI/D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,mBAAoB,MAAM,WAIjE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,kBAAmB,MAAM,WAI/D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,iBAAkB,MAAM,WAI7D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,sBAAuB,MAAM;;;;;CAQzE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B;iBAKtB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AW3C,CAAC;AAIF,eAAO,MAAM,gBAAgB,aACf,GAAG,0CACgD,CAAC;AAElE,eAAO,MAAM,cAAc,aAAc,GAAG,qBACd,CAAC;AAE/B,eAAO,MAAM,gBAAgB,aACf,GAAG,qDACyD,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,SAAS,kBAAqB,CAAC;AAE5C,eAAO,MAAM,iBAAiB,WAAY,MAAM,gBAAgB,MAAM,WAOrE,CAAC"}
@@ -28,6 +28,9 @@ export const isPermissionsClean = (permissions) => {
28
28
  export const isNullOrEmpty = (str) => {
29
29
  return str == null || str === "";
30
30
  };
31
+ export function toBN(num) {
32
+ return ethers.BigNumber.from(num);
33
+ }
31
34
  /**
32
35
  * Removes the 8-character signature hash from `callData`.
33
36
  * @param callData
@@ -100,8 +103,9 @@ export const getFlowAmountByPerSecondFlowRate = (perSecondFlowRate) => {
100
103
  * @returns the flowed amount since the updatedAt timestamp
101
104
  */
102
105
  export const flowedAmountSinceUpdatedAt = ({ netFlowRate, currentTimestamp, updatedAtTimestamp, }) => {
103
- return ((Number(currentTimestamp) - Number(updatedAtTimestamp)) *
104
- Number(netFlowRate));
106
+ return toBN(currentTimestamp)
107
+ .sub(toBN(updatedAtTimestamp))
108
+ .mul(toBN(netFlowRate));
105
109
  };
106
110
  /**
107
111
  * The formula for calculating the total amount distributed to the subscriber (pending or received).
@@ -109,9 +113,9 @@ export const flowedAmountSinceUpdatedAt = ({ netFlowRate, currentTimestamp, upda
109
113
  * @returns the total amount received since updated at (both pending and actually distributed)
110
114
  */
111
115
  export const subscriptionTotalAmountDistributedSinceUpdated = (indexSubscriptions) => {
112
- return indexSubscriptions.reduce((x, y) => x +
113
- (Number(y.index.indexValue) - Number(y.indexValueUntilUpdatedAt)) *
114
- Number(y.units), 0);
116
+ return indexSubscriptions.reduce((x, y) => toBN(x)
117
+ .add(toBN(y.index.indexValue).sub(toBN(y.indexValueUntilUpdatedAt)))
118
+ .mul(toBN(y.units)), toBN(0));
115
119
  };
116
120
  /**
117
121
  * The formula for calculating the total amount received (approved subscriptions).
@@ -121,10 +125,9 @@ export const subscriptionTotalAmountDistributedSinceUpdated = (indexSubscription
121
125
  export const subscriptionTotalAmountReceivedSinceUpdated = (indexSubscriptions) => {
122
126
  return indexSubscriptions
123
127
  .filter((x) => x.approved)
124
- .reduce((x, y) => x +
125
- (Number(y.index.indexValue) -
126
- Number(y.indexValueUntilUpdatedAt)) *
127
- Number(y.units), 0);
128
+ .reduce((x, y) => toBN(x)
129
+ .add(toBN(y.index.indexValue).sub(toBN(y.indexValueUntilUpdatedAt)))
130
+ .mul(toBN(y.units)), toBN(0));
128
131
  };
129
132
  /**
130
133
  * The formula for calculating the total amount that is claimable.
@@ -132,8 +135,7 @@ export const subscriptionTotalAmountReceivedSinceUpdated = (indexSubscriptions)
132
135
  * @returns the total amount that can be claimed since updated at
133
136
  */
134
137
  export const subscriptionTotalAmountClaimableSinceUpdatedAt = (indexSubscriptions) => {
135
- return (subscriptionTotalAmountDistributedSinceUpdated(indexSubscriptions) -
136
- subscriptionTotalAmountReceivedSinceUpdated(indexSubscriptions));
138
+ return subscriptionTotalAmountDistributedSinceUpdated(indexSubscriptions).sub(subscriptionTotalAmountReceivedSinceUpdated(indexSubscriptions));
137
139
  };
138
140
  export const getStringCurrentTimeInSeconds = () => Math.floor(new Date().getTime() / 1000);
139
141
  export const getSanitizedTimestamp = (timestamp) => new Date(Number(timestamp.toString()) * 1000);
@@ -145,14 +147,14 @@ export const getSanitizedTimestamp = (timestamp) => new Date(Number(timestamp.to
145
147
  * @param updatedAtTimestamp the updated at timestamp of the `AccountTokenSnapshot` entity
146
148
  * @returns the balance since the updated at timestamp
147
149
  */
148
- export const getBalance = ({ currentBalance, netFlowRate, currentTimestamp, updatedAtTimestamp, indexSubscriptions, }) => {
149
- return (Number(currentBalance) +
150
- flowedAmountSinceUpdatedAt({
151
- netFlowRate,
152
- currentTimestamp,
153
- updatedAtTimestamp,
154
- }) +
155
- subscriptionTotalAmountReceivedSinceUpdated(indexSubscriptions));
150
+ export const calculateAvailableBalance = ({ currentBalance, netFlowRate, currentTimestamp, updatedAtTimestamp, indexSubscriptions, }) => {
151
+ return toBN(currentBalance)
152
+ .add(flowedAmountSinceUpdatedAt({
153
+ netFlowRate,
154
+ currentTimestamp,
155
+ updatedAtTimestamp,
156
+ }))
157
+ .add(subscriptionTotalAmountReceivedSinceUpdated(indexSubscriptions));
156
158
  };
157
159
  // NOTE: This is the only places we are allowed to use explicit any in the
158
160
  // sdk-core otherwise this doesn't work properly.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACH,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,eAAe,GAClB,MAAM,aAAa,CAAC;AAGrB,MAAM,KAAK,GAAG,IAAI,CAAC;AAEnB;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAgB,EAAU,EAAE;IACzD,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACxB,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,KAAK,EAAE;QAC3C,MAAM,IAAI,OAAO,CAAC;YACd,IAAI,EAAE,iBAAiB;YACvB,aAAa,EACT,8DAA8D;SACrE,CAAC,CAAC;KACN;IAED,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,WAAmB,EAAW,EAAE;IAC/D,OAAO,CACH,CAAC,WAAW;QACR,CAAC,CACG,8BAA8B;YAC9B,8BAA8B;YAC9B,8BAA8B,CACjC,CAAC;QACN,CAAC,CACJ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2C,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAC9E,CAAC,CAAC;AAEF,0EAA0E;AAC1E,iDAAiD;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC5B,QAAa,EACwB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC;AAElE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAa,EAAoB,EAAE,CAC9D,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;AAE/B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC5B,QAAa,EACmC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;AAE3E;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAI,GAAM,EAAE,EAAE,CAAC,GAAG,CAAC;AAE5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAE,YAAoB,EAAE,EAAE;IACtE,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC;IAC7C,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAC9B,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,EAChC,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,CAAC,CACzC,CAAC;IACF,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;AAC/C,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superfluid-finance/sdk-core",
3
- "version": "0.4.4-dev.ff4f866.0",
3
+ "version": "0.4.5-dev.53e1b83.0",
4
4
  "description": "SDK Core for building with Superfluid Protocol",
5
5
  "homepage": "https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core#readme",
6
6
  "repository": {
@@ -57,21 +57,25 @@
57
57
  "dependencies": {
58
58
  "ajv": "^8.11.0",
59
59
  "browserify": "^17.0.0",
60
- "ethers": "^5.6.2",
61
- "graphql-request": "^3.7.0",
60
+ "graphql-request": "^4.3.0",
62
61
  "lodash": "^4.17.21",
63
62
  "tsify": "^5.0.4"
64
63
  },
65
64
  "devDependencies": {
66
- "@graphql-codegen/cli": "^2.6.2",
65
+ "@graphql-codegen/cli": "^2.6.4",
67
66
  "@graphql-codegen/introspection": "^2.1.1",
68
- "@graphql-codegen/near-operation-file-preset": "^2.2.9",
69
- "@graphql-codegen/typed-document-node": "^2.2.8",
70
- "@graphql-codegen/typescript": "^2.4.8",
71
- "@graphql-codegen/typescript-operations": "^2.3.5",
67
+ "@graphql-codegen/near-operation-file-preset": "^2.2.14",
68
+ "@graphql-codegen/typed-document-node": "^2.2.13",
69
+ "@graphql-codegen/typescript": "^2.5.1",
70
+ "@graphql-codegen/typescript-operations": "^2.4.2",
72
71
  "@graphql-typed-document-node/core": "^3.1.1",
72
+ "ethers": "^5.6.9",
73
73
  "get-graphql-schema": "^2.1.2",
74
- "mocha": "^9.2.2"
74
+ "mocha": "^10.0.0"
75
+ },
76
+ "peerDependencies": {
77
+ "ethers": "^5.6.9",
78
+ "graphql": "^16.0.0"
75
79
  },
76
80
  "resolutions": {
77
81
  "graphql": "^16.0.0"