@0xsequence/relayer
Advanced tools
Comparing version 0.10.4 to 0.10.5
# @0xsequence/relayer | ||
## 0.10.5 | ||
### Patch Changes | ||
- update relayer gas refund options | ||
- Updated dependencies [undefined] | ||
- @0xsequence/abi@0.10.5 | ||
- @0xsequence/chaind@0.10.5 | ||
- @0xsequence/config@0.10.5 | ||
- @0xsequence/transactions@0.10.5 | ||
## 0.10.4 | ||
@@ -4,0 +15,0 @@ |
@@ -110,4 +110,4 @@ 'use strict'; | ||
async gasRefundOptions(_config, _context, ...transactions) { | ||
return [transactions]; | ||
async gasRefundOptions(_config, _context, ..._transactions) { | ||
return [[]]; | ||
} | ||
@@ -218,6 +218,6 @@ | ||
// TODO: Add compatiblity for different refund options | ||
const tokenFee = (await this.chaindService.tokenFee()).fee; // No gas refund required, return transactions as-is | ||
const tokenFee = (await this.chaindService.tokenFee()).fee; // No gas refund required | ||
if (tokenFee === ethers.ethers.constants.AddressZero) { | ||
return [transactions$1]; | ||
return [[]]; | ||
} | ||
@@ -241,4 +241,13 @@ | ||
}); | ||
const decoded = ethers.ethers.utils.defaultAbiCoder.decode([transactions.MetaTransactionsType], `0x${res.res.payload}`)[0]; | ||
return prevNonce === undefined ? [decoded] : [transactions.appendNonce(decoded, prevNonce)]; | ||
let decoded = ethers.ethers.utils.defaultAbiCoder.decode([transactions.MetaTransactionsType], `0x${res.res.payload}`)[0]; | ||
if (prevNonce !== undefined) { | ||
decoded = transactions.appendNonce(decoded, prevNonce); | ||
} | ||
if (res.res.feeAppended) { | ||
return [[decoded[decoded.length - 1]]]; | ||
} else { | ||
return [[]]; | ||
} | ||
} | ||
@@ -245,0 +254,0 @@ |
@@ -110,4 +110,4 @@ 'use strict'; | ||
async gasRefundOptions(_config, _context, ...transactions) { | ||
return [transactions]; | ||
async gasRefundOptions(_config, _context, ..._transactions) { | ||
return [[]]; | ||
} | ||
@@ -218,6 +218,6 @@ | ||
// TODO: Add compatiblity for different refund options | ||
const tokenFee = (await this.chaindService.tokenFee()).fee; // No gas refund required, return transactions as-is | ||
const tokenFee = (await this.chaindService.tokenFee()).fee; // No gas refund required | ||
if (tokenFee === ethers.ethers.constants.AddressZero) { | ||
return [transactions$1]; | ||
return [[]]; | ||
} | ||
@@ -241,4 +241,13 @@ | ||
}); | ||
const decoded = ethers.ethers.utils.defaultAbiCoder.decode([transactions.MetaTransactionsType], `0x${res.res.payload}`)[0]; | ||
return prevNonce === undefined ? [decoded] : [transactions.appendNonce(decoded, prevNonce)]; | ||
let decoded = ethers.ethers.utils.defaultAbiCoder.decode([transactions.MetaTransactionsType], `0x${res.res.payload}`)[0]; | ||
if (prevNonce !== undefined) { | ||
decoded = transactions.appendNonce(decoded, prevNonce); | ||
} | ||
if (res.res.feeAppended) { | ||
return [[decoded[decoded.length - 1]]]; | ||
} else { | ||
return [[]]; | ||
} | ||
} | ||
@@ -245,0 +254,0 @@ |
@@ -102,4 +102,4 @@ import { ethers } from 'ethers'; | ||
async gasRefundOptions(_config, _context, ...transactions) { | ||
return [transactions]; | ||
async gasRefundOptions(_config, _context, ..._transactions) { | ||
return [[]]; | ||
} | ||
@@ -210,6 +210,6 @@ | ||
// TODO: Add compatiblity for different refund options | ||
const tokenFee = (await this.chaindService.tokenFee()).fee; // No gas refund required, return transactions as-is | ||
const tokenFee = (await this.chaindService.tokenFee()).fee; // No gas refund required | ||
if (tokenFee === ethers.constants.AddressZero) { | ||
return [transactions]; | ||
return [[]]; | ||
} | ||
@@ -233,4 +233,13 @@ | ||
}); | ||
const decoded = ethers.utils.defaultAbiCoder.decode([MetaTransactionsType], `0x${res.res.payload}`)[0]; | ||
return prevNonce === undefined ? [decoded] : [appendNonce(decoded, prevNonce)]; | ||
let decoded = ethers.utils.defaultAbiCoder.decode([MetaTransactionsType], `0x${res.res.payload}`)[0]; | ||
if (prevNonce !== undefined) { | ||
decoded = appendNonce(decoded, prevNonce); | ||
} | ||
if (res.res.feeAppended) { | ||
return [[decoded[decoded.length - 1]]]; | ||
} else { | ||
return [[]]; | ||
} | ||
} | ||
@@ -237,0 +246,0 @@ |
import { providers } from 'ethers'; | ||
import { Transaction, SignedTransactions } from '@0xsequence/transactions'; | ||
import { SignedTransactions, Transaction, TransactionEncoded } from '@0xsequence/transactions'; | ||
import { WalletContext } from '@0xsequence/network'; | ||
@@ -7,3 +7,3 @@ import { WalletConfig } from '@0xsequence/config'; | ||
estimateGasLimits(config: WalletConfig, context: WalletContext, ...transactions: Transaction[]): Promise<Transaction[]>; | ||
gasRefundOptions(config: WalletConfig, context: WalletContext, ...transactions: Transaction[]): Promise<Transaction[][]>; | ||
gasRefundOptions(config: WalletConfig, context: WalletContext, ...transactions: Transaction[]): Promise<TransactionEncoded[][]>; | ||
getNonce(config: WalletConfig, context: WalletContext, space?: number, blockTag?: providers.BlockTag): Promise<number>; | ||
@@ -10,0 +10,0 @@ relay(signedTxs: SignedTransactions): Promise<providers.TransactionResponse>; |
import { TransactionResponse, BlockTag } from '@ethersproject/providers'; | ||
import { Signer as AbstractSigner } from 'ethers'; | ||
import { Transaction, SignedTransactions } from '@0xsequence/transactions'; | ||
import { SignedTransactions, Transaction, TransactionEncoded } from '@0xsequence/transactions'; | ||
import { WalletContext } from '@0xsequence/network'; | ||
@@ -12,3 +12,3 @@ import { WalletConfig } from '@0xsequence/config'; | ||
deployWallet(config: WalletConfig, context: WalletContext): Promise<TransactionResponse>; | ||
gasRefundOptions(_config: WalletConfig, _context: WalletContext, ...transactions: Transaction[]): Promise<Transaction[][]>; | ||
gasRefundOptions(_config: WalletConfig, _context: WalletContext, ..._transactions: Transaction[]): Promise<TransactionEncoded[][]>; | ||
estimateGasLimits(config: WalletConfig, context: WalletContext, ...transactions: Transaction[]): Promise<Transaction[]>; | ||
@@ -15,0 +15,0 @@ getNonce(config: WalletConfig, context: WalletContext, space?: number, blockTag?: BlockTag): Promise<number>; |
import { TransactionResponse, Provider, BlockTag } from '@ethersproject/providers'; | ||
import { Transaction, SignedTransactions } from '@0xsequence/transactions'; | ||
import { Transaction, TransactionEncoded, SignedTransactions } from '@0xsequence/transactions'; | ||
import { BaseRelayer } from './base-relayer'; | ||
@@ -12,3 +12,3 @@ import { Relayer } from '.'; | ||
waitReceipt(metaTxHash: string, wait?: number): Promise<import("@0xsequence/chaind").GetMetaTxnReceiptReturn>; | ||
gasRefundOptions(config: WalletConfig, context: WalletContext, ...transactions: Transaction[]): Promise<Transaction[][]>; | ||
gasRefundOptions(config: WalletConfig, context: WalletContext, ...transactions: Transaction[]): Promise<TransactionEncoded[][]>; | ||
estimateGasLimits(config: WalletConfig, context: WalletContext, ...transactions: Transaction[]): Promise<Transaction[]>; | ||
@@ -15,0 +15,0 @@ getNonce(config: WalletConfig, context: WalletContext, space?: number, blockTag?: BlockTag): Promise<number>; |
{ | ||
"name": "@0xsequence/relayer", | ||
"version": "0.10.4", | ||
"version": "0.10.5", | ||
"description": "relayer sub-package for Sequence", | ||
@@ -16,6 +16,6 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/relayer", | ||
"dependencies": { | ||
"@0xsequence/abi": "^0.10.4", | ||
"@0xsequence/chaind": "^0.10.4", | ||
"@0xsequence/config": "^0.10.4", | ||
"@0xsequence/transactions": "^0.10.4", | ||
"@0xsequence/abi": "^0.10.5", | ||
"@0xsequence/chaind": "^0.10.5", | ||
"@0xsequence/config": "^0.10.5", | ||
"@0xsequence/transactions": "^0.10.5", | ||
"ethers": "^5.0.32", | ||
@@ -22,0 +22,0 @@ "fetch-ponyfill": "^7.1.0" |
import { providers } from 'ethers' | ||
import { Transaction, SignedTransactions } from '@0xsequence/transactions' | ||
import { SignedTransactions, Transaction, TransactionEncoded } from '@0xsequence/transactions' | ||
import { WalletContext } from '@0xsequence/network' | ||
@@ -22,3 +22,3 @@ import { WalletConfig } from '@0xsequence/config' | ||
...transactions: Transaction[] | ||
): Promise<Transaction[][]> | ||
): Promise<TransactionEncoded[][]> | ||
@@ -25,0 +25,0 @@ // getNonce returns the transaction count/nonce for a wallet. |
import { TransactionResponse, BlockTag } from '@ethersproject/providers' | ||
import { Signer as AbstractSigner, ethers } from 'ethers' | ||
import { walletContracts } from '@0xsequence/abi' | ||
import { Transaction, SignedTransactions } from '@0xsequence/transactions' | ||
import { SignedTransactions, Transaction, TransactionEncoded } from '@0xsequence/transactions' | ||
import { WalletContext } from '@0xsequence/network' | ||
@@ -37,5 +37,5 @@ import { WalletConfig, addressOf } from '@0xsequence/config' | ||
_context: WalletContext, | ||
...transactions: Transaction[] | ||
): Promise<Transaction[][]> { | ||
return [transactions] | ||
..._transactions: Transaction[] | ||
): Promise<TransactionEncoded[][]> { | ||
return [[]] | ||
} | ||
@@ -42,0 +42,0 @@ |
import { TransactionResponse, Provider, BlockTag } from '@ethersproject/providers' | ||
import { ethers } from 'ethers' | ||
import fetchPonyfill from 'fetch-ponyfill' | ||
import { Transaction, readSequenceNonce, appendNonce, MetaTransactionsType, sequenceTxAbiEncode, SignedTransactions } from '@0xsequence/transactions' | ||
import { Transaction, TransactionEncoded, readSequenceNonce, appendNonce, MetaTransactionsType, sequenceTxAbiEncode, SignedTransactions } from '@0xsequence/transactions' | ||
import { BaseRelayer } from './base-relayer' | ||
@@ -49,3 +49,3 @@ import { ChaindService } from '@0xsequence/chaind' | ||
...transactions: Transaction[] | ||
): Promise<Transaction[][]> { | ||
): Promise<TransactionEncoded[][]> { | ||
// chaind only supports refunds on a single token | ||
@@ -55,5 +55,5 @@ // TODO: Add compatiblity for different refund options | ||
// No gas refund required, return transactions as-is | ||
// No gas refund required | ||
if (tokenFee === ethers.constants.AddressZero) { | ||
return [transactions] | ||
return [[]] | ||
} | ||
@@ -79,4 +79,12 @@ | ||
const decoded = ethers.utils.defaultAbiCoder.decode([MetaTransactionsType], `0x${res.res.payload}`)[0] | ||
return prevNonce === undefined ? [decoded] : [appendNonce(decoded, prevNonce)] | ||
let decoded = ethers.utils.defaultAbiCoder.decode([MetaTransactionsType], `0x${res.res.payload}`)[0] | ||
if (prevNonce !== undefined) { | ||
decoded = appendNonce(decoded, prevNonce) | ||
} | ||
if (res.res.feeAppended) { | ||
return [[decoded[decoded.length - 1]]] | ||
} else { | ||
return [[]] | ||
} | ||
} | ||
@@ -83,0 +91,0 @@ |
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
61649
1305
Updated@0xsequence/abi@^0.10.5
Updated@0xsequence/chaind@^0.10.5
Updated@0xsequence/config@^0.10.5