@towns-labs/web3 3.2.0 → 3.3.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 (334) hide show
  1. package/dist/cache/KVCacheStorage.d.ts +3 -3
  2. package/dist/cache/KVCacheStorage.d.ts.map +1 -1
  3. package/dist/cache/KVCacheStorage.js +10 -103
  4. package/dist/cache/KVCacheStorage.js.map +1 -1
  5. package/dist/cache/Keyable.d.ts +2 -3
  6. package/dist/cache/Keyable.d.ts.map +1 -1
  7. package/dist/cache/Keyable.js +1 -2
  8. package/dist/cache/Keyable.js.map +1 -1
  9. package/dist/eip-712/EIP-712.d.ts +16 -6
  10. package/dist/eip-712/EIP-712.d.ts.map +1 -1
  11. package/dist/eip-712/EIP-712.js +20 -8
  12. package/dist/eip-712/EIP-712.js.map +1 -1
  13. package/dist/index.d.ts +2 -77
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +2 -77
  16. package/dist/index.js.map +1 -1
  17. package/dist/test-helpers/MockERC1155.d.ts +1 -1
  18. package/dist/test-helpers/MockERC1155.d.ts.map +1 -1
  19. package/dist/test-helpers/MockERC20.d.ts +1 -1
  20. package/dist/test-helpers/MockERC20.d.ts.map +1 -1
  21. package/dist/types/ContractTypes.d.ts +0 -170
  22. package/dist/types/ContractTypes.d.ts.map +1 -1
  23. package/dist/types/ContractTypes.js +0 -32
  24. package/dist/types/ContractTypes.js.map +1 -1
  25. package/dist/utils/ut.d.ts +1 -4
  26. package/dist/utils/ut.d.ts.map +1 -1
  27. package/dist/utils/ut.js +2 -14
  28. package/dist/utils/ut.js.map +1 -1
  29. package/dist/utils/web3Env.js +1 -1
  30. package/dist/utils/web3Env.js.map +1 -1
  31. package/dist/utils/xchain.d.ts +21 -0
  32. package/dist/utils/xchain.d.ts.map +1 -0
  33. package/dist/{space/entitlements/XChainConfig.js → utils/xchain.js} +45 -29
  34. package/dist/utils/xchain.js.map +1 -0
  35. package/dist/web3Types.d.ts +33 -0
  36. package/dist/web3Types.d.ts.map +1 -0
  37. package/dist/web3Types.js +89 -0
  38. package/dist/web3Types.js.map +1 -0
  39. package/package.json +3 -5
  40. package/dist/BaseContractShim.d.ts +0 -57
  41. package/dist/BaseContractShim.d.ts.map +0 -1
  42. package/dist/BaseContractShim.js +0 -224
  43. package/dist/BaseContractShim.js.map +0 -1
  44. package/dist/airdrop/IDropFacetShim.d.ts +0 -9
  45. package/dist/airdrop/IDropFacetShim.d.ts.map +0 -1
  46. package/dist/airdrop/IDropFacetShim.js +0 -9
  47. package/dist/airdrop/IDropFacetShim.js.map +0 -1
  48. package/dist/airdrop/IRiverPointsShim.d.ts +0 -9
  49. package/dist/airdrop/IRiverPointsShim.d.ts.map +0 -1
  50. package/dist/airdrop/IRiverPointsShim.js +0 -9
  51. package/dist/airdrop/IRiverPointsShim.js.map +0 -1
  52. package/dist/airdrop/RiverAirdropDapp.d.ts +0 -16
  53. package/dist/airdrop/RiverAirdropDapp.d.ts.map +0 -1
  54. package/dist/airdrop/RiverAirdropDapp.js +0 -30
  55. package/dist/airdrop/RiverAirdropDapp.js.map +0 -1
  56. package/dist/app-registry/AppRegistryDapp.d.ts +0 -68
  57. package/dist/app-registry/AppRegistryDapp.d.ts.map +0 -1
  58. package/dist/app-registry/AppRegistryDapp.js +0 -182
  59. package/dist/app-registry/AppRegistryDapp.js.map +0 -1
  60. package/dist/app-registry/IAppFactoryShim.d.ts +0 -9
  61. package/dist/app-registry/IAppFactoryShim.d.ts.map +0 -1
  62. package/dist/app-registry/IAppFactoryShim.js +0 -9
  63. package/dist/app-registry/IAppFactoryShim.js.map +0 -1
  64. package/dist/app-registry/IAppInstallerShim.d.ts +0 -9
  65. package/dist/app-registry/IAppInstallerShim.d.ts.map +0 -1
  66. package/dist/app-registry/IAppInstallerShim.js +0 -9
  67. package/dist/app-registry/IAppInstallerShim.js.map +0 -1
  68. package/dist/app-registry/IAppRegistryShim.d.ts +0 -9
  69. package/dist/app-registry/IAppRegistryShim.d.ts.map +0 -1
  70. package/dist/app-registry/IAppRegistryShim.js +0 -9
  71. package/dist/app-registry/IAppRegistryShim.js.map +0 -1
  72. package/dist/app-registry/IIdentityRegistryShim.d.ts +0 -9
  73. package/dist/app-registry/IIdentityRegistryShim.d.ts.map +0 -1
  74. package/dist/app-registry/IIdentityRegistryShim.js +0 -9
  75. package/dist/app-registry/IIdentityRegistryShim.js.map +0 -1
  76. package/dist/app-registry/IReputationRegistryShim.d.ts +0 -9
  77. package/dist/app-registry/IReputationRegistryShim.d.ts.map +0 -1
  78. package/dist/app-registry/IReputationRegistryShim.js +0 -9
  79. package/dist/app-registry/IReputationRegistryShim.js.map +0 -1
  80. package/dist/app-registry/SimpleAppShim.d.ts +0 -9
  81. package/dist/app-registry/SimpleAppShim.d.ts.map +0 -1
  82. package/dist/app-registry/SimpleAppShim.js +0 -9
  83. package/dist/app-registry/SimpleAppShim.js.map +0 -1
  84. package/dist/base-registry/BaseRegistry.d.ts +0 -32
  85. package/dist/base-registry/BaseRegistry.d.ts.map +0 -1
  86. package/dist/base-registry/BaseRegistry.js +0 -67
  87. package/dist/base-registry/BaseRegistry.js.map +0 -1
  88. package/dist/base-registry/IEntitlementCheckerShim.d.ts +0 -9
  89. package/dist/base-registry/IEntitlementCheckerShim.d.ts.map +0 -1
  90. package/dist/base-registry/IEntitlementCheckerShim.js +0 -9
  91. package/dist/base-registry/IEntitlementCheckerShim.js.map +0 -1
  92. package/dist/base-registry/INodeOperatorShim.d.ts +0 -9
  93. package/dist/base-registry/INodeOperatorShim.d.ts.map +0 -1
  94. package/dist/base-registry/INodeOperatorShim.js +0 -9
  95. package/dist/base-registry/INodeOperatorShim.js.map +0 -1
  96. package/dist/base-registry/ISpaceDelegationShim.d.ts +0 -9
  97. package/dist/base-registry/ISpaceDelegationShim.d.ts.map +0 -1
  98. package/dist/base-registry/ISpaceDelegationShim.js +0 -9
  99. package/dist/base-registry/ISpaceDelegationShim.js.map +0 -1
  100. package/dist/base-registry/RewardsDistributionShim.d.ts +0 -9
  101. package/dist/base-registry/RewardsDistributionShim.d.ts.map +0 -1
  102. package/dist/base-registry/RewardsDistributionShim.js +0 -9
  103. package/dist/base-registry/RewardsDistributionShim.js.map +0 -1
  104. package/dist/delegate-registry/DelegateRegistry.d.ts +0 -3
  105. package/dist/delegate-registry/DelegateRegistry.d.ts.map +0 -1
  106. package/dist/delegate-registry/DelegateRegistry.js +0 -72
  107. package/dist/delegate-registry/DelegateRegistry.js.map +0 -1
  108. package/dist/erc-721/IERC721AQueryableShim.d.ts +0 -9
  109. package/dist/erc-721/IERC721AQueryableShim.d.ts.map +0 -1
  110. package/dist/erc-721/IERC721AQueryableShim.js +0 -9
  111. package/dist/erc-721/IERC721AQueryableShim.js.map +0 -1
  112. package/dist/erc-721/IERC721AShim.d.ts +0 -9
  113. package/dist/erc-721/IERC721AShim.d.ts.map +0 -1
  114. package/dist/erc-721/IERC721AShim.js +0 -9
  115. package/dist/erc-721/IERC721AShim.js.map +0 -1
  116. package/dist/platform-requirements/PlatformRequirements.d.ts +0 -12
  117. package/dist/platform-requirements/PlatformRequirements.d.ts.map +0 -1
  118. package/dist/platform-requirements/PlatformRequirements.js +0 -18
  119. package/dist/platform-requirements/PlatformRequirements.js.map +0 -1
  120. package/dist/pricing-modules/IPricingShim.d.ts +0 -9
  121. package/dist/pricing-modules/IPricingShim.d.ts.map +0 -1
  122. package/dist/pricing-modules/IPricingShim.js +0 -9
  123. package/dist/pricing-modules/IPricingShim.js.map +0 -1
  124. package/dist/pricing-modules/PricingModules.d.ts +0 -13
  125. package/dist/pricing-modules/PricingModules.d.ts.map +0 -1
  126. package/dist/pricing-modules/PricingModules.js +0 -23
  127. package/dist/pricing-modules/PricingModules.js.map +0 -1
  128. package/dist/pricing-modules/helpers.d.ts +0 -16
  129. package/dist/pricing-modules/helpers.d.ts.map +0 -1
  130. package/dist/pricing-modules/helpers.js +0 -35
  131. package/dist/pricing-modules/helpers.js.map +0 -1
  132. package/dist/readContractRetryer.d.ts +0 -10
  133. package/dist/readContractRetryer.d.ts.map +0 -1
  134. package/dist/readContractRetryer.js +0 -68
  135. package/dist/readContractRetryer.js.map +0 -1
  136. package/dist/river-registry/IOperatorRegistryShim.d.ts +0 -9
  137. package/dist/river-registry/IOperatorRegistryShim.d.ts.map +0 -1
  138. package/dist/river-registry/IOperatorRegistryShim.js +0 -9
  139. package/dist/river-registry/IOperatorRegistryShim.js.map +0 -1
  140. package/dist/river-registry/IStreamRegistryShim.d.ts +0 -9
  141. package/dist/river-registry/IStreamRegistryShim.d.ts.map +0 -1
  142. package/dist/river-registry/IStreamRegistryShim.js +0 -9
  143. package/dist/river-registry/IStreamRegistryShim.js.map +0 -1
  144. package/dist/river-registry/RiverRegistry.d.ts +0 -18
  145. package/dist/river-registry/RiverRegistry.d.ts.map +0 -1
  146. package/dist/river-registry/RiverRegistry.js +0 -42
  147. package/dist/river-registry/RiverRegistry.js.map +0 -1
  148. package/dist/river-registry/RiverRegistryFactory.d.ts +0 -5
  149. package/dist/river-registry/RiverRegistryFactory.d.ts.map +0 -1
  150. package/dist/river-registry/RiverRegistryFactory.js +0 -5
  151. package/dist/river-registry/RiverRegistryFactory.js.map +0 -1
  152. package/dist/space/IAppAccountShim.d.ts +0 -9
  153. package/dist/space/IAppAccountShim.d.ts.map +0 -1
  154. package/dist/space/IAppAccountShim.js +0 -9
  155. package/dist/space/IAppAccountShim.js.map +0 -1
  156. package/dist/space/IBanningShim.d.ts +0 -9
  157. package/dist/space/IBanningShim.d.ts.map +0 -1
  158. package/dist/space/IBanningShim.js +0 -9
  159. package/dist/space/IBanningShim.js.map +0 -1
  160. package/dist/space/IChannelShim.d.ts +0 -9
  161. package/dist/space/IChannelShim.d.ts.map +0 -1
  162. package/dist/space/IChannelShim.js +0 -9
  163. package/dist/space/IChannelShim.js.map +0 -1
  164. package/dist/space/IEntitlementDataQueryableShim.d.ts +0 -11
  165. package/dist/space/IEntitlementDataQueryableShim.d.ts.map +0 -1
  166. package/dist/space/IEntitlementDataQueryableShim.js +0 -9
  167. package/dist/space/IEntitlementDataQueryableShim.js.map +0 -1
  168. package/dist/space/IEntitlementsShim.d.ts +0 -13
  169. package/dist/space/IEntitlementsShim.d.ts.map +0 -1
  170. package/dist/space/IEntitlementsShim.js +0 -19
  171. package/dist/space/IEntitlementsShim.js.map +0 -1
  172. package/dist/space/IMembershipMetadataShim.d.ts +0 -9
  173. package/dist/space/IMembershipMetadataShim.d.ts.map +0 -1
  174. package/dist/space/IMembershipMetadataShim.js +0 -9
  175. package/dist/space/IMembershipMetadataShim.js.map +0 -1
  176. package/dist/space/IMembershipShim.d.ts +0 -33
  177. package/dist/space/IMembershipShim.d.ts.map +0 -1
  178. package/dist/space/IMembershipShim.js +0 -139
  179. package/dist/space/IMembershipShim.js.map +0 -1
  180. package/dist/space/IMulticallShim.d.ts +0 -13
  181. package/dist/space/IMulticallShim.d.ts.map +0 -1
  182. package/dist/space/IMulticallShim.js +0 -15
  183. package/dist/space/IMulticallShim.js.map +0 -1
  184. package/dist/space/IReviewShim.d.ts +0 -64
  185. package/dist/space/IReviewShim.d.ts.map +0 -1
  186. package/dist/space/IReviewShim.js +0 -102
  187. package/dist/space/IReviewShim.js.map +0 -1
  188. package/dist/space/IRolesShim.d.ts +0 -10
  189. package/dist/space/IRolesShim.d.ts.map +0 -1
  190. package/dist/space/IRolesShim.js +0 -9
  191. package/dist/space/IRolesShim.js.map +0 -1
  192. package/dist/space/ITippingShim.d.ts +0 -39
  193. package/dist/space/ITippingShim.d.ts.map +0 -1
  194. package/dist/space/ITippingShim.js +0 -76
  195. package/dist/space/ITippingShim.js.map +0 -1
  196. package/dist/space/ITreasuryShim.d.ts +0 -9
  197. package/dist/space/ITreasuryShim.d.ts.map +0 -1
  198. package/dist/space/ITreasuryShim.js +0 -9
  199. package/dist/space/ITreasuryShim.js.map +0 -1
  200. package/dist/space/OwnableFacetShim.d.ts +0 -12
  201. package/dist/space/OwnableFacetShim.d.ts.map +0 -1
  202. package/dist/space/OwnableFacetShim.js +0 -19
  203. package/dist/space/OwnableFacetShim.js.map +0 -1
  204. package/dist/space/Space.d.ts +0 -107
  205. package/dist/space/Space.d.ts.map +0 -1
  206. package/dist/space/Space.js +0 -511
  207. package/dist/space/Space.js.map +0 -1
  208. package/dist/space/TokenPausableFacetShim.d.ts +0 -9
  209. package/dist/space/TokenPausableFacetShim.d.ts.map +0 -1
  210. package/dist/space/TokenPausableFacetShim.js +0 -9
  211. package/dist/space/TokenPausableFacetShim.js.map +0 -1
  212. package/dist/space/entitlements/ConvertersEntitlements.d.ts +0 -14
  213. package/dist/space/entitlements/ConvertersEntitlements.d.ts.map +0 -1
  214. package/dist/space/entitlements/ConvertersEntitlements.js +0 -193
  215. package/dist/space/entitlements/ConvertersEntitlements.js.map +0 -1
  216. package/dist/space/entitlements/RuleBuilder.d.ts +0 -83
  217. package/dist/space/entitlements/RuleBuilder.d.ts.map +0 -1
  218. package/dist/space/entitlements/RuleBuilder.js +0 -86
  219. package/dist/space/entitlements/RuleBuilder.js.map +0 -1
  220. package/dist/space/entitlements/RuleEntitlementShim.d.ts +0 -353
  221. package/dist/space/entitlements/RuleEntitlementShim.d.ts.map +0 -1
  222. package/dist/space/entitlements/RuleEntitlementShim.js +0 -40
  223. package/dist/space/entitlements/RuleEntitlementShim.js.map +0 -1
  224. package/dist/space/entitlements/RuleEntitlementV2Shim.d.ts +0 -353
  225. package/dist/space/entitlements/RuleEntitlementV2Shim.d.ts.map +0 -1
  226. package/dist/space/entitlements/RuleEntitlementV2Shim.js +0 -40
  227. package/dist/space/entitlements/RuleEntitlementV2Shim.js.map +0 -1
  228. package/dist/space/entitlements/UserEntitlementShim.d.ts +0 -13
  229. package/dist/space/entitlements/UserEntitlementShim.d.ts.map +0 -1
  230. package/dist/space/entitlements/UserEntitlementShim.js +0 -45
  231. package/dist/space/entitlements/UserEntitlementShim.js.map +0 -1
  232. package/dist/space/entitlements/XChainConfig.d.ts +0 -14
  233. package/dist/space/entitlements/XChainConfig.d.ts.map +0 -1
  234. package/dist/space/entitlements/XChainConfig.js.map +0 -1
  235. package/dist/space/entitlements/entitlement.d.ts +0 -147
  236. package/dist/space/entitlements/entitlement.d.ts.map +0 -1
  237. package/dist/space/entitlements/entitlement.js +0 -940
  238. package/dist/space/entitlements/entitlement.js.map +0 -1
  239. package/dist/space/entitlements/validateAndParseXChainConfig.d.ts +0 -6
  240. package/dist/space/entitlements/validateAndParseXChainConfig.d.ts.map +0 -1
  241. package/dist/space/entitlements/validateAndParseXChainConfig.js +0 -34
  242. package/dist/space/entitlements/validateAndParseXChainConfig.js.map +0 -1
  243. package/dist/space-dapp/SpaceDapp.d.ts +0 -223
  244. package/dist/space-dapp/SpaceDapp.d.ts.map +0 -1
  245. package/dist/space-dapp/SpaceDapp.js +0 -1260
  246. package/dist/space-dapp/SpaceDapp.js.map +0 -1
  247. package/dist/space-dapp/SpaceDappFactory.d.ts +0 -5
  248. package/dist/space-dapp/SpaceDappFactory.d.ts.map +0 -1
  249. package/dist/space-dapp/SpaceDappFactory.js +0 -8
  250. package/dist/space-dapp/SpaceDappFactory.js.map +0 -1
  251. package/dist/space-dapp/wrapTransaction.d.ts +0 -4
  252. package/dist/space-dapp/wrapTransaction.d.ts.map +0 -1
  253. package/dist/space-dapp/wrapTransaction.js +0 -99
  254. package/dist/space-dapp/wrapTransaction.js.map +0 -1
  255. package/dist/space-owner/GuardianFacetShim.d.ts +0 -9
  256. package/dist/space-owner/GuardianFacetShim.d.ts.map +0 -1
  257. package/dist/space-owner/GuardianFacetShim.js +0 -9
  258. package/dist/space-owner/GuardianFacetShim.js.map +0 -1
  259. package/dist/space-owner/SpaceOwner.d.ts +0 -48
  260. package/dist/space-owner/SpaceOwner.d.ts.map +0 -1
  261. package/dist/space-owner/SpaceOwner.js +0 -81
  262. package/dist/space-owner/SpaceOwner.js.map +0 -1
  263. package/dist/space-registrar/ICreateSpaceShim.d.ts +0 -11
  264. package/dist/space-registrar/ICreateSpaceShim.d.ts.map +0 -1
  265. package/dist/space-registrar/ICreateSpaceShim.js +0 -9
  266. package/dist/space-registrar/ICreateSpaceShim.js.map +0 -1
  267. package/dist/space-registrar/ILegacySpaceArchitectShim.d.ts +0 -10
  268. package/dist/space-registrar/ILegacySpaceArchitectShim.d.ts.map +0 -1
  269. package/dist/space-registrar/ILegacySpaceArchitectShim.js +0 -9
  270. package/dist/space-registrar/ILegacySpaceArchitectShim.js.map +0 -1
  271. package/dist/space-registrar/ISpaceArchitectShim.d.ts +0 -10
  272. package/dist/space-registrar/ISpaceArchitectShim.d.ts.map +0 -1
  273. package/dist/space-registrar/ISpaceArchitectShim.js +0 -39
  274. package/dist/space-registrar/ISpaceArchitectShim.js.map +0 -1
  275. package/dist/space-registrar/SpaceRegistrar.d.ts +0 -27
  276. package/dist/space-registrar/SpaceRegistrar.d.ts.map +0 -1
  277. package/dist/space-registrar/SpaceRegistrar.js +0 -58
  278. package/dist/space-registrar/SpaceRegistrar.js.map +0 -1
  279. package/dist/test-helpers/LocalhostWeb3Provider.d.ts +0 -19
  280. package/dist/test-helpers/LocalhostWeb3Provider.d.ts.map +0 -1
  281. package/dist/test-helpers/LocalhostWeb3Provider.js +0 -80
  282. package/dist/test-helpers/LocalhostWeb3Provider.js.map +0 -1
  283. package/dist/test-helpers/MockCrossChainEntitlement.d.ts +0 -6
  284. package/dist/test-helpers/MockCrossChainEntitlement.d.ts.map +0 -1
  285. package/dist/test-helpers/MockCrossChainEntitlement.js +0 -104
  286. package/dist/test-helpers/MockCrossChainEntitlement.js.map +0 -1
  287. package/dist/test-helpers/MockERC721AShim.d.ts +0 -9
  288. package/dist/test-helpers/MockERC721AShim.d.ts.map +0 -1
  289. package/dist/test-helpers/MockERC721AShim.js +0 -9
  290. package/dist/test-helpers/MockERC721AShim.js.map +0 -1
  291. package/dist/test-helpers/TestCrossChainEntitlement.d.ts +0 -14
  292. package/dist/test-helpers/TestCrossChainEntitlement.d.ts.map +0 -1
  293. package/dist/test-helpers/TestCrossChainEntitlement.js +0 -99
  294. package/dist/test-helpers/TestCrossChainEntitlement.js.map +0 -1
  295. package/dist/test-helpers/TestGatingERC1155.d.ts +0 -17
  296. package/dist/test-helpers/TestGatingERC1155.d.ts.map +0 -1
  297. package/dist/test-helpers/TestGatingERC1155.js +0 -100
  298. package/dist/test-helpers/TestGatingERC1155.js.map +0 -1
  299. package/dist/test-helpers/TestGatingERC20.d.ts +0 -17
  300. package/dist/test-helpers/TestGatingERC20.d.ts.map +0 -1
  301. package/dist/test-helpers/TestGatingERC20.js +0 -149
  302. package/dist/test-helpers/TestGatingERC20.js.map +0 -1
  303. package/dist/test-helpers/TestGatingNFT.d.ts +0 -17
  304. package/dist/test-helpers/TestGatingNFT.d.ts.map +0 -1
  305. package/dist/test-helpers/TestGatingNFT.js +0 -137
  306. package/dist/test-helpers/TestGatingNFT.js.map +0 -1
  307. package/dist/test-helpers/TestGatingUtils.d.ts +0 -15
  308. package/dist/test-helpers/TestGatingUtils.d.ts.map +0 -1
  309. package/dist/test-helpers/TestGatingUtils.js +0 -112
  310. package/dist/test-helpers/TestGatingUtils.js.map +0 -1
  311. package/dist/test-helpers/utils.d.ts +0 -22
  312. package/dist/test-helpers/utils.d.ts.map +0 -1
  313. package/dist/test-helpers/utils.js +0 -30
  314. package/dist/test-helpers/utils.js.map +0 -1
  315. package/dist/towns-token/TownsToken.d.ts +0 -17
  316. package/dist/towns-token/TownsToken.d.ts.map +0 -1
  317. package/dist/towns-token/TownsToken.js +0 -33
  318. package/dist/towns-token/TownsToken.js.map +0 -1
  319. package/dist/types/typechain.d.ts +0 -4
  320. package/dist/types/typechain.d.ts.map +0 -1
  321. package/dist/types/typechain.js +0 -2
  322. package/dist/types/typechain.js.map +0 -1
  323. package/dist/utils/ContractHelpers.d.ts +0 -14
  324. package/dist/utils/ContractHelpers.d.ts.map +0 -1
  325. package/dist/utils/ContractHelpers.js +0 -54
  326. package/dist/utils/ContractHelpers.js.map +0 -1
  327. package/dist/wallet-link/WalletLink.d.ts +0 -58
  328. package/dist/wallet-link/WalletLink.d.ts.map +0 -1
  329. package/dist/wallet-link/WalletLink.js +0 -226
  330. package/dist/wallet-link/WalletLink.js.map +0 -1
  331. package/dist/wallet-link/WalletLinkShim.d.ts +0 -9
  332. package/dist/wallet-link/WalletLinkShim.d.ts.map +0 -1
  333. package/dist/wallet-link/WalletLinkShim.js +0 -9
  334. package/dist/wallet-link/WalletLinkShim.js.map +0 -1
@@ -1,9 +0,0 @@
1
- import { BaseContractShim } from '../BaseContractShim';
2
- import { IBanning__factory } from '@towns-labs/generated/dev/typings/factories/IBanning__factory';
3
- const { abi, connect } = IBanning__factory;
4
- export class IBanningShim extends BaseContractShim {
5
- constructor(address, provider) {
6
- super(address, provider, connect, abi);
7
- }
8
- }
9
- //# sourceMappingURL=IBanningShim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IBanningShim.js","sourceRoot":"","sources":["../../src/space/IBanningShim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+DAA+D,CAAA;AAEjG,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,iBAAiB,CAAA;AAE1C,MAAM,OAAO,YAAa,SAAQ,gBAAgC;IAC9D,YAAY,OAAe,EAAE,QAAmC;QAC5D,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;IAC1C,CAAC;CACJ"}
@@ -1,9 +0,0 @@
1
- import { ethers } from 'ethers';
2
- import { BaseContractShim } from '../BaseContractShim';
3
- import { Channels__factory } from '@towns-labs/generated/dev/typings/factories/Channels__factory';
4
- declare const connect: typeof Channels__factory.connect;
5
- export type { IChannelBase } from '@towns-labs/generated/dev/typings/IChannel';
6
- export declare class IChannelShim extends BaseContractShim<typeof connect> {
7
- constructor(address: string, provider: ethers.providers.Provider);
8
- }
9
- //# sourceMappingURL=IChannelShim.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IChannelShim.d.ts","sourceRoot":"","sources":["../../src/space/IChannelShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+DAA+D,CAAA;AAEjG,QAAA,MAAa,OAAO,kCAAsB,CAAA;AAE1C,YAAY,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAA;AAE9E,qBAAa,YAAa,SAAQ,gBAAgB,CAAC,OAAO,OAAO,CAAC;gBAClD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;CAGnE"}
@@ -1,9 +0,0 @@
1
- import { BaseContractShim } from '../BaseContractShim';
2
- import { Channels__factory } from '@towns-labs/generated/dev/typings/factories/Channels__factory';
3
- const { abi, connect } = Channels__factory;
4
- export class IChannelShim extends BaseContractShim {
5
- constructor(address, provider) {
6
- super(address, provider, connect, abi);
7
- }
8
- }
9
- //# sourceMappingURL=IChannelShim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IChannelShim.js","sourceRoot":"","sources":["../../src/space/IChannelShim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+DAA+D,CAAA;AAEjG,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,iBAAiB,CAAA;AAI1C,MAAM,OAAO,YAAa,SAAQ,gBAAgC;IAC9D,YAAY,OAAe,EAAE,QAAmC;QAC5D,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;IAC1C,CAAC;CACJ"}
@@ -1,11 +0,0 @@
1
- import { ethers } from 'ethers';
2
- import { BaseContractShim } from '../BaseContractShim';
3
- import { IEntitlementDataQueryable__factory } from '@towns-labs/generated/dev/typings/factories/IEntitlementDataQueryable__factory';
4
- import { IEntitlementDataQueryableBase } from '@towns-labs/generated/dev/typings/IEntitlementDataQueryable';
5
- declare const connect: typeof IEntitlementDataQueryable__factory.connect;
6
- export declare class IEntitlementDataQueryableShim extends BaseContractShim<typeof connect> {
7
- constructor(address: string, provider: ethers.providers.Provider);
8
- }
9
- export type EntitlementDataStructOutput = IEntitlementDataQueryableBase.EntitlementDataStructOutput;
10
- export {};
11
- //# sourceMappingURL=IEntitlementDataQueryableShim.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IEntitlementDataQueryableShim.d.ts","sourceRoot":"","sources":["../../src/space/IEntitlementDataQueryableShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,kCAAkC,EAAE,MAAM,gFAAgF,CAAA;AACnI,OAAO,EAAE,6BAA6B,EAAE,MAAM,6DAA6D,CAAA;AAE3G,QAAA,MAAa,OAAO,mDAAuC,CAAA;AAE3D,qBAAa,6BAA8B,SAAQ,gBAAgB,CAAC,OAAO,OAAO,CAAC;gBACnE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;CAGnE;AAED,MAAM,MAAM,2BAA2B,GAAG,6BAA6B,CAAC,2BAA2B,CAAA"}
@@ -1,9 +0,0 @@
1
- import { BaseContractShim } from '../BaseContractShim';
2
- import { IEntitlementDataQueryable__factory } from '@towns-labs/generated/dev/typings/factories/IEntitlementDataQueryable__factory';
3
- const { abi, connect } = IEntitlementDataQueryable__factory;
4
- export class IEntitlementDataQueryableShim extends BaseContractShim {
5
- constructor(address, provider) {
6
- super(address, provider, connect, abi);
7
- }
8
- }
9
- //# sourceMappingURL=IEntitlementDataQueryableShim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IEntitlementDataQueryableShim.js","sourceRoot":"","sources":["../../src/space/IEntitlementDataQueryableShim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,kCAAkC,EAAE,MAAM,gFAAgF,CAAA;AAGnI,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,kCAAkC,CAAA;AAE3D,MAAM,OAAO,6BAA8B,SAAQ,gBAAgC;IAC/E,YAAY,OAAe,EAAE,QAAmC;QAC5D,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;IAC1C,CAAC;CACJ"}
@@ -1,13 +0,0 @@
1
- import { EntitlementsManager__factory } from '@towns-labs/generated/dev/typings/factories/EntitlementsManager__factory';
2
- import { ethers } from 'ethers';
3
- import { IEntitlementsManagerBase } from '@towns-labs/generated/dev/typings/IEntitlementsManager';
4
- import { BaseContractShim } from '../BaseContractShim';
5
- import { SpaceDappCreateStorageFn } from '../space-dapp/SpaceDapp';
6
- declare const connect: typeof EntitlementsManager__factory.connect;
7
- export type { IEntitlementsManagerBase as IEntitlementsBase };
8
- export declare class IEntitlementsShim extends BaseContractShim<typeof connect> {
9
- private readonly getEntitlementsCache;
10
- constructor(address: string, provider: ethers.providers.Provider, createStorageFn: SpaceDappCreateStorageFn | undefined);
11
- getEntitlements(): Promise<IEntitlementsManagerBase.EntitlementStructOutput[]>;
12
- }
13
- //# sourceMappingURL=IEntitlementsShim.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IEntitlementsShim.d.ts","sourceRoot":"","sources":["../../src/space/IEntitlementsShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,0EAA0E,CAAA;AACvH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAA;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAGtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAElE,QAAA,MAAa,OAAO,6CAAiC,CAAA;AAErD,YAAY,EAAE,wBAAwB,IAAI,iBAAiB,EAAE,CAAA;AAE7D,qBAAa,iBAAkB,SAAQ,gBAAgB,CAAC,OAAO,OAAO,CAAC;IACnE,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAEpC;gBAGG,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,EACnC,eAAe,EAAE,wBAAwB,GAAG,SAAS;IAU5C,eAAe,IAAI,OAAO,CAAC,wBAAwB,CAAC,uBAAuB,EAAE,CAAC;CAM9F"}
@@ -1,19 +0,0 @@
1
- import { EntitlementsManager__factory } from '@towns-labs/generated/dev/typings/factories/EntitlementsManager__factory';
2
- import { BaseContractShim } from '../BaseContractShim';
3
- import { Keyable } from '../cache/Keyable';
4
- import { SimpleCache } from '../cache/SimpleCache';
5
- const { abi, connect } = EntitlementsManager__factory;
6
- export class IEntitlementsShim extends BaseContractShim {
7
- getEntitlementsCache;
8
- constructor(address, provider, createStorageFn) {
9
- super(address, provider, connect, abi);
10
- this.getEntitlementsCache = new SimpleCache({
11
- ttlSeconds: 15 * 60,
12
- createStorageFn,
13
- });
14
- }
15
- async getEntitlements() {
16
- return this.getEntitlementsCache.executeUsingCache(Keyable.getEntitlements(this.address), async () => this.read.getEntitlements());
17
- }
18
- }
19
- //# sourceMappingURL=IEntitlementsShim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IEntitlementsShim.js","sourceRoot":"","sources":["../../src/space/IEntitlementsShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,0EAA0E,CAAA;AAGvH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAGlD,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,4BAA4B,CAAA;AAIrD,MAAM,OAAO,iBAAkB,SAAQ,gBAAgC;IAClD,oBAAoB,CAEpC;IAED,YACI,OAAe,EACf,QAAmC,EACnC,eAAqD;QAErD,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;QAEtC,IAAI,CAAC,oBAAoB,GAAG,IAAI,WAAW,CAAC;YACxC,UAAU,EAAE,EAAE,GAAG,EAAE;YACnB,eAAe;SAClB,CAAC,CAAA;IACN,CAAC;IAEM,KAAK,CAAC,eAAe;QACxB,OAAO,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAC9C,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,EACrC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAC1C,CAAA;IACL,CAAC;CACJ"}
@@ -1,9 +0,0 @@
1
- import { ethers } from 'ethers';
2
- import { BaseContractShim } from '../BaseContractShim';
3
- import { IMembershipMetadata__factory } from '@towns-labs/generated/dev/typings/factories/IMembershipMetadata__factory';
4
- declare const connect: typeof IMembershipMetadata__factory.connect;
5
- export declare class IMembershipMetadataShim extends BaseContractShim<typeof connect> {
6
- constructor(address: string, provider: ethers.providers.Provider);
7
- }
8
- export {};
9
- //# sourceMappingURL=IMembershipMetadataShim.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IMembershipMetadataShim.d.ts","sourceRoot":"","sources":["../../src/space/IMembershipMetadataShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,0EAA0E,CAAA;AAEvH,QAAA,MAAa,OAAO,6CAAiC,CAAA;AAErD,qBAAa,uBAAwB,SAAQ,gBAAgB,CAAC,OAAO,OAAO,CAAC;gBAC7D,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;CAGnE"}
@@ -1,9 +0,0 @@
1
- import { BaseContractShim } from '../BaseContractShim';
2
- import { IMembershipMetadata__factory } from '@towns-labs/generated/dev/typings/factories/IMembershipMetadata__factory';
3
- const { abi, connect } = IMembershipMetadata__factory;
4
- export class IMembershipMetadataShim extends BaseContractShim {
5
- constructor(address, provider) {
6
- super(address, provider, connect, abi);
7
- }
8
- }
9
- //# sourceMappingURL=IMembershipMetadataShim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IMembershipMetadataShim.js","sourceRoot":"","sources":["../../src/space/IMembershipMetadataShim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,0EAA0E,CAAA;AAEvH,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,4BAA4B,CAAA;AAErD,MAAM,OAAO,uBAAwB,SAAQ,gBAAgC;IACzE,YAAY,OAAe,EAAE,QAAmC;QAC5D,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;IAC1C,CAAC;CACJ"}
@@ -1,33 +0,0 @@
1
- import { ContractTransaction, ethers, Signer } from 'ethers';
2
- import { BaseContractShim, OverrideExecution } from '../BaseContractShim';
3
- import { IMembershipMetadataShim } from './IMembershipMetadataShim';
4
- import { MembershipFacet__factory } from '@towns-labs/generated/dev/typings/factories/MembershipFacet__factory';
5
- import { IMulticallShim } from './IMulticallShim';
6
- import { TransactionOpts } from '../types/ContractTypes';
7
- declare const connect: typeof MembershipFacet__factory.connect;
8
- export declare class IMembershipShim extends BaseContractShim<typeof connect> {
9
- private erc721Shim;
10
- metadata: IMembershipMetadataShim;
11
- multicall: IMulticallShim;
12
- constructor(address: string, provider: ethers.providers.Provider);
13
- getMembershipRenewalPrice(tokenId: string): Promise<bigint>;
14
- renewMembership<T = ContractTransaction>(args: {
15
- tokenId: string;
16
- signer: Signer;
17
- overrideExecution?: OverrideExecution<T>;
18
- transactionOpts?: TransactionOpts;
19
- }): Promise<T extends undefined ? ContractTransaction : T>;
20
- listenForMembershipToken(args: {
21
- receiver: string;
22
- startingBlock: number;
23
- providedAbortController?: AbortController;
24
- }): () => Promise<{
25
- issued: true;
26
- tokenId: string;
27
- } | {
28
- issued: false;
29
- tokenId: undefined;
30
- }>;
31
- }
32
- export {};
33
- //# sourceMappingURL=IMembershipShim.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IMembershipShim.d.ts","sourceRoot":"","sources":["../../src/space/IMembershipShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sEAAsE,CAAA;AAE/G,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAGxD,QAAA,MAAa,OAAO,yCAA6B,CAAA;AAEjD,qBAAa,eAAgB,SAAQ,gBAAgB,CAAC,OAAO,OAAO,CAAC;IACjE,OAAO,CAAC,UAAU,CAAc;IAChC,QAAQ,EAAE,uBAAuB,CAAA;IACjC,SAAS,EAAE,cAAc,CAAA;gBAEb,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;IAOnD,yBAAyB,CAAC,OAAO,EAAE,MAAM;IAIzC,eAAe,CAAC,CAAC,GAAG,mBAAmB,EAAE,IAAI,EAAE;QACxD,OAAO,EAAE,MAAM,CAAA;QACf,MAAM,EAAE,MAAM,CAAA;QACd,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA;QACxC,eAAe,CAAC,EAAE,eAAe,CAAA;KACpC;IAuBD,wBAAwB,CAAC,IAAI,EAAE;QAC3B,QAAQ,EAAE,MAAM,CAAA;QAChB,aAAa,EAAE,MAAM,CAAA;QACrB,uBAAuB,CAAC,EAAE,eAAe,CAAA;KAC5C,GAAG,MAAM,OAAO,CAAC;QAAE,MAAM,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,MAAM,EAAE,KAAK,CAAC;QAAC,OAAO,EAAE,SAAS,CAAA;KAAE,CAAC;CAgH/F"}
@@ -1,139 +0,0 @@
1
- import { BigNumber } from 'ethers';
2
- import { BaseContractShim } from '../BaseContractShim';
3
- import { dlogger } from '@towns-labs/utils';
4
- import { IMembershipMetadataShim } from './IMembershipMetadataShim';
5
- import { MembershipFacet__factory } from '@towns-labs/generated/dev/typings/factories/MembershipFacet__factory';
6
- import { IERC721AShim } from '../erc-721/IERC721AShim';
7
- import { IMulticallShim } from './IMulticallShim';
8
- const logger = dlogger('csb:IMembershipShim');
9
- const { abi, connect } = MembershipFacet__factory;
10
- export class IMembershipShim extends BaseContractShim {
11
- erc721Shim;
12
- metadata;
13
- multicall;
14
- constructor(address, provider) {
15
- super(address, provider, connect, abi);
16
- this.erc721Shim = new IERC721AShim(address, provider);
17
- this.metadata = new IMembershipMetadataShim(address, provider);
18
- this.multicall = new IMulticallShim(address, provider);
19
- }
20
- async getMembershipRenewalPrice(tokenId) {
21
- return (await this.read.getMembershipRenewalPrice(tokenId)).toBigInt();
22
- }
23
- async renewMembership(args) {
24
- const { tokenId, signer, overrideExecution, transactionOpts } = args;
25
- const renewalPrice = await this.getMembershipRenewalPrice(tokenId);
26
- return this.executeCall({
27
- signer,
28
- functionName: 'renewMembership',
29
- args: [tokenId],
30
- value: renewalPrice,
31
- overrideExecution,
32
- transactionOpts,
33
- });
34
- }
35
- // If the caller doesn't provide an abort controller, create one and set a timeout
36
- // to abort the call after 20 seconds.
37
- // exmample:
38
- // const startListener = space.Membership.listenForMembershipToken({
39
- // receiver: recipient,
40
- // startingBlock: blockNumber,
41
- // })
42
- // await txn()
43
- // const result = await startListener()
44
- listenForMembershipToken(args) {
45
- const { receiver, providedAbortController, startingBlock } = args;
46
- return async () => {
47
- const contract = this.read;
48
- const provider = contract.provider;
49
- const iface = contract.interface;
50
- const issuedFilter = contract.filters['MembershipTokenIssued(address,uint256)'](receiver);
51
- const rejectedFilter = contract.filters['MembershipTokenRejected(address)'](receiver);
52
- const abortController = providedAbortController ?? new AbortController();
53
- const abortTimeout = providedAbortController
54
- ? undefined
55
- : setTimeout(() => {
56
- logger.error('joinSpace timeout');
57
- abortController.abort();
58
- }, 20_000);
59
- const pollingInterval = 1_000;
60
- let lastCheckedBlock = startingBlock;
61
- return new Promise((resolve) => {
62
- let active = true;
63
- const cleanup = () => {
64
- active = false;
65
- clearInterval(intervalId);
66
- abortController.signal.removeEventListener('abort', onAbort);
67
- if (abortTimeout) {
68
- clearTimeout(abortTimeout);
69
- }
70
- };
71
- const onAbort = () => {
72
- cleanup();
73
- resolve({ issued: false, tokenId: undefined });
74
- };
75
- abortController.signal.addEventListener('abort', onAbort);
76
- const intervalId = setInterval(() => {
77
- void (async () => {
78
- if (!active) {
79
- return;
80
- }
81
- const currentBlock = await provider.getBlockNumber();
82
- if (currentBlock <= lastCheckedBlock) {
83
- return;
84
- }
85
- try {
86
- // check for both issued and rejected logs
87
- const [issuedLogs, rejectedLogs] = await Promise.all([
88
- provider.getLogs({
89
- ...issuedFilter,
90
- fromBlock: lastCheckedBlock + 1,
91
- toBlock: currentBlock,
92
- }),
93
- provider.getLogs({
94
- ...rejectedFilter,
95
- fromBlock: lastCheckedBlock + 1,
96
- toBlock: currentBlock,
97
- }),
98
- ]);
99
- for (const log of issuedLogs) {
100
- const parsed = iface.parseLog(log);
101
- const { recipient, tokenId } = parsed.args;
102
- if (recipient &&
103
- typeof recipient === 'string' &&
104
- recipient === receiver) {
105
- logger.log('MembershipTokenIssued', {
106
- receiver,
107
- recipient,
108
- tokenId,
109
- });
110
- cleanup();
111
- resolve({
112
- issued: true,
113
- tokenId: BigNumber.from(tokenId).toString(),
114
- });
115
- return;
116
- }
117
- }
118
- for (const log of rejectedLogs) {
119
- const parsed = iface.parseLog(log);
120
- const { recipient } = parsed.args;
121
- if (recipient === receiver) {
122
- logger.log('MembershipTokenRejected', { receiver, recipient });
123
- cleanup();
124
- resolve({ issued: false, tokenId: undefined });
125
- return;
126
- }
127
- }
128
- lastCheckedBlock = currentBlock;
129
- }
130
- catch (err) {
131
- logger.error('Log polling error', err);
132
- }
133
- })();
134
- }, pollingInterval);
135
- });
136
- };
137
- }
138
- }
139
- //# sourceMappingURL=IMembershipShim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IMembershipShim.js","sourceRoot":"","sources":["../../src/space/IMembershipShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuC,MAAM,QAAQ,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAqB,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sEAAsE,CAAA;AAC/G,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,MAAM,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAE7C,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,wBAAwB,CAAA;AAEjD,MAAM,OAAO,eAAgB,SAAQ,gBAAgC;IACzD,UAAU,CAAc;IAChC,QAAQ,CAAyB;IACjC,SAAS,C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ACF,OAAM;gCACV,CAAC;4BACL,CAAC;4BAED,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;gCAC7B,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;gCAClC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,IAAI,CAAA;gCACjC,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;oCACzB,MAAM,CAAC,GAAG,CAAC,yBAAyB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAA;oCAC9D,OAAO,EAAE,CAAA;oCACT,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAA;oCAC9C,OAAM;gCACV,CAAC;4BACL,CAAC;4BAED,gBAAgB,GAAG,YAAY,CAAA;wBACnC,CAAC;wBAAC,OAAO,GAAG,EAAE,CAAC;4BACX,MAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAA;wBAC1C,CAAC;oBACL,CAAC,CAAC,EAAE,CAAA;gBACR,CAAC,EAAE,eAAe,CAAC,CAAA;YACvB,CAAC,CAAC,CAAA;QACN,CAAC,CAAA;IACL,CAAC;CACJ"}
@@ -1,13 +0,0 @@
1
- import { IMulticall__factory } from '@towns-labs/generated/dev/typings/factories/IMulticall__factory';
2
- import { ethers } from 'ethers';
3
- import { BaseContractShim } from '../BaseContractShim';
4
- declare const connect: typeof IMulticall__factory.connect;
5
- export declare class IMulticallShim extends BaseContractShim<typeof connect> {
6
- constructor(address: string, provider: ethers.providers.Provider);
7
- makeCalls<T>(args: {
8
- encoder: () => string[];
9
- decoder: (result: string) => T;
10
- }): Promise<T[]>;
11
- }
12
- export {};
13
- //# sourceMappingURL=IMulticallShim.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IMulticallShim.d.ts","sourceRoot":"","sources":["../../src/space/IMulticallShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iEAAiE,CAAA;AACrG,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,QAAA,MAAa,OAAO,oCAAwB,CAAA;AAE5C,qBAAa,cAAe,SAAQ,gBAAgB,CAAC,OAAO,OAAO,CAAC;gBACpD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;IAInD,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,CAAA;KAAE;CAM9F"}
@@ -1,15 +0,0 @@
1
- import { IMulticall__factory } from '@towns-labs/generated/dev/typings/factories/IMulticall__factory';
2
- import { BaseContractShim } from '../BaseContractShim';
3
- const { abi, connect } = IMulticall__factory;
4
- export class IMulticallShim extends BaseContractShim {
5
- constructor(address, provider) {
6
- super(address, provider, connect, abi);
7
- }
8
- async makeCalls(args) {
9
- const { encoder, decoder } = args;
10
- const calldata = encoder();
11
- const results = await this.read.callStatic.multicall(calldata);
12
- return results.map((result) => decoder(result));
13
- }
14
- }
15
- //# sourceMappingURL=IMulticallShim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IMulticallShim.js","sourceRoot":"","sources":["../../src/space/IMulticallShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iEAAiE,CAAA;AAErG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,mBAAmB,CAAA;AAE5C,MAAM,OAAO,cAAe,SAAQ,gBAAgC;IAChE,YAAY,OAAe,EAAE,QAAmC;QAC5D,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;IAC1C,CAAC;IAEM,KAAK,CAAC,SAAS,CAAI,IAAiE;QACvF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;QACjC,MAAM,QAAQ,GAAG,OAAO,EAAE,CAAA;QAC1B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;QAC9D,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;IACnD,CAAC;CACJ"}
@@ -1,64 +0,0 @@
1
- import { ReviewStorage } from '@towns-labs/generated/dev/typings/IReview';
2
- import { ContractTransaction, ethers } from 'ethers';
3
- import { BaseContractShim } from '../BaseContractShim';
4
- import { Address } from 'abitype';
5
- import { IReview__factory } from '@towns-labs/generated/dev/typings/factories/IReview__factory';
6
- export declare enum SpaceReviewAction {
7
- None = -1,
8
- Add = 0,
9
- Update = 1,
10
- Delete = 2
11
- }
12
- export interface SpaceReviewEventObject {
13
- action: SpaceReviewAction;
14
- user: string;
15
- comment?: string;
16
- rating: number;
17
- }
18
- export interface ReviewParams {
19
- rating: number;
20
- comment: string;
21
- }
22
- declare const connect: typeof IReview__factory.connect;
23
- export declare class IReviewShim extends BaseContractShim<typeof connect> {
24
- constructor(address: string, provider: ethers.providers.Provider);
25
- /**
26
- * Get the review for a user
27
- * @param userAddress - The address of the user to get the review for
28
- * @returns The review for the user
29
- */
30
- getReview(userAddress: Address): Promise<ReviewStorage.ContentStructOutput>;
31
- /**
32
- * Get all reviews
33
- * @returns All reviews
34
- */
35
- getAllReviews(): Promise<[
36
- string[],
37
- ReviewStorage.ContentStructOutput[]
38
- ] & {
39
- users: string[];
40
- reviews: ReviewStorage.ContentStructOutput[];
41
- }>;
42
- addReview(params: ReviewParams, signer: ethers.Signer): Promise<ContractTransaction>;
43
- updateReview(params: ReviewParams, signer: ethers.Signer): Promise<ContractTransaction>;
44
- deleteReview(signer: ethers.Signer): Promise<ContractTransaction>;
45
- private encodeReviewParams;
46
- }
47
- export declare function getSpaceReviewEventDataBin(binLogs: {
48
- topics: Uint8Array[];
49
- data: Uint8Array;
50
- address: Uint8Array;
51
- }[], from: Uint8Array): SpaceReviewEventObject;
52
- /**
53
- * Get the review event data from a receipt, public static for ease of use in the SDK
54
- * @param receipt - The receipt of the transaction
55
- * @param senderAddress - The address of the sender
56
- * @returns The review event data
57
- */
58
- export declare function getSpaceReviewEventData(logs: {
59
- topics: string[];
60
- data: string;
61
- address: string;
62
- }[], senderAddress: string): SpaceReviewEventObject;
63
- export {};
64
- //# sourceMappingURL=IReviewShim.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IReviewShim.d.ts","sourceRoot":"","sources":["../../src/space/IReviewShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAA;AAEzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAA;AAG/F,oBAAY,iBAAiB;IACzB,IAAI,KAAK;IACT,GAAG,IAAI;IACP,MAAM,IAAI;IACV,MAAM,IAAI;CACb;AAED,MAAM,WAAW,sBAAsB;IACnC,MAAM,EAAE,iBAAiB,CAAA;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,YAAY;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAClB;AAED,QAAA,MAAa,OAAO,iCAAqB,CAAA;AAEzC,qBAAa,WAAY,SAAQ,gBAAgB,CAAC,OAAO,OAAO,CAAC;gBACjD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;IAIhE;;;;OAIG;IACU,SAAS,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,mBAAmB,CAAC;IAKxF;;;OAGG;IACU,aAAa,IAAI,OAAO,CACjC;QAAC,MAAM,EAAE;QAAE,aAAa,CAAC,mBAAmB,EAAE;KAAC,GAAG;QAC9C,KAAK,EAAE,MAAM,EAAE,CAAA;QACf,OAAO,EAAE,aAAa,CAAC,mBAAmB,EAAE,CAAA;KAC/C,CACJ;IAKY,SAAS,CAClB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,GACtB,OAAO,CAAC,mBAAmB,CAAC;IAIlB,YAAY,CACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,GACtB,OAAO,CAAC,mBAAmB,CAAC;IAOlB,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAO9E,OAAO,CAAC,kBAAkB;CAM7B;AAED,wBAAgB,0BAA0B,CACtC,OAAO,EAAE;IAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAE,EAAE,EAC1E,IAAI,EAAE,UAAU,GACjB,sBAAsB,CASxB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACnC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,EAC3D,aAAa,EAAE,MAAM,GACtB,sBAAsB,CAyCxB"}
@@ -1,102 +0,0 @@
1
- import { ethers } from 'ethers';
2
- import { BaseContractShim } from '../BaseContractShim';
3
- import { bin_toHexString } from '@towns-labs/utils';
4
- import { IReview__factory } from '@towns-labs/generated/dev/typings/factories/IReview__factory';
5
- // solidity doesn't export enums, so we need to define them here, boooooo
6
- export var SpaceReviewAction;
7
- (function (SpaceReviewAction) {
8
- SpaceReviewAction[SpaceReviewAction["None"] = -1] = "None";
9
- SpaceReviewAction[SpaceReviewAction["Add"] = 0] = "Add";
10
- SpaceReviewAction[SpaceReviewAction["Update"] = 1] = "Update";
11
- SpaceReviewAction[SpaceReviewAction["Delete"] = 2] = "Delete";
12
- })(SpaceReviewAction || (SpaceReviewAction = {}));
13
- const { abi, connect } = IReview__factory;
14
- export class IReviewShim extends BaseContractShim {
15
- constructor(address, provider) {
16
- super(address, provider, connect, abi);
17
- }
18
- /**
19
- * Get the review for a user
20
- * @param userAddress - The address of the user to get the review for
21
- * @returns The review for the user
22
- */
23
- async getReview(userAddress) {
24
- const review = await this.read.getReview(userAddress);
25
- return review;
26
- }
27
- /**
28
- * Get all reviews
29
- * @returns All reviews
30
- */
31
- async getAllReviews() {
32
- const reviews = await this.read.getAllReviews();
33
- return reviews;
34
- }
35
- async addReview(params, signer) {
36
- return this.write(signer).setReview(SpaceReviewAction.Add, this.encodeReviewParams(params));
37
- }
38
- async updateReview(params, signer) {
39
- return this.write(signer).setReview(SpaceReviewAction.Update, this.encodeReviewParams(params));
40
- }
41
- async deleteReview(signer) {
42
- return this.write(signer).setReview(SpaceReviewAction.Delete, ethers.utils.defaultAbiCoder.encode(['string'], ['']));
43
- }
44
- encodeReviewParams(params) {
45
- return ethers.utils.defaultAbiCoder.encode(['tuple(string,uint8)'], [[params.comment, params.rating]]);
46
- }
47
- }
48
- export function getSpaceReviewEventDataBin(binLogs, from) {
49
- const logs = binLogs.map((log) => ({
50
- address: '0x' + bin_toHexString(log.address),
51
- topics: log.topics.map((topic) => '0x' + bin_toHexString(topic)),
52
- data: '0x' + bin_toHexString(log.data),
53
- })) ?? [];
54
- const senderWallet = '0x' + bin_toHexString(from);
55
- return getSpaceReviewEventData(logs, senderWallet);
56
- }
57
- /**
58
- * Get the review event data from a receipt, public static for ease of use in the SDK
59
- * @param receipt - The receipt of the transaction
60
- * @param senderAddress - The address of the sender
61
- * @returns The review event data
62
- */
63
- export function getSpaceReviewEventData(logs, senderAddress) {
64
- const contractInterface = IReview__factory.createInterface();
65
- for (const log of logs) {
66
- try {
67
- const parsedLog = contractInterface.parseLog(log);
68
- if (parsedLog.name === 'ReviewAdded' &&
69
- parsedLog.args.user.toLowerCase() === senderAddress.toLowerCase()) {
70
- return {
71
- user: parsedLog.args.user,
72
- comment: parsedLog.args.comment,
73
- rating: parsedLog.args.rating,
74
- action: SpaceReviewAction.Add,
75
- };
76
- }
77
- else if (parsedLog.name === 'ReviewUpdated' &&
78
- parsedLog.args.user.toLowerCase() === senderAddress.toLowerCase()) {
79
- return {
80
- user: parsedLog.args.user,
81
- comment: parsedLog.args.comment,
82
- rating: parsedLog.args.rating,
83
- action: SpaceReviewAction.Update,
84
- };
85
- }
86
- else if (parsedLog.name === 'ReviewDeleted' &&
87
- parsedLog.args.user.toLowerCase() === senderAddress.toLowerCase()) {
88
- return {
89
- user: parsedLog.args.user,
90
- comment: undefined,
91
- rating: 0,
92
- action: SpaceReviewAction.Delete,
93
- };
94
- }
95
- }
96
- catch {
97
- // no need for error, this log is not from the contract we're interested in
98
- }
99
- }
100
- return { user: '', comment: undefined, rating: 0, action: SpaceReviewAction.None };
101
- }
102
- //# sourceMappingURL=IReviewShim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IReviewShim.js","sourceRoot":"","sources":["../../src/space/IReviewShim.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAA;AAE/F,yEAAyE;AACzE,MAAM,CAAN,IAAY,iBA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BaseContractShim } from '../BaseContractShim';
3
- import { Roles__factory } from '@towns-labs/generated/dev/typings/factories/Roles__factory';
4
- import { IRolesBase } from '@towns-labs/generated/dev/typings/IRoles';
5
- export type { IRolesBase };
6
- declare const connect: typeof Roles__factory.connect;
7
- export declare class IRolesShim extends BaseContractShim<typeof connect> {
8
- constructor(address: string, provider: ethers.providers.Provider);
9
- }
10
- //# sourceMappingURL=IRolesShim.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IRolesShim.d.ts","sourceRoot":"","sources":["../../src/space/IRolesShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,4DAA4D,CAAA;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAA;AACrE,YAAY,EAAE,UAAU,EAAE,CAAA;AAE1B,QAAA,MAAa,OAAO,+BAAmB,CAAA;AAEvC,qBAAa,UAAW,SAAQ,gBAAgB,CAAC,OAAO,OAAO,CAAC;gBAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;CAGnE"}
@@ -1,9 +0,0 @@
1
- import { BaseContractShim } from '../BaseContractShim';
2
- import { Roles__factory } from '@towns-labs/generated/dev/typings/factories/Roles__factory';
3
- const { abi, connect } = Roles__factory;
4
- export class IRolesShim extends BaseContractShim {
5
- constructor(address, provider) {
6
- super(address, provider, connect, abi);
7
- }
8
- }
9
- //# sourceMappingURL=IRolesShim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IRolesShim.js","sourceRoot":"","sources":["../../src/space/IRolesShim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,4DAA4D,CAAA;AAI3F,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,cAAc,CAAA;AAEvC,MAAM,OAAO,UAAW,SAAQ,gBAAgC;IAC5D,YAAY,OAAe,EAAE,QAAmC;QAC5D,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;IAC1C,CAAC;CACJ"}
@@ -1,39 +0,0 @@
1
- import { TipEventObject as GeneratedTipEventObject } from '@towns-labs/generated/dev/typings/ITipping';
2
- import { ITipping__factory } from '@towns-labs/generated/dev/typings/factories/ITipping__factory';
3
- import { BaseContractShim } from '../BaseContractShim';
4
- import { ContractReceipt, ethers, BigNumber } from 'ethers';
5
- declare const connect: typeof ITipping__factory.connect;
6
- export type TipEventObject = GeneratedTipEventObject;
7
- export declare enum TipRecipientType {
8
- Member = 0,
9
- Bot = 1,
10
- Any = 2
11
- }
12
- export type TipSentEventObject = {
13
- sender: string;
14
- receiver: string;
15
- recipientType: TipRecipientType;
16
- currency: string;
17
- amount: BigNumber;
18
- tokenId: BigNumber | undefined;
19
- messageId: string;
20
- channelId: string;
21
- };
22
- export declare class ITippingShim extends BaseContractShim<typeof connect> {
23
- constructor(address: string, provider: ethers.providers.Provider);
24
- /**
25
- * Get the total number of tips by currency
26
- * @param currency - The currency to get the total tips for
27
- * @returns The total number of tips by currency
28
- */
29
- totalTipsByCurrency(currency: string): Promise<bigint>;
30
- /**
31
- * Get the tip amount by currency
32
- * @param currency - The currency to get the tip amount for
33
- * @returns The tip amount by currency
34
- */
35
- tipAmountByCurrency(currency: string): Promise<bigint>;
36
- getTipEvent(receipt: ContractReceipt, senderAddress: string): TipSentEventObject | undefined;
37
- }
38
- export {};
39
- //# sourceMappingURL=ITippingShim.d.ts.map