clanker-sdk 3.1.6 → 3.1.8
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/README.md +1 -1
- package/dist/index.js +10 -8
- package/dist/index.mjs +11 -8
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(index_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(index_exports);
|
|
26
26
|
var import_viem = require("viem");
|
|
27
|
+
var import_actions = require("viem/actions");
|
|
27
28
|
|
|
28
29
|
// src/constants.ts
|
|
29
30
|
var WETH_ADDRESS = "0x4200000000000000000000000000000000000006";
|
|
@@ -523,8 +524,6 @@ var Clanker_v3_1_abi = [
|
|
|
523
524
|
];
|
|
524
525
|
|
|
525
526
|
// src/index.ts
|
|
526
|
-
var import_simulateContract = require("viem/_types/actions/public/simulateContract");
|
|
527
|
-
var import_writeContract = require("viem/_types/actions/wallet/writeContract");
|
|
528
527
|
var Clanker = class {
|
|
529
528
|
wallet;
|
|
530
529
|
factoryAddress;
|
|
@@ -628,7 +627,7 @@ var Clanker = class {
|
|
|
628
627
|
interfaceRewardRecipient: rewardsConfig.interfaceRewardRecipient
|
|
629
628
|
}
|
|
630
629
|
};
|
|
631
|
-
const { request } = await (0,
|
|
630
|
+
const { request } = await (0, import_actions.simulateContract)(this.publicClient, {
|
|
632
631
|
address: this.factoryAddress,
|
|
633
632
|
abi: Clanker_v3_1_abi,
|
|
634
633
|
functionName: "deployToken",
|
|
@@ -637,16 +636,19 @@ var Clanker = class {
|
|
|
637
636
|
chain: this.publicClient.chain,
|
|
638
637
|
account: this.wallet.account
|
|
639
638
|
});
|
|
640
|
-
const hash = await (0,
|
|
639
|
+
const hash = await (0, import_actions.writeContract)(this.wallet, request);
|
|
641
640
|
const receipt = await this.publicClient.waitForTransactionReceipt({
|
|
642
641
|
hash
|
|
643
642
|
});
|
|
644
|
-
const
|
|
645
|
-
|
|
643
|
+
const [log] = (0, import_viem.parseEventLogs)({
|
|
644
|
+
abi: Clanker_v3_1_abi,
|
|
645
|
+
eventName: "TokenCreated",
|
|
646
|
+
logs: receipt.logs
|
|
647
|
+
});
|
|
648
|
+
if (!log) {
|
|
646
649
|
throw new Error("No deployment event found");
|
|
647
650
|
}
|
|
648
|
-
|
|
649
|
-
return tokenAddress;
|
|
651
|
+
return log.args.tokenAddress;
|
|
650
652
|
} catch (error) {
|
|
651
653
|
this.handleError(error);
|
|
652
654
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -3,8 +3,10 @@ import {
|
|
|
3
3
|
getContract,
|
|
4
4
|
parseEther,
|
|
5
5
|
stringify,
|
|
6
|
-
erc20Abi
|
|
6
|
+
erc20Abi,
|
|
7
|
+
parseEventLogs
|
|
7
8
|
} from "viem";
|
|
9
|
+
import { simulateContract, writeContract } from "viem/actions";
|
|
8
10
|
|
|
9
11
|
// src/constants.ts
|
|
10
12
|
var WETH_ADDRESS = "0x4200000000000000000000000000000000000006";
|
|
@@ -504,8 +506,6 @@ var Clanker_v3_1_abi = [
|
|
|
504
506
|
];
|
|
505
507
|
|
|
506
508
|
// src/index.ts
|
|
507
|
-
import { simulateContract } from "viem/_types/actions/public/simulateContract";
|
|
508
|
-
import { writeContract } from "viem/_types/actions/wallet/writeContract";
|
|
509
509
|
var Clanker = class {
|
|
510
510
|
wallet;
|
|
511
511
|
factoryAddress;
|
|
@@ -609,7 +609,7 @@ var Clanker = class {
|
|
|
609
609
|
interfaceRewardRecipient: rewardsConfig.interfaceRewardRecipient
|
|
610
610
|
}
|
|
611
611
|
};
|
|
612
|
-
const { request } = await simulateContract(this.
|
|
612
|
+
const { request } = await simulateContract(this.publicClient, {
|
|
613
613
|
address: this.factoryAddress,
|
|
614
614
|
abi: Clanker_v3_1_abi,
|
|
615
615
|
functionName: "deployToken",
|
|
@@ -622,12 +622,15 @@ var Clanker = class {
|
|
|
622
622
|
const receipt = await this.publicClient.waitForTransactionReceipt({
|
|
623
623
|
hash
|
|
624
624
|
});
|
|
625
|
-
const
|
|
626
|
-
|
|
625
|
+
const [log] = parseEventLogs({
|
|
626
|
+
abi: Clanker_v3_1_abi,
|
|
627
|
+
eventName: "TokenCreated",
|
|
628
|
+
logs: receipt.logs
|
|
629
|
+
});
|
|
630
|
+
if (!log) {
|
|
627
631
|
throw new Error("No deployment event found");
|
|
628
632
|
}
|
|
629
|
-
|
|
630
|
-
return tokenAddress;
|
|
633
|
+
return log.args.tokenAddress;
|
|
631
634
|
} catch (error) {
|
|
632
635
|
this.handleError(error);
|
|
633
636
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clanker-sdk",
|
|
3
|
-
"version": "3.1.
|
|
4
|
-
"description": "SDK for deploying tokens using Clanker v3.1.
|
|
3
|
+
"version": "3.1.8",
|
|
4
|
+
"description": "SDK for deploying tokens using Clanker v3.1.3",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|