Socket
Socket
Sign inDemoInstall

@0xsequence/relayer

Package Overview
Dependencies
Maintainers
4
Versions
476
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0xsequence/relayer - npm Package Compare versions

Comparing version 0.14.0 to 0.14.3

23

CHANGELOG.md
# @0xsequence/relayer
## 0.14.3
### Patch Changes
- Fix 0xSequence relayer dependencies
- Updated dependencies [undefined]
- @0xsequence/abi@0.14.3
- @0xsequence/chaind@0.14.3
- @0xsequence/config@0.14.3
- @0xsequence/transactions@0.14.3
- @0xsequence/utils@0.14.3
## 0.14.2
### Patch Changes
- Add debug logs to rpc-relayer
- Updated dependencies [undefined]
- @0xsequence/abi@0.14.2
- @0xsequence/chaind@0.14.2
- @0xsequence/config@0.14.2
- @0xsequence/transactions@0.14.2
## 0.14.0

@@ -4,0 +27,0 @@

22

dist/0xsequence-relayer.cjs.dev.js

@@ -12,2 +12,3 @@ 'use strict';

var chaind = require('@0xsequence/chaind');
var utils$1 = require('@0xsequence/utils');

@@ -224,3 +225,4 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }

// TODO: Add compatiblity for different refund options
const tokenFee = await this.chaindService.tokenFee(); // No gas refund required
const tokenFee = await this.chaindService.tokenFee();
utils$1.logger.info(`[rpc-relayer/gasRefundOptions] using token fee ${tokenFee}`); // No gas refund required

@@ -253,2 +255,4 @@ if (!tokenFee.isFee || tokenFee.fee === ethers.ethers.constants.AddressZero) {

utils$1.logger.info(`[rpc-relayer/gasRefundOptions] got refund options ${JSON.stringify(decoded)}`);
if (res.res.feeAppended) {

@@ -262,2 +266,4 @@ return [[decoded[decoded.length - 1]]];

async estimateGasLimits(config$1, context, ...transactions$1) {
utils$1.logger.info(`[rpc-relayer/estimateGasLimits] estimate gas limits request ${JSON.stringify(transactions$1)}`);
if (transactions$1.length == 0) {

@@ -269,2 +275,3 @@ return [];

const tokenFee = this.chaindService.tokenFee();
utils$1.logger.info(`[rpc-relayer/estimateGasLimits] using token fee ${tokenFee}`);
const addr = config.addressOf(config$1, context);

@@ -289,3 +296,4 @@ const prevNonce = transactions.readSequenceNonce(...transactions$1); // Set temporal nonce to simulate meta-txn

gasLimit: decoded[i].gasLimit
})); // Remove placeholder nonce if previously defined
}));
utils$1.logger.info(`[rpc-relayer/estimateGasLimits] got transactions with gas limits ${JSON.stringify(modTxns)}`); // Remove placeholder nonce if previously defined

@@ -297,6 +305,9 @@ return prevNonce === undefined ? modTxns : transactions.appendNonce(modTxns, prevNonce);

const addr = config.addressOf(config$1, context);
utils$1.logger.info(`[rpc-relayer/getNonce] get nonce for wallet ${addr} space: ${space}`);
const resp = await this.chaindService.getMetaTxnNonce({
walletContractAddress: addr
});
return ethers.ethers.BigNumber.from(resp.nonce).toNumber();
const nonce = ethers.ethers.BigNumber.from(resp.nonce).toNumber();
utils$1.logger.info(`[rpc-relayer/getNonce] got next nonce for wallet ${addr} ${nonce} space: ${space}`);
return nonce;
}

@@ -307,3 +318,6 @@

utils$1.logger.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(signedTxs)}`);
if (!this.provider) {
utils$1.logger.warn(`[rpc-relayer/relay] provider not set, failed relay`);
throw new Error('provider is not set');

@@ -319,2 +333,3 @@ }

});
utils$1.logger.warn(`[rpc-relayer/relay] got relay result ${JSON.stringify(result)}`);

@@ -349,2 +364,3 @@ const waitReceipt = async function waitReceipt() {

const receipt = await waitReceipt();
utils$1.logger.info(`[rpc-relayer/relay] got meta-transaction receipt ${JSON.stringify(receipt)}`);
return receipt.wait(confirmations);

@@ -351,0 +367,0 @@ }

@@ -12,2 +12,3 @@ 'use strict';

var chaind = require('@0xsequence/chaind');
var utils$1 = require('@0xsequence/utils');

@@ -224,3 +225,4 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }

// TODO: Add compatiblity for different refund options
const tokenFee = await this.chaindService.tokenFee(); // No gas refund required
const tokenFee = await this.chaindService.tokenFee();
utils$1.logger.info(`[rpc-relayer/gasRefundOptions] using token fee ${tokenFee}`); // No gas refund required

@@ -253,2 +255,4 @@ if (!tokenFee.isFee || tokenFee.fee === ethers.ethers.constants.AddressZero) {

utils$1.logger.info(`[rpc-relayer/gasRefundOptions] got refund options ${JSON.stringify(decoded)}`);
if (res.res.feeAppended) {

@@ -262,2 +266,4 @@ return [[decoded[decoded.length - 1]]];

async estimateGasLimits(config$1, context, ...transactions$1) {
utils$1.logger.info(`[rpc-relayer/estimateGasLimits] estimate gas limits request ${JSON.stringify(transactions$1)}`);
if (transactions$1.length == 0) {

@@ -269,2 +275,3 @@ return [];

const tokenFee = this.chaindService.tokenFee();
utils$1.logger.info(`[rpc-relayer/estimateGasLimits] using token fee ${tokenFee}`);
const addr = config.addressOf(config$1, context);

@@ -289,3 +296,4 @@ const prevNonce = transactions.readSequenceNonce(...transactions$1); // Set temporal nonce to simulate meta-txn

gasLimit: decoded[i].gasLimit
})); // Remove placeholder nonce if previously defined
}));
utils$1.logger.info(`[rpc-relayer/estimateGasLimits] got transactions with gas limits ${JSON.stringify(modTxns)}`); // Remove placeholder nonce if previously defined

@@ -297,6 +305,9 @@ return prevNonce === undefined ? modTxns : transactions.appendNonce(modTxns, prevNonce);

const addr = config.addressOf(config$1, context);
utils$1.logger.info(`[rpc-relayer/getNonce] get nonce for wallet ${addr} space: ${space}`);
const resp = await this.chaindService.getMetaTxnNonce({
walletContractAddress: addr
});
return ethers.ethers.BigNumber.from(resp.nonce).toNumber();
const nonce = ethers.ethers.BigNumber.from(resp.nonce).toNumber();
utils$1.logger.info(`[rpc-relayer/getNonce] got next nonce for wallet ${addr} ${nonce} space: ${space}`);
return nonce;
}

@@ -307,3 +318,6 @@

utils$1.logger.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(signedTxs)}`);
if (!this.provider) {
utils$1.logger.warn(`[rpc-relayer/relay] provider not set, failed relay`);
throw new Error('provider is not set');

@@ -319,2 +333,3 @@ }

});
utils$1.logger.warn(`[rpc-relayer/relay] got relay result ${JSON.stringify(result)}`);

@@ -349,2 +364,3 @@ const waitReceipt = async function waitReceipt() {

const receipt = await waitReceipt();
utils$1.logger.info(`[rpc-relayer/relay] got meta-transaction receipt ${JSON.stringify(receipt)}`);
return receipt.wait(confirmations);

@@ -351,0 +367,0 @@ }

@@ -8,2 +8,3 @@ import { ethers } from 'ethers';

import { ChaindService } from '@0xsequence/chaind';
import { logger } from '@0xsequence/utils';

@@ -216,3 +217,4 @@ function _extends() {

// TODO: Add compatiblity for different refund options
const tokenFee = await this.chaindService.tokenFee(); // No gas refund required
const tokenFee = await this.chaindService.tokenFee();
logger.info(`[rpc-relayer/gasRefundOptions] using token fee ${tokenFee}`); // No gas refund required

@@ -245,2 +247,4 @@ if (!tokenFee.isFee || tokenFee.fee === ethers.constants.AddressZero) {

logger.info(`[rpc-relayer/gasRefundOptions] got refund options ${JSON.stringify(decoded)}`);
if (res.res.feeAppended) {

@@ -254,2 +258,4 @@ return [[decoded[decoded.length - 1]]];

async estimateGasLimits(config, context, ...transactions) {
logger.info(`[rpc-relayer/estimateGasLimits] estimate gas limits request ${JSON.stringify(transactions)}`);
if (transactions.length == 0) {

@@ -261,2 +267,3 @@ return [];

const tokenFee = this.chaindService.tokenFee();
logger.info(`[rpc-relayer/estimateGasLimits] using token fee ${tokenFee}`);
const addr = addressOf(config, context);

@@ -281,3 +288,4 @@ const prevNonce = readSequenceNonce(...transactions); // Set temporal nonce to simulate meta-txn

gasLimit: decoded[i].gasLimit
})); // Remove placeholder nonce if previously defined
}));
logger.info(`[rpc-relayer/estimateGasLimits] got transactions with gas limits ${JSON.stringify(modTxns)}`); // Remove placeholder nonce if previously defined

@@ -289,6 +297,9 @@ return prevNonce === undefined ? modTxns : appendNonce(modTxns, prevNonce);

const addr = addressOf(config, context);
logger.info(`[rpc-relayer/getNonce] get nonce for wallet ${addr} space: ${space}`);
const resp = await this.chaindService.getMetaTxnNonce({
walletContractAddress: addr
});
return ethers.BigNumber.from(resp.nonce).toNumber();
const nonce = ethers.BigNumber.from(resp.nonce).toNumber();
logger.info(`[rpc-relayer/getNonce] got next nonce for wallet ${addr} ${nonce} space: ${space}`);
return nonce;
}

@@ -299,3 +310,6 @@

logger.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(signedTxs)}`);
if (!this.provider) {
logger.warn(`[rpc-relayer/relay] provider not set, failed relay`);
throw new Error('provider is not set');

@@ -311,2 +325,3 @@ }

});
logger.warn(`[rpc-relayer/relay] got relay result ${JSON.stringify(result)}`);

@@ -341,2 +356,3 @@ const waitReceipt = async function waitReceipt() {

const receipt = await waitReceipt();
logger.info(`[rpc-relayer/relay] got meta-transaction receipt ${JSON.stringify(receipt)}`);
return receipt.wait(confirmations);

@@ -343,0 +359,0 @@ }

11

package.json
{
"name": "@0xsequence/relayer",
"version": "0.14.0",
"version": "0.14.3",
"description": "relayer sub-package for Sequence",

@@ -16,6 +16,7 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/relayer",

"dependencies": {
"@0xsequence/abi": "^0.14.0",
"@0xsequence/chaind": "^0.14.0",
"@0xsequence/config": "^0.14.0",
"@0xsequence/transactions": "^0.14.0",
"@0xsequence/abi": "^0.14.3",
"@0xsequence/chaind": "^0.14.3",
"@0xsequence/config": "^0.14.3",
"@0xsequence/transactions": "^0.14.3",
"@0xsequence/utils": "^0.14.3",
"ethers": "^5.0.32",

@@ -22,0 +23,0 @@ "fetch-ponyfill": "^7.1.0"

@@ -10,2 +10,3 @@ import { TransactionResponse, Provider, BlockTag } from '@ethersproject/providers'

import { WalletConfig, addressOf } from '@0xsequence/config'
import { logger } from '@0xsequence/utils'

@@ -55,2 +56,4 @@ export class RpcRelayer extends BaseRelayer implements Relayer {

logger.info(`[rpc-relayer/gasRefundOptions] using token fee ${tokenFee}`)
// No gas refund required

@@ -84,2 +87,4 @@ if (!tokenFee.isFee || tokenFee.fee === ethers.constants.AddressZero) {

logger.info(`[rpc-relayer/gasRefundOptions] got refund options ${JSON.stringify(decoded)}`)
if (res.res.feeAppended) {

@@ -97,2 +102,4 @@ return [[decoded[decoded.length - 1]]]

): Promise<Transaction[]> {
logger.info(`[rpc-relayer/estimateGasLimits] estimate gas limits request ${JSON.stringify(transactions)}`)
if (transactions.length == 0) {

@@ -105,2 +112,4 @@ return []

logger.info(`[rpc-relayer/estimateGasLimits] using token fee ${tokenFee}`)
const addr = addressOf(config, context)

@@ -130,2 +139,4 @@ const prevNonce = readSequenceNonce(...transactions)

logger.info(`[rpc-relayer/estimateGasLimits] got transactions with gas limits ${JSON.stringify(modTxns)}`)
// Remove placeholder nonce if previously defined

@@ -142,8 +153,14 @@ return prevNonce === undefined ? modTxns : appendNonce(modTxns, prevNonce)

const addr = addressOf(config, context)
logger.info(`[rpc-relayer/getNonce] get nonce for wallet ${addr} space: ${space}`)
const resp = await this.chaindService.getMetaTxnNonce({ walletContractAddress: addr })
return ethers.BigNumber.from(resp.nonce).toNumber()
const nonce = ethers.BigNumber.from(resp.nonce).toNumber()
logger.info(`[rpc-relayer/getNonce] got next nonce for wallet ${addr} ${nonce} space: ${space}`)
return nonce
}
async relay(signedTxs: SignedTransactions): Promise<PendingTransactionResponse> {
logger.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(signedTxs)}`)
if (!this.provider) {
logger.warn(`[rpc-relayer/relay] provider not set, failed relay`)
throw new Error('provider is not set')

@@ -160,2 +177,4 @@ }

logger.warn(`[rpc-relayer/relay] got relay result ${JSON.stringify(result)}`)
const waitReceipt = async () => {

@@ -188,2 +207,3 @@ const hash = (await result).txnHash

const receipt = await waitReceipt()
logger.info(`[rpc-relayer/relay] got meta-transaction receipt ${JSON.stringify(receipt)}`)
return receipt.wait(confirmations)

@@ -190,0 +210,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc