@0xsequence/relayer
Advanced tools
Comparing version 2.0.26 to 2.1.0
@@ -1004,3 +1004,3 @@ 'use strict'; | ||
// before the request is made | ||
init.headers = _extends({}, init.headers, headers); | ||
init.headers = _extends({}, headers, init.headers); | ||
return fetch(input, init); | ||
@@ -1109,3 +1109,5 @@ }; | ||
simulate: options == null ? void 0 : options.simulate | ||
}); | ||
}, _extends({}, options != null && options.projectAccessKey ? { | ||
'X-Access-Key': options.projectAccessKey | ||
} : undefined)); | ||
return { | ||
@@ -1137,3 +1139,3 @@ options: feeOptions, | ||
} | ||
async relay(signedTxs, quote, waitForReceipt = true) { | ||
async relay(signedTxs, quote, waitForReceipt = true, projectAccessKey) { | ||
var _this = this; | ||
@@ -1161,3 +1163,5 @@ utils.logger.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(signedTxs, utils.bigintReplacer)} with quote ${JSON.stringify(quote, utils.bigintReplacer)}`); | ||
quote: typecheckedQuote | ||
}); | ||
}, _extends({}, projectAccessKey ? { | ||
'X-Access-Key': projectAccessKey | ||
} : undefined)); | ||
utils.logger.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(metaTxn, utils.bigintReplacer)}`); | ||
@@ -1164,0 +1168,0 @@ if (waitForReceipt) { |
@@ -1004,3 +1004,3 @@ 'use strict'; | ||
// before the request is made | ||
init.headers = _extends({}, init.headers, headers); | ||
init.headers = _extends({}, headers, init.headers); | ||
return fetch(input, init); | ||
@@ -1109,3 +1109,5 @@ }; | ||
simulate: options == null ? void 0 : options.simulate | ||
}); | ||
}, _extends({}, options != null && options.projectAccessKey ? { | ||
'X-Access-Key': options.projectAccessKey | ||
} : undefined)); | ||
return { | ||
@@ -1137,3 +1139,3 @@ options: feeOptions, | ||
} | ||
async relay(signedTxs, quote, waitForReceipt = true) { | ||
async relay(signedTxs, quote, waitForReceipt = true, projectAccessKey) { | ||
var _this = this; | ||
@@ -1161,3 +1163,5 @@ utils.logger.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(signedTxs, utils.bigintReplacer)} with quote ${JSON.stringify(quote, utils.bigintReplacer)}`); | ||
quote: typecheckedQuote | ||
}); | ||
}, _extends({}, projectAccessKey ? { | ||
'X-Access-Key': projectAccessKey | ||
} : undefined)); | ||
utils.logger.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(metaTxn, utils.bigintReplacer)}`); | ||
@@ -1164,0 +1168,0 @@ if (waitForReceipt) { |
@@ -1000,3 +1000,3 @@ import { logger, getFetchRequest, bigintReplacer, toHexString } from '@0xsequence/utils'; | ||
// before the request is made | ||
init.headers = _extends({}, init.headers, headers); | ||
init.headers = _extends({}, headers, init.headers); | ||
return fetch(input, init); | ||
@@ -1105,3 +1105,5 @@ }; | ||
simulate: options == null ? void 0 : options.simulate | ||
}); | ||
}, _extends({}, options != null && options.projectAccessKey ? { | ||
'X-Access-Key': options.projectAccessKey | ||
} : undefined)); | ||
return { | ||
@@ -1133,3 +1135,3 @@ options: feeOptions, | ||
} | ||
async relay(signedTxs, quote, waitForReceipt = true) { | ||
async relay(signedTxs, quote, waitForReceipt = true, projectAccessKey) { | ||
var _this = this; | ||
@@ -1157,3 +1159,5 @@ logger.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(signedTxs, bigintReplacer)} with quote ${JSON.stringify(quote, bigintReplacer)}`); | ||
quote: typecheckedQuote | ||
}); | ||
}, _extends({}, projectAccessKey ? { | ||
'X-Access-Key': projectAccessKey | ||
} : undefined)); | ||
logger.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(metaTxn, bigintReplacer)}`); | ||
@@ -1160,0 +1164,0 @@ if (waitForReceipt) { |
@@ -18,3 +18,3 @@ import { ethers } from 'ethers'; | ||
getNonce(address: string, space?: ethers.BigNumberish, blockTag?: ethers.BlockTag): Promise<ethers.BigNumberish>; | ||
relay(signedTxs: commons.transaction.IntendedTransactionBundle, quote?: FeeQuote, waitForReceipt?: boolean): Promise<commons.transaction.TransactionResponse>; | ||
relay(signedTxs: commons.transaction.IntendedTransactionBundle, quote?: FeeQuote, waitForReceipt?: boolean, projectAccessKey?: string): Promise<commons.transaction.TransactionResponse>; | ||
wait(metaTxnId: string | commons.transaction.SignedTransactionBundle, timeout?: number, delay?: number, maxFails?: number): Promise<commons.transaction.TransactionResponse>; | ||
@@ -21,0 +21,0 @@ } |
@@ -29,2 +29,3 @@ import { ethers } from 'ethers'; | ||
simulate?: boolean; | ||
projectAccessKey?: string; | ||
}): Promise<{ | ||
@@ -36,3 +37,3 @@ options: FeeOption[]; | ||
getNonce(address: string, space?: ethers.BigNumberish): Promise<ethers.BigNumberish>; | ||
relay(signedTxs: commons.transaction.IntendedTransactionBundle, quote?: FeeQuote, waitForReceipt?: boolean): Promise<commons.transaction.TransactionResponse<RelayerTxReceipt>>; | ||
relay(signedTxs: commons.transaction.IntendedTransactionBundle, quote?: FeeQuote, waitForReceipt?: boolean, projectAccessKey?: string): Promise<commons.transaction.TransactionResponse<RelayerTxReceipt>>; | ||
wait(metaTxnId: string | commons.transaction.SignedTransactionBundle, timeout?: number, delay?: number, maxFails?: number): Promise<commons.transaction.TransactionResponse<RelayerTxReceipt>>; | ||
@@ -39,0 +40,0 @@ } |
{ | ||
"name": "@0xsequence/relayer", | ||
"version": "2.0.26", | ||
"version": "2.1.0", | ||
"description": "relayer sub-package for Sequence", | ||
@@ -15,5 +15,5 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/relayer", | ||
"dependencies": { | ||
"@0xsequence/abi": "2.0.26", | ||
"@0xsequence/core": "2.0.26", | ||
"@0xsequence/utils": "2.0.26" | ||
"@0xsequence/abi": "2.1.0", | ||
"@0xsequence/core": "2.1.0", | ||
"@0xsequence/utils": "2.1.0" | ||
}, | ||
@@ -23,4 +23,4 @@ "devDependencies": { | ||
"ethers": "6.13.4", | ||
"@0xsequence/signhub": "2.0.26", | ||
"@0xsequence/tests": "2.0.26" | ||
"@0xsequence/signhub": "2.1.0", | ||
"@0xsequence/tests": "2.1.0" | ||
}, | ||
@@ -27,0 +27,0 @@ "files": [ |
@@ -43,3 +43,4 @@ import { ethers } from 'ethers' | ||
quote?: FeeQuote, | ||
waitForReceipt?: boolean | ||
waitForReceipt?: boolean, | ||
projectAccessKey?: string | ||
): Promise<commons.transaction.TransactionResponse> | ||
@@ -46,0 +47,0 @@ |
@@ -64,3 +64,3 @@ import { ethers } from 'ethers' | ||
// before the request is made | ||
init!.headers = { ...init!.headers, ...headers } | ||
init!.headers = { ...headers, ...init!.headers } | ||
@@ -164,10 +164,14 @@ return fetch(input, init) | ||
simulate?: boolean | ||
projectAccessKey?: string | ||
} | ||
): Promise<{ options: FeeOption[]; quote?: FeeQuote }> { | ||
const { options: feeOptions, quote } = await this.service.feeOptions({ | ||
wallet: entrypoint, | ||
to: entrypoint, | ||
data: ethers.hexlify(data), | ||
simulate: options?.simulate | ||
}) | ||
const { options: feeOptions, quote } = await this.service.feeOptions( | ||
{ | ||
wallet: entrypoint, | ||
to: entrypoint, | ||
data: ethers.hexlify(data), | ||
simulate: options?.simulate | ||
}, | ||
{ ...(options?.projectAccessKey ? { 'X-Access-Key': options.projectAccessKey } : undefined) } | ||
) | ||
@@ -195,3 +199,4 @@ return { options: feeOptions, quote: { _tag: 'FeeQuote', _quote: quote } } | ||
quote?: FeeQuote, | ||
waitForReceipt: boolean = true | ||
waitForReceipt: boolean = true, | ||
projectAccessKey?: string | ||
): Promise<commons.transaction.TransactionResponse<RelayerTxReceipt>> { | ||
@@ -217,10 +222,13 @@ logger.info( | ||
const data = commons.transaction.encodeBundleExecData(signedTxs) | ||
const metaTxn = await this.service.sendMetaTxn({ | ||
call: { | ||
walletAddress: signedTxs.intent.wallet, | ||
contract: signedTxs.entrypoint, | ||
input: data | ||
const metaTxn = await this.service.sendMetaTxn( | ||
{ | ||
call: { | ||
walletAddress: signedTxs.intent.wallet, | ||
contract: signedTxs.entrypoint, | ||
input: data | ||
}, | ||
quote: typecheckedQuote | ||
}, | ||
quote: typecheckedQuote | ||
}) | ||
{ ...(projectAccessKey ? { 'X-Access-Key': projectAccessKey } : undefined) } | ||
) | ||
@@ -227,0 +235,0 @@ logger.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(metaTxn, bigintReplacer)}`) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
247284
6414
+ Added@0xsequence/abi@2.1.0(transitive)
+ Added@0xsequence/core@2.1.0(transitive)
+ Added@0xsequence/utils@2.1.0(transitive)
- Removed@0xsequence/abi@2.0.26(transitive)
- Removed@0xsequence/core@2.0.26(transitive)
- Removed@0xsequence/utils@2.0.26(transitive)
Updated@0xsequence/abi@2.1.0
Updated@0xsequence/core@2.1.0
Updated@0xsequence/utils@2.1.0