@towns-labs/relayer 2.1.1 → 3.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.
- package/dist/README.md +1 -1
- package/dist/index.js +74 -58
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
- package/src/rpc/schema/prepareCalls.ts +4 -6
- package/src/rpc/schema/upgradeAccount.ts +3 -3
package/dist/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
This folder contains the built output assets for the worker "relayer-worker" generated at 2026-02-
|
|
1
|
+
This folder contains the built output assets for the worker "relayer-worker" generated at 2026-02-18T05:42:51.313Z.
|
package/dist/index.js
CHANGED
|
@@ -12238,6 +12238,18 @@ var addresses_default = {
|
|
|
12238
12238
|
simulator: "0xDAD7c34d0c41698B227D3C5ee3d6d88A78c63a65",
|
|
12239
12239
|
townsAccount: "0x2eEBFfcFABEB8cE3AC016effFeC37dBBAccCff2a"
|
|
12240
12240
|
}
|
|
12241
|
+
},
|
|
12242
|
+
"42161": {
|
|
12243
|
+
addresses: {
|
|
12244
|
+
accountProxy: "0x9172852305F32819469bf38A3772f29361d7b768",
|
|
12245
|
+
escrow: "0x05f9597eed844410b7c0746A1C584188d0644730",
|
|
12246
|
+
multiSigSigner: "0xa3972FEebd6E1f973eD19cC586D79B3F61f892A3",
|
|
12247
|
+
orchestrator: "0x11050FEC41B66730E91c46Bfd25EBFF3B16F5bcC",
|
|
12248
|
+
simpleFunder: "0x41D23D227C6D0F732D41eE5c203C48d96292A48B",
|
|
12249
|
+
simpleSettler: "0x5386d1026e1598177e03eA52cbF1a0994ADF5eaE",
|
|
12250
|
+
simulator: "0xDAD7c34d0c41698B227D3C5ee3d6d88A78c63a65",
|
|
12251
|
+
townsAccount: "0x4f58d66c5d55B4E6f0aA578Df8D9342f63473FF6"
|
|
12252
|
+
}
|
|
12241
12253
|
}
|
|
12242
12254
|
},
|
|
12243
12255
|
stage: {
|
|
@@ -12264,6 +12276,18 @@ var addresses_default = {
|
|
|
12264
12276
|
simulator: "0xDAD7c34d0c41698B227D3C5ee3d6d88A78c63a65",
|
|
12265
12277
|
townsAccount: "0x4f58d66c5d55B4E6f0aA578Df8D9342f63473FF6"
|
|
12266
12278
|
}
|
|
12279
|
+
},
|
|
12280
|
+
"42161": {
|
|
12281
|
+
addresses: {
|
|
12282
|
+
accountProxy: "0xeE06c19146427bDd5abb702579F3B0568b24Bf6F",
|
|
12283
|
+
escrow: "0x05f9597eed844410b7c0746A1C584188d0644730",
|
|
12284
|
+
multiSigSigner: "0xa3972FEebd6E1f973eD19cC586D79B3F61f892A3",
|
|
12285
|
+
orchestrator: "0x11050FEC41B66730E91c46Bfd25EBFF3B16F5bcC",
|
|
12286
|
+
simpleFunder: "0xf297614c45E3AfAAC849B7Cde4A20A8cF336D8bF",
|
|
12287
|
+
simpleSettler: "0x195424235453eC103082A9406AEE0Cc30E908b24",
|
|
12288
|
+
simulator: "0xDAD7c34d0c41698B227D3C5ee3d6d88A78c63a65",
|
|
12289
|
+
townsAccount: "0x4f58d66c5d55B4E6f0aA578Df8D9342f63473FF6"
|
|
12290
|
+
}
|
|
12267
12291
|
}
|
|
12268
12292
|
}
|
|
12269
12293
|
};
|
|
@@ -24497,7 +24521,7 @@ function selectSignerForEoa(eoa, signerCount) {
|
|
|
24497
24521
|
__name(selectSignerForEoa, "selectSignerForEoa");
|
|
24498
24522
|
|
|
24499
24523
|
// src/rpc/methods/shared/calls-helpers.ts
|
|
24500
|
-
function getChainIdFromContext(context
|
|
24524
|
+
function getChainIdFromContext(context) {
|
|
24501
24525
|
if ("quote" in context && context.quote?.quotes?.length) {
|
|
24502
24526
|
const first = parseHexChainId(context.quote.quotes[0].chainId, "chain_id");
|
|
24503
24527
|
for (const quote of context.quote.quotes) {
|
|
@@ -24577,30 +24601,11 @@ function hashQuotes(signedQuotes, config2) {
|
|
|
24577
24601
|
}
|
|
24578
24602
|
__name(hashQuotes, "hashQuotes");
|
|
24579
24603
|
function extractIntentFromContext(context) {
|
|
24580
|
-
|
|
24581
|
-
|
|
24582
|
-
|
|
24583
|
-
throw new RpcError2(INVALID_PARAMS, "No quote found in context");
|
|
24584
|
-
}
|
|
24585
|
-
return quote.intent;
|
|
24604
|
+
const quote = context.quote.quotes[0];
|
|
24605
|
+
if (!quote) {
|
|
24606
|
+
throw new RpcError2(INVALID_PARAMS, "No quote found in context");
|
|
24586
24607
|
}
|
|
24587
|
-
|
|
24588
|
-
return {
|
|
24589
|
-
eoa: legacyContext.eoa,
|
|
24590
|
-
calls: legacyContext.calls,
|
|
24591
|
-
nonce: legacyContext.nonce,
|
|
24592
|
-
combinedGas: legacyContext.combinedGas,
|
|
24593
|
-
expiry: legacyContext.expiry,
|
|
24594
|
-
encodedPreCalls: legacyContext.encodedPreCalls,
|
|
24595
|
-
funder: legacyContext.funder,
|
|
24596
|
-
encodedFundTransfers: legacyContext.encodedFundTransfers,
|
|
24597
|
-
settler: legacyContext.settler,
|
|
24598
|
-
settlerContext: legacyContext.settlerContext,
|
|
24599
|
-
payer: legacyContext.payer,
|
|
24600
|
-
paymentToken: legacyContext.paymentToken,
|
|
24601
|
-
paymentMaxAmount: legacyContext.paymentMaxAmount,
|
|
24602
|
-
paymentSignature: legacyContext.paymentSignature
|
|
24603
|
-
};
|
|
24608
|
+
return quote.intent;
|
|
24604
24609
|
}
|
|
24605
24610
|
__name(extractIntentFromContext, "extractIntentFromContext");
|
|
24606
24611
|
async function validateQuote(signedQuotes, env) {
|
|
@@ -24635,12 +24640,7 @@ function buildIntentFromParams(params) {
|
|
|
24635
24640
|
const { context, signature, paymentSignature: paramsPaymentSig, capabilities } = params;
|
|
24636
24641
|
const explicitPaymentSignature = paramsPaymentSig ?? capabilities?.feeSignature;
|
|
24637
24642
|
const quoteIntent = extractIntentFromContext(context);
|
|
24638
|
-
|
|
24639
|
-
if ("quote" in context && context.quote?.quotes[0]) {
|
|
24640
|
-
calculatedPaymentAmount = context.quote.quotes[0].paymentAmount ?? "0";
|
|
24641
|
-
} else if ("paymentAmount" in context && context.paymentAmount) {
|
|
24642
|
-
calculatedPaymentAmount = context.paymentAmount;
|
|
24643
|
-
}
|
|
24643
|
+
const calculatedPaymentAmount = context.quote.quotes[0]?.paymentAmount ?? "0";
|
|
24644
24644
|
return {
|
|
24645
24645
|
eoa: quoteIntent.eoa,
|
|
24646
24646
|
calls: quoteIntent.calls.map((call2) => ({
|
|
@@ -24703,7 +24703,7 @@ async function handleSendPreparedCalls(params, ctx) {
|
|
|
24703
24703
|
const quoteError = await validateQuote(context.quote, env);
|
|
24704
24704
|
if (quoteError) throw quoteError;
|
|
24705
24705
|
}
|
|
24706
|
-
const chainId = getChainIdFromContext(context
|
|
24706
|
+
const chainId = getChainIdFromContext(context);
|
|
24707
24707
|
const supportedChainIds = getChainIds(env);
|
|
24708
24708
|
if (supportedChainIds.length > 0 && !supportedChainIds.includes(chainId)) {
|
|
24709
24709
|
throw new RpcError2(INVALID_PARAMS, `Unsupported chain ID: ${chainId}`);
|
|
@@ -24876,7 +24876,7 @@ async function handleBatchSendPreparedCalls(requests, ctx) {
|
|
|
24876
24876
|
continue;
|
|
24877
24877
|
}
|
|
24878
24878
|
}
|
|
24879
|
-
const chainId = getChainIdFromContext(typedParams.context
|
|
24879
|
+
const chainId = getChainIdFromContext(typedParams.context);
|
|
24880
24880
|
const supportedChainIds = getChainIds(env);
|
|
24881
24881
|
if (supportedChainIds.length > 0 && !supportedChainIds.includes(chainId)) {
|
|
24882
24882
|
validationErrors.set(
|
|
@@ -39838,9 +39838,32 @@ var ChainsConfigSchema = external_exports.object({
|
|
|
39838
39838
|
var chains_default = {
|
|
39839
39839
|
version: "1.0.0",
|
|
39840
39840
|
chains: {
|
|
39841
|
-
"
|
|
39842
|
-
name: "
|
|
39843
|
-
isTestnet:
|
|
39841
|
+
"137": {
|
|
39842
|
+
name: "polygon",
|
|
39843
|
+
isTestnet: false,
|
|
39844
|
+
nativeCurrency: {
|
|
39845
|
+
name: "POL",
|
|
39846
|
+
symbol: "POL",
|
|
39847
|
+
decimals: 18
|
|
39848
|
+
},
|
|
39849
|
+
assets: {
|
|
39850
|
+
pol: {
|
|
39851
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
39852
|
+
decimals: 18,
|
|
39853
|
+
feeToken: true,
|
|
39854
|
+
interop: false
|
|
39855
|
+
},
|
|
39856
|
+
usdc: {
|
|
39857
|
+
address: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
|
|
39858
|
+
decimals: 6,
|
|
39859
|
+
feeToken: true,
|
|
39860
|
+
interop: true
|
|
39861
|
+
}
|
|
39862
|
+
}
|
|
39863
|
+
},
|
|
39864
|
+
"8453": {
|
|
39865
|
+
name: "base",
|
|
39866
|
+
isTestnet: false,
|
|
39844
39867
|
nativeCurrency: {
|
|
39845
39868
|
name: "Ether",
|
|
39846
39869
|
symbol: "ETH",
|
|
@@ -39857,12 +39880,12 @@ var chains_default = {
|
|
|
39857
39880
|
address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
39858
39881
|
decimals: 6,
|
|
39859
39882
|
feeToken: true,
|
|
39860
|
-
interop:
|
|
39883
|
+
interop: true
|
|
39861
39884
|
}
|
|
39862
39885
|
}
|
|
39863
39886
|
},
|
|
39864
|
-
"
|
|
39865
|
-
name: "local-anvil
|
|
39887
|
+
"31337": {
|
|
39888
|
+
name: "local-anvil",
|
|
39866
39889
|
isTestnet: true,
|
|
39867
39890
|
nativeCurrency: {
|
|
39868
39891
|
name: "Ether",
|
|
@@ -39884,31 +39907,31 @@ var chains_default = {
|
|
|
39884
39907
|
}
|
|
39885
39908
|
}
|
|
39886
39909
|
},
|
|
39887
|
-
"
|
|
39888
|
-
name: "
|
|
39889
|
-
isTestnet:
|
|
39910
|
+
"41337": {
|
|
39911
|
+
name: "local-anvil-2",
|
|
39912
|
+
isTestnet: true,
|
|
39890
39913
|
nativeCurrency: {
|
|
39891
|
-
name: "
|
|
39892
|
-
symbol: "
|
|
39914
|
+
name: "Ether",
|
|
39915
|
+
symbol: "ETH",
|
|
39893
39916
|
decimals: 18
|
|
39894
39917
|
},
|
|
39895
39918
|
assets: {
|
|
39896
|
-
|
|
39919
|
+
eth: {
|
|
39897
39920
|
address: "0x0000000000000000000000000000000000000000",
|
|
39898
39921
|
decimals: 18,
|
|
39899
39922
|
feeToken: true,
|
|
39900
39923
|
interop: false
|
|
39901
39924
|
},
|
|
39902
39925
|
usdc: {
|
|
39903
|
-
address: "
|
|
39926
|
+
address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
39904
39927
|
decimals: 6,
|
|
39905
39928
|
feeToken: true,
|
|
39906
|
-
interop:
|
|
39929
|
+
interop: false
|
|
39907
39930
|
}
|
|
39908
39931
|
}
|
|
39909
39932
|
},
|
|
39910
|
-
"
|
|
39911
|
-
name: "
|
|
39933
|
+
"42161": {
|
|
39934
|
+
name: "arbitrum",
|
|
39912
39935
|
isTestnet: false,
|
|
39913
39936
|
nativeCurrency: {
|
|
39914
39937
|
name: "Ether",
|
|
@@ -39923,10 +39946,10 @@ var chains_default = {
|
|
|
39923
39946
|
interop: false
|
|
39924
39947
|
},
|
|
39925
39948
|
usdc: {
|
|
39926
|
-
address: "
|
|
39949
|
+
address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
39927
39950
|
decimals: 6,
|
|
39928
39951
|
feeToken: true,
|
|
39929
|
-
interop:
|
|
39952
|
+
interop: false
|
|
39930
39953
|
}
|
|
39931
39954
|
}
|
|
39932
39955
|
},
|
|
@@ -40205,8 +40228,6 @@ async function handlePrepareCalls(params, ctx) {
|
|
|
40205
40228
|
message
|
|
40206
40229
|
},
|
|
40207
40230
|
capabilities: {
|
|
40208
|
-
authorizeKeys: [],
|
|
40209
|
-
revokeKeys: [],
|
|
40210
40231
|
feeTotals: {},
|
|
40211
40232
|
assetDiffs: {}
|
|
40212
40233
|
},
|
|
@@ -40844,10 +40865,6 @@ async function handleGetAuthorization(_params, _ctx) {
|
|
|
40844
40865
|
throw new RpcError2(METHOD_NOT_IMPLEMENTED, "wallet_getAuthorization not implemented");
|
|
40845
40866
|
}
|
|
40846
40867
|
__name(handleGetAuthorization, "handleGetAuthorization");
|
|
40847
|
-
async function handleAddFaucetFunds(_params, _ctx) {
|
|
40848
|
-
throw new RpcError2(METHOD_NOT_IMPLEMENTED, "wallet_addFaucetFunds not implemented");
|
|
40849
|
-
}
|
|
40850
|
-
__name(handleAddFaucetFunds, "handleAddFaucetFunds");
|
|
40851
40868
|
|
|
40852
40869
|
// src/lib/erc1271.ts
|
|
40853
40870
|
var ERC1271_SIGN_TYPEHASH = keccak256(
|
|
@@ -40987,8 +41004,7 @@ function createMethods(_env) {
|
|
|
40987
41004
|
wallet_getAssets: handleGetAssets,
|
|
40988
41005
|
wallet_getCallsHistory: handleGetCallsHistory,
|
|
40989
41006
|
wallet_getAuthorization: handleGetAuthorization,
|
|
40990
|
-
wallet_verifySignature: handleVerifySignature
|
|
40991
|
-
wallet_addFaucetFunds: handleAddFaucetFunds
|
|
41007
|
+
wallet_verifySignature: handleVerifySignature
|
|
40992
41008
|
};
|
|
40993
41009
|
}
|
|
40994
41010
|
__name(createMethods, "createMethods");
|