@snapshot-labs/snapshot.js 0.2.2 → 0.2.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.
Files changed (287) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/plugins/charts/index.d.ts +5 -0
  5. package/dist/plugins/commentBox/index.d.ts +5 -0
  6. package/dist/plugins/index.d.ts +4 -0
  7. package/dist/rollup.cjs.config.dev.js +43 -0
  8. package/dist/rollup.config.dev.js +75 -0
  9. package/dist/sign/eip1271.d.ts +1 -1
  10. package/dist/sign/index.d.ts +2 -2
  11. package/dist/snapshot.cjs.js +73 -34
  12. package/dist/snapshot.esm.js +73 -34
  13. package/dist/snapshot.min.js +1 -1
  14. package/dist/strategies/aave-governance-power/index.d.ts +3 -0
  15. package/dist/strategies/aavegotchi/index.d.ts +6 -0
  16. package/dist/strategies/aavegotchi-agip/index.d.ts +3 -0
  17. package/dist/strategies/apescape/index.d.ts +6 -0
  18. package/dist/strategies/api/index.d.ts +6 -0
  19. package/dist/strategies/avn-balance-of-staked/index.d.ts +3 -0
  20. package/dist/strategies/badgeth/index.d.ts +3 -0
  21. package/dist/strategies/balance-of-with-min/index.d.ts +3 -0
  22. package/dist/strategies/balance-of-with-thresholds/index.d.ts +25 -0
  23. package/dist/strategies/balancer/index.d.ts +3 -0
  24. package/dist/strategies/balancer-delegation/index.d.ts +6 -0
  25. package/dist/strategies/balancer-smart-pool/index.d.ts +6 -0
  26. package/dist/strategies/balancer-unipool/index.d.ts +6 -0
  27. package/dist/strategies/brightid/index.d.ts +6 -0
  28. package/dist/strategies/cake/index.d.ts +3 -0
  29. package/dist/strategies/celer-sgn-delegation/index.d.ts +3 -0
  30. package/dist/strategies/comp-like-votes/index.d.ts +6 -0
  31. package/dist/strategies/contract-call/index.d.ts +6 -0
  32. package/dist/strategies/cream/index.d.ts +3 -0
  33. package/dist/strategies/ctoken/index.d.ts +3 -0
  34. package/dist/strategies/curio-cards-erc20-weighted/index.d.ts +3 -0
  35. package/dist/strategies/decentraland-estate-size/index.d.ts +3 -0
  36. package/dist/strategies/defidollar/index.d.ts +3 -0
  37. package/dist/strategies/delegation/index.d.ts +6 -0
  38. package/dist/strategies/dittomoney/index.d.ts +3 -0
  39. package/dist/strategies/ens-domains-owned/index.d.ts +3 -0
  40. package/dist/strategies/ens-reverse-record/index.d.ts +6 -0
  41. package/dist/strategies/erc1155-all-balances-of/index.d.ts +6 -0
  42. package/dist/strategies/erc1155-balance-of/index.d.ts +6 -0
  43. package/dist/strategies/erc1155-balance-of-cv/index.d.ts +6 -0
  44. package/dist/strategies/erc20-balance-of/index.d.ts +3 -0
  45. package/dist/strategies/erc20-balance-of-coeff/index.d.ts +3 -0
  46. package/dist/strategies/erc20-balance-of-cv/index.d.ts +6 -0
  47. package/dist/strategies/erc20-balance-of-delegation/index.d.ts +6 -0
  48. package/dist/strategies/erc20-balance-of-fixed-total/index.d.ts +6 -0
  49. package/dist/strategies/erc20-balance-of-quadratic-delegation/index.d.ts +6 -0
  50. package/dist/strategies/erc20-price/index.d.ts +3 -0
  51. package/dist/strategies/erc20-received/index.d.ts +10 -0
  52. package/dist/strategies/erc20-with-balance/index.d.ts +3 -0
  53. package/dist/strategies/erc721/index.d.ts +6 -0
  54. package/dist/strategies/erc721-enumerable/index.d.ts +3 -0
  55. package/dist/strategies/erc721-with-multiplier/index.d.ts +6 -0
  56. package/dist/strategies/erc721-with-tokenid/index.d.ts +21 -0
  57. package/dist/strategies/esd/index.d.ts +3 -0
  58. package/dist/strategies/esd-delegation/index.d.ts +6 -0
  59. package/dist/strategies/eth-balance/index.d.ts +6 -0
  60. package/dist/strategies/eth-philanthropy/index.d.ts +6 -0
  61. package/dist/strategies/eth-received/ElasticSearchTxResult.d.ts +71 -0
  62. package/dist/strategies/eth-received/index.d.ts +7 -0
  63. package/dist/strategies/eth-wallet-age/index.d.ts +3 -0
  64. package/dist/strategies/eth-with-balance/index.d.ts +3 -0
  65. package/dist/strategies/flashstake/index.d.ts +3 -0
  66. package/dist/strategies/frax-finance/index.d.ts +3 -0
  67. package/dist/strategies/governor-alpha/index.d.ts +6 -0
  68. package/dist/strategies/hopr-uni-lp-farm/index.d.ts +3 -0
  69. package/dist/strategies/ilv/index.d.ts +6 -0
  70. package/dist/strategies/impossible-finance/index.d.ts +6 -0
  71. package/dist/strategies/index.d.ts +243 -0
  72. package/dist/strategies/infinityprotocol-liquidity-pools/index.d.ts +3 -0
  73. package/dist/strategies/inverse-xinv/index.d.ts +6 -0
  74. package/dist/strategies/iotex-balance/index.d.ts +3 -0
  75. package/dist/strategies/iotex-staked-balance/index.d.ts +3 -0
  76. package/dist/strategies/liftkitchen/index.d.ts +3 -0
  77. package/dist/strategies/maker-ds-chief/index.d.ts +6 -0
  78. package/dist/strategies/masterchef/index.d.ts +3 -0
  79. package/dist/strategies/masterchef-pool-balance/index.d.ts +3 -0
  80. package/dist/strategies/masterchef-pool-balance-price/index.d.ts +6 -0
  81. package/dist/strategies/mithcash/index.d.ts +3 -0
  82. package/dist/strategies/modefi/index.d.ts +6 -0
  83. package/dist/strategies/modefi-staking/index.d.ts +6 -0
  84. package/dist/strategies/moloch/index.d.ts +6 -0
  85. package/dist/strategies/moloch-all/index.d.ts +6 -0
  86. package/dist/strategies/moloch-loot/index.d.ts +6 -0
  87. package/dist/strategies/multichain/index.d.ts +3 -0
  88. package/dist/strategies/multisig-owners/index.d.ts +6 -0
  89. package/dist/strategies/mushrooms/index.d.ts +6 -0
  90. package/dist/strategies/niu-staked/index.d.ts +6 -0
  91. package/dist/strategies/ocean-marketplace/index.d.ts +8 -0
  92. package/dist/strategies/ocean-marketplace/oceanUtils.d.ts +2 -0
  93. package/dist/strategies/ogn/index.d.ts +3 -0
  94. package/dist/strategies/opium/index.d.ts +3 -0
  95. package/dist/strategies/pagination/index.d.ts +3 -0
  96. package/dist/strategies/pancake/index.d.ts +6 -0
  97. package/dist/strategies/pepemon/index.d.ts +6 -0
  98. package/dist/strategies/piedao/index.d.ts +3 -0
  99. package/dist/strategies/planet-finance/index.d.ts +4 -0
  100. package/dist/strategies/pob-hash/index.d.ts +9 -0
  101. package/dist/strategies/rebased/index.d.ts +3 -0
  102. package/dist/strategies/ren-nodes/index.d.ts +3 -0
  103. package/dist/strategies/rnbw-balance/index.d.ts +3 -0
  104. package/dist/strategies/ruler-staked-lp/index.d.ts +6 -0
  105. package/dist/strategies/ruler-staked-token/index.d.ts +6 -0
  106. package/dist/strategies/saffron-finance/index.d.ts +6 -0
  107. package/dist/strategies/spookyswap/index.d.ts +6 -0
  108. package/dist/strategies/stablexswap/index.d.ts +6 -0
  109. package/dist/strategies/staked-keep/index.d.ts +3 -0
  110. package/dist/strategies/staked-uniswap/index.d.ts +6 -0
  111. package/dist/strategies/strategiesFull.d.ts +245 -0
  112. package/dist/strategies/sushiswap/index.d.ts +3 -0
  113. package/dist/strategies/synthetix/index.d.ts +3 -0
  114. package/dist/strategies/the-graph/baseStrategy.d.ts +4 -0
  115. package/dist/strategies/the-graph/graphUtils.d.ts +12 -0
  116. package/dist/strategies/the-graph/tokenLockWallets.d.ts +9 -0
  117. package/dist/strategies/the-graph-balance/balances.d.ts +2 -0
  118. package/dist/strategies/the-graph-balance/index.d.ts +6 -0
  119. package/dist/strategies/the-graph-delegation/delegators.d.ts +2 -0
  120. package/dist/strategies/the-graph-delegation/index.d.ts +6 -0
  121. package/dist/strategies/the-graph-indexing/index.d.ts +6 -0
  122. package/dist/strategies/the-graph-indexing/indexers.d.ts +2 -0
  123. package/dist/strategies/ticket/index.d.ts +6 -0
  124. package/dist/strategies/ticket-validity/index.d.ts +3 -0
  125. package/dist/strategies/tokenlon/index.d.ts +3 -0
  126. package/dist/strategies/tomb-finance/index.d.ts +6 -0
  127. package/dist/strategies/total-axion-shares/index.d.ts +3 -0
  128. package/dist/strategies/tranche-staking/index.d.ts +6 -0
  129. package/dist/strategies/tranche-staking-lp/index.d.ts +6 -0
  130. package/dist/strategies/tranche-staking-slice/index.d.ts +3 -0
  131. package/dist/strategies/typhoon/index.d.ts +3 -0
  132. package/dist/strategies/uni/index.d.ts +6 -0
  133. package/dist/strategies/unipool-same-token/index.d.ts +6 -0
  134. package/dist/strategies/unipool-univ2-lp/index.d.ts +6 -0
  135. package/dist/strategies/uniswap/index.d.ts +3 -0
  136. package/dist/strategies/whitelist/index.d.ts +6 -0
  137. package/dist/strategies/work/index.d.ts +6 -0
  138. package/dist/strategies/xcover/index.d.ts +6 -0
  139. package/dist/strategies/xdai-easy-staking/index.d.ts +3 -0
  140. package/dist/strategies/xdai-easy-staking/utils.d.ts +3 -0
  141. package/dist/strategies/xdai-posdao-staking/index.d.ts +3 -0
  142. package/dist/strategies/xdai-stake-delegation/index.d.ts +6 -0
  143. package/dist/strategies/xdai-stake-holders/index.d.ts +3 -0
  144. package/dist/strategies/xdai-stakers-and-holders/index.d.ts +3 -0
  145. package/dist/strategies/xrc20-balance-of/index.d.ts +3 -0
  146. package/dist/strategies/xseen/index.d.ts +6 -0
  147. package/dist/strategies/yearn-vault/index.d.ts +3 -0
  148. package/dist/strategies/zrx-voting-power/index.d.ts +3 -0
  149. package/dist/utils/contentHash.d.ts +28 -0
  150. package/package.json +2 -2
  151. package/src/client.ts +0 -0
  152. package/src/dist/index.js +14 -0
  153. package/src/dist/utils.js +291 -0
  154. package/src/networks/{fuse.png → 122.png} +0 -0
  155. package/src/networks/43114.png +0 -0
  156. package/src/networks.json +2 -2
  157. package/src/plugins/charts/index.ts +5 -0
  158. package/src/plugins/charts/logo.png +0 -0
  159. package/src/plugins/commentBox/index.ts +5 -0
  160. package/src/plugins/commentBox/logo.png +0 -0
  161. package/src/plugins/index.ts +5 -1
  162. package/src/plugins/safeSnap/dist/index.js +585 -0
  163. package/src/plugins/safeSnap/index.ts +22 -7
  164. package/src/sign/eip1271.ts +2 -2
  165. package/src/sign/index.ts +9 -5
  166. package/src/strategies/aave-governance-power/dist/index.js +110 -0
  167. package/src/strategies/aavegotchi/dist/index.js +156 -0
  168. package/src/strategies/aavegotchi-agip/dist/index.js +168 -0
  169. package/src/strategies/apescape/dist/index.js +164 -0
  170. package/src/strategies/api/dist/index.js +76 -0
  171. package/src/strategies/avn-balance-of-staked/dist/index.js +173 -0
  172. package/src/strategies/badgeth/dist/index.js +86 -0
  173. package/src/strategies/balance-of-with-min/dist/index.js +64 -0
  174. package/src/strategies/balance-of-with-thresholds/dist/index.js +73 -0
  175. package/src/strategies/balancer/dist/index.js +121 -0
  176. package/src/strategies/balancer-delegation/dist/index.js +62 -0
  177. package/src/strategies/balancer-smart-pool/dist/index.js +85 -0
  178. package/src/strategies/balancer-unipool/dist/index.js +141 -0
  179. package/src/strategies/brightid/dist/index.js +69 -0
  180. package/src/strategies/cake/dist/index.js +146 -0
  181. package/src/strategies/celer-sgn-delegation/dist/index.js +199 -0
  182. package/src/strategies/comp-like-votes/dist/index.js +91 -0
  183. package/src/strategies/contract-call/dist/index.js +76 -0
  184. package/src/strategies/cream/dist/index.js +310 -0
  185. package/src/strategies/ctoken/dist/index.js +145 -0
  186. package/src/strategies/curio-cards-erc20-weighted/dist/index.js +188 -0
  187. package/src/strategies/decentraland-estate-size/dist/index.js +101 -0
  188. package/src/strategies/defidollar/dist/index.js +106 -0
  189. package/src/strategies/delegation/dist/index.js +71 -0
  190. package/src/strategies/dist/index.js +248 -0
  191. package/src/strategies/dist/strategiesFull.js +246 -0
  192. package/src/strategies/dittomoney/dist/index.js +167 -0
  193. package/src/strategies/ens-domains-owned/dist/index.js +105 -0
  194. package/src/strategies/ens-reverse-record/dist/index.js +98 -0
  195. package/src/strategies/erc1155-all-balances-of/dist/index.js +99 -0
  196. package/src/strategies/erc1155-balance-of/dist/index.js +94 -0
  197. package/src/strategies/erc1155-balance-of-cv/dist/index.js +58 -0
  198. package/src/strategies/erc20-balance-of/dist/index.js +76 -0
  199. package/src/strategies/erc20-balance-of-delegation/dist/index.js +73 -0
  200. package/src/strategies/erc20-balance-of-quadratic-delegation/dist/index.js +75 -0
  201. package/src/strategies/erc20-price/dist/index.js +107 -0
  202. package/src/strategies/erc20-received/dist/index.js +166 -0
  203. package/src/strategies/erc20-with-balance/dist/index.js +61 -0
  204. package/src/strategies/erc721/dist/index.js +69 -0
  205. package/src/strategies/erc721-enumerable/dist/index.js +57 -0
  206. package/src/strategies/erc721-with-multiplier/dist/index.js +70 -0
  207. package/src/strategies/erc721-with-tokenid/dist/index.js +68 -0
  208. package/src/strategies/esd/dist/index.js +125 -0
  209. package/src/strategies/esd-delegation/dist/index.js +73 -0
  210. package/src/strategies/eth-balance/dist/index.js +72 -0
  211. package/src/strategies/eth-philanthropy/dist/index.js +81 -0
  212. package/src/strategies/eth-received/dist/index.js +127 -0
  213. package/src/strategies/eth-wallet-age/dist/index.js +126 -0
  214. package/src/strategies/eth-with-balance/dist/index.js +63 -0
  215. package/src/strategies/flashstake/dist/index.js +138 -0
  216. package/src/strategies/frax-finance/dist/index.js +236 -0
  217. package/src/strategies/governor-alpha/dist/index.js +71 -0
  218. package/src/strategies/hopr-uni-lp-farm/dist/index.js +232 -0
  219. package/src/strategies/ilv/dist/index.js +58 -0
  220. package/src/strategies/impossible-finance/dist/index.js +126 -0
  221. package/src/strategies/infinityprotocol-liquidity-pools/dist/index.js +120 -0
  222. package/src/strategies/inverse-xinv/dist/index.js +76 -0
  223. package/src/strategies/iotex-balance/dist/index.js +82 -0
  224. package/src/strategies/iotex-staked-balance/dist/index.js +79 -0
  225. package/src/strategies/liftkitchen/dist/index.js +167 -0
  226. package/src/strategies/masterchef/dist/index.js +183 -0
  227. package/src/strategies/masterchef-pool-balance/dist/index.js +190 -0
  228. package/src/strategies/masterchef-pool-balance-price/dist/index.js +442 -0
  229. package/src/strategies/mithcash/dist/index.js +133 -0
  230. package/src/strategies/modefi/dist/index.js +120 -0
  231. package/src/strategies/modefi-staking/dist/index.js +115 -0
  232. package/src/strategies/moloch-all/dist/index.js +154 -0
  233. package/src/strategies/moloch-loot/dist/index.js +153 -0
  234. package/src/strategies/multichain/dist/index.js +149 -0
  235. package/src/strategies/multisig-owners/dist/index.js +85 -0
  236. package/src/strategies/mushrooms/dist/index.js +202 -0
  237. package/src/strategies/niu-staked/dist/index.js +83 -0
  238. package/src/strategies/ocean-marketplace/dist/index.js +155 -0
  239. package/src/strategies/ogn/dist/index.js +105 -0
  240. package/src/strategies/opium/dist/index.js +153 -0
  241. package/src/strategies/pagination/dist/index.js +78 -0
  242. package/src/strategies/pancake/dist/index.js +140 -0
  243. package/src/strategies/pepemon/dist/index.js +177 -0
  244. package/src/strategies/piedao/dist/index.js +156 -0
  245. package/src/strategies/planet-finance/dist/index.js +190 -0
  246. package/src/strategies/pob-hash/dist/index.js +95 -0
  247. package/src/strategies/rebased/dist/index.js +134 -0
  248. package/src/strategies/ren-nodes/dist/index.js +148 -0
  249. package/src/strategies/rnbw-balance/dist/index.js +107 -0
  250. package/src/strategies/ruler-staked-lp/dist/index.js +156 -0
  251. package/src/strategies/ruler-staked-token/dist/index.js +100 -0
  252. package/src/strategies/saffron-finance/dist/index.js +293 -0
  253. package/src/strategies/spookyswap/dist/index.js +161 -0
  254. package/src/strategies/stablexswap/dist/index.js +153 -0
  255. package/src/strategies/staked-keep/dist/index.js +90 -0
  256. package/src/strategies/staked-uniswap/dist/index.js +112 -0
  257. package/src/strategies/sushiswap/dist/index.js +120 -0
  258. package/src/strategies/synthetix/dist/index.js +233 -0
  259. package/src/strategies/the-graph-balance/dist/index.js +55 -0
  260. package/src/strategies/the-graph-delegation/dist/index.js +55 -0
  261. package/src/strategies/the-graph-indexing/dist/index.js +55 -0
  262. package/src/strategies/ticket/dist/index.js +51 -0
  263. package/src/strategies/ticket-validity/dist/index.js +63 -0
  264. package/src/strategies/tokenlon/dist/index.js +211 -0
  265. package/src/strategies/tomb-finance/dist/index.js +130 -0
  266. package/src/strategies/total-axion-shares/dist/index.js +93 -0
  267. package/src/strategies/tranche-staking/dist/index.js +96 -0
  268. package/src/strategies/tranche-staking-lp/dist/index.js +133 -0
  269. package/src/strategies/tranche-staking-slice/dist/index.js +164 -0
  270. package/src/strategies/typhoon/dist/index.js +124 -0
  271. package/src/strategies/uni/dist/index.js +93 -0
  272. package/src/strategies/unipool-same-token/dist/index.js +98 -0
  273. package/src/strategies/unipool-univ2-lp/dist/index.js +105 -0
  274. package/src/strategies/uniswap/dist/index.js +120 -0
  275. package/src/strategies/whitelist/dist/index.js +56 -0
  276. package/src/strategies/work/dist/index.js +90 -0
  277. package/src/strategies/xcover/dist/index.js +95 -0
  278. package/src/strategies/xdai-easy-staking/dist/index.js +193 -0
  279. package/src/strategies/xdai-posdao-staking/dist/index.js +63 -0
  280. package/src/strategies/xdai-stake-delegation/dist/index.js +93 -0
  281. package/src/strategies/xdai-stake-holders/dist/index.js +63 -0
  282. package/src/strategies/xdai-stakers-and-holders/dist/index.js +137 -0
  283. package/src/strategies/xrc20-balance-of/dist/index.js +83 -0
  284. package/src/strategies/xseen/dist/index.js +121 -0
  285. package/src/strategies/zrx-voting-power/dist/index.js +104 -0
  286. package/src/utils/dist/provider.js +12 -0
  287. package/src/utils/dist/web3.js +73 -0
package/LICENSE CHANGED
File without changes
package/README.md CHANGED
File without changes
package/dist/index.d.ts CHANGED
@@ -3,10 +3,12 @@ declare const _default: {
3
3
  Client: typeof Client;
4
4
  plugins: {
5
5
  aragon: typeof import("./plugins/aragon").default;
6
+ charts: typeof import("./plugins/charts").default;
6
7
  gnosis: typeof import("./plugins/gnosis").default;
7
8
  safeSnap: typeof import("./plugins/safeSnap").default;
8
9
  poap: typeof import("./plugins/poap").default;
9
10
  quorum: typeof import("./plugins/quorum").default;
11
+ commentBox: typeof import("./plugins/commentBox").default;
10
12
  };
11
13
  schemas: {
12
14
  space: {
@@ -0,0 +1,5 @@
1
+ export default class Plugin {
2
+ author: string;
3
+ version: string;
4
+ name: string;
5
+ }
@@ -0,0 +1,5 @@
1
+ export default class Plugin {
2
+ author: string;
3
+ version: string;
4
+ name: string;
5
+ }
@@ -1,13 +1,17 @@
1
1
  import aragon from './aragon';
2
+ import charts from './charts';
2
3
  import gnosis from './gnosis';
3
4
  import safeSnap from './safeSnap';
4
5
  import quorum from './quorum';
5
6
  import poap from './poap';
7
+ import commentBox from './commentBox';
6
8
  declare const _default: {
7
9
  aragon: typeof aragon;
10
+ charts: typeof charts;
8
11
  gnosis: typeof gnosis;
9
12
  safeSnap: typeof safeSnap;
10
13
  poap: typeof poap;
11
14
  quorum: typeof quorum;
15
+ commentBox: typeof commentBox;
12
16
  };
13
17
  export default _default;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _rollupPluginTypescript = _interopRequireDefault(require("rollup-plugin-typescript2"));
9
+
10
+ var _rollupPluginJson = _interopRequireDefault(require("rollup-plugin-json"));
11
+
12
+ var _rollupPluginString = require("rollup-plugin-string");
13
+
14
+ var _package = _interopRequireDefault(require("./package.json"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
+
18
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
19
+
20
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
21
+
22
+ function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
23
+
24
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
25
+
26
+ var input = 'src/index.ts';
27
+
28
+ var external = _toConsumableArray(Object.keys(_package["default"].dependencies || {}));
29
+
30
+ var _default = [{
31
+ input: input,
32
+ external: external,
33
+ output: [{
34
+ file: _package["default"].main,
35
+ format: 'cjs'
36
+ }],
37
+ plugins: [(0, _rollupPluginJson["default"])(), (0, _rollupPluginTypescript["default"])({
38
+ clean: true
39
+ }), (0, _rollupPluginString.string)({
40
+ include: '**/*.md'
41
+ })]
42
+ }];
43
+ exports["default"] = _default;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _rollupPluginTypescript = _interopRequireDefault(require("rollup-plugin-typescript2"));
9
+
10
+ var _rollupPluginTerser = require("rollup-plugin-terser");
11
+
12
+ var _pluginCommonjs = _interopRequireDefault(require("@rollup/plugin-commonjs"));
13
+
14
+ var _rollupPluginNodeGlobals = _interopRequireDefault(require("rollup-plugin-node-globals"));
15
+
16
+ var _rollupPluginNodeBuiltins = _interopRequireDefault(require("rollup-plugin-node-builtins"));
17
+
18
+ var _pluginNodeResolve = require("@rollup/plugin-node-resolve");
19
+
20
+ var _rollupPluginFilesize = _interopRequireDefault(require("rollup-plugin-filesize"));
21
+
22
+ var _rollupPluginJson = _interopRequireDefault(require("rollup-plugin-json"));
23
+
24
+ var _rollupPluginString = require("rollup-plugin-string");
25
+
26
+ var _package = _interopRequireDefault(require("./package.json"));
27
+
28
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
+
30
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
31
+
32
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
33
+
34
+ function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
35
+
36
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
37
+
38
+ var name = 'snapshot';
39
+ var input = 'src/index.ts';
40
+
41
+ var external = _toConsumableArray(Object.keys(_package["default"].dependencies || {}));
42
+
43
+ var _default = [{
44
+ input: input,
45
+ context: 'window',
46
+ output: [{
47
+ name: name,
48
+ file: _package["default"].browser,
49
+ format: 'umd'
50
+ }],
51
+ plugins: [(0, _rollupPluginJson["default"])(), (0, _rollupPluginNodeBuiltins["default"])(), (0, _rollupPluginTypescript["default"])({
52
+ clean: true
53
+ }), (0, _pluginNodeResolve.nodeResolve)({
54
+ preferBuiltins: true,
55
+ browser: true
56
+ }), (0, _pluginCommonjs["default"])(), (0, _rollupPluginNodeGlobals["default"])(), (0, _rollupPluginTerser.terser)(), (0, _rollupPluginFilesize["default"])(), (0, _rollupPluginString.string)({
57
+ include: '**/*.md'
58
+ })]
59
+ }, {
60
+ input: input,
61
+ external: external,
62
+ output: [{
63
+ file: _package["default"].main,
64
+ format: 'cjs'
65
+ }, {
66
+ file: _package["default"].module,
67
+ format: 'es'
68
+ }],
69
+ plugins: [(0, _rollupPluginJson["default"])(), (0, _rollupPluginTypescript["default"])({
70
+ clean: true
71
+ }), (0, _rollupPluginString.string)({
72
+ include: '**/*.md'
73
+ })]
74
+ }];
75
+ exports["default"] = _default;
@@ -1,4 +1,4 @@
1
1
  import { StaticJsonRpcProvider } from '@ethersproject/providers';
2
2
  export declare function verifyDefault(address: string, sig: string, hash: string, provider: StaticJsonRpcProvider): Promise<boolean>;
3
3
  export declare function verifyOldVersion(address: string, sig: string, hash: string, provider: StaticJsonRpcProvider): Promise<boolean>;
4
- export declare function verify(address: any, sig: any, hash: any): Promise<boolean>;
4
+ export declare function verify(address: any, sig: any, hash: any, network?: string): Promise<boolean>;
@@ -14,7 +14,7 @@ export default class Client {
14
14
  proposal(web3: Web3Provider, address: string, message: Proposal): Promise<unknown>;
15
15
  cancelProposal(web3: Web3Provider, address: string, message: CancelProposal): Promise<unknown>;
16
16
  vote(web3: Web3Provider, address: string, message: Vote): Promise<unknown>;
17
- follow(web3: Wallet, address: string, message: Follow): Promise<unknown>;
18
- unfollow(web3: Wallet, address: string, message: Unfollow): Promise<unknown>;
17
+ follow(web3: Web3Provider | Wallet, address: string, message: Follow): Promise<unknown>;
18
+ unfollow(web3: Web3Provider | Wallet, address: string, message: Unfollow): Promise<unknown>;
19
19
  alias(web3: Web3Provider, address: string, message: Alias): Promise<unknown>;
20
20
  }
@@ -724,17 +724,6 @@ var networks = {
724
724
  "https://rpc.testnet.moonbeam.network"
725
725
  ],
726
726
  explorer: "https://moonbase-blockscout.testnet.moonbeam.network/"
727
- },
728
- "2109": {
729
- key: "2109",
730
- name: "Avalanche",
731
- chainId: 43114,
732
- network: "mainnet",
733
- multicall: "0x7E9985aE4C8248fdB07607648406a48C76e9e7eD",
734
- rpc: [
735
- "https://api.avax.network/ext/bc/C/rpc"
736
- ],
737
- explorer: "https://cchain.explorer.avax.network"
738
727
  },
739
728
  "4689": {
740
729
  key: "4689",
@@ -785,6 +774,17 @@ var networks = {
785
774
  "https://celo-mainnet--rpc.datahub.figment.io/apikey/e892a66dc36e4d2d98a5d6406d609796/"
786
775
  ],
787
776
  explorer: "https://explorer.celo.org"
777
+ },
778
+ "43114": {
779
+ key: "43114",
780
+ name: "Avalanche",
781
+ chainId: 43114,
782
+ network: "mainnet",
783
+ multicall: "0x7E9985aE4C8248fdB07607648406a48C76e9e7eD",
784
+ rpc: [
785
+ "https://api.avax.network/ext/bc/C/rpc"
786
+ ],
787
+ explorer: "https://cchain.explorer.avax.network"
788
788
  },
789
789
  "80001": {
790
790
  key: "80001",
@@ -1010,13 +1010,14 @@ function verifyOldVersion(address, sig, hash, provider) {
1010
1010
  });
1011
1011
  });
1012
1012
  }
1013
- function verify(address, sig, hash) {
1013
+ function verify(address, sig, hash, network) {
1014
+ if (network === void 0) { network = '1'; }
1014
1015
  return __awaiter(this, void 0, void 0, function () {
1015
1016
  var provider;
1016
1017
  return __generator(this, function (_a) {
1017
1018
  switch (_a.label) {
1018
1019
  case 0:
1019
- provider = getProvider('1');
1020
+ provider = getProvider(network);
1020
1021
  return [4 /*yield*/, verifyDefault(address, sig, hash, provider)];
1021
1022
  case 1:
1022
1023
  if (_a.sent())
@@ -1591,6 +1592,15 @@ var Plugin = /** @class */ (function () {
1591
1592
  return Plugin;
1592
1593
  }());
1593
1594
 
1595
+ var Plugin$1 = /** @class */ (function () {
1596
+ function Plugin() {
1597
+ this.author = 'zerquix18';
1598
+ this.version = '0.1.0';
1599
+ this.name = 'Charts';
1600
+ }
1601
+ return Plugin;
1602
+ }());
1603
+
1594
1604
  var UNISWAP_V2_SUBGRAPH_URL = {
1595
1605
  '1': 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2',
1596
1606
  '4': 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2-rinkeby',
@@ -2069,7 +2079,7 @@ var getTokenInfo = function (web3, tokenAddress) { return __awaiter(void 0, void
2069
2079
  }
2070
2080
  });
2071
2081
  }); };
2072
- var Plugin$1 = /** @class */ (function () {
2082
+ var Plugin$2 = /** @class */ (function () {
2073
2083
  function Plugin() {
2074
2084
  this.author = 'davidalbela';
2075
2085
  this.version = '0.0.1';
@@ -2203,6 +2213,7 @@ var ModuleAbi = [
2203
2213
  // Events
2204
2214
  'event ProposalQuestionCreated(bytes32 indexed questionId, string indexed proposalId)',
2205
2215
  // Read functions
2216
+ 'function avatar() view returns (address)',
2206
2217
  'function executor() view returns (address)',
2207
2218
  'function oracle() view returns (address)',
2208
2219
  'function questionCooldown() view returns (uint32)',
@@ -2275,23 +2286,40 @@ var getProposalDetails = function (provider, network, moduleAddress, questionHas
2275
2286
  });
2276
2287
  }); };
2277
2288
  var getModuleDetails = function (provider, network, moduleAddress) { return __awaiter(void 0, void 0, void 0, function () {
2278
- var moduleDetails;
2289
+ var moduleDetails, err_1;
2279
2290
  return __generator(this, function (_a) {
2280
2291
  switch (_a.label) {
2281
- case 0: return [4 /*yield*/, multicall(network, provider, ModuleAbi, [
2282
- [moduleAddress, 'executor'],
2283
- [moduleAddress, 'oracle'],
2284
- [moduleAddress, 'questionCooldown'],
2285
- [moduleAddress, 'minimumBond']
2286
- ])];
2292
+ case 0:
2293
+ _a.trys.push([0, 2, , 4]);
2294
+ return [4 /*yield*/, multicall(network, provider, ModuleAbi, [
2295
+ [moduleAddress, 'avatar'],
2296
+ [moduleAddress, 'oracle'],
2297
+ [moduleAddress, 'questionCooldown'],
2298
+ [moduleAddress, 'minimumBond']
2299
+ ])];
2287
2300
  case 1:
2301
+ // Assume module is Reality Module
2288
2302
  moduleDetails = _a.sent();
2289
- return [2 /*return*/, {
2290
- dao: moduleDetails[0][0],
2291
- oracle: moduleDetails[1][0],
2292
- cooldown: moduleDetails[2][0],
2293
- minimumBond: moduleDetails[3][0]
2294
- }];
2303
+ return [3 /*break*/, 4];
2304
+ case 2:
2305
+ err_1 = _a.sent();
2306
+ return [4 /*yield*/, multicall(network, provider, ModuleAbi, [
2307
+ [moduleAddress, 'executor'],
2308
+ [moduleAddress, 'oracle'],
2309
+ [moduleAddress, 'questionCooldown'],
2310
+ [moduleAddress, 'minimumBond']
2311
+ ])];
2312
+ case 3:
2313
+ // The Reality Module doesn't have an avatar field, causing tx to fails.
2314
+ // Assume module is Dao Module (old version)
2315
+ moduleDetails = _a.sent();
2316
+ return [3 /*break*/, 4];
2317
+ case 4: return [2 /*return*/, {
2318
+ dao: moduleDetails[0][0],
2319
+ oracle: moduleDetails[1][0],
2320
+ cooldown: moduleDetails[2][0],
2321
+ minimumBond: moduleDetails[3][0]
2322
+ }];
2295
2323
  }
2296
2324
  });
2297
2325
  }); };
@@ -2352,7 +2380,7 @@ var retrieveInfoFromOracle = function (provider, network, oracleAddress, questio
2352
2380
  }
2353
2381
  });
2354
2382
  }); };
2355
- var Plugin$2 = /** @class */ (function () {
2383
+ var Plugin$3 = /** @class */ (function () {
2356
2384
  function Plugin() {
2357
2385
  this.author = 'Gnosis';
2358
2386
  this.version = '1.0.0';
@@ -2695,7 +2723,7 @@ var Plugin$2 = /** @class */ (function () {
2695
2723
  return Plugin;
2696
2724
  }());
2697
2725
 
2698
- var Plugin$3 = /** @class */ (function () {
2726
+ var Plugin$4 = /** @class */ (function () {
2699
2727
  function Plugin() {
2700
2728
  this.author = 'lbeder';
2701
2729
  this.version = '0.1.0';
@@ -2749,7 +2777,7 @@ var Plugin$3 = /** @class */ (function () {
2749
2777
  // URLS
2750
2778
  var API_BASE_URL = 'https://api.poap.xyz';
2751
2779
  var APP_BASE_URL = 'https://app.poap.xyz';
2752
- var Plugin$4 = /** @class */ (function () {
2780
+ var Plugin$5 = /** @class */ (function () {
2753
2781
  function Plugin() {
2754
2782
  this.author = 'Poap-xyz';
2755
2783
  this.version = '1.0.0';
@@ -2835,12 +2863,23 @@ var Plugin$4 = /** @class */ (function () {
2835
2863
  return Plugin;
2836
2864
  }());
2837
2865
 
2866
+ var Plugin$6 = /** @class */ (function () {
2867
+ function Plugin() {
2868
+ this.author = 'spiritbro1';
2869
+ this.version = '0.0.1';
2870
+ this.name = 'Comment Box';
2871
+ }
2872
+ return Plugin;
2873
+ }());
2874
+
2838
2875
  var plugins = {
2839
2876
  aragon: Plugin,
2840
- gnosis: Plugin$1,
2841
- safeSnap: Plugin$2,
2842
- poap: Plugin$4,
2843
- quorum: Plugin$3
2877
+ charts: Plugin$1,
2878
+ gnosis: Plugin$2,
2879
+ safeSnap: Plugin$3,
2880
+ poap: Plugin$5,
2881
+ quorum: Plugin$4,
2882
+ commentBox: Plugin$6
2844
2883
  };
2845
2884
 
2846
2885
  var $schema = "http://json-schema.org/draft-07/schema#";
@@ -715,17 +715,6 @@ var networks = {
715
715
  "https://rpc.testnet.moonbeam.network"
716
716
  ],
717
717
  explorer: "https://moonbase-blockscout.testnet.moonbeam.network/"
718
- },
719
- "2109": {
720
- key: "2109",
721
- name: "Avalanche",
722
- chainId: 43114,
723
- network: "mainnet",
724
- multicall: "0x7E9985aE4C8248fdB07607648406a48C76e9e7eD",
725
- rpc: [
726
- "https://api.avax.network/ext/bc/C/rpc"
727
- ],
728
- explorer: "https://cchain.explorer.avax.network"
729
718
  },
730
719
  "4689": {
731
720
  key: "4689",
@@ -776,6 +765,17 @@ var networks = {
776
765
  "https://celo-mainnet--rpc.datahub.figment.io/apikey/e892a66dc36e4d2d98a5d6406d609796/"
777
766
  ],
778
767
  explorer: "https://explorer.celo.org"
768
+ },
769
+ "43114": {
770
+ key: "43114",
771
+ name: "Avalanche",
772
+ chainId: 43114,
773
+ network: "mainnet",
774
+ multicall: "0x7E9985aE4C8248fdB07607648406a48C76e9e7eD",
775
+ rpc: [
776
+ "https://api.avax.network/ext/bc/C/rpc"
777
+ ],
778
+ explorer: "https://cchain.explorer.avax.network"
779
779
  },
780
780
  "80001": {
781
781
  key: "80001",
@@ -1001,13 +1001,14 @@ function verifyOldVersion(address, sig, hash, provider) {
1001
1001
  });
1002
1002
  });
1003
1003
  }
1004
- function verify(address, sig, hash) {
1004
+ function verify(address, sig, hash, network) {
1005
+ if (network === void 0) { network = '1'; }
1005
1006
  return __awaiter(this, void 0, void 0, function () {
1006
1007
  var provider;
1007
1008
  return __generator(this, function (_a) {
1008
1009
  switch (_a.label) {
1009
1010
  case 0:
1010
- provider = getProvider('1');
1011
+ provider = getProvider(network);
1011
1012
  return [4 /*yield*/, verifyDefault(address, sig, hash, provider)];
1012
1013
  case 1:
1013
1014
  if (_a.sent())
@@ -1582,6 +1583,15 @@ var Plugin = /** @class */ (function () {
1582
1583
  return Plugin;
1583
1584
  }());
1584
1585
 
1586
+ var Plugin$1 = /** @class */ (function () {
1587
+ function Plugin() {
1588
+ this.author = 'zerquix18';
1589
+ this.version = '0.1.0';
1590
+ this.name = 'Charts';
1591
+ }
1592
+ return Plugin;
1593
+ }());
1594
+
1585
1595
  var UNISWAP_V2_SUBGRAPH_URL = {
1586
1596
  '1': 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2',
1587
1597
  '4': 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2-rinkeby',
@@ -2060,7 +2070,7 @@ var getTokenInfo = function (web3, tokenAddress) { return __awaiter(void 0, void
2060
2070
  }
2061
2071
  });
2062
2072
  }); };
2063
- var Plugin$1 = /** @class */ (function () {
2073
+ var Plugin$2 = /** @class */ (function () {
2064
2074
  function Plugin() {
2065
2075
  this.author = 'davidalbela';
2066
2076
  this.version = '0.0.1';
@@ -2194,6 +2204,7 @@ var ModuleAbi = [
2194
2204
  // Events
2195
2205
  'event ProposalQuestionCreated(bytes32 indexed questionId, string indexed proposalId)',
2196
2206
  // Read functions
2207
+ 'function avatar() view returns (address)',
2197
2208
  'function executor() view returns (address)',
2198
2209
  'function oracle() view returns (address)',
2199
2210
  'function questionCooldown() view returns (uint32)',
@@ -2266,23 +2277,40 @@ var getProposalDetails = function (provider, network, moduleAddress, questionHas
2266
2277
  });
2267
2278
  }); };
2268
2279
  var getModuleDetails = function (provider, network, moduleAddress) { return __awaiter(void 0, void 0, void 0, function () {
2269
- var moduleDetails;
2280
+ var moduleDetails, err_1;
2270
2281
  return __generator(this, function (_a) {
2271
2282
  switch (_a.label) {
2272
- case 0: return [4 /*yield*/, multicall(network, provider, ModuleAbi, [
2273
- [moduleAddress, 'executor'],
2274
- [moduleAddress, 'oracle'],
2275
- [moduleAddress, 'questionCooldown'],
2276
- [moduleAddress, 'minimumBond']
2277
- ])];
2283
+ case 0:
2284
+ _a.trys.push([0, 2, , 4]);
2285
+ return [4 /*yield*/, multicall(network, provider, ModuleAbi, [
2286
+ [moduleAddress, 'avatar'],
2287
+ [moduleAddress, 'oracle'],
2288
+ [moduleAddress, 'questionCooldown'],
2289
+ [moduleAddress, 'minimumBond']
2290
+ ])];
2278
2291
  case 1:
2292
+ // Assume module is Reality Module
2279
2293
  moduleDetails = _a.sent();
2280
- return [2 /*return*/, {
2281
- dao: moduleDetails[0][0],
2282
- oracle: moduleDetails[1][0],
2283
- cooldown: moduleDetails[2][0],
2284
- minimumBond: moduleDetails[3][0]
2285
- }];
2294
+ return [3 /*break*/, 4];
2295
+ case 2:
2296
+ err_1 = _a.sent();
2297
+ return [4 /*yield*/, multicall(network, provider, ModuleAbi, [
2298
+ [moduleAddress, 'executor'],
2299
+ [moduleAddress, 'oracle'],
2300
+ [moduleAddress, 'questionCooldown'],
2301
+ [moduleAddress, 'minimumBond']
2302
+ ])];
2303
+ case 3:
2304
+ // The Reality Module doesn't have an avatar field, causing tx to fails.
2305
+ // Assume module is Dao Module (old version)
2306
+ moduleDetails = _a.sent();
2307
+ return [3 /*break*/, 4];
2308
+ case 4: return [2 /*return*/, {
2309
+ dao: moduleDetails[0][0],
2310
+ oracle: moduleDetails[1][0],
2311
+ cooldown: moduleDetails[2][0],
2312
+ minimumBond: moduleDetails[3][0]
2313
+ }];
2286
2314
  }
2287
2315
  });
2288
2316
  }); };
@@ -2343,7 +2371,7 @@ var retrieveInfoFromOracle = function (provider, network, oracleAddress, questio
2343
2371
  }
2344
2372
  });
2345
2373
  }); };
2346
- var Plugin$2 = /** @class */ (function () {
2374
+ var Plugin$3 = /** @class */ (function () {
2347
2375
  function Plugin() {
2348
2376
  this.author = 'Gnosis';
2349
2377
  this.version = '1.0.0';
@@ -2686,7 +2714,7 @@ var Plugin$2 = /** @class */ (function () {
2686
2714
  return Plugin;
2687
2715
  }());
2688
2716
 
2689
- var Plugin$3 = /** @class */ (function () {
2717
+ var Plugin$4 = /** @class */ (function () {
2690
2718
  function Plugin() {
2691
2719
  this.author = 'lbeder';
2692
2720
  this.version = '0.1.0';
@@ -2740,7 +2768,7 @@ var Plugin$3 = /** @class */ (function () {
2740
2768
  // URLS
2741
2769
  var API_BASE_URL = 'https://api.poap.xyz';
2742
2770
  var APP_BASE_URL = 'https://app.poap.xyz';
2743
- var Plugin$4 = /** @class */ (function () {
2771
+ var Plugin$5 = /** @class */ (function () {
2744
2772
  function Plugin() {
2745
2773
  this.author = 'Poap-xyz';
2746
2774
  this.version = '1.0.0';
@@ -2826,12 +2854,23 @@ var Plugin$4 = /** @class */ (function () {
2826
2854
  return Plugin;
2827
2855
  }());
2828
2856
 
2857
+ var Plugin$6 = /** @class */ (function () {
2858
+ function Plugin() {
2859
+ this.author = 'spiritbro1';
2860
+ this.version = '0.0.1';
2861
+ this.name = 'Comment Box';
2862
+ }
2863
+ return Plugin;
2864
+ }());
2865
+
2829
2866
  var plugins = {
2830
2867
  aragon: Plugin,
2831
- gnosis: Plugin$1,
2832
- safeSnap: Plugin$2,
2833
- poap: Plugin$4,
2834
- quorum: Plugin$3
2868
+ charts: Plugin$1,
2869
+ gnosis: Plugin$2,
2870
+ safeSnap: Plugin$3,
2871
+ poap: Plugin$5,
2872
+ quorum: Plugin$4,
2873
+ commentBox: Plugin$6
2835
2874
  };
2836
2875
 
2837
2876
  var $schema = "http://json-schema.org/draft-07/schema#";