@safe-global/protocol-kit 0.1.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 (238) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +984 -0
  3. package/dist/src/Safe.d.ts +383 -0
  4. package/dist/src/Safe.js +715 -0
  5. package/dist/src/Safe.js.map +1 -0
  6. package/dist/src/adapters/ethers/EthersAdapter.d.ts +53 -0
  7. package/dist/src/adapters/ethers/EthersAdapter.js +189 -0
  8. package/dist/src/adapters/ethers/EthersAdapter.js.map +1 -0
  9. package/dist/src/adapters/ethers/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerEthersContract.d.ts +9 -0
  10. package/dist/src/adapters/ethers/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerEthersContract.js +15 -0
  11. package/dist/src/adapters/ethers/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerEthersContract.js.map +1 -0
  12. package/dist/src/adapters/ethers/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandler_V1_3_0_Ethers.d.ts +7 -0
  13. package/dist/src/adapters/ethers/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandler_V1_3_0_Ethers.js +14 -0
  14. package/dist/src/adapters/ethers/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandler_V1_3_0_Ethers.js.map +1 -0
  15. package/dist/src/adapters/ethers/contracts/CreateCall/CreateCallEthersContract.d.ts +13 -0
  16. package/dist/src/adapters/ethers/contracts/CreateCall/CreateCallEthersContract.js +37 -0
  17. package/dist/src/adapters/ethers/contracts/CreateCall/CreateCallEthersContract.js.map +1 -0
  18. package/dist/src/adapters/ethers/contracts/CreateCall/v1.3.0/CreateCallEthersContract_V1_3_0_Ethers.d.ts +7 -0
  19. package/dist/src/adapters/ethers/contracts/CreateCall/v1.3.0/CreateCallEthersContract_V1_3_0_Ethers.js +14 -0
  20. package/dist/src/adapters/ethers/contracts/CreateCall/v1.3.0/CreateCallEthersContract_V1_3_0_Ethers.js.map +1 -0
  21. package/dist/src/adapters/ethers/contracts/GnosisSafe/GnosisSafeContractEthers.d.ts +28 -0
  22. package/dist/src/adapters/ethers/contracts/GnosisSafe/GnosisSafeContractEthers.js +91 -0
  23. package/dist/src/adapters/ethers/contracts/GnosisSafe/GnosisSafeContractEthers.js.map +1 -0
  24. package/dist/src/adapters/ethers/contracts/GnosisSafe/v1.0.0/GnosisSafeContract_V1_0_0_Ethers.d.ts +12 -0
  25. package/dist/src/adapters/ethers/contracts/GnosisSafe/v1.0.0/GnosisSafeContract_V1_0_0_Ethers.js +34 -0
  26. package/dist/src/adapters/ethers/contracts/GnosisSafe/v1.0.0/GnosisSafeContract_V1_0_0_Ethers.js.map +1 -0
  27. package/dist/src/adapters/ethers/contracts/GnosisSafe/v1.1.1/GnosisSafeContract_V1_1_1_Ethers.d.ts +12 -0
  28. package/dist/src/adapters/ethers/contracts/GnosisSafe/v1.1.1/GnosisSafeContract_V1_1_1_Ethers.js +34 -0
  29. package/dist/src/adapters/ethers/contracts/GnosisSafe/v1.1.1/GnosisSafeContract_V1_1_1_Ethers.js.map +1 -0
  30. package/dist/src/adapters/ethers/contracts/GnosisSafe/v1.2.0/GnosisSafeContract_V1_2_0_Ethers.d.ts +12 -0
  31. package/dist/src/adapters/ethers/contracts/GnosisSafe/v1.2.0/GnosisSafeContract_V1_2_0_Ethers.js +32 -0
  32. package/dist/src/adapters/ethers/contracts/GnosisSafe/v1.2.0/GnosisSafeContract_V1_2_0_Ethers.js.map +1 -0
  33. package/dist/src/adapters/ethers/contracts/GnosisSafe/v1.3.0/GnosisSafeContract_V1_3_0_Ethers.d.ts +12 -0
  34. package/dist/src/adapters/ethers/contracts/GnosisSafe/v1.3.0/GnosisSafeContract_V1_3_0_Ethers.js +33 -0
  35. package/dist/src/adapters/ethers/contracts/GnosisSafe/v1.3.0/GnosisSafeContract_V1_3_0_Ethers.js.map +1 -0
  36. package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/GnosisSafeProxyFactoryEthersContract.d.ts +22 -0
  37. package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/GnosisSafeProxyFactoryEthersContract.js +47 -0
  38. package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/GnosisSafeProxyFactoryEthersContract.js.map +1 -0
  39. package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/v1.0.0/GnosisSafeProxyFactoryContract_V1_0_0_Ethers.d.ts +7 -0
  40. package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/v1.0.0/GnosisSafeProxyFactoryContract_V1_0_0_Ethers.js +14 -0
  41. package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/v1.0.0/GnosisSafeProxyFactoryContract_V1_0_0_Ethers.js.map +1 -0
  42. package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/v1.1.1/GnosisSafeProxyFactoryContract_V1_1_1_Ethers.d.ts +7 -0
  43. package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/v1.1.1/GnosisSafeProxyFactoryContract_V1_1_1_Ethers.js +14 -0
  44. package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/v1.1.1/GnosisSafeProxyFactoryContract_V1_1_1_Ethers.js.map +1 -0
  45. package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/v1.3.0/GnosisSafeProxyFactoryContract_V1_3_0_Ethers.d.ts +7 -0
  46. package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/v1.3.0/GnosisSafeProxyFactoryContract_V1_3_0_Ethers.js +14 -0
  47. package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/v1.3.0/GnosisSafeProxyFactoryContract_V1_3_0_Ethers.js.map +1 -0
  48. package/dist/src/adapters/ethers/contracts/MultiSend/MultiSendEthersContract.d.ts +10 -0
  49. package/dist/src/adapters/ethers/contracts/MultiSend/MultiSendEthersContract.js +15 -0
  50. package/dist/src/adapters/ethers/contracts/MultiSend/MultiSendEthersContract.js.map +1 -0
  51. package/dist/src/adapters/ethers/contracts/MultiSend/v1.1.1/MultiSendContract_V1_1_1_Ethers.d.ts +7 -0
  52. package/dist/src/adapters/ethers/contracts/MultiSend/v1.1.1/MultiSendContract_V1_1_1_Ethers.js +14 -0
  53. package/dist/src/adapters/ethers/contracts/MultiSend/v1.1.1/MultiSendContract_V1_1_1_Ethers.js.map +1 -0
  54. package/dist/src/adapters/ethers/contracts/MultiSend/v1.3.0/MultiSendContract_V1_3_0_Ethers.d.ts +7 -0
  55. package/dist/src/adapters/ethers/contracts/MultiSend/v1.3.0/MultiSendContract_V1_3_0_Ethers.js +14 -0
  56. package/dist/src/adapters/ethers/contracts/MultiSend/v1.3.0/MultiSendContract_V1_3_0_Ethers.js.map +1 -0
  57. package/dist/src/adapters/ethers/contracts/MultiSendCallOnly/MultiSendCallOnlyEthersContract.d.ts +9 -0
  58. package/dist/src/adapters/ethers/contracts/MultiSendCallOnly/MultiSendCallOnlyEthersContract.js +15 -0
  59. package/dist/src/adapters/ethers/contracts/MultiSendCallOnly/MultiSendCallOnlyEthersContract.js.map +1 -0
  60. package/dist/src/adapters/ethers/contracts/MultiSendCallOnly/v1.3.0/MultiSendCallOnlyContract_V1_3_0_Ethers.d.ts +7 -0
  61. package/dist/src/adapters/ethers/contracts/MultiSendCallOnly/v1.3.0/MultiSendCallOnlyContract_V1_3_0_Ethers.js +14 -0
  62. package/dist/src/adapters/ethers/contracts/MultiSendCallOnly/v1.3.0/MultiSendCallOnlyContract_V1_3_0_Ethers.js.map +1 -0
  63. package/dist/src/adapters/ethers/contracts/SignMessageLib/SignMessageLibEthersContract.d.ts +13 -0
  64. package/dist/src/adapters/ethers/contracts/SignMessageLib/SignMessageLibEthersContract.js +29 -0
  65. package/dist/src/adapters/ethers/contracts/SignMessageLib/SignMessageLibEthersContract.js.map +1 -0
  66. package/dist/src/adapters/ethers/contracts/SignMessageLib/v1.3.0/SignMessageLibContract_V1_3_0_Ethers.d.ts +7 -0
  67. package/dist/src/adapters/ethers/contracts/SignMessageLib/v1.3.0/SignMessageLibContract_V1_3_0_Ethers.js +14 -0
  68. package/dist/src/adapters/ethers/contracts/SignMessageLib/v1.3.0/SignMessageLibContract_V1_3_0_Ethers.js.map +1 -0
  69. package/dist/src/adapters/ethers/contracts/contractInstancesEthers.d.ts +23 -0
  70. package/dist/src/adapters/ethers/contracts/contractInstancesEthers.js +139 -0
  71. package/dist/src/adapters/ethers/contracts/contractInstancesEthers.js.map +1 -0
  72. package/dist/src/adapters/ethers/index.d.ts +9 -0
  73. package/dist/src/adapters/ethers/index.js +21 -0
  74. package/dist/src/adapters/ethers/index.js.map +1 -0
  75. package/dist/src/adapters/ethers/types.d.ts +14 -0
  76. package/dist/src/adapters/ethers/types.js +3 -0
  77. package/dist/src/adapters/ethers/types.js.map +1 -0
  78. package/dist/src/adapters/ethers/utils/constants.d.ts +3 -0
  79. package/dist/src/adapters/ethers/utils/constants.js +7 -0
  80. package/dist/src/adapters/ethers/utils/constants.js.map +1 -0
  81. package/dist/src/adapters/ethers/utils/index.d.ts +6 -0
  82. package/dist/src/adapters/ethers/utils/index.js +20 -0
  83. package/dist/src/adapters/ethers/utils/index.js.map +1 -0
  84. package/dist/src/adapters/web3/Web3Adapter.d.ts +51 -0
  85. package/dist/src/adapters/web3/Web3Adapter.js +192 -0
  86. package/dist/src/adapters/web3/Web3Adapter.js.map +1 -0
  87. package/dist/src/adapters/web3/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerWeb3Contract.d.ts +9 -0
  88. package/dist/src/adapters/web3/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerWeb3Contract.js +15 -0
  89. package/dist/src/adapters/web3/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerWeb3Contract.js.map +1 -0
  90. package/dist/src/adapters/web3/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandler_V1_3_0_Web3.d.ts +7 -0
  91. package/dist/src/adapters/web3/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandler_V1_3_0_Web3.js +14 -0
  92. package/dist/src/adapters/web3/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandler_V1_3_0_Web3.js.map +1 -0
  93. package/dist/src/adapters/web3/contracts/CreateCall/CreateCallWeb3Contract.d.ts +13 -0
  94. package/dist/src/adapters/web3/contracts/CreateCall/CreateCallWeb3Contract.js +42 -0
  95. package/dist/src/adapters/web3/contracts/CreateCall/CreateCallWeb3Contract.js.map +1 -0
  96. package/dist/src/adapters/web3/contracts/CreateCall/v1.3.0/CreateCallEthersContract_V1_3_0_Web3.d.ts +7 -0
  97. package/dist/src/adapters/web3/contracts/CreateCall/v1.3.0/CreateCallEthersContract_V1_3_0_Web3.js +14 -0
  98. package/dist/src/adapters/web3/contracts/CreateCall/v1.3.0/CreateCallEthersContract_V1_3_0_Web3.js.map +1 -0
  99. package/dist/src/adapters/web3/contracts/GnosisSafe/GnosisSafeContractWeb3.d.ts +28 -0
  100. package/dist/src/adapters/web3/contracts/GnosisSafe/GnosisSafeContractWeb3.js +103 -0
  101. package/dist/src/adapters/web3/contracts/GnosisSafe/GnosisSafeContractWeb3.js.map +1 -0
  102. package/dist/src/adapters/web3/contracts/GnosisSafe/v1.0.0/GnosisSafeContract_V1_0_0_Web3.d.ts +12 -0
  103. package/dist/src/adapters/web3/contracts/GnosisSafe/v1.0.0/GnosisSafeContract_V1_0_0_Web3.js +36 -0
  104. package/dist/src/adapters/web3/contracts/GnosisSafe/v1.0.0/GnosisSafeContract_V1_0_0_Web3.js.map +1 -0
  105. package/dist/src/adapters/web3/contracts/GnosisSafe/v1.1.1/GnosisSafeContract_V1_1_1_Web3.d.ts +12 -0
  106. package/dist/src/adapters/web3/contracts/GnosisSafe/v1.1.1/GnosisSafeContract_V1_1_1_Web3.js +36 -0
  107. package/dist/src/adapters/web3/contracts/GnosisSafe/v1.1.1/GnosisSafeContract_V1_1_1_Web3.js.map +1 -0
  108. package/dist/src/adapters/web3/contracts/GnosisSafe/v1.2.0/GnosisSafeContract_V1_2_0_Web3.d.ts +12 -0
  109. package/dist/src/adapters/web3/contracts/GnosisSafe/v1.2.0/GnosisSafeContract_V1_2_0_Web3.js +34 -0
  110. package/dist/src/adapters/web3/contracts/GnosisSafe/v1.2.0/GnosisSafeContract_V1_2_0_Web3.js.map +1 -0
  111. package/dist/src/adapters/web3/contracts/GnosisSafe/v1.3.0/GnosisSafeContract_V1_3_0_Web3.d.ts +12 -0
  112. package/dist/src/adapters/web3/contracts/GnosisSafe/v1.3.0/GnosisSafeContract_V1_3_0_Web3.js +35 -0
  113. package/dist/src/adapters/web3/contracts/GnosisSafe/v1.3.0/GnosisSafeContract_V1_3_0_Web3.js.map +1 -0
  114. package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/GnosisSafeProxyFactoryWeb3Contract.d.ts +22 -0
  115. package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/GnosisSafeProxyFactoryWeb3Contract.js +51 -0
  116. package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/GnosisSafeProxyFactoryWeb3Contract.js.map +1 -0
  117. package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/v1.0.0/GnosisSafeProxyFactoryContract_V1_0_0_Web3.d.ts +7 -0
  118. package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/v1.0.0/GnosisSafeProxyFactoryContract_V1_0_0_Web3.js +14 -0
  119. package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/v1.0.0/GnosisSafeProxyFactoryContract_V1_0_0_Web3.js.map +1 -0
  120. package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/v1.1.1/GnosisSafeProxyFactoryContract_V1_1_1_Web3.d.ts +7 -0
  121. package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/v1.1.1/GnosisSafeProxyFactoryContract_V1_1_1_Web3.js +14 -0
  122. package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/v1.1.1/GnosisSafeProxyFactoryContract_V1_1_1_Web3.js.map +1 -0
  123. package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/v1.3.0/GnosisSafeProxyFactoryContract_V1_3_0_Web3.d.ts +7 -0
  124. package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/v1.3.0/GnosisSafeProxyFactoryContract_V1_3_0_Web3.js +14 -0
  125. package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/v1.3.0/GnosisSafeProxyFactoryContract_V1_3_0_Web3.js.map +1 -0
  126. package/dist/src/adapters/web3/contracts/MultiSend/MultiSendWeb3Contract.d.ts +10 -0
  127. package/dist/src/adapters/web3/contracts/MultiSend/MultiSendWeb3Contract.js +15 -0
  128. package/dist/src/adapters/web3/contracts/MultiSend/MultiSendWeb3Contract.js.map +1 -0
  129. package/dist/src/adapters/web3/contracts/MultiSend/v1.1.1/MultiSendContract_V1_1_1_Web3.d.ts +7 -0
  130. package/dist/src/adapters/web3/contracts/MultiSend/v1.1.1/MultiSendContract_V1_1_1_Web3.js +14 -0
  131. package/dist/src/adapters/web3/contracts/MultiSend/v1.1.1/MultiSendContract_V1_1_1_Web3.js.map +1 -0
  132. package/dist/src/adapters/web3/contracts/MultiSend/v1.3.0/MultiSendContract_V1_3_0_Web3.d.ts +7 -0
  133. package/dist/src/adapters/web3/contracts/MultiSend/v1.3.0/MultiSendContract_V1_3_0_Web3.js +14 -0
  134. package/dist/src/adapters/web3/contracts/MultiSend/v1.3.0/MultiSendContract_V1_3_0_Web3.js.map +1 -0
  135. package/dist/src/adapters/web3/contracts/MultiSendCallOnly/MultiSendCallOnlyWeb3Contract.d.ts +9 -0
  136. package/dist/src/adapters/web3/contracts/MultiSendCallOnly/MultiSendCallOnlyWeb3Contract.js +15 -0
  137. package/dist/src/adapters/web3/contracts/MultiSendCallOnly/MultiSendCallOnlyWeb3Contract.js.map +1 -0
  138. package/dist/src/adapters/web3/contracts/MultiSendCallOnly/v1.3.0/MultiSendCallOnlyContract_V1_3_0_Web3.d.ts +7 -0
  139. package/dist/src/adapters/web3/contracts/MultiSendCallOnly/v1.3.0/MultiSendCallOnlyContract_V1_3_0_Web3.js +14 -0
  140. package/dist/src/adapters/web3/contracts/MultiSendCallOnly/v1.3.0/MultiSendCallOnlyContract_V1_3_0_Web3.js.map +1 -0
  141. package/dist/src/adapters/web3/contracts/SignMessageLib/SignMessageLibWeb3Contract.d.ts +13 -0
  142. package/dist/src/adapters/web3/contracts/SignMessageLib/SignMessageLibWeb3Contract.js +34 -0
  143. package/dist/src/adapters/web3/contracts/SignMessageLib/SignMessageLibWeb3Contract.js.map +1 -0
  144. package/dist/src/adapters/web3/contracts/SignMessageLib/v1.3.0/SignMessageLibContract_V1_3_0_Web3.d.ts +7 -0
  145. package/dist/src/adapters/web3/contracts/SignMessageLib/v1.3.0/SignMessageLibContract_V1_3_0_Web3.js +14 -0
  146. package/dist/src/adapters/web3/contracts/SignMessageLib/v1.3.0/SignMessageLibContract_V1_3_0_Web3.js.map +1 -0
  147. package/dist/src/adapters/web3/contracts/contractInstancesWeb3.d.ts +33 -0
  148. package/dist/src/adapters/web3/contracts/contractInstancesWeb3.js +106 -0
  149. package/dist/src/adapters/web3/contracts/contractInstancesWeb3.js.map +1 -0
  150. package/dist/src/adapters/web3/index.d.ts +9 -0
  151. package/dist/src/adapters/web3/index.js +21 -0
  152. package/dist/src/adapters/web3/index.js.map +1 -0
  153. package/dist/src/adapters/web3/types.d.ts +14 -0
  154. package/dist/src/adapters/web3/types.js +3 -0
  155. package/dist/src/adapters/web3/types.js.map +1 -0
  156. package/dist/src/adapters/web3/utils/constants.d.ts +3 -0
  157. package/dist/src/adapters/web3/utils/constants.js +7 -0
  158. package/dist/src/adapters/web3/utils/constants.js.map +1 -0
  159. package/dist/src/adapters/web3/utils/index.d.ts +4 -0
  160. package/dist/src/adapters/web3/utils/index.js +14 -0
  161. package/dist/src/adapters/web3/utils/index.js.map +1 -0
  162. package/dist/src/contracts/config.d.ts +18 -0
  163. package/dist/src/contracts/config.js +51 -0
  164. package/dist/src/contracts/config.js.map +1 -0
  165. package/dist/src/contracts/safeDeploymentContracts.d.ts +28 -0
  166. package/dist/src/contracts/safeDeploymentContracts.js +161 -0
  167. package/dist/src/contracts/safeDeploymentContracts.js.map +1 -0
  168. package/dist/src/index.d.ts +11 -0
  169. package/dist/src/index.js +40 -0
  170. package/dist/src/index.js.map +1 -0
  171. package/dist/src/managers/contractManager.d.ts +14 -0
  172. package/dist/src/managers/contractManager.js +83 -0
  173. package/dist/src/managers/contractManager.js.map +1 -0
  174. package/dist/src/managers/fallbackHandlerManager.d.ts +12 -0
  175. package/dist/src/managers/fallbackHandlerManager.js +65 -0
  176. package/dist/src/managers/fallbackHandlerManager.js.map +1 -0
  177. package/dist/src/managers/guardManager.d.ts +12 -0
  178. package/dist/src/managers/guardManager.js +65 -0
  179. package/dist/src/managers/guardManager.js.map +1 -0
  180. package/dist/src/managers/moduleManager.d.ts +13 -0
  181. package/dist/src/managers/moduleManager.js +67 -0
  182. package/dist/src/managers/moduleManager.js.map +1 -0
  183. package/dist/src/managers/ownerManager.d.ts +17 -0
  184. package/dist/src/managers/ownerManager.js +101 -0
  185. package/dist/src/managers/ownerManager.js.map +1 -0
  186. package/dist/src/safeFactory/index.d.ts +49 -0
  187. package/dist/src/safeFactory/index.js +165 -0
  188. package/dist/src/safeFactory/index.js.map +1 -0
  189. package/dist/src/safeFactory/utils.d.ts +3 -0
  190. package/dist/src/safeFactory/utils.js +19 -0
  191. package/dist/src/safeFactory/utils.js.map +1 -0
  192. package/dist/src/types/index.d.ts +35 -0
  193. package/dist/src/types/index.js +3 -0
  194. package/dist/src/types/index.js.map +1 -0
  195. package/dist/src/utils/address.d.ts +3 -0
  196. package/dist/src/utils/address.js +20 -0
  197. package/dist/src/utils/address.js.map +1 -0
  198. package/dist/src/utils/constants.d.ts +3 -0
  199. package/dist/src/utils/constants.js +7 -0
  200. package/dist/src/utils/constants.js.map +1 -0
  201. package/dist/src/utils/eip-3770/config.d.ts +6 -0
  202. package/dist/src/utils/eip-3770/config.js +116 -0
  203. package/dist/src/utils/eip-3770/config.js.map +1 -0
  204. package/dist/src/utils/eip-3770/index.d.ts +7 -0
  205. package/dist/src/utils/eip-3770/index.js +48 -0
  206. package/dist/src/utils/eip-3770/index.js.map +1 -0
  207. package/dist/src/utils/eip-712/index.d.ts +17 -0
  208. package/dist/src/utils/eip-712/index.js +68 -0
  209. package/dist/src/utils/eip-712/index.js.map +1 -0
  210. package/dist/src/utils/index.d.ts +5 -0
  211. package/dist/src/utils/index.js +22 -0
  212. package/dist/src/utils/index.js.map +1 -0
  213. package/dist/src/utils/safeVersions.d.ts +7 -0
  214. package/dist/src/utils/safeVersions.js +28 -0
  215. package/dist/src/utils/safeVersions.js.map +1 -0
  216. package/dist/src/utils/signatures/SafeSignature.d.ts +26 -0
  217. package/dist/src/utils/signatures/SafeSignature.js +33 -0
  218. package/dist/src/utils/signatures/SafeSignature.js.map +1 -0
  219. package/dist/src/utils/signatures/index.d.ts +12 -0
  220. package/dist/src/utils/signatures/index.js +94 -0
  221. package/dist/src/utils/signatures/index.js.map +1 -0
  222. package/dist/src/utils/transactions/SafeTransaction.d.ts +9 -0
  223. package/dist/src/utils/transactions/SafeTransaction.js +25 -0
  224. package/dist/src/utils/transactions/SafeTransaction.js.map +1 -0
  225. package/dist/src/utils/transactions/gas.d.ts +2 -0
  226. package/dist/src/utils/transactions/gas.js +75 -0
  227. package/dist/src/utils/transactions/gas.js.map +1 -0
  228. package/dist/src/utils/transactions/index.d.ts +4 -0
  229. package/dist/src/utils/transactions/index.js +21 -0
  230. package/dist/src/utils/transactions/index.js.map +1 -0
  231. package/dist/src/utils/transactions/types.d.ts +2 -0
  232. package/dist/src/utils/transactions/types.js +3 -0
  233. package/dist/src/utils/transactions/types.js.map +1 -0
  234. package/dist/src/utils/transactions/utils.d.ts +7 -0
  235. package/dist/src/utils/transactions/utils.js +98 -0
  236. package/dist/src/utils/transactions/utils.js.map +1 -0
  237. package/dist/tsconfig.build.tsbuildinfo +1 -0
  238. package/package.json +90 -0
@@ -0,0 +1,383 @@
1
+ import { BigNumber } from '@ethersproject/bignumber';
2
+ import { EthAdapter, MetaTransactionData, SafeMultisigTransactionResponse, SafeTransaction, SafeTransactionDataPartial, SafeVersion, TransactionOptions, TransactionResult } from '@safe-global/safe-core-sdk-types';
3
+ import ContractManager from './managers/contractManager';
4
+ import { ContractNetworksConfig } from './types';
5
+ import SafeSignature from './utils/signatures/SafeSignature';
6
+ import { SafeTransactionOptionalProps } from './utils/transactions/types';
7
+ export interface SafeConfig {
8
+ /** ethAdapter - Ethereum adapter */
9
+ ethAdapter: EthAdapter;
10
+ /** safeAddress - The address of the Safe account to use */
11
+ safeAddress: string;
12
+ /** isL1SafeMasterCopy - Forces to use the GnosisSafe L1 version of the contract instead of the L2 version */
13
+ isL1SafeMasterCopy?: boolean;
14
+ /** contractNetworks - Contract network configuration */
15
+ contractNetworks?: ContractNetworksConfig;
16
+ }
17
+ export interface ConnectSafeConfig {
18
+ /** ethAdapter - Ethereum adapter */
19
+ ethAdapter?: EthAdapter;
20
+ /** safeAddress - The address of the Safe account to use */
21
+ safeAddress?: string;
22
+ /** isL1SafeMasterCopy - Forces to use the GnosisSafe L1 version of the contract instead of the L2 version */
23
+ isL1SafeMasterCopy?: boolean;
24
+ /** contractNetworks - Contract network configuration */
25
+ contractNetworks?: ContractNetworksConfig;
26
+ }
27
+ export interface CreateTransactionProps {
28
+ /** safeTransactionData - The transaction or transaction array to process */
29
+ safeTransactionData: SafeTransactionDataPartial | MetaTransactionData[];
30
+ /** options - The transaction array optional properties */
31
+ options?: SafeTransactionOptionalProps;
32
+ /** onlyCalls - Forces the execution of the transaction array with MultiSendCallOnly contract */
33
+ onlyCalls?: boolean;
34
+ }
35
+ export interface AddOwnerTxParams {
36
+ /** ownerAddress - The address of the new owner */
37
+ ownerAddress: string;
38
+ /** threshold - The new threshold */
39
+ threshold?: number;
40
+ }
41
+ export interface RemoveOwnerTxParams {
42
+ /** ownerAddress - The address of the owner that will be removed */
43
+ ownerAddress: string;
44
+ /** threshold - The new threshold */
45
+ threshold?: number;
46
+ }
47
+ export interface SwapOwnerTxParams {
48
+ /** oldOwnerAddress - The old owner address */
49
+ oldOwnerAddress: string;
50
+ /** newOwnerAddress - The new owner address */
51
+ newOwnerAddress: string;
52
+ }
53
+ declare class Safe {
54
+ #private;
55
+ /**
56
+ * Creates an instance of the Safe Core SDK.
57
+ * @param config - Ethers Safe configuration
58
+ * @returns The Safe Core SDK instance
59
+ * @throws "SafeProxy contract is not deployed on the current network"
60
+ * @throws "MultiSend contract is not deployed on the current network"
61
+ * @throws "MultiSendCallOnly contract is not deployed on the current network"
62
+ */
63
+ static create({ ethAdapter, safeAddress, isL1SafeMasterCopy, contractNetworks }: SafeConfig): Promise<Safe>;
64
+ /**
65
+ * Initializes the Safe Core SDK instance.
66
+ * @param config - Safe configuration
67
+ * @throws "Signer must be connected to a provider"
68
+ * @throws "SafeProxy contract is not deployed on the current network"
69
+ * @throws "MultiSend contract is not deployed on the current network"
70
+ * @throws "MultiSendCallOnly contract is not deployed on the current network"
71
+ */
72
+ private init;
73
+ /**
74
+ * Returns a new instance of the Safe Core SDK.
75
+ * @param config - Connect Safe configuration
76
+ * @throws "SafeProxy contract is not deployed on the current network"
77
+ * @throws "MultiSend contract is not deployed on the current network"
78
+ * @throws "MultiSendCallOnly contract is not deployed on the current network"
79
+ */
80
+ connect({ ethAdapter, safeAddress, isL1SafeMasterCopy, contractNetworks }: ConnectSafeConfig): Promise<Safe>;
81
+ /**
82
+ * Returns the address of the current SafeProxy contract.
83
+ *
84
+ * @returns The address of the SafeProxy contract
85
+ */
86
+ getAddress(): string;
87
+ /**
88
+ * Returns the ContractManager
89
+ *
90
+ * @returns The current ContractManager
91
+ * */
92
+ getContractManager(): ContractManager;
93
+ /**
94
+ * Returns the current EthAdapter.
95
+ *
96
+ * @returns The current EthAdapter
97
+ */
98
+ getEthAdapter(): EthAdapter;
99
+ /**
100
+ * Returns the address of the MultiSend contract.
101
+ *
102
+ * @returns The address of the MultiSend contract
103
+ */
104
+ getMultiSendAddress(): string;
105
+ /**
106
+ * Returns the address of the MultiSendCallOnly contract.
107
+ *
108
+ * @returns The address of the MultiSendCallOnly contract
109
+ */
110
+ getMultiSendCallOnlyAddress(): string;
111
+ /**
112
+ * Returns the Safe Master Copy contract version.
113
+ *
114
+ * @returns The Safe Master Copy contract version
115
+ */
116
+ getContractVersion(): Promise<SafeVersion>;
117
+ /**
118
+ * Returns the list of Safe owner accounts.
119
+ *
120
+ * @returns The list of owners
121
+ */
122
+ getOwners(): Promise<string[]>;
123
+ /**
124
+ * Returns the Safe nonce.
125
+ *
126
+ * @returns The Safe nonce
127
+ */
128
+ getNonce(): Promise<number>;
129
+ /**
130
+ * Returns the Safe threshold.
131
+ *
132
+ * @returns The Safe threshold
133
+ */
134
+ getThreshold(): Promise<number>;
135
+ /**
136
+ * Returns the chainId of the connected network.
137
+ *
138
+ * @returns The chainId of the connected network
139
+ */
140
+ getChainId(): Promise<number>;
141
+ /**
142
+ * Returns the ETH balance of the Safe.
143
+ *
144
+ * @returns The ETH balance of the Safe
145
+ */
146
+ getBalance(): Promise<BigNumber>;
147
+ /**
148
+ * Returns the address of the FallbackHandler contract.
149
+ *
150
+ * @returns The address of the FallbackHandler contract
151
+ */
152
+ getFallbackHandler(): Promise<string>;
153
+ /**
154
+ * Returns the enabled Safe guard or 0x address if no guards are enabled.
155
+ *
156
+ * @returns The address of the enabled Safe guard
157
+ * @throws "Current version of the Safe does not support Safe transaction guards functionality"
158
+ */
159
+ getGuard(): Promise<string>;
160
+ /**
161
+ * Returns the list of addresses of all the enabled Safe modules.
162
+ *
163
+ * @returns The list of addresses of all the enabled Safe modules
164
+ */
165
+ getModules(): Promise<string[]>;
166
+ /**
167
+ * Checks if a specific Safe module is enabled for the current Safe.
168
+ *
169
+ * @param moduleAddress - The desired module address
170
+ * @returns TRUE if the module is enabled
171
+ */
172
+ isModuleEnabled(moduleAddress: string): Promise<boolean>;
173
+ /**
174
+ * Checks if a specific address is an owner of the current Safe.
175
+ *
176
+ * @param ownerAddress - The account address
177
+ * @returns TRUE if the account is an owner
178
+ */
179
+ isOwner(ownerAddress: string): Promise<boolean>;
180
+ /**
181
+ * Returns a Safe transaction ready to be signed by the owners.
182
+ *
183
+ * @param createTransactionProps - The createTransaction props
184
+ * @returns The Safe transaction
185
+ * @throws "Invalid empty array of transactions"
186
+ */
187
+ createTransaction({ safeTransactionData, onlyCalls, options }: CreateTransactionProps): Promise<SafeTransaction>;
188
+ /**
189
+ * Returns a Safe transaction ready to be signed by the owners that invalidates the pending Safe transaction/s with a specific nonce.
190
+ *
191
+ * @param nonce - The nonce of the transaction/s that are going to be rejected
192
+ * @returns The Safe transaction that invalidates the pending Safe transaction/s
193
+ */
194
+ createRejectionTransaction(nonce: number): Promise<SafeTransaction>;
195
+ /**
196
+ * Copies a Safe transaction
197
+ *
198
+ * @param safeTransaction - The Safe transaction
199
+ * @returns The new Safe transaction
200
+ */
201
+ copyTransaction(safeTransaction: SafeTransaction): Promise<SafeTransaction>;
202
+ /**
203
+ * Returns the transaction hash of a Safe transaction.
204
+ *
205
+ * @param safeTransaction - The Safe transaction
206
+ * @returns The transaction hash of the Safe transaction
207
+ */
208
+ getTransactionHash(safeTransaction: SafeTransaction): Promise<string>;
209
+ /**
210
+ * Signs a hash using the current signer account.
211
+ *
212
+ * @param hash - The hash to sign
213
+ * @returns The Safe signature
214
+ */
215
+ signTransactionHash(hash: string): Promise<SafeSignature>;
216
+ /**
217
+ * Signs a transaction according to the EIP-712 using the current signer account.
218
+ *
219
+ * @param safeTransaction - The Safe transaction to be signed
220
+ * @param methodVersion - EIP-712 version. Optional
221
+ * @returns The Safe signature
222
+ */
223
+ signTypedData(safeTransaction: SafeTransaction, methodVersion?: 'v3' | 'v4'): Promise<SafeSignature>;
224
+ /**
225
+ * Adds the signature of the current signer to the Safe transaction object.
226
+ *
227
+ * @param safeTransaction - The Safe transaction to be signed
228
+ * @param signingMethod - Method followed to sign a transaction. Optional. Default value is "eth_sign"
229
+ * @returns The signed Safe transaction
230
+ * @throws "Transactions can only be signed by Safe owners"
231
+ */
232
+ signTransaction(safeTransaction: SafeTransaction | SafeMultisigTransactionResponse, signingMethod?: 'eth_sign' | 'eth_signTypedData' | 'eth_signTypedData_v3' | 'eth_signTypedData_v4'): Promise<SafeTransaction>;
233
+ /**
234
+ * Approves on-chain a hash using the current signer account.
235
+ *
236
+ * @param hash - The hash to approve
237
+ * @param options - The Safe transaction execution options. Optional
238
+ * @returns The Safe transaction response
239
+ * @throws "Transaction hashes can only be approved by Safe owners"
240
+ * @throws "Cannot specify gas and gasLimit together in transaction options"
241
+ */
242
+ approveTransactionHash(hash: string, options?: TransactionOptions): Promise<TransactionResult>;
243
+ /**
244
+ * Returns a list of owners who have approved a specific Safe transaction.
245
+ *
246
+ * @param txHash - The Safe transaction hash
247
+ * @returns The list of owners
248
+ */
249
+ getOwnersWhoApprovedTx(txHash: string): Promise<string[]>;
250
+ /**
251
+ * Returns the Safe transaction to enable the fallback handler.
252
+ *
253
+ * @param address - The new fallback handler address
254
+ * @param options - The transaction optional properties
255
+ * @returns The Safe transaction ready to be signed
256
+ * @throws "Invalid fallback handler address provided"
257
+ * @throws "Fallback handler provided is already enabled"
258
+ * @throws "Current version of the Safe does not support the fallback handler functionality"
259
+ */
260
+ createEnableFallbackHandlerTx(fallbackHandlerAddress: string, options?: SafeTransactionOptionalProps): Promise<SafeTransaction>;
261
+ /**
262
+ * Returns the Safe transaction to disable the fallback handler.
263
+ *
264
+ * @param options - The transaction optional properties
265
+ * @returns The Safe transaction ready to be signed
266
+ * @throws "There is no fallback handler enabled yet"
267
+ * @throws "Current version of the Safe does not support the fallback handler functionality"
268
+ */
269
+ createDisableFallbackHandlerTx(options?: SafeTransactionOptionalProps): Promise<SafeTransaction>;
270
+ /**
271
+ * Returns the Safe transaction to enable a Safe guard.
272
+ *
273
+ * @param guardAddress - The desired guard address
274
+ * @param options - The transaction optional properties
275
+ * @returns The Safe transaction ready to be signed
276
+ * @throws "Invalid guard address provided"
277
+ * @throws "Guard provided is already enabled"
278
+ * @throws "Current version of the Safe does not support Safe transaction guards functionality"
279
+ */
280
+ createEnableGuardTx(guardAddress: string, options?: SafeTransactionOptionalProps): Promise<SafeTransaction>;
281
+ /**
282
+ * Returns the Safe transaction to disable a Safe guard.
283
+ *
284
+ * @param options - The transaction optional properties
285
+ * @returns The Safe transaction ready to be signed
286
+ * @throws "There is no guard enabled yet"
287
+ * @throws "Current version of the Safe does not support Safe transaction guards functionality"
288
+ */
289
+ createDisableGuardTx(options?: SafeTransactionOptionalProps): Promise<SafeTransaction>;
290
+ /**
291
+ * Returns the Safe transaction to enable a Safe module.
292
+ *
293
+ * @param moduleAddress - The desired module address
294
+ * @param options - The transaction optional properties
295
+ * @returns The Safe transaction ready to be signed
296
+ * @throws "Invalid module address provided"
297
+ * @throws "Module provided is already enabled"
298
+ */
299
+ createEnableModuleTx(moduleAddress: string, options?: SafeTransactionOptionalProps): Promise<SafeTransaction>;
300
+ /**
301
+ * Returns the Safe transaction to disable a Safe module.
302
+ *
303
+ * @param moduleAddress - The desired module address
304
+ * @param options - The transaction optional properties
305
+ * @returns The Safe transaction ready to be signed
306
+ * @throws "Invalid module address provided"
307
+ * @throws "Module provided is not enabled already"
308
+ */
309
+ createDisableModuleTx(moduleAddress: string, options?: SafeTransactionOptionalProps): Promise<SafeTransaction>;
310
+ /**
311
+ * Returns the Safe transaction to add an owner and optionally change the threshold.
312
+ *
313
+ * @param params - The transaction params
314
+ * @param options - The transaction optional properties
315
+ * @returns The Safe transaction ready to be signed
316
+ * @throws "Invalid owner address provided"
317
+ * @throws "Address provided is already an owner"
318
+ * @throws "Threshold needs to be greater than 0"
319
+ * @throws "Threshold cannot exceed owner count"
320
+ */
321
+ createAddOwnerTx({ ownerAddress, threshold }: AddOwnerTxParams, options?: SafeTransactionOptionalProps): Promise<SafeTransaction>;
322
+ /**
323
+ * Returns the Safe transaction to remove an owner and optionally change the threshold.
324
+ *
325
+ * @param params - The transaction params
326
+ * @param options - The transaction optional properties
327
+ * @returns The Safe transaction ready to be signed
328
+ * @throws "Invalid owner address provided"
329
+ * @throws "Address provided is not an owner"
330
+ * @throws "Threshold needs to be greater than 0"
331
+ * @throws "Threshold cannot exceed owner count"
332
+ */
333
+ createRemoveOwnerTx({ ownerAddress, threshold }: RemoveOwnerTxParams, options?: SafeTransactionOptionalProps): Promise<SafeTransaction>;
334
+ /**
335
+ * Returns the Safe transaction to replace an owner of the Safe with a new one.
336
+ *
337
+ * @param params - The transaction params
338
+ * @param options - The transaction optional properties
339
+ * @returns The Safe transaction ready to be signed
340
+ * @throws "Invalid new owner address provided"
341
+ * @throws "Invalid old owner address provided"
342
+ * @throws "New address provided is already an owner"
343
+ * @throws "Old address provided is not an owner"
344
+ */
345
+ createSwapOwnerTx({ oldOwnerAddress, newOwnerAddress }: SwapOwnerTxParams, options?: SafeTransactionOptionalProps): Promise<SafeTransaction>;
346
+ /**
347
+ * Returns the Safe transaction to change the threshold.
348
+ *
349
+ * @param threshold - The new threshold
350
+ * @param options - The transaction optional properties
351
+ * @returns The Safe transaction ready to be signed
352
+ * @throws "Threshold needs to be greater than 0"
353
+ * @throws "Threshold cannot exceed owner count"
354
+ */
355
+ createChangeThresholdTx(threshold: number, options?: SafeTransactionOptionalProps): Promise<SafeTransaction>;
356
+ /**
357
+ * Converts a transaction from type SafeMultisigTransactionResponse to type SafeTransaction
358
+ *
359
+ * @param serviceTransactionResponse - The transaction to convert
360
+ * @returns The converted transaction with type SafeTransaction
361
+ */
362
+ toSafeTransactionType(serviceTransactionResponse: SafeMultisigTransactionResponse): Promise<SafeTransaction>;
363
+ /**
364
+ * Checks if a Safe transaction can be executed successfully with no errors.
365
+ *
366
+ * @param safeTransaction - The Safe transaction to check
367
+ * @param options - The Safe transaction execution options. Optional
368
+ * @returns TRUE if the Safe transaction can be executed successfully with no errors
369
+ */
370
+ isValidTransaction(safeTransaction: SafeTransaction | SafeMultisigTransactionResponse, options?: TransactionOptions): Promise<boolean>;
371
+ /**
372
+ * Executes a Safe transaction.
373
+ *
374
+ * @param safeTransaction - The Safe transaction to execute
375
+ * @param options - The Safe transaction execution options. Optional
376
+ * @returns The Safe transaction response
377
+ * @throws "No signer provided"
378
+ * @throws "There are X signatures missing"
379
+ * @throws "Cannot specify gas and gasLimit together in transaction options"
380
+ */
381
+ executeTransaction(safeTransaction: SafeTransaction | SafeMultisigTransactionResponse, options?: TransactionOptions): Promise<TransactionResult>;
382
+ }
383
+ export default Safe;