punkkit-sdk 1.0.17 → 1.0.18

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.
package/dist/index.js CHANGED
@@ -35530,7 +35530,14 @@ function getAbi(artifact) {
35530
35530
  return artifact.abi ? artifact.abi : artifact;
35531
35531
  }
35532
35532
  async function getContract(wallet, name) {
35533
- console.log(`Getting contract `, name, CONTRACT_ADDRESSES.LiquidPool);
35533
+ const address = CONTRACT_ADDRESSES[`${name}`];
35534
+ console.log(`[SDK] Getting contract ${name} at address: ${address}`);
35535
+ if (wallet.provider) {
35536
+ const code = await wallet.provider.getCode(address);
35537
+ if (code === "0x") {
35538
+ console.error(`[SDK] WARNING: Contract ${name} at ${address} has NO CODE (it is empty). Check your network connection or deployment.`);
35539
+ }
35540
+ }
35534
35541
  switch (name) {
35535
35542
  case "Token0":
35536
35543
  return new ethers_exports.Contract(CONTRACT_ADDRESSES.Token0, getAbi(CONTRACTS_ABI.MockERC20), wallet);
package/dist/index.mjs CHANGED
@@ -35534,7 +35534,14 @@ function getAbi(artifact) {
35534
35534
  return artifact.abi ? artifact.abi : artifact;
35535
35535
  }
35536
35536
  async function getContract(wallet, name) {
35537
- console.log(`Getting contract `, name, CONTRACT_ADDRESSES.LiquidPool);
35537
+ const address = CONTRACT_ADDRESSES[`${name}`];
35538
+ console.log(`[SDK] Getting contract ${name} at address: ${address}`);
35539
+ if (wallet.provider) {
35540
+ const code = await wallet.provider.getCode(address);
35541
+ if (code === "0x") {
35542
+ console.error(`[SDK] WARNING: Contract ${name} at ${address} has NO CODE (it is empty). Check your network connection or deployment.`);
35543
+ }
35544
+ }
35538
35545
  switch (name) {
35539
35546
  case "Token0":
35540
35547
  return new ethers_exports.Contract(CONTRACT_ADDRESSES.Token0, getAbi(CONTRACTS_ABI.MockERC20), wallet);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "punkkit-sdk",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "devDependencies": {
5
5
  "@nomicfoundation/hardhat-chai-matchers": "1.0.2",
6
6
  "@nomicfoundation/hardhat-network-helpers": "^1.1.2",