@towns-labs/web3 2.0.1

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 (378) hide show
  1. package/README.md +3 -0
  2. package/dist/BaseContractShim.d.ts +57 -0
  3. package/dist/BaseContractShim.d.ts.map +1 -0
  4. package/dist/BaseContractShim.js +224 -0
  5. package/dist/BaseContractShim.js.map +1 -0
  6. package/dist/airdrop/IDropFacetShim.d.ts +9 -0
  7. package/dist/airdrop/IDropFacetShim.d.ts.map +1 -0
  8. package/dist/airdrop/IDropFacetShim.js +9 -0
  9. package/dist/airdrop/IDropFacetShim.js.map +1 -0
  10. package/dist/airdrop/IRiverPointsShim.d.ts +9 -0
  11. package/dist/airdrop/IRiverPointsShim.d.ts.map +1 -0
  12. package/dist/airdrop/IRiverPointsShim.js +9 -0
  13. package/dist/airdrop/IRiverPointsShim.js.map +1 -0
  14. package/dist/airdrop/RiverAirdropDapp.d.ts +16 -0
  15. package/dist/airdrop/RiverAirdropDapp.d.ts.map +1 -0
  16. package/dist/airdrop/RiverAirdropDapp.js +30 -0
  17. package/dist/airdrop/RiverAirdropDapp.js.map +1 -0
  18. package/dist/app-registry/AppRegistryDapp.d.ts +68 -0
  19. package/dist/app-registry/AppRegistryDapp.d.ts.map +1 -0
  20. package/dist/app-registry/AppRegistryDapp.js +182 -0
  21. package/dist/app-registry/AppRegistryDapp.js.map +1 -0
  22. package/dist/app-registry/IAppFactoryShim.d.ts +9 -0
  23. package/dist/app-registry/IAppFactoryShim.d.ts.map +1 -0
  24. package/dist/app-registry/IAppFactoryShim.js +9 -0
  25. package/dist/app-registry/IAppFactoryShim.js.map +1 -0
  26. package/dist/app-registry/IAppInstallerShim.d.ts +9 -0
  27. package/dist/app-registry/IAppInstallerShim.d.ts.map +1 -0
  28. package/dist/app-registry/IAppInstallerShim.js +9 -0
  29. package/dist/app-registry/IAppInstallerShim.js.map +1 -0
  30. package/dist/app-registry/IAppRegistryShim.d.ts +9 -0
  31. package/dist/app-registry/IAppRegistryShim.d.ts.map +1 -0
  32. package/dist/app-registry/IAppRegistryShim.js +9 -0
  33. package/dist/app-registry/IAppRegistryShim.js.map +1 -0
  34. package/dist/app-registry/IIdentityRegistryShim.d.ts +9 -0
  35. package/dist/app-registry/IIdentityRegistryShim.d.ts.map +1 -0
  36. package/dist/app-registry/IIdentityRegistryShim.js +9 -0
  37. package/dist/app-registry/IIdentityRegistryShim.js.map +1 -0
  38. package/dist/app-registry/IReputationRegistryShim.d.ts +9 -0
  39. package/dist/app-registry/IReputationRegistryShim.d.ts.map +1 -0
  40. package/dist/app-registry/IReputationRegistryShim.js +9 -0
  41. package/dist/app-registry/IReputationRegistryShim.js.map +1 -0
  42. package/dist/app-registry/SimpleAppShim.d.ts +9 -0
  43. package/dist/app-registry/SimpleAppShim.d.ts.map +1 -0
  44. package/dist/app-registry/SimpleAppShim.js +9 -0
  45. package/dist/app-registry/SimpleAppShim.js.map +1 -0
  46. package/dist/base-registry/BaseRegistry.d.ts +32 -0
  47. package/dist/base-registry/BaseRegistry.d.ts.map +1 -0
  48. package/dist/base-registry/BaseRegistry.js +67 -0
  49. package/dist/base-registry/BaseRegistry.js.map +1 -0
  50. package/dist/base-registry/IEntitlementCheckerShim.d.ts +9 -0
  51. package/dist/base-registry/IEntitlementCheckerShim.d.ts.map +1 -0
  52. package/dist/base-registry/IEntitlementCheckerShim.js +9 -0
  53. package/dist/base-registry/IEntitlementCheckerShim.js.map +1 -0
  54. package/dist/base-registry/INodeOperatorShim.d.ts +9 -0
  55. package/dist/base-registry/INodeOperatorShim.d.ts.map +1 -0
  56. package/dist/base-registry/INodeOperatorShim.js +9 -0
  57. package/dist/base-registry/INodeOperatorShim.js.map +1 -0
  58. package/dist/base-registry/ISpaceDelegationShim.d.ts +9 -0
  59. package/dist/base-registry/ISpaceDelegationShim.d.ts.map +1 -0
  60. package/dist/base-registry/ISpaceDelegationShim.js +9 -0
  61. package/dist/base-registry/ISpaceDelegationShim.js.map +1 -0
  62. package/dist/base-registry/RewardsDistributionShim.d.ts +9 -0
  63. package/dist/base-registry/RewardsDistributionShim.d.ts.map +1 -0
  64. package/dist/base-registry/RewardsDistributionShim.js +9 -0
  65. package/dist/base-registry/RewardsDistributionShim.js.map +1 -0
  66. package/dist/cache/EntitlementCache.d.ts +25 -0
  67. package/dist/cache/EntitlementCache.d.ts.map +1 -0
  68. package/dist/cache/EntitlementCache.js +91 -0
  69. package/dist/cache/EntitlementCache.js.map +1 -0
  70. package/dist/cache/ICacheStorage.d.ts +44 -0
  71. package/dist/cache/ICacheStorage.d.ts.map +1 -0
  72. package/dist/cache/ICacheStorage.js +2 -0
  73. package/dist/cache/ICacheStorage.js.map +1 -0
  74. package/dist/cache/KVCacheStorage.d.ts +79 -0
  75. package/dist/cache/KVCacheStorage.d.ts.map +1 -0
  76. package/dist/cache/KVCacheStorage.js +227 -0
  77. package/dist/cache/KVCacheStorage.js.map +1 -0
  78. package/dist/cache/Keyable.d.ts +20 -0
  79. package/dist/cache/Keyable.d.ts.map +1 -0
  80. package/dist/cache/Keyable.js +62 -0
  81. package/dist/cache/Keyable.js.map +1 -0
  82. package/dist/cache/SimpleCache.d.ts +30 -0
  83. package/dist/cache/SimpleCache.d.ts.map +1 -0
  84. package/dist/cache/SimpleCache.js +84 -0
  85. package/dist/cache/SimpleCache.js.map +1 -0
  86. package/dist/cache/TTLCacheStorage.d.ts +19 -0
  87. package/dist/cache/TTLCacheStorage.d.ts.map +1 -0
  88. package/dist/cache/TTLCacheStorage.js +40 -0
  89. package/dist/cache/TTLCacheStorage.js.map +1 -0
  90. package/dist/chain.d.ts +89 -0
  91. package/dist/chain.d.ts.map +1 -0
  92. package/dist/chain.js +48 -0
  93. package/dist/chain.js.map +1 -0
  94. package/dist/delegate-registry/DelegateRegistry.d.ts +3 -0
  95. package/dist/delegate-registry/DelegateRegistry.d.ts.map +1 -0
  96. package/dist/delegate-registry/DelegateRegistry.js +72 -0
  97. package/dist/delegate-registry/DelegateRegistry.js.map +1 -0
  98. package/dist/eip-712/EIP-712.d.ts +35 -0
  99. package/dist/eip-712/EIP-712.d.ts.map +1 -0
  100. package/dist/eip-712/EIP-712.js +57 -0
  101. package/dist/eip-712/EIP-712.js.map +1 -0
  102. package/dist/erc-721/IERC721AQueryableShim.d.ts +9 -0
  103. package/dist/erc-721/IERC721AQueryableShim.d.ts.map +1 -0
  104. package/dist/erc-721/IERC721AQueryableShim.js +9 -0
  105. package/dist/erc-721/IERC721AQueryableShim.js.map +1 -0
  106. package/dist/erc-721/IERC721AShim.d.ts +9 -0
  107. package/dist/erc-721/IERC721AShim.d.ts.map +1 -0
  108. package/dist/erc-721/IERC721AShim.js +9 -0
  109. package/dist/erc-721/IERC721AShim.js.map +1 -0
  110. package/dist/index.d.ts +96 -0
  111. package/dist/index.d.ts.map +1 -0
  112. package/dist/index.js +96 -0
  113. package/dist/index.js.map +1 -0
  114. package/dist/platform-requirements/PlatformRequirements.d.ts +12 -0
  115. package/dist/platform-requirements/PlatformRequirements.d.ts.map +1 -0
  116. package/dist/platform-requirements/PlatformRequirements.js +18 -0
  117. package/dist/platform-requirements/PlatformRequirements.js.map +1 -0
  118. package/dist/pricing-modules/IPricingShim.d.ts +9 -0
  119. package/dist/pricing-modules/IPricingShim.d.ts.map +1 -0
  120. package/dist/pricing-modules/IPricingShim.js +9 -0
  121. package/dist/pricing-modules/IPricingShim.js.map +1 -0
  122. package/dist/pricing-modules/PricingModules.d.ts +13 -0
  123. package/dist/pricing-modules/PricingModules.d.ts.map +1 -0
  124. package/dist/pricing-modules/PricingModules.js +23 -0
  125. package/dist/pricing-modules/PricingModules.js.map +1 -0
  126. package/dist/pricing-modules/helpers.d.ts +16 -0
  127. package/dist/pricing-modules/helpers.d.ts.map +1 -0
  128. package/dist/pricing-modules/helpers.js +35 -0
  129. package/dist/pricing-modules/helpers.js.map +1 -0
  130. package/dist/readContractRetryer.d.ts +10 -0
  131. package/dist/readContractRetryer.d.ts.map +1 -0
  132. package/dist/readContractRetryer.js +68 -0
  133. package/dist/readContractRetryer.js.map +1 -0
  134. package/dist/river-registry/INodeRegistryShim.d.ts +9 -0
  135. package/dist/river-registry/INodeRegistryShim.d.ts.map +1 -0
  136. package/dist/river-registry/INodeRegistryShim.js +9 -0
  137. package/dist/river-registry/INodeRegistryShim.js.map +1 -0
  138. package/dist/river-registry/IOperatorRegistryShim.d.ts +9 -0
  139. package/dist/river-registry/IOperatorRegistryShim.d.ts.map +1 -0
  140. package/dist/river-registry/IOperatorRegistryShim.js +9 -0
  141. package/dist/river-registry/IOperatorRegistryShim.js.map +1 -0
  142. package/dist/river-registry/IStreamRegistryShim.d.ts +9 -0
  143. package/dist/river-registry/IStreamRegistryShim.d.ts.map +1 -0
  144. package/dist/river-registry/IStreamRegistryShim.js +9 -0
  145. package/dist/river-registry/IStreamRegistryShim.js.map +1 -0
  146. package/dist/river-registry/RiverRegistry.d.ts +18 -0
  147. package/dist/river-registry/RiverRegistry.d.ts.map +1 -0
  148. package/dist/river-registry/RiverRegistry.js +42 -0
  149. package/dist/river-registry/RiverRegistry.js.map +1 -0
  150. package/dist/river-registry/RiverRegistryFactory.d.ts +5 -0
  151. package/dist/river-registry/RiverRegistryFactory.d.ts.map +1 -0
  152. package/dist/river-registry/RiverRegistryFactory.js +5 -0
  153. package/dist/river-registry/RiverRegistryFactory.js.map +1 -0
  154. package/dist/space/IAppAccountShim.d.ts +9 -0
  155. package/dist/space/IAppAccountShim.d.ts.map +1 -0
  156. package/dist/space/IAppAccountShim.js +9 -0
  157. package/dist/space/IAppAccountShim.js.map +1 -0
  158. package/dist/space/IBanningShim.d.ts +9 -0
  159. package/dist/space/IBanningShim.d.ts.map +1 -0
  160. package/dist/space/IBanningShim.js +9 -0
  161. package/dist/space/IBanningShim.js.map +1 -0
  162. package/dist/space/IChannelShim.d.ts +9 -0
  163. package/dist/space/IChannelShim.d.ts.map +1 -0
  164. package/dist/space/IChannelShim.js +9 -0
  165. package/dist/space/IChannelShim.js.map +1 -0
  166. package/dist/space/IEntitlementDataQueryableShim.d.ts +11 -0
  167. package/dist/space/IEntitlementDataQueryableShim.d.ts.map +1 -0
  168. package/dist/space/IEntitlementDataQueryableShim.js +9 -0
  169. package/dist/space/IEntitlementDataQueryableShim.js.map +1 -0
  170. package/dist/space/IEntitlementsShim.d.ts +13 -0
  171. package/dist/space/IEntitlementsShim.d.ts.map +1 -0
  172. package/dist/space/IEntitlementsShim.js +19 -0
  173. package/dist/space/IEntitlementsShim.js.map +1 -0
  174. package/dist/space/IMembershipMetadataShim.d.ts +9 -0
  175. package/dist/space/IMembershipMetadataShim.d.ts.map +1 -0
  176. package/dist/space/IMembershipMetadataShim.js +9 -0
  177. package/dist/space/IMembershipMetadataShim.js.map +1 -0
  178. package/dist/space/IMembershipShim.d.ts +33 -0
  179. package/dist/space/IMembershipShim.d.ts.map +1 -0
  180. package/dist/space/IMembershipShim.js +139 -0
  181. package/dist/space/IMembershipShim.js.map +1 -0
  182. package/dist/space/IMulticallShim.d.ts +13 -0
  183. package/dist/space/IMulticallShim.d.ts.map +1 -0
  184. package/dist/space/IMulticallShim.js +15 -0
  185. package/dist/space/IMulticallShim.js.map +1 -0
  186. package/dist/space/IReviewShim.d.ts +64 -0
  187. package/dist/space/IReviewShim.d.ts.map +1 -0
  188. package/dist/space/IReviewShim.js +102 -0
  189. package/dist/space/IReviewShim.js.map +1 -0
  190. package/dist/space/IRolesShim.d.ts +10 -0
  191. package/dist/space/IRolesShim.d.ts.map +1 -0
  192. package/dist/space/IRolesShim.js +9 -0
  193. package/dist/space/IRolesShim.js.map +1 -0
  194. package/dist/space/ITippingShim.d.ts +39 -0
  195. package/dist/space/ITippingShim.d.ts.map +1 -0
  196. package/dist/space/ITippingShim.js +76 -0
  197. package/dist/space/ITippingShim.js.map +1 -0
  198. package/dist/space/ITreasuryShim.d.ts +9 -0
  199. package/dist/space/ITreasuryShim.d.ts.map +1 -0
  200. package/dist/space/ITreasuryShim.js +9 -0
  201. package/dist/space/ITreasuryShim.js.map +1 -0
  202. package/dist/space/OwnableFacetShim.d.ts +12 -0
  203. package/dist/space/OwnableFacetShim.d.ts.map +1 -0
  204. package/dist/space/OwnableFacetShim.js +19 -0
  205. package/dist/space/OwnableFacetShim.js.map +1 -0
  206. package/dist/space/Space.d.ts +107 -0
  207. package/dist/space/Space.d.ts.map +1 -0
  208. package/dist/space/Space.js +511 -0
  209. package/dist/space/Space.js.map +1 -0
  210. package/dist/space/TokenPausableFacetShim.d.ts +9 -0
  211. package/dist/space/TokenPausableFacetShim.d.ts.map +1 -0
  212. package/dist/space/TokenPausableFacetShim.js +9 -0
  213. package/dist/space/TokenPausableFacetShim.js.map +1 -0
  214. package/dist/space/entitlements/ConvertersEntitlements.d.ts +14 -0
  215. package/dist/space/entitlements/ConvertersEntitlements.d.ts.map +1 -0
  216. package/dist/space/entitlements/ConvertersEntitlements.js +193 -0
  217. package/dist/space/entitlements/ConvertersEntitlements.js.map +1 -0
  218. package/dist/space/entitlements/RuleBuilder.d.ts +83 -0
  219. package/dist/space/entitlements/RuleBuilder.d.ts.map +1 -0
  220. package/dist/space/entitlements/RuleBuilder.js +86 -0
  221. package/dist/space/entitlements/RuleBuilder.js.map +1 -0
  222. package/dist/space/entitlements/RuleEntitlementShim.d.ts +353 -0
  223. package/dist/space/entitlements/RuleEntitlementShim.d.ts.map +1 -0
  224. package/dist/space/entitlements/RuleEntitlementShim.js +40 -0
  225. package/dist/space/entitlements/RuleEntitlementShim.js.map +1 -0
  226. package/dist/space/entitlements/RuleEntitlementV2Shim.d.ts +353 -0
  227. package/dist/space/entitlements/RuleEntitlementV2Shim.d.ts.map +1 -0
  228. package/dist/space/entitlements/RuleEntitlementV2Shim.js +40 -0
  229. package/dist/space/entitlements/RuleEntitlementV2Shim.js.map +1 -0
  230. package/dist/space/entitlements/UserEntitlementShim.d.ts +13 -0
  231. package/dist/space/entitlements/UserEntitlementShim.d.ts.map +1 -0
  232. package/dist/space/entitlements/UserEntitlementShim.js +45 -0
  233. package/dist/space/entitlements/UserEntitlementShim.js.map +1 -0
  234. package/dist/space/entitlements/XChainConfig.d.ts +14 -0
  235. package/dist/space/entitlements/XChainConfig.d.ts.map +1 -0
  236. package/dist/space/entitlements/XChainConfig.js +70 -0
  237. package/dist/space/entitlements/XChainConfig.js.map +1 -0
  238. package/dist/space/entitlements/entitlement.d.ts +147 -0
  239. package/dist/space/entitlements/entitlement.d.ts.map +1 -0
  240. package/dist/space/entitlements/entitlement.js +940 -0
  241. package/dist/space/entitlements/entitlement.js.map +1 -0
  242. package/dist/space/entitlements/validateAndParseXChainConfig.d.ts +6 -0
  243. package/dist/space/entitlements/validateAndParseXChainConfig.d.ts.map +1 -0
  244. package/dist/space/entitlements/validateAndParseXChainConfig.js +34 -0
  245. package/dist/space/entitlements/validateAndParseXChainConfig.js.map +1 -0
  246. package/dist/space-dapp/SpaceDapp.d.ts +223 -0
  247. package/dist/space-dapp/SpaceDapp.d.ts.map +1 -0
  248. package/dist/space-dapp/SpaceDapp.js +1260 -0
  249. package/dist/space-dapp/SpaceDapp.js.map +1 -0
  250. package/dist/space-dapp/SpaceDappFactory.d.ts +5 -0
  251. package/dist/space-dapp/SpaceDappFactory.d.ts.map +1 -0
  252. package/dist/space-dapp/SpaceDappFactory.js +8 -0
  253. package/dist/space-dapp/SpaceDappFactory.js.map +1 -0
  254. package/dist/space-dapp/wrapTransaction.d.ts +4 -0
  255. package/dist/space-dapp/wrapTransaction.d.ts.map +1 -0
  256. package/dist/space-dapp/wrapTransaction.js +99 -0
  257. package/dist/space-dapp/wrapTransaction.js.map +1 -0
  258. package/dist/space-owner/GuardianFacetShim.d.ts +9 -0
  259. package/dist/space-owner/GuardianFacetShim.d.ts.map +1 -0
  260. package/dist/space-owner/GuardianFacetShim.js +9 -0
  261. package/dist/space-owner/GuardianFacetShim.js.map +1 -0
  262. package/dist/space-owner/SpaceOwner.d.ts +48 -0
  263. package/dist/space-owner/SpaceOwner.d.ts.map +1 -0
  264. package/dist/space-owner/SpaceOwner.js +81 -0
  265. package/dist/space-owner/SpaceOwner.js.map +1 -0
  266. package/dist/space-registrar/ICreateSpaceShim.d.ts +11 -0
  267. package/dist/space-registrar/ICreateSpaceShim.d.ts.map +1 -0
  268. package/dist/space-registrar/ICreateSpaceShim.js +9 -0
  269. package/dist/space-registrar/ICreateSpaceShim.js.map +1 -0
  270. package/dist/space-registrar/ILegacySpaceArchitectShim.d.ts +10 -0
  271. package/dist/space-registrar/ILegacySpaceArchitectShim.d.ts.map +1 -0
  272. package/dist/space-registrar/ILegacySpaceArchitectShim.js +9 -0
  273. package/dist/space-registrar/ILegacySpaceArchitectShim.js.map +1 -0
  274. package/dist/space-registrar/ISpaceArchitectShim.d.ts +10 -0
  275. package/dist/space-registrar/ISpaceArchitectShim.d.ts.map +1 -0
  276. package/dist/space-registrar/ISpaceArchitectShim.js +39 -0
  277. package/dist/space-registrar/ISpaceArchitectShim.js.map +1 -0
  278. package/dist/space-registrar/SpaceRegistrar.d.ts +27 -0
  279. package/dist/space-registrar/SpaceRegistrar.d.ts.map +1 -0
  280. package/dist/space-registrar/SpaceRegistrar.js +58 -0
  281. package/dist/space-registrar/SpaceRegistrar.js.map +1 -0
  282. package/dist/test-helpers/LocalhostWeb3Provider.d.ts +19 -0
  283. package/dist/test-helpers/LocalhostWeb3Provider.d.ts.map +1 -0
  284. package/dist/test-helpers/LocalhostWeb3Provider.js +80 -0
  285. package/dist/test-helpers/LocalhostWeb3Provider.js.map +1 -0
  286. package/dist/test-helpers/MockCrossChainEntitlement.d.ts +6 -0
  287. package/dist/test-helpers/MockCrossChainEntitlement.d.ts.map +1 -0
  288. package/dist/test-helpers/MockCrossChainEntitlement.js +104 -0
  289. package/dist/test-helpers/MockCrossChainEntitlement.js.map +1 -0
  290. package/dist/test-helpers/MockERC1155.d.ts +6 -0
  291. package/dist/test-helpers/MockERC1155.d.ts.map +1 -0
  292. package/dist/test-helpers/MockERC1155.js +518 -0
  293. package/dist/test-helpers/MockERC1155.js.map +1 -0
  294. package/dist/test-helpers/MockERC20.d.ts +6 -0
  295. package/dist/test-helpers/MockERC20.d.ts.map +1 -0
  296. package/dist/test-helpers/MockERC20.js +574 -0
  297. package/dist/test-helpers/MockERC20.js.map +1 -0
  298. package/dist/test-helpers/MockERC721A.d.ts +1563 -0
  299. package/dist/test-helpers/MockERC721A.d.ts.map +1 -0
  300. package/dist/test-helpers/MockERC721A.js +1913 -0
  301. package/dist/test-helpers/MockERC721A.js.map +1 -0
  302. package/dist/test-helpers/MockERC721AShim.d.ts +9 -0
  303. package/dist/test-helpers/MockERC721AShim.d.ts.map +1 -0
  304. package/dist/test-helpers/MockERC721AShim.js +9 -0
  305. package/dist/test-helpers/MockERC721AShim.js.map +1 -0
  306. package/dist/test-helpers/TestCrossChainEntitlement.d.ts +14 -0
  307. package/dist/test-helpers/TestCrossChainEntitlement.d.ts.map +1 -0
  308. package/dist/test-helpers/TestCrossChainEntitlement.js +99 -0
  309. package/dist/test-helpers/TestCrossChainEntitlement.js.map +1 -0
  310. package/dist/test-helpers/TestEthBalance.d.ts +72 -0
  311. package/dist/test-helpers/TestEthBalance.d.ts.map +1 -0
  312. package/dist/test-helpers/TestEthBalance.js +94 -0
  313. package/dist/test-helpers/TestEthBalance.js.map +1 -0
  314. package/dist/test-helpers/TestGatingERC1155.d.ts +17 -0
  315. package/dist/test-helpers/TestGatingERC1155.d.ts.map +1 -0
  316. package/dist/test-helpers/TestGatingERC1155.js +100 -0
  317. package/dist/test-helpers/TestGatingERC1155.js.map +1 -0
  318. package/dist/test-helpers/TestGatingERC20.d.ts +17 -0
  319. package/dist/test-helpers/TestGatingERC20.d.ts.map +1 -0
  320. package/dist/test-helpers/TestGatingERC20.js +149 -0
  321. package/dist/test-helpers/TestGatingERC20.js.map +1 -0
  322. package/dist/test-helpers/TestGatingNFT.d.ts +17 -0
  323. package/dist/test-helpers/TestGatingNFT.d.ts.map +1 -0
  324. package/dist/test-helpers/TestGatingNFT.js +137 -0
  325. package/dist/test-helpers/TestGatingNFT.js.map +1 -0
  326. package/dist/test-helpers/TestGatingUtils.d.ts +15 -0
  327. package/dist/test-helpers/TestGatingUtils.d.ts.map +1 -0
  328. package/dist/test-helpers/TestGatingUtils.js +112 -0
  329. package/dist/test-helpers/TestGatingUtils.js.map +1 -0
  330. package/dist/test-helpers/utils.d.ts +22 -0
  331. package/dist/test-helpers/utils.d.ts.map +1 -0
  332. package/dist/test-helpers/utils.js +30 -0
  333. package/dist/test-helpers/utils.js.map +1 -0
  334. package/dist/towns-token/TownsToken.d.ts +17 -0
  335. package/dist/towns-token/TownsToken.d.ts.map +1 -0
  336. package/dist/towns-token/TownsToken.js +33 -0
  337. package/dist/towns-token/TownsToken.js.map +1 -0
  338. package/dist/types/ContractTypes.d.ts +240 -0
  339. package/dist/types/ContractTypes.d.ts.map +1 -0
  340. package/dist/types/ContractTypes.js +65 -0
  341. package/dist/types/ContractTypes.js.map +1 -0
  342. package/dist/types/error-types.d.ts +7 -0
  343. package/dist/types/error-types.d.ts.map +1 -0
  344. package/dist/types/error-types.js +13 -0
  345. package/dist/types/error-types.js.map +1 -0
  346. package/dist/types/typechain.d.ts +4 -0
  347. package/dist/types/typechain.d.ts.map +1 -0
  348. package/dist/types/typechain.js +2 -0
  349. package/dist/types/typechain.js.map +1 -0
  350. package/dist/types/types.d.ts +29 -0
  351. package/dist/types/types.d.ts.map +1 -0
  352. package/dist/types/types.js +2 -0
  353. package/dist/types/types.js.map +1 -0
  354. package/dist/utils/ContractHelpers.d.ts +14 -0
  355. package/dist/utils/ContractHelpers.d.ts.map +1 -0
  356. package/dist/utils/ContractHelpers.js +54 -0
  357. package/dist/utils/ContractHelpers.js.map +1 -0
  358. package/dist/utils/Web3Constants.d.ts +6 -0
  359. package/dist/utils/Web3Constants.d.ts.map +1 -0
  360. package/dist/utils/Web3Constants.js +7 -0
  361. package/dist/utils/Web3Constants.js.map +1 -0
  362. package/dist/utils/ut.d.ts +46 -0
  363. package/dist/utils/ut.d.ts.map +1 -0
  364. package/dist/utils/ut.js +94 -0
  365. package/dist/utils/ut.js.map +1 -0
  366. package/dist/utils/web3Env.d.ts +36 -0
  367. package/dist/utils/web3Env.d.ts.map +1 -0
  368. package/dist/utils/web3Env.js +123 -0
  369. package/dist/utils/web3Env.js.map +1 -0
  370. package/dist/wallet-link/WalletLink.d.ts +58 -0
  371. package/dist/wallet-link/WalletLink.d.ts.map +1 -0
  372. package/dist/wallet-link/WalletLink.js +226 -0
  373. package/dist/wallet-link/WalletLink.js.map +1 -0
  374. package/dist/wallet-link/WalletLinkShim.d.ts +9 -0
  375. package/dist/wallet-link/WalletLinkShim.d.ts.map +1 -0
  376. package/dist/wallet-link/WalletLinkShim.js +9 -0
  377. package/dist/wallet-link/WalletLinkShim.js.map +1 -0
  378. package/package.json +50 -0
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # web3
2
+
3
+ Dapps for our Space and Registry contracts
@@ -0,0 +1,57 @@
1
+ import { BytesLike, ContractTransaction, ethers } from 'ethers';
2
+ import { Connect, ContractType } from './types/typechain';
3
+ import { Abi } from 'abitype';
4
+ import { TransactionOpts } from './types/ContractTypes';
5
+ export type PromiseOrValue<T> = T | Promise<T>;
6
+ export declare const UNKNOWN_ERROR = "UNKNOWN_ERROR";
7
+ export type OverrideExecution<T> = (args: {
8
+ toAddress: string;
9
+ calldata: string;
10
+ value?: bigint;
11
+ }) => Promise<T>;
12
+ export declare class BaseContractShim<connect extends Connect<ethers.Contract>, T_CONTRACT extends ContractType<connect> = ContractType<connect>> {
13
+ readonly address: string;
14
+ readonly provider: ethers.providers.Provider;
15
+ readonly connect: Connect<T_CONTRACT>;
16
+ readonly abi: Abi;
17
+ private _network?;
18
+ private _networkPromise?;
19
+ private contractInterface?;
20
+ private readContract?;
21
+ private writeContract?;
22
+ constructor(address: string, provider: ethers.providers.Provider, connect: Connect<T_CONTRACT>, abi: Abi);
23
+ getNetwork(): Promise<ethers.providers.Network | undefined>;
24
+ get interface(): T_CONTRACT['interface'];
25
+ get read(): T_CONTRACT;
26
+ write(signer: ethers.Signer): T_CONTRACT;
27
+ /**
28
+ * Executes a contract function call. If overrideExecution is provided, uses that instead of
29
+ * the default blockchain transaction. This allows for custom handling of the call, such as
30
+ * returning the raw calldata or implementing custom transaction logic.
31
+ *
32
+ * @param params.signer - The signer to use for the transaction
33
+ * @param params.functionName - The name of the contract function to call
34
+ * @param params.args - The arguments to pass to the function
35
+ * @param params.overrideExecution - Optional function to override the default execution
36
+ * @param params.transactionOpts - Optional transaction options
37
+ * @returns The result of the function call or the override execution
38
+ */
39
+ executeCall<T = ContractTransaction, FnName extends keyof T_CONTRACT['functions'] = keyof T_CONTRACT['functions'], Args extends Parameters<T_CONTRACT['functions'][FnName]> = Parameters<T_CONTRACT['functions'][FnName]>>(params: {
40
+ signer: ethers.Signer;
41
+ functionName: FnName;
42
+ args: Args;
43
+ value?: bigint;
44
+ overrideExecution?: OverrideExecution<T>;
45
+ transactionOpts?: TransactionOpts;
46
+ }): Promise<T extends undefined ? ContractTransaction : T>;
47
+ decodeFunctionResult<FnName extends keyof T_CONTRACT['functions']>(functionName: FnName, data: BytesLike): Awaited<ReturnType<T_CONTRACT['functions'][FnName]>>;
48
+ decodeFunctionData<FnName extends keyof T_CONTRACT['functions']>(functionName: FnName, data: BytesLike): ethers.utils.Result;
49
+ encodeFunctionData<FnName extends keyof T_CONTRACT['functions'], FnParams extends Parameters<T_CONTRACT['functions'][FnName]>>(functionName: FnName, args: FnParams): string;
50
+ parseError(error: unknown): Error & {
51
+ code?: string;
52
+ data?: unknown;
53
+ };
54
+ private getErrorData;
55
+ parseLog(log: ethers.providers.Log): ethers.utils.LogDescription;
56
+ }
57
+ //# sourceMappingURL=BaseContractShim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseContractShim.d.ts","sourceRoot":"","sources":["../src/BaseContractShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/D,OAAO,E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YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM;IAUxC,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,GAAG;QACvC,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE,OAAO,CAAA;KACjB;IA4CD,OAAO,CAAC,YAAY;IAmEb,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,GAAG;CAG5C"}
@@ -0,0 +1,224 @@
1
+ import { dlogger } from '@towns-labs/utils';
2
+ import { wrapTransaction } from './space-dapp/wrapTransaction';
3
+ export const UNKNOWN_ERROR = 'UNKNOWN_ERROR';
4
+ const logger = dlogger('csb:BaseContractShim');
5
+ export class BaseContractShim {
6
+ address;
7
+ provider;
8
+ connect;
9
+ abi;
10
+ _network;
11
+ _networkPromise;
12
+ contractInterface;
13
+ readContract;
14
+ writeContract;
15
+ constructor(address, provider, connect, abi) {
16
+ this.address = address;
17
+ this.provider = provider;
18
+ this.connect = connect;
19
+ this.abi = abi;
20
+ void this.getNetwork();
21
+ }
22
+ async getNetwork() {
23
+ if (this._network) {
24
+ return this._network;
25
+ }
26
+ if (!this._networkPromise) {
27
+ this._networkPromise = this.provider.getNetwork();
28
+ }
29
+ try {
30
+ this._network = await this._networkPromise;
31
+ }
32
+ catch (error) {
33
+ this._networkPromise = undefined;
34
+ logger.error('Failed to fetch network info:', error);
35
+ }
36
+ return this._network;
37
+ }
38
+ get interface() {
39
+ if (!this.contractInterface) {
40
+ this.readContract = this.connect(this.address, this.provider);
41
+ this.contractInterface = this.readContract.interface;
42
+ }
43
+ return this.contractInterface;
44
+ }
45
+ get read() {
46
+ // lazy create an instance if it is not already cached
47
+ if (!this.readContract) {
48
+ this.readContract = this.connect(this.address, this.provider);
49
+ this.contractInterface = this.readContract.interface;
50
+ }
51
+ return this.readContract;
52
+ }
53
+ write(signer) {
54
+ // lazy create an instance if it is not already cached
55
+ if (!this.writeContract) {
56
+ this.writeContract = this.connect(this.address, signer);
57
+ this.contractInterface = this.writeContract.interface;
58
+ }
59
+ else {
60
+ // update the signer if it has changed
61
+ if (this.writeContract.signer !== signer) {
62
+ this.writeContract = this.connect(this.address, signer);
63
+ }
64
+ }
65
+ return this.writeContract;
66
+ }
67
+ /**
68
+ * Executes a contract function call. If overrideExecution is provided, uses that instead of
69
+ * the default blockchain transaction. This allows for custom handling of the call, such as
70
+ * returning the raw calldata or implementing custom transaction logic.
71
+ *
72
+ * @param params.signer - The signer to use for the transaction
73
+ * @param params.functionName - The name of the contract function to call
74
+ * @param params.args - The arguments to pass to the function
75
+ * @param params.overrideExecution - Optional function to override the default execution
76
+ * @param params.transactionOpts - Optional transaction options
77
+ * @returns The result of the function call or the override execution
78
+ */
79
+ executeCall(params) {
80
+ return (params.overrideExecution
81
+ ? params.overrideExecution({
82
+ toAddress: this.address,
83
+ calldata: this.encodeFunctionData(params.functionName, params.args),
84
+ value: params.value,
85
+ })
86
+ : wrapTransaction(() => this.write(params.signer)[params.functionName](...(params.value
87
+ ? [...params.args, { value: params.value }]
88
+ : params.args)), params.transactionOpts));
89
+ }
90
+ decodeFunctionResult(functionName, data) {
91
+ if (typeof functionName !== 'string') {
92
+ throw new Error('functionName must be a string');
93
+ }
94
+ if (!this.interface.getFunction(functionName)) {
95
+ throw new Error(`Function ${functionName} not found in contract interface`);
96
+ }
97
+ const decoded = this.interface.decodeFunctionResult(functionName, data);
98
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
99
+ return decoded;
100
+ }
101
+ decodeFunctionData(functionName, data) {
102
+ if (typeof functionName !== 'string') {
103
+ throw new Error('functionName must be a string');
104
+ }
105
+ if (!this.interface.getFunction(functionName)) {
106
+ throw new Error(`Function ${functionName} not found in contract interface`);
107
+ }
108
+ return this.interface.decodeFunctionData(functionName, data);
109
+ }
110
+ encodeFunctionData(functionName, args) {
111
+ if (typeof functionName !== 'string') {
112
+ throw new Error('functionName must be a string');
113
+ }
114
+ if (!this.interface.getFunction(functionName)) {
115
+ throw new Error(`Function ${functionName} not found in contract interface`);
116
+ }
117
+ return this.interface.encodeFunctionData(functionName, args);
118
+ }
119
+ parseError(error) {
120
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
121
+ const anyError = error;
122
+ const { errorData, errorMessage, errorName } = this.getErrorData(anyError);
123
+ /**
124
+ * Return early if we have trouble extracting the error data.
125
+ * Don't know how to decode it.
126
+ */
127
+ if (!errorData) {
128
+ logger.log(`parseError ${errorName}: no error data, or don't know how to extract error data`);
129
+ return {
130
+ name: errorName ?? UNKNOWN_ERROR,
131
+ message: errorMessage ?? anyError,
132
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
133
+ code: anyError?.code,
134
+ };
135
+ }
136
+ /**
137
+ * Try to decode the error data. If it fails, return the original error message.
138
+ */
139
+ try {
140
+ const errDescription = this.interface.parseError(errorData);
141
+ const decodedError = {
142
+ name: errDescription?.errorFragment.name ?? UNKNOWN_ERROR,
143
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
144
+ message: errorMessage,
145
+ };
146
+ logger.log('decodedError', decodedError);
147
+ return decodedError;
148
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
149
+ }
150
+ catch (e) {
151
+ // Cannot decode error
152
+ logger.error('cannot decode error', e);
153
+ return {
154
+ name: UNKNOWN_ERROR,
155
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
156
+ message: e.message,
157
+ };
158
+ }
159
+ }
160
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
161
+ getErrorData(anyError) {
162
+ /**
163
+ * Error data is nested in different places depending on whether the app is
164
+ * running in jest/node, or which blockchain (goerli, or anvil).
165
+ */
166
+ // Case: jest/node error
167
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
168
+ let errorData = anyError.error?.error?.error?.data;
169
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
170
+ let errorMessage = anyError.error?.error?.error?.message;
171
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
172
+ let errorName = anyError.error?.error?.error?.name;
173
+ if (!errorData) {
174
+ // Case: Browser (anvil || base goerli)
175
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
176
+ errorData = anyError.error?.error?.data;
177
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
178
+ errorMessage = anyError.error?.error?.message;
179
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
180
+ errorName = anyError.error?.error?.name;
181
+ }
182
+ if (!errorData) {
183
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
184
+ errorData = anyError.data;
185
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
186
+ errorData = anyError?.data;
187
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
188
+ errorMessage = anyError?.message;
189
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
190
+ errorName = anyError?.name;
191
+ }
192
+ if (!errorData) {
193
+ // sometimes it's a stringified object under anyError.reason or anyError.message
194
+ try {
195
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
196
+ const reason = anyError?.reason || anyError?.message;
197
+ if (typeof reason === 'string') {
198
+ const errorMatch = reason?.match(/error\\":\{([^}]+)\}/)?.[1];
199
+ if (errorMatch) {
200
+ const parsedData = JSON.parse(`{${errorMatch?.replace(/\\/g, '')}}`);
201
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
202
+ errorData = parsedData?.data;
203
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
204
+ errorMessage = parsedData?.message;
205
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
206
+ errorName = parsedData?.name;
207
+ }
208
+ }
209
+ }
210
+ catch (error) {
211
+ logger.error('error parsing reason', error);
212
+ }
213
+ }
214
+ return {
215
+ errorData,
216
+ errorMessage,
217
+ errorName,
218
+ };
219
+ }
220
+ parseLog(log) {
221
+ return this.interface.parseLog(log);
222
+ }
223
+ }
224
+ //# sourceMappingURL=BaseContractShim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseContractShim.js","sourceRoot":"","sources":["../src/BaseContractShim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAI3C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAG9D,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAA;AAE5C,MAAM,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;AAQ9C,MAAM,OAAO,gBAAgB;IAIT,OAAO,CAAQ;IACf,QAAQ,CAA2B;IACnC,OAAO,CAAqB;IAC5B,GAAG,CAAK;IAChB,QAAQ,CAA2B;IACnC,eAAe,CAAoC;IACnD,iBAAiB,CAA0B;IAC3C,YAAY,CAAa;IACzB,aAAa,CAAa;IAElC,YACI,OAAe,EACf,QAAmC,EACnC,OAA4B,EAC5B,GAAQ;QAER,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,KAAK,IAAI,CAAC,UAAU,EAAE,CAAA;IAC1B,CAAC;IAEM,KAAK,CAAC,UAAU;QACnB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC,QAAQ,CAAA;QACxB,CAAC;QAED,IAAI,CA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;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,MAAM,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAA;YAC/C,CAAC;QACL,CAAC;QAED,OAAO;YACH,SAAS;YACT,YAAY;YACZ,SAAS;SACZ,CAAA;IACL,CAAC;IAEM,QAAQ,CAAC,GAAyB;QACrC,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IACvC,CAAC;CACJ"}
@@ -0,0 +1,9 @@
1
+ import { ethers } from 'ethers';
2
+ import { BaseContractShim } from '../BaseContractShim';
3
+ import { DropFacet__factory } from '@towns-labs/generated/dev/typings/factories/DropFacet__factory';
4
+ declare const connect: typeof DropFacet__factory.connect;
5
+ export declare class IDropFacetShim extends BaseContractShim<typeof connect> {
6
+ constructor(address: string, provider: ethers.providers.Provider);
7
+ }
8
+ export {};
9
+ //# sourceMappingURL=IDropFacetShim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDropFacetShim.d.ts","sourceRoot":"","sources":["../../src/airdrop/IDropFacetShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAA;AAEnG,QAAA,MAAa,OAAO,mCAAuB,CAAA;AAE3C,qBAAa,cAAe,SAAQ,gBAAgB,CAAC,OAAO,OAAO,CAAC;gBACpD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;CAGnE"}
@@ -0,0 +1,9 @@
1
+ import { BaseContractShim } from '../BaseContractShim';
2
+ import { DropFacet__factory } from '@towns-labs/generated/dev/typings/factories/DropFacet__factory';
3
+ const { abi, connect } = DropFacet__factory;
4
+ export class IDropFacetShim extends BaseContractShim {
5
+ constructor(address, provider) {
6
+ super(address, provider, connect, abi);
7
+ }
8
+ }
9
+ //# sourceMappingURL=IDropFacetShim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDropFacetShim.js","sourceRoot":"","sources":["../../src/airdrop/IDropFacetShim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAA;AAEnG,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,kBAAkB,CAAA;AAE3C,MAAM,OAAO,cAAe,SAAQ,gBAAgC;IAChE,YAAY,OAAe,EAAE,QAAmC;QAC5D,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;IAC1C,CAAC;CACJ"}
@@ -0,0 +1,9 @@
1
+ import { ethers } from 'ethers';
2
+ import { BaseContractShim } from '../BaseContractShim';
3
+ import { ITownsPoints__factory } from '@towns-labs/generated/dev/typings/factories/ITownsPoints__factory';
4
+ declare const connect: typeof ITownsPoints__factory.connect;
5
+ export declare class IRiverPointsShim extends BaseContractShim<typeof connect> {
6
+ constructor(address: string, provider: ethers.providers.Provider);
7
+ }
8
+ export {};
9
+ //# sourceMappingURL=IRiverPointsShim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IRiverPointsShim.d.ts","sourceRoot":"","sources":["../../src/airdrop/IRiverPointsShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mEAAmE,CAAA;AAEzG,QAAA,MAAa,OAAO,sCAA0B,CAAA;AAE9C,qBAAa,gBAAiB,SAAQ,gBAAgB,CAAC,OAAO,OAAO,CAAC;gBACtD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;CAGnE"}
@@ -0,0 +1,9 @@
1
+ import { BaseContractShim } from '../BaseContractShim';
2
+ import { ITownsPoints__factory } from '@towns-labs/generated/dev/typings/factories/ITownsPoints__factory';
3
+ const { abi, connect } = ITownsPoints__factory;
4
+ export class IRiverPointsShim extends BaseContractShim {
5
+ constructor(address, provider) {
6
+ super(address, provider, connect, abi);
7
+ }
8
+ }
9
+ //# sourceMappingURL=IRiverPointsShim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IRiverPointsShim.js","sourceRoot":"","sources":["../../src/airdrop/IRiverPointsShim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mEAAmE,CAAA;AAEzG,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,qBAAqB,CAAA;AAE9C,MAAM,OAAO,gBAAiB,SAAQ,gBAAgC;IAClE,YAAY,OAAe,EAAE,QAAmC;QAC5D,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;IAC1C,CAAC;CACJ"}
@@ -0,0 +1,16 @@
1
+ import { IDropFacetShim } from './IDropFacetShim';
2
+ import { BaseChainConfig } from '../utils/web3Env';
3
+ import { BigNumber, ethers } from 'ethers';
4
+ import { IERC721AShim } from '../erc-721/IERC721AShim';
5
+ import { IRiverPointsShim } from './IRiverPointsShim';
6
+ export declare class RiverAirdropDapp {
7
+ readonly drop?: IDropFacetShim;
8
+ readonly riverPoints?: IRiverPointsShim;
9
+ readonly erc721A?: IERC721AShim;
10
+ constructor(config: BaseChainConfig, provider: ethers.providers.Provider);
11
+ getCurrentStreak(walletAddress: string): Promise<BigNumber>;
12
+ getLastCheckIn(walletAddress: string): Promise<BigNumber>;
13
+ checkIn(signer: ethers.Signer): Promise<ethers.ContractTransaction | undefined>;
14
+ balanceOf(walletAddress: string): Promise<BigNumber>;
15
+ }
16
+ //# sourceMappingURL=RiverAirdropDapp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiverAirdropDapp.d.ts","sourceRoot":"","sources":["../../src/airdrop/RiverAirdropDapp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,qBAAa,gBAAgB;IAEzB,SAAgB,IAAI,CAAC,EAAE,cAAc,CAAA;IACrC,SAAgB,WAAW,CAAC,EAAE,gBAAgB,CAAA;IAC9C,SAAgB,OAAO,CAAC,EAAE,YAAY,CAAA;gBAE1B,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;IAQ3D,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAI3D,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIzD,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM;IAI7B,SAAS,CAAC,aAAa,EAAE,MAAM;CAG/C"}
@@ -0,0 +1,30 @@
1
+ import { IDropFacetShim } from './IDropFacetShim';
2
+ import { BigNumber } from 'ethers';
3
+ import { IERC721AShim } from '../erc-721/IERC721AShim';
4
+ import { IRiverPointsShim } from './IRiverPointsShim';
5
+ export class RiverAirdropDapp {
6
+ // river airdrop isn't on all chains, so the facets might be undefined
7
+ drop;
8
+ riverPoints;
9
+ erc721A;
10
+ constructor(config, provider) {
11
+ if (config.addresses.riverAirdrop) {
12
+ this.drop = new IDropFacetShim(config.addresses.riverAirdrop, provider);
13
+ this.riverPoints = new IRiverPointsShim(config.addresses.riverAirdrop, provider);
14
+ this.erc721A = new IERC721AShim(config.addresses.riverAirdrop, provider);
15
+ }
16
+ }
17
+ async getCurrentStreak(walletAddress) {
18
+ return this.riverPoints?.read.getCurrentStreak(walletAddress) ?? BigNumber.from(0);
19
+ }
20
+ async getLastCheckIn(walletAddress) {
21
+ return this.riverPoints?.read.getLastCheckIn(walletAddress) ?? BigNumber.from(0);
22
+ }
23
+ async checkIn(signer) {
24
+ return this.riverPoints?.write(signer).checkIn();
25
+ }
26
+ async balanceOf(walletAddress) {
27
+ return this.erc721A?.read.balanceOf(walletAddress) ?? BigNumber.from(0);
28
+ }
29
+ }
30
+ //# sourceMappingURL=RiverAirdropDapp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiverAirdropDapp.js","sourceRoot":"","sources":["../../src/airdrop/RiverAirdropDapp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,OAAO,EAAE,SAAS,EAAU,MAAM,QAAQ,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,MAAM,OAAO,gBAAgB;IACzB,sEAAsE;IACtD,IAAI,CAAiB;IACrB,WAAW,CAAmB;IAC9B,OAAO,CAAe;IAEtC,YAAY,MAAuB,EAAE,QAAmC;QACpE,IAAI,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;YAChC,IAAI,CAAC,IAAI,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAA;YACvE,IAAI,CAAC,WAAW,GAAG,IAAI,gBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAA;YAChF,IAAI,CAAC,OAAO,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAA;QAC5E,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,aAAqB;QAC/C,OAAO,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACtF,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,aAAqB;QAC7C,OAAO,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACpF,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,MAAqB;QACtC,OAAO,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAA;IACpD,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,aAAqB;QACxC,OAAO,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC3E,CAAC;CACJ"}
@@ -0,0 +1,68 @@
1
+ import { ethers, type BigNumber, type ContractReceipt, type ContractTransaction } from 'ethers';
2
+ import { BaseChainConfig } from '../utils/web3Env';
3
+ import type { Address } from 'viem';
4
+ import { IAppRegistryShim } from './IAppRegistryShim';
5
+ import { IAppInstallerShim } from './IAppInstallerShim';
6
+ import { IAppFactoryShim } from './IAppFactoryShim';
7
+ import { IReputationRegistryShim } from './IReputationRegistryShim';
8
+ import { SimpleAppShim } from './SimpleAppShim';
9
+ import type { AppRegisteredEventObject, IAppRegistryBase } from '@towns-labs/generated/dev/typings/IAppRegistry';
10
+ import type { AppCreatedEventObject } from '@towns-labs/generated/dev/typings/IAppFactory';
11
+ import { Permission } from '../types/ContractTypes';
12
+ export type BotInfo = {
13
+ appId: Address;
14
+ app: {
15
+ client: Address;
16
+ module: Address;
17
+ owner: Address;
18
+ permissions: Permission[];
19
+ };
20
+ };
21
+ export declare class AppRegistryDapp {
22
+ readonly registry: IAppRegistryShim;
23
+ readonly installer: IAppInstallerShim;
24
+ readonly factory: IAppFactoryShim;
25
+ readonly reputation: IReputationRegistryShim;
26
+ private readonly provider;
27
+ constructor(config: BaseChainConfig, provider: ethers.providers.Provider);
28
+ callApp(appAddress: Address): SimpleAppShim;
29
+ createApp(signer: ethers.Signer, name: string, permissions: Permission[], client: Address, installPrice: bigint, accessDuration: bigint): Promise<ContractTransaction>;
30
+ getCreateAppEvent(receipt: ContractReceipt, senderAddress: Address): AppCreatedEventObject;
31
+ getRegisterAppEvent(receipt: ContractReceipt, appAddress: Address): AppRegisteredEventObject;
32
+ /** To register a smart contract app with a App Client */
33
+ registerApp(signer: ethers.Signer, app: Address, client: Address): Promise<ContractTransaction>;
34
+ /** To install a smart contract app in a space */
35
+ installApp(
36
+ /** The signer of the app owner */
37
+ signer: ethers.Signer,
38
+ /** The address of the app to install */
39
+ app: Address,
40
+ /** The address of the space to install the app in */
41
+ spaceAddress: Address,
42
+ /** The price of the app in wei */
43
+ price: bigint,
44
+ /** The data to pass to the app's onInstall function */
45
+ data?: Uint8Array): Promise<ContractTransaction>;
46
+ /** To uninstall a smart contract app from a space */
47
+ uninstallApp(
48
+ /** The signer of the app owner */
49
+ signer: ethers.Signer,
50
+ /** The address of the app to uninstall */
51
+ app: Address,
52
+ /** The address of the space to uninstall the app from */
53
+ spaceAddress: Address,
54
+ /** The data to pass to the app's onUninstall function */
55
+ data?: Uint8Array): Promise<ContractTransaction>;
56
+ removeApp(signer: ethers.Signer, appId: string): Promise<ContractTransaction>;
57
+ getAppPrice(app: Address): Promise<BigNumber>;
58
+ getAppDuration(app: Address): Promise<number>;
59
+ getAppSchema(): Promise<string>;
60
+ getAppSchemaId(): Promise<string>;
61
+ isAppBanned(app: Address): Promise<boolean>;
62
+ getLatestAppId(app: Address): Promise<string>;
63
+ getAppById(appId: string): Promise<IAppRegistryBase.AppStructOutput>;
64
+ adminRegisterAppSchema(signer: ethers.Signer, schema: string, resolver: Address, revocable: boolean): Promise<ContractTransaction>;
65
+ adminBanApp(signer: ethers.Signer, app: Address): Promise<ContractTransaction>;
66
+ getAllAppsByOwner(targetOwner: Address, fromBlock?: number): Promise<BotInfo[]>;
67
+ }
68
+ //# sourceMappingURL=AppRegistryDapp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppRegistryDapp.d.ts","sourceRoot":"","sources":["../../src/app-registry/AppRegistryDapp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,EACR,wBAAwB,EACxB,gBAAgB,EACnB,MAAM,gDAAgD,CAAA;AAEvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAA;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,MAAM,MAAM,OAAO,GAAG;IAClB,KAAK,EAAE,OAAO,CAAA;IACd,GAAG,EAAE;QACD,MAAM,EAAE,OAAO,CAAA;QACf,MAAM,EAAE,OAAO,CAAA;QACf,KAAK,EAAE,OAAO,CAAA;QACd,WAAW,EAAE,UAAU,EAAE,CAAA;KAC5B,CAAA;CACJ,CAAA;AAED,qBAAa,eAAe;IACxB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