@0xsequence/relayer 0.36.4 → 0.36.7

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.
@@ -296,6 +296,7 @@ class LocalRelayer extends ProviderRelayer {
296
296
  provider: options.signer.provider
297
297
  }));
298
298
  this.signer = void 0;
299
+ this.txnOptions = void 0;
299
300
  this.signer = ethers.Signer.isSigner(options) ? options : options.signer;
300
301
  if (!this.signer.provider) throw new Error("Signer must have a provider");
301
302
  }
@@ -324,6 +325,10 @@ class LocalRelayer extends ProviderRelayer {
324
325
  return options;
325
326
  }
326
327
 
328
+ setTransactionOptions(transactionRequest) {
329
+ this.txnOptions = transactionRequest;
330
+ }
331
+
327
332
  async relay(signedTxs, quote) {
328
333
  if (quote !== undefined) {
329
334
  utils.logger.warn(`LocalRelayer doesn't accept fee quotes`);
@@ -343,10 +348,10 @@ class LocalRelayer extends ProviderRelayer {
343
348
  // const gasLimit = signedTxs.transactions.reduce((sum, tx) => sum.add(tx.gasLimit), ethers.BigNumber.from(0))
344
349
  // txRequest.gasLimit = gasLimit
345
350
 
346
- return this.signer.sendTransaction({
351
+ return this.signer.sendTransaction(_extends({
347
352
  to,
348
353
  data
349
- });
354
+ }, this.txnOptions));
350
355
  }
351
356
 
352
357
  }
@@ -296,6 +296,7 @@ class LocalRelayer extends ProviderRelayer {
296
296
  provider: options.signer.provider
297
297
  }));
298
298
  this.signer = void 0;
299
+ this.txnOptions = void 0;
299
300
  this.signer = ethers.Signer.isSigner(options) ? options : options.signer;
300
301
  if (!this.signer.provider) throw new Error("Signer must have a provider");
301
302
  }
@@ -324,6 +325,10 @@ class LocalRelayer extends ProviderRelayer {
324
325
  return options;
325
326
  }
326
327
 
328
+ setTransactionOptions(transactionRequest) {
329
+ this.txnOptions = transactionRequest;
330
+ }
331
+
327
332
  async relay(signedTxs, quote) {
328
333
  if (quote !== undefined) {
329
334
  utils.logger.warn(`LocalRelayer doesn't accept fee quotes`);
@@ -343,10 +348,10 @@ class LocalRelayer extends ProviderRelayer {
343
348
  // const gasLimit = signedTxs.transactions.reduce((sum, tx) => sum.add(tx.gasLimit), ethers.BigNumber.from(0))
344
349
  // txRequest.gasLimit = gasLimit
345
350
 
346
- return this.signer.sendTransaction({
351
+ return this.signer.sendTransaction(_extends({
347
352
  to,
348
353
  data
349
- });
354
+ }, this.txnOptions));
350
355
  }
351
356
 
352
357
  }
@@ -288,6 +288,7 @@ class LocalRelayer extends ProviderRelayer {
288
288
  provider: options.signer.provider
289
289
  }));
290
290
  this.signer = void 0;
291
+ this.txnOptions = void 0;
291
292
  this.signer = Signer.isSigner(options) ? options : options.signer;
292
293
  if (!this.signer.provider) throw new Error("Signer must have a provider");
293
294
  }
@@ -316,6 +317,10 @@ class LocalRelayer extends ProviderRelayer {
316
317
  return options;
317
318
  }
318
319
 
320
+ setTransactionOptions(transactionRequest) {
321
+ this.txnOptions = transactionRequest;
322
+ }
323
+
319
324
  async relay(signedTxs, quote) {
320
325
  if (quote !== undefined) {
321
326
  logger.warn(`LocalRelayer doesn't accept fee quotes`);
@@ -335,10 +340,10 @@ class LocalRelayer extends ProviderRelayer {
335
340
  // const gasLimit = signedTxs.transactions.reduce((sum, tx) => sum.add(tx.gasLimit), ethers.BigNumber.from(0))
336
341
  // txRequest.gasLimit = gasLimit
337
342
 
338
- return this.signer.sendTransaction({
343
+ return this.signer.sendTransaction(_extends({
339
344
  to,
340
345
  data
341
- });
346
+ }, this.txnOptions));
342
347
  }
343
348
 
344
349
  }
@@ -1,4 +1,4 @@
1
- import { TransactionResponse } from '@ethersproject/providers';
1
+ import { TransactionRequest, TransactionResponse } from '@ethersproject/providers';
2
2
  import { Signer as AbstractSigner } from 'ethers';
3
3
  import { SignedTransactions, Transaction } from '@0xsequence/transactions';
4
4
  import { WalletContext } from '@0xsequence/network';
@@ -11,11 +11,13 @@ export declare type LocalRelayerOptions = Omit<ProviderRelayerOptions, "provider
11
11
  export declare function isLocalRelayerOptions(obj: any): obj is LocalRelayerOptions;
12
12
  export declare class LocalRelayer extends ProviderRelayer implements Relayer {
13
13
  private signer;
14
+ private txnOptions;
14
15
  constructor(options: LocalRelayerOptions | AbstractSigner);
15
16
  deployWallet(config: WalletConfig, context: WalletContext): Promise<TransactionResponse>;
16
17
  getFeeOptions(_config: WalletConfig, _context: WalletContext, ..._transactions: Transaction[]): Promise<{
17
18
  options: FeeOption[];
18
19
  }>;
19
20
  gasRefundOptions(config: WalletConfig, context: WalletContext, ...transactions: Transaction[]): Promise<FeeOption[]>;
21
+ setTransactionOptions(transactionRequest: TransactionRequest): void;
20
22
  relay(signedTxs: SignedTransactions, quote?: FeeQuote): Promise<TransactionResponse>;
21
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsequence/relayer",
3
- "version": "0.36.4",
3
+ "version": "0.36.7",
4
4
  "description": "relayer sub-package for Sequence",
5
5
  "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/relayer",
6
6
  "source": "src/index.ts",
@@ -17,10 +17,10 @@
17
17
  "typecheck": "tsc --noEmit"
18
18
  },
19
19
  "dependencies": {
20
- "@0xsequence/abi": "^0.36.4",
21
- "@0xsequence/config": "^0.36.4",
22
- "@0xsequence/transactions": "^0.36.4",
23
- "@0xsequence/utils": "^0.36.4",
20
+ "@0xsequence/abi": "^0.36.7",
21
+ "@0xsequence/config": "^0.36.7",
22
+ "@0xsequence/transactions": "^0.36.7",
23
+ "@0xsequence/utils": "^0.36.7",
24
24
  "@ethersproject/providers": "^5.5.1",
25
25
  "ethers": "^5.5.2",
26
26
  "fetch-ponyfill": "^7.1.0"
@@ -1,4 +1,4 @@
1
- import { TransactionResponse } from '@ethersproject/providers'
1
+ import { TransactionRequest, TransactionResponse } from '@ethersproject/providers'
2
2
  import { Signer as AbstractSigner, ethers } from 'ethers'
3
3
  import { walletContracts } from '@0xsequence/abi'
4
4
  import { SignedTransactions, Transaction, sequenceTxAbiEncode } from '@0xsequence/transactions'
@@ -18,6 +18,7 @@ export function isLocalRelayerOptions(obj: any): obj is LocalRelayerOptions {
18
18
 
19
19
  export class LocalRelayer extends ProviderRelayer implements Relayer {
20
20
  private signer: AbstractSigner
21
+ private txnOptions: TransactionRequest
21
22
 
22
23
  constructor(options: LocalRelayerOptions | AbstractSigner) {
23
24
  super(AbstractSigner.isSigner(options) ? { provider: options.provider! } : { ...options, provider: options.signer.provider! })
@@ -52,6 +53,10 @@ export class LocalRelayer extends ProviderRelayer implements Relayer {
52
53
  return options
53
54
  }
54
55
 
56
+ setTransactionOptions(transactionRequest: TransactionRequest) {
57
+ this.txnOptions = transactionRequest
58
+ }
59
+
55
60
  async relay(signedTxs: SignedTransactions, quote?: FeeQuote): Promise<TransactionResponse> {
56
61
  if (quote !== undefined) {
57
62
  logger.warn(`LocalRelayer doesn't accept fee quotes`)
@@ -75,6 +80,6 @@ export class LocalRelayer extends ProviderRelayer implements Relayer {
75
80
  // const gasLimit = signedTxs.transactions.reduce((sum, tx) => sum.add(tx.gasLimit), ethers.BigNumber.from(0))
76
81
  // txRequest.gasLimit = gasLimit
77
82
 
78
- return this.signer.sendTransaction({ to, data })
83
+ return this.signer.sendTransaction({ to, data, ...this.txnOptions })
79
84
  }
80
85
  }