Skip to content

Commit ab60ba4

Browse files
committed
fix: add missing PubkeyRouter.getDerivedPubkey method
1 parent 1dac723 commit ab60ba4

File tree

6 files changed

+10881
-0
lines changed

6 files changed

+10881
-0
lines changed

packages/contracts/dist/custom-network-signatures.cjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ var METHODS_TO_EXTRACT = [
7575
"PubkeyRouter.ethAddressToPkpId",
7676
"PubkeyRouter.getPubkey",
7777
"PubkeyRouter.getEthAddress",
78+
"PubkeyRouter.getDerivedPubkey",
7879
// Ledger:
7980
"Ledger.deposit",
8081
"Ledger.depositForUser",
@@ -5148,6 +5149,14 @@ function generateAbiSignatures(networkData) {
51485149
if (methodsByContract.has(contractName)) {
51495150
const methods = methodsByContract.get(contractName);
51505151
const contractMethods = extractAbiMethods(networkData, methods);
5152+
const missingMethods = methods.filter(
5153+
(methodName) => !contractMethods[methodName]
5154+
);
5155+
if (missingMethods.length > 0) {
5156+
throw new Error(
5157+
`Missing ABI definitions for ${contractName}: ${missingMethods.join(", ")}. Ensure your networkContext.json includes these functions.`
5158+
);
5159+
}
51515160
if (Object.keys(contractMethods).length > 0) {
51525161
const address = contractGroup.contracts[0].address_hash;
51535162
const events = contractGroup.contracts[0].ABI.filter(

packages/contracts/dist/custom-network-signatures.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ var METHODS_TO_EXTRACT = [
3939
"PubkeyRouter.ethAddressToPkpId",
4040
"PubkeyRouter.getPubkey",
4141
"PubkeyRouter.getEthAddress",
42+
"PubkeyRouter.getDerivedPubkey",
4243
// Ledger:
4344
"Ledger.deposit",
4445
"Ledger.depositForUser",
@@ -5112,6 +5113,14 @@ function generateAbiSignatures(networkData) {
51125113
if (methodsByContract.has(contractName)) {
51135114
const methods = methodsByContract.get(contractName);
51145115
const contractMethods = extractAbiMethods(networkData, methods);
5116+
const missingMethods = methods.filter(
5117+
(methodName) => !contractMethods[methodName]
5118+
);
5119+
if (missingMethods.length > 0) {
5120+
throw new Error(
5121+
`Missing ABI definitions for ${contractName}: ${missingMethods.join(", ")}. Ensure your networkContext.json includes these functions.`
5122+
);
5123+
}
51155124
if (Object.keys(contractMethods).length > 0) {
51165125
const address = contractGroup.contracts[0].address_hash;
51175126
const events = contractGroup.contracts[0].ABI.filter(

packages/contracts/src/custom-network-signatures.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,17 @@ function generateAbiSignatures(networkData: NetworkCache) {
208208
if (methodsByContract.has(contractName)) {
209209
const methods = methodsByContract.get(contractName)!;
210210
const contractMethods = extractAbiMethods(networkData, methods);
211+
const missingMethods = methods.filter(
212+
(methodName) => !contractMethods[methodName]
213+
);
214+
215+
if (missingMethods.length > 0) {
216+
throw new Error(
217+
`Missing ABI definitions for ${contractName}: ${missingMethods.join(
218+
', '
219+
)}. ` + 'Ensure your networkContext.json includes these functions.'
220+
);
221+
}
211222

212223
if (Object.keys(contractMethods).length > 0) {
213224
const address = contractGroup.contracts[0].address_hash;
@@ -261,6 +272,8 @@ export function buildSignaturesFromContext(
261272
console.log('📊 Generating signatures...');
262273
const signatures = generateAbiSignatures(jsonData);
263274

275+
console.log('✅ Signatures generated successfully for network:', networkName);
276+
264277
return {
265278
signatures,
266279
networkName,

0 commit comments

Comments
 (0)