@safe-global/protocol-kit 4.1.0 → 5.0.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 (214) hide show
  1. package/dist/src/Safe.d.ts +12 -17
  2. package/dist/src/Safe.js +159 -112
  3. package/dist/src/Safe.js.map +1 -1
  4. package/dist/src/SafeProvider.d.ts +11 -20
  5. package/dist/src/SafeProvider.js +141 -90
  6. package/dist/src/SafeProvider.js.map +1 -1
  7. package/dist/src/contracts/BaseContract.d.ts +26 -6
  8. package/dist/src/contracts/BaseContract.js +101 -14
  9. package/dist/src/contracts/BaseContract.js.map +1 -1
  10. package/dist/src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.d.ts +5 -4
  11. package/dist/src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.js +3 -2
  12. package/dist/src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.js.map +1 -1
  13. package/dist/src/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandlerContract_v1_3_0.d.ts +4 -3
  14. package/dist/src/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandlerContract_v1_3_0.js +5 -5
  15. package/dist/src/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandlerContract_v1_3_0.js.map +1 -1
  16. package/dist/src/contracts/CompatibilityFallbackHandler/v1.4.1/CompatibilityFallbackHandlerContract_v1_4_1.d.ts +4 -3
  17. package/dist/src/contracts/CompatibilityFallbackHandler/v1.4.1/CompatibilityFallbackHandlerContract_v1_4_1.js +5 -5
  18. package/dist/src/contracts/CompatibilityFallbackHandler/v1.4.1/CompatibilityFallbackHandlerContract_v1_4_1.js.map +1 -1
  19. package/dist/src/contracts/CreateCall/CreateCallBaseContract.d.ts +5 -4
  20. package/dist/src/contracts/CreateCall/CreateCallBaseContract.js +3 -2
  21. package/dist/src/contracts/CreateCall/CreateCallBaseContract.js.map +1 -1
  22. package/dist/src/contracts/CreateCall/v1.3.0/CreateCallContract_v1_3_0.d.ts +4 -3
  23. package/dist/src/contracts/CreateCall/v1.3.0/CreateCallContract_v1_3_0.js +7 -9
  24. package/dist/src/contracts/CreateCall/v1.3.0/CreateCallContract_v1_3_0.js.map +1 -1
  25. package/dist/src/contracts/CreateCall/v1.4.1/CreateCallContract_v1_4_1.d.ts +4 -3
  26. package/dist/src/contracts/CreateCall/v1.4.1/CreateCallContract_v1_4_1.js +7 -9
  27. package/dist/src/contracts/CreateCall/v1.4.1/CreateCallContract_v1_4_1.js.map +1 -1
  28. package/dist/src/contracts/MultiSend/MultiSendBaseContract.d.ts +5 -4
  29. package/dist/src/contracts/MultiSend/MultiSendBaseContract.js +3 -2
  30. package/dist/src/contracts/MultiSend/MultiSendBaseContract.js.map +1 -1
  31. package/dist/src/contracts/MultiSend/MultiSendCallOnlyBaseContract.d.ts +5 -4
  32. package/dist/src/contracts/MultiSend/MultiSendCallOnlyBaseContract.js +3 -2
  33. package/dist/src/contracts/MultiSend/MultiSendCallOnlyBaseContract.js.map +1 -1
  34. package/dist/src/contracts/MultiSend/v1.1.1/MultiSendContract_v1_1_1.d.ts +4 -3
  35. package/dist/src/contracts/MultiSend/v1.1.1/MultiSendContract_v1_1_1.js +5 -5
  36. package/dist/src/contracts/MultiSend/v1.1.1/MultiSendContract_v1_1_1.js.map +1 -1
  37. package/dist/src/contracts/MultiSend/v1.3.0/MultiSendCallOnlyContract_v1_3_0.d.ts +4 -3
  38. package/dist/src/contracts/MultiSend/v1.3.0/MultiSendCallOnlyContract_v1_3_0.js +5 -5
  39. package/dist/src/contracts/MultiSend/v1.3.0/MultiSendCallOnlyContract_v1_3_0.js.map +1 -1
  40. package/dist/src/contracts/MultiSend/v1.3.0/MultiSendContract_v1_3_0.d.ts +4 -3
  41. package/dist/src/contracts/MultiSend/v1.3.0/MultiSendContract_v1_3_0.js +5 -5
  42. package/dist/src/contracts/MultiSend/v1.3.0/MultiSendContract_v1_3_0.js.map +1 -1
  43. package/dist/src/contracts/MultiSend/v1.4.1/MultiSendCallOnlyContract_v1_4_1.d.ts +4 -3
  44. package/dist/src/contracts/MultiSend/v1.4.1/MultiSendCallOnlyContract_v1_4_1.js +5 -5
  45. package/dist/src/contracts/MultiSend/v1.4.1/MultiSendCallOnlyContract_v1_4_1.js.map +1 -1
  46. package/dist/src/contracts/MultiSend/v1.4.1/MultiSendContract_v1_4_1.d.ts +4 -3
  47. package/dist/src/contracts/MultiSend/v1.4.1/MultiSendContract_v1_4_1.js +5 -5
  48. package/dist/src/contracts/MultiSend/v1.4.1/MultiSendContract_v1_4_1.js.map +1 -1
  49. package/dist/src/contracts/Safe/SafeBaseContract.d.ts +5 -4
  50. package/dist/src/contracts/Safe/SafeBaseContract.js +3 -2
  51. package/dist/src/contracts/Safe/SafeBaseContract.js.map +1 -1
  52. package/dist/src/contracts/Safe/v1.0.0/SafeContract_v1_0_0.d.ts +7 -11
  53. package/dist/src/contracts/Safe/v1.0.0/SafeContract_v1_0_0.js +64 -42
  54. package/dist/src/contracts/Safe/v1.0.0/SafeContract_v1_0_0.js.map +1 -1
  55. package/dist/src/contracts/Safe/v1.1.1/SafeContract_v1_1_1.d.ts +4 -9
  56. package/dist/src/contracts/Safe/v1.1.1/SafeContract_v1_1_1.js +61 -39
  57. package/dist/src/contracts/Safe/v1.1.1/SafeContract_v1_1_1.js.map +1 -1
  58. package/dist/src/contracts/Safe/v1.2.0/SafeContract_v1_2_0.d.ts +5 -10
  59. package/dist/src/contracts/Safe/v1.2.0/SafeContract_v1_2_0.js +63 -41
  60. package/dist/src/contracts/Safe/v1.2.0/SafeContract_v1_2_0.js.map +1 -1
  61. package/dist/src/contracts/Safe/v1.3.0/SafeContract_v1_3_0.d.ts +5 -10
  62. package/dist/src/contracts/Safe/v1.3.0/SafeContract_v1_3_0.js +63 -41
  63. package/dist/src/contracts/Safe/v1.3.0/SafeContract_v1_3_0.js.map +1 -1
  64. package/dist/src/contracts/Safe/v1.4.1/SafeContract_v1_4_1.d.ts +5 -10
  65. package/dist/src/contracts/Safe/v1.4.1/SafeContract_v1_4_1.js +63 -41
  66. package/dist/src/contracts/Safe/v1.4.1/SafeContract_v1_4_1.js.map +1 -1
  67. package/dist/src/contracts/SafeProxyFactory/SafeProxyFactoryBaseContract.d.ts +5 -7
  68. package/dist/src/contracts/SafeProxyFactory/SafeProxyFactoryBaseContract.js +3 -2
  69. package/dist/src/contracts/SafeProxyFactory/SafeProxyFactoryBaseContract.js.map +1 -1
  70. package/dist/src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.d.ts +5 -11
  71. package/dist/src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.js +9 -38
  72. package/dist/src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.js.map +1 -1
  73. package/dist/src/contracts/SafeProxyFactory/v1.1.1/SafeProxyFactoryContract_v1_1_1.d.ts +6 -12
  74. package/dist/src/contracts/SafeProxyFactory/v1.1.1/SafeProxyFactoryContract_v1_1_1.js +12 -41
  75. package/dist/src/contracts/SafeProxyFactory/v1.1.1/SafeProxyFactoryContract_v1_1_1.js.map +1 -1
  76. package/dist/src/contracts/SafeProxyFactory/v1.3.0/SafeProxyFactoryContract_v1_3_0.d.ts +5 -11
  77. package/dist/src/contracts/SafeProxyFactory/v1.3.0/SafeProxyFactoryContract_v1_3_0.js +11 -40
  78. package/dist/src/contracts/SafeProxyFactory/v1.3.0/SafeProxyFactoryContract_v1_3_0.js.map +1 -1
  79. package/dist/src/contracts/SafeProxyFactory/v1.4.1/SafeProxyFactoryContract_v1_4_1.d.ts +5 -11
  80. package/dist/src/contracts/SafeProxyFactory/v1.4.1/SafeProxyFactoryContract_v1_4_1.js +10 -39
  81. package/dist/src/contracts/SafeProxyFactory/v1.4.1/SafeProxyFactoryContract_v1_4_1.js.map +1 -1
  82. package/dist/src/contracts/SafeWebAuthnSharedSigner/SafeWebAuthnSharedSignerBaseContract.d.ts +5 -7
  83. package/dist/src/contracts/SafeWebAuthnSharedSigner/SafeWebAuthnSharedSignerBaseContract.js +3 -2
  84. package/dist/src/contracts/SafeWebAuthnSharedSigner/SafeWebAuthnSharedSignerBaseContract.js.map +1 -1
  85. package/dist/src/contracts/SafeWebAuthnSharedSigner/v0.2.1/SafeWebAuthnSharedSignerContract_v0_2_1.d.ts +4 -3
  86. package/dist/src/contracts/SafeWebAuthnSharedSigner/v0.2.1/SafeWebAuthnSharedSignerContract_v0_2_1.js +9 -9
  87. package/dist/src/contracts/SafeWebAuthnSharedSigner/v0.2.1/SafeWebAuthnSharedSignerContract_v0_2_1.js.map +1 -1
  88. package/dist/src/contracts/SafeWebAuthnSignerFactory/SafeWebAuthnSignerFactoryBaseContract.d.ts +5 -7
  89. package/dist/src/contracts/SafeWebAuthnSignerFactory/SafeWebAuthnSignerFactoryBaseContract.js +3 -2
  90. package/dist/src/contracts/SafeWebAuthnSignerFactory/SafeWebAuthnSignerFactoryBaseContract.js.map +1 -1
  91. package/dist/src/contracts/SafeWebAuthnSignerFactory/v0.2.1/SafeWebAuthnSignerFactoryContract_v0_2_1.d.ts +4 -3
  92. package/dist/src/contracts/SafeWebAuthnSignerFactory/v0.2.1/SafeWebAuthnSignerFactoryContract_v0_2_1.js +8 -8
  93. package/dist/src/contracts/SafeWebAuthnSignerFactory/v0.2.1/SafeWebAuthnSignerFactoryContract_v0_2_1.js.map +1 -1
  94. package/dist/src/contracts/SignMessageLib/SignMessageLibBaseContract.d.ts +5 -4
  95. package/dist/src/contracts/SignMessageLib/SignMessageLibBaseContract.js +3 -2
  96. package/dist/src/contracts/SignMessageLib/SignMessageLibBaseContract.js.map +1 -1
  97. package/dist/src/contracts/SignMessageLib/v1.3.0/SignMessageLibContract_v1_3_0.d.ts +4 -3
  98. package/dist/src/contracts/SignMessageLib/v1.3.0/SignMessageLibContract_v1_3_0.js +7 -8
  99. package/dist/src/contracts/SignMessageLib/v1.3.0/SignMessageLibContract_v1_3_0.js.map +1 -1
  100. package/dist/src/contracts/SignMessageLib/v1.4.1/SignMessageLibContract_v1_4_1.d.ts +4 -3
  101. package/dist/src/contracts/SignMessageLib/v1.4.1/SignMessageLibContract_v1_4_1.js +7 -8
  102. package/dist/src/contracts/SignMessageLib/v1.4.1/SignMessageLibContract_v1_4_1.js.map +1 -1
  103. package/dist/src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.d.ts +5 -4
  104. package/dist/src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.js +3 -2
  105. package/dist/src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.js.map +1 -1
  106. package/dist/src/contracts/SimulateTxAccessor/v1.3.0/SimulateTxAccessorContract_v1_3_0.d.ts +4 -3
  107. package/dist/src/contracts/SimulateTxAccessor/v1.3.0/SimulateTxAccessorContract_v1_3_0.js +9 -7
  108. package/dist/src/contracts/SimulateTxAccessor/v1.3.0/SimulateTxAccessorContract_v1_3_0.js.map +1 -1
  109. package/dist/src/contracts/SimulateTxAccessor/v1.4.1/SimulateTxAccessorContract_v1_4_1.d.ts +4 -3
  110. package/dist/src/contracts/SimulateTxAccessor/v1.4.1/SimulateTxAccessorContract_v1_4_1.js +9 -7
  111. package/dist/src/contracts/SimulateTxAccessor/v1.4.1/SimulateTxAccessorContract_v1_4_1.js.map +1 -1
  112. package/dist/src/contracts/config.d.ts +8 -1
  113. package/dist/src/contracts/config.js +47 -16
  114. package/dist/src/contracts/config.js.map +1 -1
  115. package/dist/src/contracts/constants.d.ts +4 -3
  116. package/dist/src/contracts/constants.js +2 -1
  117. package/dist/src/contracts/constants.js.map +1 -1
  118. package/dist/src/contracts/contractInstances.d.ts +13 -12
  119. package/dist/src/contracts/contractInstances.js +34 -34
  120. package/dist/src/contracts/contractInstances.js.map +1 -1
  121. package/dist/src/contracts/safeDeploymentContracts.d.ts +6 -5
  122. package/dist/src/contracts/safeDeploymentContracts.js +26 -66
  123. package/dist/src/contracts/safeDeploymentContracts.js.map +1 -1
  124. package/dist/src/contracts/utils.d.ts +35 -13
  125. package/dist/src/contracts/utils.js +136 -55
  126. package/dist/src/contracts/utils.js.map +1 -1
  127. package/dist/src/index.d.ts +10 -6
  128. package/dist/src/index.js +7 -9
  129. package/dist/src/index.js.map +1 -1
  130. package/dist/src/managers/contractManager.js +12 -17
  131. package/dist/src/managers/contractManager.js.map +1 -1
  132. package/dist/src/managers/fallbackHandlerManager.js +5 -4
  133. package/dist/src/managers/fallbackHandlerManager.js.map +1 -1
  134. package/dist/src/managers/guardManager.js +5 -4
  135. package/dist/src/managers/guardManager.js.map +1 -1
  136. package/dist/src/types/contracts.d.ts +13 -13
  137. package/dist/src/types/index.d.ts +0 -1
  138. package/dist/src/types/index.js +0 -1
  139. package/dist/src/types/index.js.map +1 -1
  140. package/dist/src/types/safeConfig.d.ts +3 -1
  141. package/dist/src/types/safeProvider.d.ts +33 -5
  142. package/dist/src/types/transactions.d.ts +1 -1
  143. package/dist/src/utils/address.d.ts +1 -1
  144. package/dist/src/utils/address.js +1 -1
  145. package/dist/src/utils/address.js.map +1 -1
  146. package/dist/src/utils/block.d.ts +6 -0
  147. package/dist/src/utils/block.js +14 -0
  148. package/dist/src/utils/block.js.map +1 -0
  149. package/dist/src/utils/constants.d.ts +4 -3
  150. package/dist/src/utils/constants.js +2 -1
  151. package/dist/src/utils/constants.js.map +1 -1
  152. package/dist/src/utils/eip-3770/config.js +32 -1
  153. package/dist/src/utils/eip-3770/config.js.map +1 -1
  154. package/dist/src/utils/eip-3770/index.d.ts +1 -1
  155. package/dist/src/utils/eip-3770/index.js +2 -3
  156. package/dist/src/utils/eip-3770/index.js.map +1 -1
  157. package/dist/src/utils/eip-712/encode.d.ts +3 -0
  158. package/dist/src/utils/eip-712/encode.js +127 -0
  159. package/dist/src/utils/eip-712/encode.js.map +1 -0
  160. package/dist/src/utils/eip-712/index.d.ts +1 -1
  161. package/dist/src/utils/eip-712/index.js +5 -7
  162. package/dist/src/utils/eip-712/index.js.map +1 -1
  163. package/dist/src/utils/erc-20/index.d.ts +1 -1
  164. package/dist/src/utils/erc-20/index.js +12 -5
  165. package/dist/src/utils/erc-20/index.js.map +1 -1
  166. package/dist/src/utils/messages/SafeMessage.d.ts +1 -1
  167. package/dist/src/utils/passkeys/PasskeyClient.d.ts +5 -0
  168. package/dist/src/utils/passkeys/PasskeyClient.js +156 -0
  169. package/dist/src/utils/passkeys/PasskeyClient.js.map +1 -0
  170. package/dist/src/utils/passkeys/createPasskeyDeploymentTransaction.d.ts +2 -1
  171. package/dist/src/utils/passkeys/createPasskeyDeploymentTransaction.js +12 -12
  172. package/dist/src/utils/passkeys/createPasskeyDeploymentTransaction.js.map +1 -1
  173. package/dist/src/utils/passkeys/extractPasskeyData.d.ts +1 -2
  174. package/dist/src/utils/passkeys/extractPasskeyData.js +8 -15
  175. package/dist/src/utils/passkeys/extractPasskeyData.js.map +1 -1
  176. package/dist/src/utils/passkeys/getPasskeyOwnerAddress.js +10 -3
  177. package/dist/src/utils/passkeys/getPasskeyOwnerAddress.js.map +1 -1
  178. package/dist/src/utils/passkeys/index.d.ts +1 -1
  179. package/dist/src/utils/passkeys/index.js +1 -1
  180. package/dist/src/utils/passkeys/isSharedSigner.d.ts +2 -3
  181. package/dist/src/utils/passkeys/isSharedSigner.js +6 -5
  182. package/dist/src/utils/passkeys/isSharedSigner.js.map +1 -1
  183. package/dist/src/utils/provider.d.ts +3 -0
  184. package/dist/src/utils/provider.js +12 -0
  185. package/dist/src/utils/provider.js.map +1 -0
  186. package/dist/src/utils/safeVersions.js +2 -2
  187. package/dist/src/utils/safeVersions.js.map +1 -1
  188. package/dist/src/utils/signatures/SafeSignature.d.ts +1 -1
  189. package/dist/src/utils/signatures/utils.d.ts +4 -4
  190. package/dist/src/utils/signatures/utils.js +34 -20
  191. package/dist/src/utils/signatures/utils.js.map +1 -1
  192. package/dist/src/utils/transactions/SafeTransaction.d.ts +1 -1
  193. package/dist/src/utils/transactions/SafeTransaction.js.map +1 -1
  194. package/dist/src/utils/transactions/gas.d.ts +1 -1
  195. package/dist/src/utils/transactions/gas.js +37 -64
  196. package/dist/src/utils/transactions/gas.js.map +1 -1
  197. package/dist/src/utils/transactions/types.d.ts +17 -1
  198. package/dist/src/utils/transactions/utils.d.ts +11 -2
  199. package/dist/src/utils/transactions/utils.js +117 -27
  200. package/dist/src/utils/transactions/utils.js.map +1 -1
  201. package/dist/src/utils/types.d.ts +4 -0
  202. package/dist/src/utils/types.js +59 -1
  203. package/dist/src/utils/types.js.map +1 -1
  204. package/dist/tsconfig.build.tsbuildinfo +1 -1
  205. package/package.json +26 -35
  206. package/dist/src/SafeFactory.d.ts +0 -15
  207. package/dist/src/SafeFactory.js +0 -136
  208. package/dist/src/SafeFactory.js.map +0 -1
  209. package/dist/src/types/safeFactory.d.ts +0 -31
  210. package/dist/src/types/safeFactory.js +0 -3
  211. package/dist/src/types/safeFactory.js.map +0 -1
  212. package/dist/src/utils/passkeys/PasskeySigner.d.ts +0 -63
  213. package/dist/src/utils/passkeys/PasskeySigner.js +0 -163
  214. package/dist/src/utils/passkeys/PasskeySigner.js.map +0 -1
@@ -1,8 +1,11 @@
1
1
  import { Abi } from 'abitype';
2
- import { Contract, ContractRunner, InterfaceAbi } from 'ethers';
2
+ import { ContractFunctionName, ContractFunctionArgs, Transport, WalletClient, Hash, Chain } from 'viem';
3
3
  import { contractName } from '../contracts/config';
4
+ import { DeploymentType } from '../types';
4
5
  import SafeProvider from '../SafeProvider';
5
- import { EncodeFunction, EstimateGasFunction, GetAddressFunction, SafeVersion } from '@safe-global/safe-core-sdk-types';
6
+ import { EncodeFunction, EstimateGasFunction, GetAddressFunction, SafeVersion, TransactionOptions } from '@safe-global/types-kit';
7
+ import { WalletTransactionOptions, WalletLegacyTransactionOptions } from '../utils';
8
+ import { ExternalClient } from '../types';
6
9
  /**
7
10
  * Abstract class BaseContract
8
11
  * It is designed to be instantiated for different contracts.
@@ -18,14 +21,16 @@ import { EncodeFunction, EstimateGasFunction, GetAddressFunction, SafeVersion }
18
21
  * - CreateCallBaseContract<CreateCallContractAbiType> extends BaseContract<CreateCallContractAbiType>
19
22
  * - SafeProxyFactoryBaseContract<SafeProxyFactoryContractAbiType> extends BaseContract<SafeProxyFactoryContractAbiType>
20
23
  */
21
- declare class BaseContract<ContractAbiType extends InterfaceAbi & Abi> {
24
+ declare class BaseContract<ContractAbiType extends Abi> {
25
+ #private;
22
26
  contractAbi: ContractAbiType;
23
27
  contractAddress: string;
24
28
  contractName: contractName;
25
29
  safeVersion: SafeVersion;
26
30
  safeProvider: SafeProvider;
27
- contract: Contract;
28
- runner?: ContractRunner | null;
31
+ chainId: bigint;
32
+ runner: ExternalClient;
33
+ wallet?: WalletClient<Transport, Chain | undefined>;
29
34
  /**
30
35
  * @constructor
31
36
  * Constructs an instance of BaseContract.
@@ -37,11 +42,26 @@ declare class BaseContract<ContractAbiType extends InterfaceAbi & Abi> {
37
42
  * @param safeVersion - The version of the Safe contract.
38
43
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
39
44
  * @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
45
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
40
46
  */
41
- constructor(contractName: contractName, chainId: bigint, safeProvider: SafeProvider, defaultAbi: ContractAbiType, safeVersion: SafeVersion, customContractAddress?: string, customContractAbi?: ContractAbiType, runner?: ContractRunner | null);
47
+ constructor(contractName: contractName, chainId: bigint, safeProvider: SafeProvider, defaultAbi: ContractAbiType, safeVersion: SafeVersion, customContractAddress?: string, customContractAbi?: ContractAbiType, deploymentType?: DeploymentType);
42
48
  init(): Promise<void>;
49
+ getTransactionReceipt(hash: Hash): Promise<import("viem").TransactionReceipt<bigint, number, "success" | "reverted", import("viem").TransactionType>>;
50
+ /**
51
+ * Converts a type of TransactionOptions to a viem transaction type. The viem transaction type creates a clear distinction between the multiple transaction objects (e.g., post-London hard fork) and doesn't allow a union of fields.
52
+ * See: https://github.com/wevm/viem/blob/viem%402.18.0/src/types/fee.ts and https://github.com/wevm/viem/blob/603227e2588366914fb79a902d23fd9afc353cc6/src/types/transaction.ts#L200
53
+ *
54
+ * @param options - Transaction options as expected throughout safe sdk and propagated on the results.
55
+ *
56
+ * @returns Options object compatible with Viem
57
+ */
58
+ convertOptions(options?: TransactionOptions): WalletTransactionOptions | WalletLegacyTransactionOptions;
59
+ getChain(): Chain | undefined;
43
60
  getAddress: GetAddressFunction;
44
61
  encode: EncodeFunction<ContractAbiType>;
45
62
  estimateGas: EstimateGasFunction<ContractAbiType>;
63
+ getWallet(): WalletClient<Transport, Chain | undefined>;
64
+ write<functionName extends ContractFunctionName<ContractAbiType, 'payable' | 'nonpayable'>, functionArgs extends ContractFunctionArgs<ContractAbiType, 'payable' | 'nonpayable', functionName>>(functionName: functionName, args: functionArgs, options?: TransactionOptions): Promise<`0x${string}`>;
65
+ read<functionName extends ContractFunctionName<ContractAbiType, 'pure' | 'view'>, functionArgs extends ContractFunctionArgs<ContractAbiType, 'pure' | 'view', functionName>>(functionName: functionName, args?: functionArgs): Promise<import("viem").ContractFunctionReturnType<ContractAbiType, "pure" | "view", functionName, ContractFunctionArgs<ContractAbiType, "pure" | "view", functionName>>>;
46
66
  }
47
67
  export default BaseContract;
@@ -1,7 +1,16 @@
1
1
  "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
7
+ var _BaseContract_instances, _BaseContract_resolveAddress;
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const ethers_1 = require("ethers");
9
+ const viem_1 = require("viem");
10
+ const actions_1 = require("viem/actions");
4
11
  const config_1 = require("../contracts/config");
12
+ const types_1 = require("../utils/types");
13
+ const utils_1 = require("../utils");
5
14
  /**
6
15
  * Abstract class BaseContract
7
16
  * It is designed to be instantiated for different contracts.
@@ -29,38 +38,116 @@ class BaseContract {
29
38
  * @param safeVersion - The version of the Safe contract.
30
39
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
31
40
  * @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
41
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
32
42
  */
33
- constructor(contractName, chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, runner) {
43
+ constructor(contractName, chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
44
+ _BaseContract_instances.add(this);
34
45
  this.getAddress = () => {
35
- return this.contract.getAddress();
46
+ return this.contractAddress;
36
47
  };
37
48
  this.encode = (functionToEncode, args) => {
38
- return this.contract.interface.encodeFunctionData(functionToEncode, args);
49
+ const abi = this.contractAbi;
50
+ const functionName = functionToEncode;
51
+ const params = args;
52
+ return (0, viem_1.encodeFunctionData)({
53
+ abi,
54
+ functionName,
55
+ args: params
56
+ });
39
57
  };
40
- this.estimateGas = (functionToEstimate, args, options = {}) => {
41
- const contractMethodToEstimate = this.contract.getFunction(functionToEstimate);
42
- return contractMethodToEstimate.estimateGas(...args, options);
58
+ this.estimateGas = async (functionToEstimate, args, options = {}) => {
59
+ const contractOptions = this.convertOptions(options);
60
+ const abi = this.contractAbi;
61
+ const params = args;
62
+ return (0, actions_1.estimateContractGas)(this.runner, {
63
+ abi,
64
+ functionName: functionToEstimate,
65
+ address: this.getAddress(),
66
+ args: params,
67
+ ...contractOptions
68
+ });
43
69
  };
44
70
  const deployment = (0, config_1.getContractDeployment)(safeVersion, chainId, contractName);
45
- const contractAddress = customContractAddress ||
46
- deployment?.networkAddresses[chainId.toString()] ||
47
- deployment?.defaultAddress;
48
- if (!contractAddress) {
71
+ const resolvedAddress = customContractAddress ??
72
+ __classPrivateFieldGet(this, _BaseContract_instances, "m", _BaseContract_resolveAddress).call(this, deployment?.networkAddresses[chainId.toString()], deployment, deploymentType);
73
+ if (!resolvedAddress) {
49
74
  throw new Error(`Invalid ${contractName.replace('Version', '')} contract address`);
50
75
  }
76
+ this.chainId = chainId;
51
77
  this.contractName = contractName;
52
78
  this.safeVersion = safeVersion;
53
- this.contractAddress = contractAddress;
79
+ this.contractAddress = resolvedAddress;
54
80
  this.contractAbi =
55
81
  customContractAbi ||
56
82
  deployment?.abi || // this cast is required because abi is set as any[] in safe-deployments
57
83
  defaultAbi; // if no customAbi and no abi is present in the safe-deployments we use our hardcoded abi
58
- this.runner = runner || safeProvider.getExternalProvider();
84
+ this.runner = safeProvider.getExternalProvider();
59
85
  this.safeProvider = safeProvider;
60
86
  }
61
87
  async init() {
62
- this.contract = new ethers_1.Contract(this.contractAddress, this.contractAbi, (await this.safeProvider.getExternalSigner()) || this.runner);
88
+ this.wallet = await this.safeProvider.getExternalSigner();
89
+ }
90
+ async getTransactionReceipt(hash) {
91
+ return (0, actions_1.getTransactionReceipt)(this.runner, { hash });
92
+ }
93
+ /**
94
+ * Converts a type of TransactionOptions to a viem transaction type. The viem transaction type creates a clear distinction between the multiple transaction objects (e.g., post-London hard fork) and doesn't allow a union of fields.
95
+ * See: https://github.com/wevm/viem/blob/viem%402.18.0/src/types/fee.ts and https://github.com/wevm/viem/blob/603227e2588366914fb79a902d23fd9afc353cc6/src/types/transaction.ts#L200
96
+ *
97
+ * @param options - Transaction options as expected throughout safe sdk and propagated on the results.
98
+ *
99
+ * @returns Options object compatible with Viem
100
+ */
101
+ convertOptions(options) {
102
+ const chain = this.getChain();
103
+ if (!chain)
104
+ throw new Error('Invalid chainId');
105
+ const account = this.getWallet().account;
106
+ if (!account)
107
+ throw new Error('Invalid signer');
108
+ const txOptions = (0, utils_1.convertTransactionOptions)(options);
109
+ return { chain, ...txOptions, account }; // Needs to be in this order to override the `account` if necessary
110
+ }
111
+ getChain() {
112
+ return (0, types_1.getChainById)(this.chainId);
113
+ }
114
+ getWallet() {
115
+ if (!this.wallet)
116
+ throw new Error('A signer must be set');
117
+ return this.wallet;
118
+ }
119
+ async write(functionName, args, options) {
120
+ const converted = this.convertOptions(options);
121
+ return await this.getWallet().writeContract({
122
+ address: this.contractAddress,
123
+ abi: this.contractAbi,
124
+ functionName,
125
+ args,
126
+ ...converted
127
+ });
128
+ }
129
+ async read(functionName, args) {
130
+ return await this.runner.readContract({
131
+ functionName,
132
+ abi: this.contractAbi,
133
+ address: this.contractAddress,
134
+ args
135
+ });
63
136
  }
64
137
  }
138
+ _BaseContract_instances = new WeakSet(), _BaseContract_resolveAddress = function _BaseContract_resolveAddress(networkAddresses, deployment, deploymentType) {
139
+ if (!networkAddresses) {
140
+ return undefined;
141
+ }
142
+ if (typeof networkAddresses === 'string') {
143
+ return networkAddresses;
144
+ }
145
+ if (deploymentType) {
146
+ const customDeploymentTypeAddress = deployment.deployments[deploymentType]?.address;
147
+ return (networkAddresses.find((address) => address === customDeploymentTypeAddress) ??
148
+ networkAddresses[0]);
149
+ }
150
+ return networkAddresses[0];
151
+ };
65
152
  exports.default = BaseContract;
66
153
  //# sourceMappingURL=BaseContract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseContract.js","sourceRoot":"","sources":["../../../src/contracts/BaseContract.ts"],"names":[],"mappings":";;AACA,mCAA+D;AAE/D,uEAAgG;AAShG;;;;;;;;;;;;;;GAcG;AACH,MAAM,YAAY;IAShB;;;;;;;;;;;OAWG;IACH,YACE,YAA0B,EAC1B,OAAe,EACf,YAA0B,EAC1B,UAA2B,EAC3B,WAAwB,EACxB,qBAA8B,EAC9B,iBAAmC,EACnC,MAA8B;QAiChC,eAAU,GAAuB,GAAG,EAAE;YACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,U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B,OAAO,EAAE,IAAI,CAAC,eAAe;YAC7B,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;CACF;8GA5HG,gBAA+C,EAC/C,UAA+B,EAC/B,cAA+B;IAE/B,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE,CAAC;QACzC,OAAO,gBAAgB,CAAA;IACzB,CAAC;IAED,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,2BAA2B,GAAG,UAAU,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,OAAO,CAAA;QAEnF,OAAO,CACL,gBAAgB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,2BAA2B,CAAC;YAC3E,gBAAgB,CAAC,CAAC,CAAC,CACpB,CAAA;IACH,CAAC;IAED,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAA;AAC5B,CAAC;AAwGH,kBAAe,YAAY,CAAA"}
@@ -1,8 +1,8 @@
1
1
  import { Abi } from 'abitype';
2
- import { ContractRunner, InterfaceAbi } from 'ethers';
3
2
  import SafeProvider from '../../SafeProvider';
4
3
  import BaseContract from '../../contracts/BaseContract';
5
- import { SafeVersion } from '@safe-global/safe-core-sdk-types';
4
+ import { DeploymentType } from '../../types';
5
+ import { SafeVersion } from '@safe-global/types-kit';
6
6
  import { contractName } from '../../contracts/config';
7
7
  /**
8
8
  * Abstract class CompatibilityFallbackHandlerBaseContract extends BaseContract to specifically integrate with the CompatibilityFallbackHandler contract.
@@ -17,7 +17,7 @@ import { contractName } from '../../contracts/config';
17
17
  * - CompatibilityFallbackHandlerContract_v1_4_1 extends CompatibilityFallbackHandlerBaseContract<CompatibilityFallbackHandlerContract_v1_4_1_Abi>
18
18
  * - CompatibilityFallbackHandlerContract_v1_3_0 extends CompatibilityFallbackHandlerBaseContract<CompatibilityFallbackHandlerContract_v1_3_0_Abi>
19
19
  */
20
- declare abstract class CompatibilityFallbackHandlerBaseContract<CompatibilityFallbackHandlerContractAbiType extends InterfaceAbi & Abi> extends BaseContract<CompatibilityFallbackHandlerContractAbiType> {
20
+ declare abstract class CompatibilityFallbackHandlerBaseContract<CompatibilityFallbackHandlerContractAbiType extends Abi> extends BaseContract<CompatibilityFallbackHandlerContractAbiType> {
21
21
  contractName: contractName;
22
22
  /**
23
23
  * @constructor
@@ -29,7 +29,8 @@ declare abstract class CompatibilityFallbackHandlerBaseContract<CompatibilityFal
29
29
  * @param safeVersion - The version of the Safe contract.
30
30
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
31
31
  * @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
32
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
32
33
  */
33
- constructor(chainId: bigint, safeProvider: SafeProvider, defaultAbi: CompatibilityFallbackHandlerContractAbiType, safeVersion: SafeVersion, customContractAddress?: string, customContractAbi?: CompatibilityFallbackHandlerContractAbiType, runner?: ContractRunner | null);
34
+ constructor(chainId: bigint, safeProvider: SafeProvider, defaultAbi: CompatibilityFallbackHandlerContractAbiType, safeVersion: SafeVersion, customContractAddress?: string, customContractAbi?: CompatibilityFallbackHandlerContractAbiType, deploymentType?: DeploymentType);
34
35
  }
35
36
  export default CompatibilityFallbackHandlerBaseContract;
@@ -28,10 +28,11 @@ class CompatibilityFallbackHandlerBaseContract extends BaseContract_1.default {
28
28
  * @param safeVersion - The version of the Safe contract.
29
29
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
30
30
  * @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
31
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
31
32
  */
32
- constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, runner) {
33
+ constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
33
34
  const contractName = 'compatibilityFallbackHandler';
34
- super(contractName, chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, runner);
35
+ super(contractName, chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType);
35
36
  this.contractName = contractName;
36
37
  }
37
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CompatibilityFallbackHandlerBaseContract.js","sourceRoot":"","sources":["../../../../src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.ts"],"names":[],"mappings":";;;;;AAIA,oGAA2E;AAI3E;;;;;;;;;;;;GAYG;AACH,MAAe,wCAEb,SAAQ,sBAAyD;IAGjE;;;;;;;;;;OAUG;IACH,YACE,OAAe,EACf,YAA0B,EAC1B,UAAuD,EACvD,WAAwB,EACxB,qBAA8B,EAC9B,iBAA+D,EAC/D,MAA8B;QAE9B,MAAM,YAAY,GAAG,8BAA8B,CAAA;QAEnD,KAAK,CACH,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,CACP,CAAA;QAED,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;CACF;AAED,kBAAe,wCAAwC,CAAA"}
1
+ {"version":3,"file":"CompatibilityFallbackHandlerBaseContract.js","sourceRoot":"","sources":["../../../../src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.ts"],"names":[],"mappings":";;;;;AAGA,oGAA2E;AAK3E;;;;;;;;;;;;GAYG;AACH,MAAe,wCAEb,SAAQ,sBAAyD;IAGjE;;;;;;;;;;;OAWG;IACH,YACE,OAAe,EACf,YAA0B,EAC1B,UAAuD,EACvD,WAAwB,EACxB,qBAA8B,EAC9B,iBAA+D,EAC/D,cAA+B;QAE/B,MAAM,YAAY,GAAG,8BAA8B,CAAA;QAEnD,KAAK,CACH,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,CACf,CAAA;QAED,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;CACF;AAED,kBAAe,wCAAwC,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import CompatibilityFallbackHandlerBaseContract from '../../../contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract';
2
2
  import SafeProvider from '../../../SafeProvider';
3
- import { SafeVersion, CompatibilityFallbackHandlerContract_v1_3_0_Abi, CompatibilityFallbackHandlerContract_v1_3_0_Contract } from '@safe-global/safe-core-sdk-types';
3
+ import { DeploymentType } from '../../../types';
4
+ import { CompatibilityFallbackHandlerContract_v1_3_0_Abi, CompatibilityFallbackHandlerContract_v1_3_0_Contract } from '@safe-global/types-kit';
4
5
  /**
5
6
  * CompatibilityFallbackHandlerContract_v1_3_0 is the implementation specific to the CompatibilityFallbackHandler contract version 1.3.0.
6
7
  *
@@ -10,7 +11,6 @@ import { SafeVersion, CompatibilityFallbackHandlerContract_v1_3_0_Abi, Compatibi
10
11
  * @implements CompatibilityFallbackHandlerContract_v1_3_0_Contract - Implements the interface specific to CompatibilityFallbackHandler contract version 1.3.0.
11
12
  */
12
13
  declare class CompatibilityFallbackHandlerContract_v1_3_0 extends CompatibilityFallbackHandlerBaseContract<CompatibilityFallbackHandlerContract_v1_3_0_Abi> implements CompatibilityFallbackHandlerContract_v1_3_0_Contract {
13
- safeVersion: SafeVersion;
14
14
  /**
15
15
  * Constructs an instance of CompatibilityFallbackHandlerContract_v1_3_0
16
16
  *
@@ -18,7 +18,8 @@ declare class CompatibilityFallbackHandlerContract_v1_3_0 extends CompatibilityF
18
18
  * @param safeProvider - An instance of SafeProvider.
19
19
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the CompatibilityFallbackHandler deployments based on the chainId and safeVersion.
20
20
  * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.3.0 is used.
21
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
21
22
  */
22
- constructor(chainId: bigint, safeProvider: SafeProvider, customContractAddress?: string, customContractAbi?: CompatibilityFallbackHandlerContract_v1_3_0_Abi);
23
+ constructor(chainId: bigint, safeProvider: SafeProvider, customContractAddress?: string, customContractAbi?: CompatibilityFallbackHandlerContract_v1_3_0_Abi, deploymentType?: DeploymentType);
23
24
  }
24
25
  export default CompatibilityFallbackHandlerContract_v1_3_0;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const CompatibilityFallbackHandlerBaseContract_1 = __importDefault(require("../../../contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract"));
7
- const safe_core_sdk_types_1 = require("@safe-global/safe-core-sdk-types");
7
+ const types_kit_1 = require("@safe-global/types-kit");
8
8
  /**
9
9
  * CompatibilityFallbackHandlerContract_v1_3_0 is the implementation specific to the CompatibilityFallbackHandler contract version 1.3.0.
10
10
  *
@@ -21,12 +21,12 @@ class CompatibilityFallbackHandlerContract_v1_3_0 extends CompatibilityFallbackH
21
21
  * @param safeProvider - An instance of SafeProvider.
22
22
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the CompatibilityFallbackHandler deployments based on the chainId and safeVersion.
23
23
  * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.3.0 is used.
24
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
24
25
  */
25
- constructor(chainId, safeProvider, customContractAddress, customContractAbi) {
26
+ constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
26
27
  const safeVersion = '1.3.0';
27
- const defaultAbi = safe_core_sdk_types_1.compatibilityFallbackHandler_1_3_0_ContractArtifacts.abi;
28
- super(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi);
29
- this.safeVersion = safeVersion;
28
+ const defaultAbi = types_kit_1.compatibilityFallbackHandler_1_3_0_ContractArtifacts.abi;
29
+ super(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType);
30
30
  }
31
31
  }
32
32
  exports.default = CompatibilityFallbackHandlerContract_v1_3_0;
@@ -1 +1 @@
1
- {"version":3,"file":"CompatibilityFallbackHandlerContract_v1_3_0.js","sourceRoot":"","sources":["../../../../../src/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandlerContract_v1_3_0.ts"],"names":[],"mappings":";;;;;AAAA,yLAAgK;AAEhK,0EAKyC;AAEzC;;;;;;;GAOG;AACH,MAAM,2CACJ,SAAQ,kDAAyF;IAKjG;;;;;;;OAOG;IACH,YACE,OAAe,EACf,YAA0B,EAC1B,qBAA8B,EAC9B,iBAAmE;QAEnE,MAAM,WAAW,GAAG,OAAO,CAAA;QAC3B,MAAM,UAAU,GAAG,0EAAoD,CAAC,GAAG,CAAA;QAE3E,KAAK,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,qBAAqB,EAAE,iBAAiB,CAAC,CAAA;QAE/F,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;IAChC,CAAC;CACF;AAED,kBAAe,2CAA2C,CAAA"}
1
+ {"version":3,"file":"CompatibilityFallbackHandlerContract_v1_3_0.js","sourceRoot":"","sources":["../../../../../src/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandlerContract_v1_3_0.ts"],"names":[],"mappings":";;;;;AAAA,yLAAgK;AAGhK,sDAI+B;AAE/B;;;;;;;GAOG;AACH,MAAM,2CACJ,SAAQ,kDAAyF;IAGjG;;;;;;;;OAQG;IACH,YACE,OAAe,EACf,YAA0B,EAC1B,qBAA8B,EAC9B,iBAAmE,EACnE,cAA+B;QAE/B,MAAM,WAAW,GAAG,OAAO,CAAA;QAC3B,MAAM,UAAU,GAAG,gEAAoD,CAAC,GAAG,CAAA;QAE3E,KAAK,CACH,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,CACf,CAAA;IACH,CAAC;CACF;AAED,kBAAe,2CAA2C,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import CompatibilityFallbackHandlerBaseContract from '../../../contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract';
2
2
  import SafeProvider from '../../../SafeProvider';
3
- import { CompatibilityFallbackHandlerContract_v1_4_1_Abi, CompatibilityFallbackHandlerContract_v1_4_1_Contract, SafeVersion } from '@safe-global/safe-core-sdk-types';
3
+ import { DeploymentType } from '../../../types';
4
+ import { CompatibilityFallbackHandlerContract_v1_4_1_Abi, CompatibilityFallbackHandlerContract_v1_4_1_Contract } from '@safe-global/types-kit';
4
5
  /**
5
6
  * CompatibilityFallbackHandlerContract_v1_4_1 is the implementation specific to the CompatibilityFallbackHandler contract version 1.4.1.
6
7
  *
@@ -10,7 +11,6 @@ import { CompatibilityFallbackHandlerContract_v1_4_1_Abi, CompatibilityFallbackH
10
11
  * @implements CompatibilityFallbackHandlerContract_v1_4_1_Contract - Implements the interface specific to CompatibilityFallbackHandler contract version 1.4.1.
11
12
  */
12
13
  declare class CompatibilityFallbackHandlerContract_v1_4_1 extends CompatibilityFallbackHandlerBaseContract<CompatibilityFallbackHandlerContract_v1_4_1_Abi> implements CompatibilityFallbackHandlerContract_v1_4_1_Contract {
13
- safeVersion: SafeVersion;
14
14
  /**
15
15
  * Constructs an instance of CompatibilityFallbackHandlerContract_v1_4_1
16
16
  *
@@ -18,7 +18,8 @@ declare class CompatibilityFallbackHandlerContract_v1_4_1 extends CompatibilityF
18
18
  * @param safeProvider - An instance of SafeProvider.
19
19
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the CompatibilityFallbackHandler deployments based on the chainId and safeVersion.
20
20
  * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.4.1 is used.
21
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
21
22
  */
22
- constructor(chainId: bigint, safeProvider: SafeProvider, customContractAddress?: string, customContractAbi?: CompatibilityFallbackHandlerContract_v1_4_1_Abi);
23
+ constructor(chainId: bigint, safeProvider: SafeProvider, customContractAddress?: string, customContractAbi?: CompatibilityFallbackHandlerContract_v1_4_1_Abi, deploymentType?: DeploymentType);
23
24
  }
24
25
  export default CompatibilityFallbackHandlerContract_v1_4_1;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const CompatibilityFallbackHandlerBaseContract_1 = __importDefault(require("../../../contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract"));
7
- const safe_core_sdk_types_1 = require("@safe-global/safe-core-sdk-types");
7
+ const types_kit_1 = require("@safe-global/types-kit");
8
8
  /**
9
9
  * CompatibilityFallbackHandlerContract_v1_4_1 is the implementation specific to the CompatibilityFallbackHandler contract version 1.4.1.
10
10
  *
@@ -21,12 +21,12 @@ class CompatibilityFallbackHandlerContract_v1_4_1 extends CompatibilityFallbackH
21
21
  * @param safeProvider - An instance of SafeProvider.
22
22
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the CompatibilityFallbackHandler deployments based on the chainId and safeVersion.
23
23
  * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.4.1 is used.
24
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
24
25
  */
25
- constructor(chainId, safeProvider, customContractAddress, customContractAbi) {
26
+ constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
26
27
  const safeVersion = '1.4.1';
27
- const defaultAbi = safe_core_sdk_types_1.compatibilityFallbackHandler_1_4_1_ContractArtifacts.abi;
28
- super(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi);
29
- this.safeVersion = safeVersion;
28
+ const defaultAbi = types_kit_1.compatibilityFallbackHandler_1_4_1_ContractArtifacts.abi;
29
+ super(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType);
30
30
  }
31
31
  }
32
32
  exports.default = CompatibilityFallbackHandlerContract_v1_4_1;
@@ -1 +1 @@
1
- {"version":3,"file":"CompatibilityFallbackHandlerContract_v1_4_1.js","sourceRoot":"","sources":["../../../../../src/contracts/CompatibilityFallbackHandler/v1.4.1/CompatibilityFallbackHandlerContract_v1_4_1.ts"],"names":[],"mappings":";;;;;AAAA,yLAAgK;AAEhK,0EAKyC;AAEzC;;;;;;;GAOG;AACH,MAAM,2CACJ,SAAQ,kDAAyF;IAKjG;;;;;;;OAOG;IACH,YACE,OAAe,EACf,YAA0B,EAC1B,qBAA8B,EAC9B,iBAAmE;QAEnE,MAAM,WAAW,GAAG,OAAO,CAAA;QAC3B,MAAM,UAAU,GAAG,0EAAoD,CAAC,GAAG,CAAA;QAE3E,KAAK,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,qBAAqB,EAAE,iBAAiB,CAAC,CAAA;QAE/F,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;IAChC,CAAC;CACF;AAED,kBAAe,2CAA2C,CAAA"}
1
+ {"version":3,"file":"CompatibilityFallbackHandlerContract_v1_4_1.js","sourceRoot":"","sources":["../../../../../src/contracts/CompatibilityFallbackHandler/v1.4.1/CompatibilityFallbackHandlerContract_v1_4_1.ts"],"names":[],"mappings":";;;;;AAAA,yLAAgK;AAGhK,sDAI+B;AAE/B;;;;;;;GAOG;AACH,MAAM,2CACJ,SAAQ,kDAAyF;IAGjG;;;;;;;;OAQG;IACH,YACE,OAAe,EACf,YAA0B,EAC1B,qBAA8B,EAC9B,iBAAmE,EACnE,cAA+B;QAE/B,MAAM,WAAW,GAAG,OAAO,CAAA;QAC3B,MAAM,UAAU,GAAG,gEAAoD,CAAC,GAAG,CAAA;QAE3E,KAAK,CACH,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,CACf,CAAA;IACH,CAAC;CACF;AAED,kBAAe,2CAA2C,CAAA"}
@@ -1,8 +1,8 @@
1
1
  import { Abi } from 'abitype';
2
- import { ContractRunner, InterfaceAbi } from 'ethers';
3
2
  import SafeProvider from '../../SafeProvider';
3
+ import { DeploymentType } from '../../types';
4
4
  import BaseContract from '../../contracts/BaseContract';
5
- import { SafeVersion } from '@safe-global/safe-core-sdk-types';
5
+ import { SafeVersion } from '@safe-global/types-kit';
6
6
  import { contractName } from '../../contracts/config';
7
7
  /**
8
8
  * Abstract class CreateCallBaseContract extends BaseContract to specifically integrate with the CreateCall contract.
@@ -17,7 +17,7 @@ import { contractName } from '../../contracts/config';
17
17
  * - CreateCallContract_v1_4_1 extends CreateCallBaseContract<CreateCallContract_v1_4_1_Abi>
18
18
  * - CreateCallContract_v1_3_0 extends CreateCallBaseContract<CreateCallContract_v1_3_0_Abi>
19
19
  */
20
- declare abstract class CreateCallBaseContract<CreateCallContractAbiType extends InterfaceAbi & Abi> extends BaseContract<CreateCallContractAbiType> {
20
+ declare abstract class CreateCallBaseContract<CreateCallContractAbiType extends Abi> extends BaseContract<CreateCallContractAbiType> {
21
21
  contractName: contractName;
22
22
  /**
23
23
  * @constructor
@@ -29,7 +29,8 @@ declare abstract class CreateCallBaseContract<CreateCallContractAbiType extends
29
29
  * @param safeVersion - The version of the Safe contract.
30
30
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
31
31
  * @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
32
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
32
33
  */
33
- constructor(chainId: bigint, safeProvider: SafeProvider, defaultAbi: CreateCallContractAbiType, safeVersion: SafeVersion, customContractAddress?: string, customContractAbi?: CreateCallContractAbiType, runner?: ContractRunner | null);
34
+ constructor(chainId: bigint, safeProvider: SafeProvider, defaultAbi: CreateCallContractAbiType, safeVersion: SafeVersion, customContractAddress?: string, customContractAbi?: CreateCallContractAbiType, deploymentType?: DeploymentType);
34
35
  }
35
36
  export default CreateCallBaseContract;
@@ -28,10 +28,11 @@ class CreateCallBaseContract extends BaseContract_1.default {
28
28
  * @param safeVersion - The version of the Safe contract.
29
29
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
30
30
  * @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
31
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
31
32
  */
32
- constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, runner) {
33
+ constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
33
34
  const contractName = 'createCallVersion';
34
- super(contractName, chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, runner);
35
+ super(contractName, chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType);
35
36
  this.contractName = contractName;
36
37
  }
37
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CreateCallBaseContract.js","sourceRoot":"","sources":["../../../../src/contracts/CreateCall/CreateCallBaseContract.ts"],"names":[],"mappings":";;;;;AAIA,oGAA2E;AAI3E;;;;;;;;;;;;GAYG;AACH,MAAe,sBAEb,SAAQ,sBAAuC;IAG/C;;;;;;;;;;OAUG;IACH,YACE,OAAe,EACf,YAA0B,EAC1B,UAAqC,EACrC,WAAwB,EACxB,qBAA8B,EAC9B,iBAA6C,EAC7C,MAA8B;QAE9B,MAAM,YAAY,GAAG,mBAAmB,CAAA;QAExC,KAAK,CACH,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,CACP,CAAA;QAED,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;CACF;AAED,kBAAe,sBAAsB,CAAA"}
1
+ {"version":3,"file":"CreateCallBaseContract.js","sourceRoot":"","sources":["../../../../src/contracts/CreateCall/CreateCallBaseContract.ts"],"names":[],"mappings":";;;;;AAIA,oGAA2E;AAI3E;;;;;;;;;;;;GAYG;AACH,MAAe,sBAEb,SAAQ,sBAAuC;IAG/C;;;;;;;;;;;OAWG;IACH,YACE,OAAe,EACf,YAA0B,EAC1B,UAAqC,EACrC,WAAwB,EACxB,qBAA8B,EAC9B,iBAA6C,EAC7C,cAA+B;QAE/B,MAAM,YAAY,GAAG,mBAAmB,CAAA;QAExC,KAAK,CACH,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,CACf,CAAA;QAED,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;CACF;AAED,kBAAe,sBAAsB,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import CreateCallBaseContract from '../../../contracts/CreateCall/CreateCallBaseContract';
2
- import { SafeVersion, CreateCallContract_v1_3_0_Abi, CreateCallContract_v1_3_0_Contract, SafeContractFunction } from '@safe-global/safe-core-sdk-types';
2
+ import { CreateCallContract_v1_3_0_Abi, CreateCallContract_v1_3_0_Contract, SafeContractFunction } from '@safe-global/types-kit';
3
3
  import SafeProvider from '../../../SafeProvider';
4
+ import { DeploymentType } from '../../../types';
4
5
  /**
5
6
  * CreateCallContract_v1_3_0 is the implementation specific to the CreateCall contract version 1.3.0.
6
7
  *
@@ -10,7 +11,6 @@ import SafeProvider from '../../../SafeProvider';
10
11
  * @implements CreateCallContract_v1_3_0_Contract - Implements the interface specific to CreateCall contract version 1.3.0.
11
12
  */
12
13
  declare class CreateCallContract_v1_3_0 extends CreateCallBaseContract<CreateCallContract_v1_3_0_Abi> implements CreateCallContract_v1_3_0_Contract {
13
- safeVersion: SafeVersion;
14
14
  /**
15
15
  * Constructs an instance of CreateCallContract_v1_3_0
16
16
  *
@@ -18,8 +18,9 @@ declare class CreateCallContract_v1_3_0 extends CreateCallBaseContract<CreateCal
18
18
  * @param safeProvider - An instance of SafeProvider.
19
19
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the CreateCall deployments based on the chainId and safeVersion.
20
20
  * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.3.0 is used.
21
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
21
22
  */
22
- constructor(chainId: bigint, safeProvider: SafeProvider, customContractAddress?: string, customContractAbi?: CreateCallContract_v1_3_0_Abi);
23
+ constructor(chainId: bigint, safeProvider: SafeProvider, customContractAddress?: string, customContractAbi?: CreateCallContract_v1_3_0_Abi, deploymentType?: DeploymentType);
23
24
  /**
24
25
  * @param args - Array[value, deploymentData]
25
26
  * @param options - TransactionOptions
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const CreateCallBaseContract_1 = __importDefault(require("../../../contracts/CreateCall/CreateCallBaseContract"));
7
- const safe_core_sdk_types_1 = require("@safe-global/safe-core-sdk-types");
7
+ const types_kit_1 = require("@safe-global/types-kit");
8
8
  const utils_1 = require("../../../contracts/utils");
9
9
  /**
10
10
  * CreateCallContract_v1_3_0 is the implementation specific to the CreateCall contract version 1.3.0.
@@ -22,11 +22,12 @@ class CreateCallContract_v1_3_0 extends CreateCallBaseContract_1.default {
22
22
  * @param safeProvider - An instance of SafeProvider.
23
23
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the CreateCall deployments based on the chainId and safeVersion.
24
24
  * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.3.0 is used.
25
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
25
26
  */
26
- constructor(chainId, safeProvider, customContractAddress, customContractAbi) {
27
+ constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
27
28
  const safeVersion = '1.3.0';
28
- const defaultAbi = safe_core_sdk_types_1.createCall_1_3_0_ContractArtifacts.abi;
29
- super(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi);
29
+ const defaultAbi = types_kit_1.createCall_1_3_0_ContractArtifacts.abi;
30
+ super(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType);
30
31
  /**
31
32
  * @param args - Array[value, deploymentData]
32
33
  * @param options - TransactionOptions
@@ -36,8 +37,7 @@ class CreateCallContract_v1_3_0 extends CreateCallBaseContract_1.default {
36
37
  if (options && !options.gasLimit) {
37
38
  options.gasLimit = (await this.estimateGas('performCreate', [...args], { ...options })).toString();
38
39
  }
39
- const txResponse = await this.contract.performCreate(...args, { ...options });
40
- return (0, utils_1.toTxResult)(txResponse, options);
40
+ return (0, utils_1.toTxResult)(this.runner, await this.write('performCreate', args, options), options);
41
41
  };
42
42
  /**
43
43
  * @param args - Array[value, deploymentData, salt]
@@ -48,10 +48,8 @@ class CreateCallContract_v1_3_0 extends CreateCallBaseContract_1.default {
48
48
  if (options && !options.gasLimit) {
49
49
  options.gasLimit = (await this.estimateGas('performCreate2', args, options)).toString();
50
50
  }
51
- const txResponse = await this.contract.performCreate2(...args);
52
- return (0, utils_1.toTxResult)(txResponse, options);
51
+ return (0, utils_1.toTxResult)(this.runner, await this.write('performCreate2', args, options), options);
53
52
  };
54
- this.safeVersion = safeVersion;
55
53
  }
56
54
  }
57
55
  exports.default = CreateCallContract_v1_3_0;
@@ -1 +1 @@
1
- {"version":3,"file":"CreateCallContract_v1_3_0.js","sourceRoot":"","sources":["../../../../../src/contracts/CreateCall/v1.3.0/CreateCallContract_v1_3_0.ts"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AAC,QAAQ,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,CAAA;YAC9D,OAAO,IAAA,kBAAU,EAAC,UAAU,EAAE,OAAO,CAAC,CAAA;QACxC,CAAC,CAAA;QAnCC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;IAChC,CAAC;CAmCF;AAED,kBAAe,yBAAyB,CAAA"}
1
+ {"version":3,"file":"CreateCallContract_v1_3_0.js","sourceRoot":"","sources":["../../../../../src/contracts/CreateCall/v1.3.0/CreateCallContract_v1_3_0.ts"],"names":[],"mappings":";;;;;AAAA,mIAA0G;AAC1G,sDAK+B;AAC/B,qEAAsE;AAItE;;;;;;;GAOG;AACH,MAAM,yBACJ,SAAQ,gCAAqD;IAG7D;;;;;;;;OAQG;IACH,YACE,OAAe,EACf,YAA0B,EAC1B,qBAA8B,EAC9B,iBAAiD,EACjD,cAA+B;QAE/B,MAAM,WAAW,GAAG,OAAO,CAAA;QAC3B,MAAM,UAAU,GAAG,8CAAkC,CAAC,GAAG,CAAA;QAEzD,KAAK,CACH,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,CACf,CAAA;QAGH;;;;WAIG;QACH,kBAAa,GAAyE,KAAK,EACzF,IAAI,EACJ,OAAO,EACP,EAAE;YACF,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACjC,OAAO,CAAC,QAAQ,GAAG,CACjB,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CACnE,CAAC,QAAQ,EAAE,CAAA;YACd,CAAC;YAED,OAAO,IAAA,kBAAU,EAAC,IAAI,CAAC,MAAO,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAA;QAC5F,CAAC,CAAA;QAED;;;;WAIG;QACH,mBAAc,GAA0E,KAAK,EAC3F,IAAI,EACJ,OAAO,EACP,EAAE;YACF,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACjC,OAAO,CAAC,QAAQ,GAAG,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;YACzF,CAAC;YAED,OAAO,IAAA,kBAAU,EAAC,IAAI,CAAC,MAAO,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAA;QAC7F,CAAC,CAAA;IAlCD,CAAC;CAmCF;AAED,kBAAe,yBAAyB,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import CreateCallBaseContract from '../../../contracts/CreateCall/CreateCallBaseContract';
2
2
  import SafeProvider from '../../../SafeProvider';
3
- import { SafeVersion, CreateCallContract_v1_4_1_Abi, CreateCallContract_v1_4_1_Contract, SafeContractFunction } from '@safe-global/safe-core-sdk-types';
3
+ import { DeploymentType } from '../../../types';
4
+ import { CreateCallContract_v1_4_1_Abi, CreateCallContract_v1_4_1_Contract, SafeContractFunction } from '@safe-global/types-kit';
4
5
  /**
5
6
  * CreateCallContract_v1_4_1 is the implementation specific to the CreateCall contract version 1.4.1.
6
7
  *
@@ -10,7 +11,6 @@ import { SafeVersion, CreateCallContract_v1_4_1_Abi, CreateCallContract_v1_4_1_C
10
11
  * @implements CreateCallContract_v1_4_1_Contract - Implements the interface specific to CreateCall contract version 1.4.1.
11
12
  */
12
13
  declare class CreateCallContract_v1_4_1 extends CreateCallBaseContract<CreateCallContract_v1_4_1_Abi> implements CreateCallContract_v1_4_1_Contract {
13
- safeVersion: SafeVersion;
14
14
  /**
15
15
  * Constructs an instance of CreateCallContract_v1_4_1
16
16
  *
@@ -18,8 +18,9 @@ declare class CreateCallContract_v1_4_1 extends CreateCallBaseContract<CreateCal
18
18
  * @param safeProvider - An instance of SafeProvider.
19
19
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the CreateCall deployments based on the chainId and safeVersion.
20
20
  * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.4.1 is used.
21
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
21
22
  */
22
- constructor(chainId: bigint, safeProvider: SafeProvider, customContractAddress?: string, customContractAbi?: CreateCallContract_v1_4_1_Abi);
23
+ constructor(chainId: bigint, safeProvider: SafeProvider, customContractAddress?: string, customContractAbi?: CreateCallContract_v1_4_1_Abi, deploymentType?: DeploymentType);
23
24
  /**
24
25
  * @param args - Array[value, deploymentData]
25
26
  * @param options - TransactionOptions