@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
@@ -0,0 +1,353 @@
1
+ import { IRuleEntitlementBase } from '@towns-labs/generated/dev/typings/IRuleEntitlement.sol/IRuleEntitlementV2';
2
+ import { IRuleEntitlementV2__factory } from '@towns-labs/generated/dev/typings/factories/IRuleEntitlement.sol/IRuleEntitlementV2__factory';
3
+ import { BaseContractShim } from '../../BaseContractShim';
4
+ import { BigNumberish, ethers } from 'ethers';
5
+ import { EntitlementModuleType, EntitlementModule } from '../../types/ContractTypes';
6
+ declare const abi: readonly [{
7
+ readonly type: "function";
8
+ readonly name: "description";
9
+ readonly inputs: readonly [];
10
+ readonly outputs: readonly [{
11
+ readonly name: "";
12
+ readonly type: "string";
13
+ readonly internalType: "string";
14
+ }];
15
+ readonly stateMutability: "view";
16
+ }, {
17
+ readonly type: "function";
18
+ readonly name: "encodeRuleData";
19
+ readonly inputs: readonly [{
20
+ readonly name: "data";
21
+ readonly type: "tuple";
22
+ readonly internalType: "struct IRuleEntitlementBase.RuleDataV2";
23
+ readonly components: readonly [{
24
+ readonly name: "operations";
25
+ readonly type: "tuple[]";
26
+ readonly internalType: "struct IRuleEntitlementBase.Operation[]";
27
+ readonly components: readonly [{
28
+ readonly name: "opType";
29
+ readonly type: "uint8";
30
+ readonly internalType: "enum IRuleEntitlementBase.CombinedOperationType";
31
+ }, {
32
+ readonly name: "index";
33
+ readonly type: "uint8";
34
+ readonly internalType: "uint8";
35
+ }];
36
+ }, {
37
+ readonly name: "checkOperations";
38
+ readonly type: "tuple[]";
39
+ readonly internalType: "struct IRuleEntitlementBase.CheckOperationV2[]";
40
+ readonly components: readonly [{
41
+ readonly name: "opType";
42
+ readonly type: "uint8";
43
+ readonly internalType: "enum IRuleEntitlementBase.CheckOperationType";
44
+ }, {
45
+ readonly name: "chainId";
46
+ readonly type: "uint256";
47
+ readonly internalType: "uint256";
48
+ }, {
49
+ readonly name: "contractAddress";
50
+ readonly type: "address";
51
+ readonly internalType: "address";
52
+ }, {
53
+ readonly name: "params";
54
+ readonly type: "bytes";
55
+ readonly internalType: "bytes";
56
+ }];
57
+ }, {
58
+ readonly name: "logicalOperations";
59
+ readonly type: "tuple[]";
60
+ readonly internalType: "struct IRuleEntitlementBase.LogicalOperation[]";
61
+ readonly components: readonly [{
62
+ readonly name: "logOpType";
63
+ readonly type: "uint8";
64
+ readonly internalType: "enum IRuleEntitlementBase.LogicalOperationType";
65
+ }, {
66
+ readonly name: "leftOperationIndex";
67
+ readonly type: "uint8";
68
+ readonly internalType: "uint8";
69
+ }, {
70
+ readonly name: "rightOperationIndex";
71
+ readonly type: "uint8";
72
+ readonly internalType: "uint8";
73
+ }];
74
+ }];
75
+ }];
76
+ readonly outputs: readonly [{
77
+ readonly name: "";
78
+ readonly type: "bytes";
79
+ readonly internalType: "bytes";
80
+ }];
81
+ readonly stateMutability: "pure";
82
+ }, {
83
+ readonly type: "function";
84
+ readonly name: "getEntitlementDataByRoleId";
85
+ readonly inputs: readonly [{
86
+ readonly name: "roleId";
87
+ readonly type: "uint256";
88
+ readonly internalType: "uint256";
89
+ }];
90
+ readonly outputs: readonly [{
91
+ readonly name: "";
92
+ readonly type: "bytes";
93
+ readonly internalType: "bytes";
94
+ }];
95
+ readonly stateMutability: "view";
96
+ }, {
97
+ readonly type: "function";
98
+ readonly name: "getRuleDataV2";
99
+ readonly inputs: readonly [{
100
+ readonly name: "roleId";
101
+ readonly type: "uint256";
102
+ readonly internalType: "uint256";
103
+ }];
104
+ readonly outputs: readonly [{
105
+ readonly name: "data";
106
+ readonly type: "tuple";
107
+ readonly internalType: "struct IRuleEntitlementBase.RuleDataV2";
108
+ readonly components: readonly [{
109
+ readonly name: "operations";
110
+ readonly type: "tuple[]";
111
+ readonly internalType: "struct IRuleEntitlementBase.Operation[]";
112
+ readonly components: readonly [{
113
+ readonly name: "opType";
114
+ readonly type: "uint8";
115
+ readonly internalType: "enum IRuleEntitlementBase.CombinedOperationType";
116
+ }, {
117
+ readonly name: "index";
118
+ readonly type: "uint8";
119
+ readonly internalType: "uint8";
120
+ }];
121
+ }, {
122
+ readonly name: "checkOperations";
123
+ readonly type: "tuple[]";
124
+ readonly internalType: "struct IRuleEntitlementBase.CheckOperationV2[]";
125
+ readonly components: readonly [{
126
+ readonly name: "opType";
127
+ readonly type: "uint8";
128
+ readonly internalType: "enum IRuleEntitlementBase.CheckOperationType";
129
+ }, {
130
+ readonly name: "chainId";
131
+ readonly type: "uint256";
132
+ readonly internalType: "uint256";
133
+ }, {
134
+ readonly name: "contractAddress";
135
+ readonly type: "address";
136
+ readonly internalType: "address";
137
+ }, {
138
+ readonly name: "params";
139
+ readonly type: "bytes";
140
+ readonly internalType: "bytes";
141
+ }];
142
+ }, {
143
+ readonly name: "logicalOperations";
144
+ readonly type: "tuple[]";
145
+ readonly internalType: "struct IRuleEntitlementBase.LogicalOperation[]";
146
+ readonly components: readonly [{
147
+ readonly name: "logOpType";
148
+ readonly type: "uint8";
149
+ readonly internalType: "enum IRuleEntitlementBase.LogicalOperationType";
150
+ }, {
151
+ readonly name: "leftOperationIndex";
152
+ readonly type: "uint8";
153
+ readonly internalType: "uint8";
154
+ }, {
155
+ readonly name: "rightOperationIndex";
156
+ readonly type: "uint8";
157
+ readonly internalType: "uint8";
158
+ }];
159
+ }];
160
+ }];
161
+ readonly stateMutability: "view";
162
+ }, {
163
+ readonly type: "function";
164
+ readonly name: "initialize";
165
+ readonly inputs: readonly [{
166
+ readonly name: "space";
167
+ readonly type: "address";
168
+ readonly internalType: "address";
169
+ }];
170
+ readonly outputs: readonly [];
171
+ readonly stateMutability: "nonpayable";
172
+ }, {
173
+ readonly type: "function";
174
+ readonly name: "isCrosschain";
175
+ readonly inputs: readonly [];
176
+ readonly outputs: readonly [{
177
+ readonly name: "";
178
+ readonly type: "bool";
179
+ readonly internalType: "bool";
180
+ }];
181
+ readonly stateMutability: "view";
182
+ }, {
183
+ readonly type: "function";
184
+ readonly name: "isEntitled";
185
+ readonly inputs: readonly [{
186
+ readonly name: "channelId";
187
+ readonly type: "bytes32";
188
+ readonly internalType: "bytes32";
189
+ }, {
190
+ readonly name: "user";
191
+ readonly type: "address[]";
192
+ readonly internalType: "address[]";
193
+ }, {
194
+ readonly name: "permission";
195
+ readonly type: "bytes32";
196
+ readonly internalType: "bytes32";
197
+ }];
198
+ readonly outputs: readonly [{
199
+ readonly name: "";
200
+ readonly type: "bool";
201
+ readonly internalType: "bool";
202
+ }];
203
+ readonly stateMutability: "view";
204
+ }, {
205
+ readonly type: "function";
206
+ readonly name: "moduleType";
207
+ readonly inputs: readonly [];
208
+ readonly outputs: readonly [{
209
+ readonly name: "";
210
+ readonly type: "string";
211
+ readonly internalType: "string";
212
+ }];
213
+ readonly stateMutability: "view";
214
+ }, {
215
+ readonly type: "function";
216
+ readonly name: "name";
217
+ readonly inputs: readonly [];
218
+ readonly outputs: readonly [{
219
+ readonly name: "";
220
+ readonly type: "string";
221
+ readonly internalType: "string";
222
+ }];
223
+ readonly stateMutability: "view";
224
+ }, {
225
+ readonly type: "function";
226
+ readonly name: "removeEntitlement";
227
+ readonly inputs: readonly [{
228
+ readonly name: "roleId";
229
+ readonly type: "uint256";
230
+ readonly internalType: "uint256";
231
+ }];
232
+ readonly outputs: readonly [];
233
+ readonly stateMutability: "nonpayable";
234
+ }, {
235
+ readonly type: "function";
236
+ readonly name: "setEntitlement";
237
+ readonly inputs: readonly [{
238
+ readonly name: "roleId";
239
+ readonly type: "uint256";
240
+ readonly internalType: "uint256";
241
+ }, {
242
+ readonly name: "entitlementData";
243
+ readonly type: "bytes";
244
+ readonly internalType: "bytes";
245
+ }];
246
+ readonly outputs: readonly [];
247
+ readonly stateMutability: "nonpayable";
248
+ }, {
249
+ readonly type: "error";
250
+ readonly name: "CheckOperationsLimitReaced";
251
+ readonly inputs: readonly [{
252
+ readonly name: "limit";
253
+ readonly type: "uint256";
254
+ readonly internalType: "uint256";
255
+ }];
256
+ }, {
257
+ readonly type: "error";
258
+ readonly name: "Entitlement__InvalidValue";
259
+ readonly inputs: readonly [];
260
+ }, {
261
+ readonly type: "error";
262
+ readonly name: "Entitlement__NotAllowed";
263
+ readonly inputs: readonly [];
264
+ }, {
265
+ readonly type: "error";
266
+ readonly name: "Entitlement__NotMember";
267
+ readonly inputs: readonly [];
268
+ }, {
269
+ readonly type: "error";
270
+ readonly name: "Entitlement__ValueAlreadyExists";
271
+ readonly inputs: readonly [];
272
+ }, {
273
+ readonly type: "error";
274
+ readonly name: "InvalidCheckOperationIndex";
275
+ readonly inputs: readonly [{
276
+ readonly name: "operationIndex";
277
+ readonly type: "uint8";
278
+ readonly internalType: "uint8";
279
+ }, {
280
+ readonly name: "checkOperationsLength";
281
+ readonly type: "uint8";
282
+ readonly internalType: "uint8";
283
+ }];
284
+ }, {
285
+ readonly type: "error";
286
+ readonly name: "InvalidLeftOperationIndex";
287
+ readonly inputs: readonly [{
288
+ readonly name: "leftOperationIndex";
289
+ readonly type: "uint8";
290
+ readonly internalType: "uint8";
291
+ }, {
292
+ readonly name: "currentOperationIndex";
293
+ readonly type: "uint8";
294
+ readonly internalType: "uint8";
295
+ }];
296
+ }, {
297
+ readonly type: "error";
298
+ readonly name: "InvalidLogicalOperationIndex";
299
+ readonly inputs: readonly [{
300
+ readonly name: "operationIndex";
301
+ readonly type: "uint8";
302
+ readonly internalType: "uint8";
303
+ }, {
304
+ readonly name: "logicalOperationsLength";
305
+ readonly type: "uint8";
306
+ readonly internalType: "uint8";
307
+ }];
308
+ }, {
309
+ readonly type: "error";
310
+ readonly name: "InvalidOperationType";
311
+ readonly inputs: readonly [{
312
+ readonly name: "opType";
313
+ readonly type: "uint8";
314
+ readonly internalType: "enum IRuleEntitlementBase.CombinedOperationType";
315
+ }];
316
+ }, {
317
+ readonly type: "error";
318
+ readonly name: "InvalidRightOperationIndex";
319
+ readonly inputs: readonly [{
320
+ readonly name: "rightOperationIndex";
321
+ readonly type: "uint8";
322
+ readonly internalType: "uint8";
323
+ }, {
324
+ readonly name: "currentOperationIndex";
325
+ readonly type: "uint8";
326
+ readonly internalType: "uint8";
327
+ }];
328
+ }, {
329
+ readonly type: "error";
330
+ readonly name: "LogicalOperationLimitReached";
331
+ readonly inputs: readonly [{
332
+ readonly name: "limit";
333
+ readonly type: "uint256";
334
+ readonly internalType: "uint256";
335
+ }];
336
+ }, {
337
+ readonly type: "error";
338
+ readonly name: "OperationsLimitReached";
339
+ readonly inputs: readonly [{
340
+ readonly name: "limit";
341
+ readonly type: "uint256";
342
+ readonly internalType: "uint256";
343
+ }];
344
+ }], connect: typeof IRuleEntitlementV2__factory.connect;
345
+ export { abi as IRuleEntitlementV2Abi };
346
+ export type { IRuleEntitlementBase as IRuleEntitlementV2Base, IRuleEntitlementV2, } from '@towns-labs/generated/dev/typings/IRuleEntitlement.sol/IRuleEntitlementV2';
347
+ export declare class RuleEntitlementV2Shim extends BaseContractShim<typeof connect> implements EntitlementModule {
348
+ constructor(address: string, provider: ethers.providers.Provider);
349
+ get moduleType(): EntitlementModuleType;
350
+ getRoleEntitlement(roleId: BigNumberish): Promise<IRuleEntitlementBase.RuleDataV2Struct | null>;
351
+ decodeGetRuleData(entitlementData: string): IRuleEntitlementBase.RuleDataV2Struct | undefined;
352
+ }
353
+ //# sourceMappingURL=RuleEntitlementV2Shim.d.ts.map
@@ -0,0 +1 @@
1
+ {"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AoB,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAWjD,iBAAiB,CACpB,eAAe,EAAE,MAAM,GACxB,oBAAoB,CAAC,gBAAgB,GAAG,SAAS;CAiBvD"}
@@ -0,0 +1,40 @@
1
+ import { IRuleEntitlementV2__factory } from '@towns-labs/generated/dev/typings/factories/IRuleEntitlement.sol/IRuleEntitlementV2__factory';
2
+ import { BaseContractShim } from '../../BaseContractShim';
3
+ import { EntitlementModuleType } from '../../types/ContractTypes';
4
+ import { dlogger } from '@towns-labs/utils';
5
+ const logger = dlogger('csb:SpaceDapp:debug');
6
+ const { abi, connect } = IRuleEntitlementV2__factory;
7
+ export { abi as IRuleEntitlementV2Abi };
8
+ export class RuleEntitlementV2Shim extends BaseContractShim {
9
+ constructor(address, provider) {
10
+ super(address, provider, connect, abi);
11
+ }
12
+ get moduleType() {
13
+ return EntitlementModuleType.RuleEntitlementV2;
14
+ }
15
+ async getRoleEntitlement(roleId) {
16
+ if (roleId === 0) {
17
+ return {
18
+ operations: [],
19
+ checkOperations: [],
20
+ logicalOperations: [],
21
+ };
22
+ }
23
+ return this.read.getRuleDataV2(roleId);
24
+ }
25
+ decodeGetRuleData(entitlementData) {
26
+ try {
27
+ const decoded = this.decodeFunctionResult('getRuleDataV2', entitlementData);
28
+ if (decoded.length === 0) {
29
+ logger.error('RuleEntitlementV2Shim No rule data', decoded);
30
+ return undefined;
31
+ }
32
+ return decoded.length > 0 ? decoded[0] : undefined;
33
+ }
34
+ catch (error) {
35
+ logger.error('RuleEntitlementV2Shim Error decoding RuleDataV2Struct', error);
36
+ }
37
+ return;
38
+ }
39
+ }
40
+ //# sourceMappingURL=RuleEntitlementV2Shim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RuleEntitlementV2Shim.js","sourceRoot":"","sources":["../../../src/space/entitlements/RuleEntitlementV2Shim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,8FAA8F,CAAA;AAC1I,OAAO,EAAE,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AAO,KAAK,EAAE,CAAC;YACb,MAAM,CAAC,KAAK,CAAC,uDAAuD,EAAE,KAAK,CAAC,CAAA;QAChF,CAAC;QACD,OAAM;IACV,CAAC;CACJ"}
@@ -0,0 +1,13 @@
1
+ import { BaseContractShim } from '../../BaseContractShim';
2
+ import { BigNumberish, ethers } from 'ethers';
3
+ import { EntitlementModuleType, EntitlementModule } from '../../types/ContractTypes';
4
+ import { UserEntitlement__factory } from '@towns-labs/generated/dev/typings/factories/UserEntitlement__factory';
5
+ declare const connect: typeof UserEntitlement__factory.connect;
6
+ export declare class UserEntitlementShim extends BaseContractShim<typeof connect> implements EntitlementModule {
7
+ constructor(address: string, provider: ethers.providers.Provider);
8
+ get moduleType(): EntitlementModuleType;
9
+ getRoleEntitlement(roleId: BigNumberish): Promise<string[]>;
10
+ decodeGetAddresses(entitlementData: string): string[] | undefined;
11
+ }
12
+ export {};
13
+ //# sourceMappingURL=UserEntitlementShim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserEntitlementShim.d.ts","sourceRoot":"","sources":["../../../src/space/entitlements/UserEntitlementShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAEpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sEAAsE,CAAA;AAI/G,QAAA,MAAa,OAAO,yCAA6B,CAAA;AAEjD,qBAAa,mBACT,SAAQ,gBAAgB,CAAC,OAAO,OAAO,CACvC,YAAW,iBAAiB;gBAEhB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;IAIhE,IAAW,UAAU,IAAI,qBAAqB,CAE7C;IAEY,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAcjE,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;CAe3E"}
@@ -0,0 +1,45 @@
1
+ import { BaseContractShim } from '../../BaseContractShim';
2
+ import { ethers } from 'ethers';
3
+ import { decodeUsers } from './ConvertersEntitlements';
4
+ import { EntitlementModuleType } from '../../types/ContractTypes';
5
+ import { dlogger } from '@towns-labs/utils';
6
+ import { UserEntitlement__factory } from '@towns-labs/generated/dev/typings/factories/UserEntitlement__factory';
7
+ const logger = dlogger('csb:UserEntitlementShim:debug');
8
+ const { abi, connect } = UserEntitlement__factory;
9
+ export class UserEntitlementShim extends BaseContractShim {
10
+ constructor(address, provider) {
11
+ super(address, provider, connect, abi);
12
+ }
13
+ get moduleType() {
14
+ return EntitlementModuleType.UserEntitlement;
15
+ }
16
+ async getRoleEntitlement(roleId) {
17
+ try {
18
+ const users = await this.read.getEntitlementDataByRoleId(roleId);
19
+ if (typeof users === 'string') {
20
+ return decodeUsers(users);
21
+ }
22
+ else {
23
+ return [];
24
+ }
25
+ }
26
+ catch (e) {
27
+ logger.error('Error getting role entitlement:', e);
28
+ throw e;
29
+ }
30
+ }
31
+ decodeGetAddresses(entitlementData) {
32
+ // where does this come from?
33
+ const abiDef = `[{"name":"getAddresses","outputs":[{"type":"address[]","name":"out"}],"constant":true,"payable":false,"type":"function"}]`;
34
+ const abi = new ethers.utils.Interface(abiDef);
35
+ try {
36
+ const decoded = abi.decodeFunctionResult('getAddresses', entitlementData);
37
+ return decoded.out;
38
+ }
39
+ catch (error) {
40
+ logger.error('RuleEntitlementShim Error decoding RuleDataStruct', error);
41
+ }
42
+ return;
43
+ }
44
+ }
45
+ //# sourceMappingURL=UserEntitlementShim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserEntitlementShim.js","sourceRoot":"","sources":["../../../src/space/entitlements/UserEntitlementShim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,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AC,CAAA;QAC9C,IAAI,CAAC;YACD,MAAM,OAAO,GAAG,GAAG,CAAC,oBAAoB,CACpC,cAAc,EACd,eAAe,CACc,CAAA;YACjC,OAAO,OAAO,CAAC,GAAG,CAAA;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,CAAC,KAAK,CAAC,mDAAmD,EAAE,KAAK,CAAC,CAAA;QAC5E,CAAC;QACD,OAAM;IACV,CAAC;CACJ"}
@@ -0,0 +1,14 @@
1
+ import { XchainConfig } from './entitlement';
2
+ export declare function getDefaultXChainIds(baseChainId: number): number[];
3
+ export type XchainConfigOptions = {
4
+ /**
5
+ * Whether to skip fetch setup when creating providers.
6
+ * Required for Cloudflare Workers where ethers.js's default fetch setup
7
+ * conflicts with the Worker's native fetch implementation.
8
+ */
9
+ skipFetchSetup?: boolean;
10
+ };
11
+ export declare function getXchainConfig(baseChainId: number, supportedXChainRpcMapping: {
12
+ [chainId: number]: string;
13
+ }, options?: XchainConfigOptions): XchainConfig;
14
+ //# sourceMappingURL=XChainConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XChainConfig.d.ts","sourceRoot":"","sources":["../../../src/space/entitlements/XChainConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AA+C5C,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CASjE;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AA0CD,wBAAgB,eAAe,CAC3B,WAAW,EAAE,MAAM,EACnB,yBAAyB,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EACxD,OAAO,GAAE,mBAAwB,GAClC,YAAY,CAQd"}
@@ -0,0 +1,70 @@
1
+ import { dlogger } from '@towns-labs/utils';
2
+ import { BASE_MAINNET, BASE_SEPOLIA } from '../../utils/Web3Constants';
3
+ const log = dlogger('csb:XChainConfig');
4
+ const DEFAULT_XCHAIN_IDs = [
5
+ // ethereum
6
+ 1,
7
+ // polygon
8
+ 137,
9
+ // arb
10
+ 42161,
11
+ // optimism
12
+ 10,
13
+ // base
14
+ 8453,
15
+ ];
16
+ function isDefined(value) {
17
+ return value !== undefined && value !== null;
18
+ }
19
+ // List of chains used across various deployment environments, and chain metadata.
20
+ // These settings are shared with the stream node.
21
+ const DEFAULT_BLOCKCHAIN_INFO = {
22
+ 1: { chainId: 1, isEtherNative: true, isEthereumNetwork: true }, // Eth mainnet
23
+ 11155111: { chainId: 11155111, isEtherNative: true, isEthereumNetwork: true }, // Eth Sepolia
24
+ 137: { chainId: 137, isEtherNative: false, isEthereumNetwork: false }, // Polygon currency is MATIC
25
+ 42161: { chainId: 42161, isEtherNative: true, isEthereumNetwork: false }, // Arb
26
+ 10: { chainId: 10, isEtherNative: true, isEthereumNetwork: false }, // Optimism
27
+ 8453: { chainId: 8453, isEtherNative: true, isEthereumNetwork: false }, // Base
28
+ 84532: { chainId: 84532, isEtherNative: true, isEthereumNetwork: false }, // Base Sepolia
29
+ 31337: { chainId: 31337, isEtherNative: true, isEthereumNetwork: false }, // Anvil base
30
+ 31338: { chainId: 31338, isEtherNative: true, isEthereumNetwork: false }, // Anvil river
31
+ 100: { chainId: 100, isEtherNative: false, isEthereumNetwork: false }, // Gnosis mainnet - uses XDai
32
+ 10200: { chainId: 10200, isEtherNative: false, isEthereumNetwork: false }, // Gnosis Chiado Testnet
33
+ };
34
+ export function getDefaultXChainIds(baseChainId) {
35
+ const ids = [...DEFAULT_XCHAIN_IDs];
36
+ // if we're not on base mainnet, add the testnet chains
37
+ if (baseChainId !== BASE_MAINNET) {
38
+ ids.push(BASE_SEPOLIA, 11155111);
39
+ }
40
+ return ids;
41
+ }
42
+ function marshallXChainConfig(supportedXChainIds, supportedXChainRpcMapping, chainInfo = DEFAULT_BLOCKCHAIN_INFO, options = {}) {
43
+ const filteredByRiverSupported = Object.entries(supportedXChainRpcMapping ?? {}).filter(([chainId, rpcUrl]) => isDefined(rpcUrl) && supportedXChainIds.includes(+chainId));
44
+ if (supportedXChainIds.length !== filteredByRiverSupported.length) {
45
+ log.warn('Some xchain rpc urls are missing from the supported xchains list');
46
+ }
47
+ const supportedRpcUrls = filteredByRiverSupported.reduce((acc, kvpair) => {
48
+ return {
49
+ ...acc,
50
+ [+kvpair[0]]: kvpair[1],
51
+ };
52
+ }, {});
53
+ const etherNativeNetworkIds = Object.keys(supportedRpcUrls)
54
+ .filter((key) => (+key) in chainInfo && chainInfo[+key].isEtherNative)
55
+ .reduce((acc, key) => [...acc, +key], []);
56
+ const ethereumNetworkIds = Object.keys(supportedRpcUrls)
57
+ .filter((key) => (+key) in chainInfo && chainInfo[+key].isEthereumNetwork)
58
+ .reduce((acc, key) => [...acc, +key], []);
59
+ return {
60
+ supportedRpcUrls,
61
+ etherNativeNetworkIds,
62
+ ethereumNetworkIds,
63
+ skipFetchSetup: options.skipFetchSetup,
64
+ };
65
+ }
66
+ export function getXchainConfig(baseChainId, supportedXChainRpcMapping, options = {}) {
67
+ const xChainIds = getDefaultXChainIds(baseChainId);
68
+ return marshallXChainConfig(xChainIds, supportedXChainRpcMapping, DEFAULT_BLOCKCHAIN_INFO, options);
69
+ }
70
+ //# sourceMappingURL=XChainConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XChainConfig.js","sourceRoot":"","sources":["../../../src/space/entitlements/XChainConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGtE,MAAM,GAAG,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAEvC,MAAM,kBAAkB,GAAG;IACvB,WAAW;IACX,CAAC;IACD,UAAU;IACV,GAAG;IACH,MAAM;IACN,KAAK;IACL,WAAW;IACX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