@0xsequence/relayer
Advanced tools
Comparing version 0.29.0 to 0.29.2
# @0xsequence/relayer | ||
## 0.29.2 | ||
### Patch Changes | ||
- relayer: don't pass nonce to GetMetaTxnNetworkFeeOptions | ||
## 0.29.0 | ||
@@ -4,0 +10,0 @@ |
@@ -290,7 +290,7 @@ 'use strict'; | ||
// WebRPC description and code-gen version | ||
const WebRPCVersion = "v1"; // Schema version of your RIDL schema | ||
const WebRPCVersion = 'v1'; // Schema version of your RIDL schema | ||
const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema | ||
const WebRPCSchemaVersion = 'v0.4.0'; // Schema hash generated from your RIDL schema | ||
const WebRPCSchemaHash = "fc9652e2bc0c3df8d1ce0b4a8e24ab8790e4dae2"; // | ||
const WebRPCSchemaHash = 'fc9652e2bc0c3df8d1ce0b4a8e24ab8790e4dae2'; // | ||
// Types | ||
@@ -618,2 +618,4 @@ // | ||
const coder = ethers.ethers.utils.defaultAbiCoder; | ||
const encoded = coder.encode([transactions.MetaTransactionsType], [transactions.sequenceTxAbiEncode(transactions$1)]); | ||
const res = await this.service.getMetaTxnNetworkFeeOptions({ | ||
@@ -623,3 +625,3 @@ walletConfig: _extends({}, config$1, { | ||
}), | ||
payload: transactions.packMetaTransactionsData(...transactions$1) | ||
payload: encoded | ||
}); | ||
@@ -626,0 +628,0 @@ utils.logger.info(`[rpc-relayer/gasRefundOptions] got refund options ${JSON.stringify(res.options)}`); |
@@ -290,7 +290,7 @@ 'use strict'; | ||
// WebRPC description and code-gen version | ||
const WebRPCVersion = "v1"; // Schema version of your RIDL schema | ||
const WebRPCVersion = 'v1'; // Schema version of your RIDL schema | ||
const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema | ||
const WebRPCSchemaVersion = 'v0.4.0'; // Schema hash generated from your RIDL schema | ||
const WebRPCSchemaHash = "fc9652e2bc0c3df8d1ce0b4a8e24ab8790e4dae2"; // | ||
const WebRPCSchemaHash = 'fc9652e2bc0c3df8d1ce0b4a8e24ab8790e4dae2'; // | ||
// Types | ||
@@ -618,2 +618,4 @@ // | ||
const coder = ethers.ethers.utils.defaultAbiCoder; | ||
const encoded = coder.encode([transactions.MetaTransactionsType], [transactions.sequenceTxAbiEncode(transactions$1)]); | ||
const res = await this.service.getMetaTxnNetworkFeeOptions({ | ||
@@ -623,3 +625,3 @@ walletConfig: _extends({}, config$1, { | ||
}), | ||
payload: transactions.packMetaTransactionsData(...transactions$1) | ||
payload: encoded | ||
}); | ||
@@ -626,0 +628,0 @@ utils.logger.info(`[rpc-relayer/gasRefundOptions] got refund options ${JSON.stringify(res.options)}`); |
import { providers, ethers, Signer } from 'ethers'; | ||
import { Provider } from '@ethersproject/providers'; | ||
import { walletContracts } from '@0xsequence/abi'; | ||
import { sequenceTxAbiEncode, readSequenceNonce, encodeNonce, computeMetaTxnHash, appendNonce, MetaTransactionsType, packMetaTransactionsData, decodeNonce } from '@0xsequence/transactions'; | ||
import { sequenceTxAbiEncode, readSequenceNonce, encodeNonce, computeMetaTxnHash, appendNonce, MetaTransactionsType, decodeNonce } from '@0xsequence/transactions'; | ||
import { imageHash, addressOf, encodeSignature } from '@0xsequence/config'; | ||
@@ -282,7 +282,7 @@ import { Interface } from 'ethers/lib/utils'; | ||
// WebRPC description and code-gen version | ||
const WebRPCVersion = "v1"; // Schema version of your RIDL schema | ||
const WebRPCVersion = 'v1'; // Schema version of your RIDL schema | ||
const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema | ||
const WebRPCSchemaVersion = 'v0.4.0'; // Schema hash generated from your RIDL schema | ||
const WebRPCSchemaHash = "fc9652e2bc0c3df8d1ce0b4a8e24ab8790e4dae2"; // | ||
const WebRPCSchemaHash = 'fc9652e2bc0c3df8d1ce0b4a8e24ab8790e4dae2'; // | ||
// Types | ||
@@ -610,2 +610,4 @@ // | ||
const coder = ethers.utils.defaultAbiCoder; | ||
const encoded = coder.encode([MetaTransactionsType], [sequenceTxAbiEncode(transactions)]); | ||
const res = await this.service.getMetaTxnNetworkFeeOptions({ | ||
@@ -615,3 +617,3 @@ walletConfig: _extends({}, config, { | ||
}), | ||
payload: packMetaTransactionsData(...transactions) | ||
payload: encoded | ||
}); | ||
@@ -618,0 +620,0 @@ logger.info(`[rpc-relayer/gasRefundOptions] got refund options ${JSON.stringify(res.options)}`); |
{ | ||
"name": "@0xsequence/relayer", | ||
"version": "0.29.0", | ||
"version": "0.29.2", | ||
"description": "relayer sub-package for Sequence", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/relayer", |
@@ -12,3 +12,2 @@ import { TransactionResponse } from '@ethersproject/providers' | ||
computeMetaTxnHash, | ||
packMetaTransactionsData, | ||
decodeNonce | ||
@@ -129,5 +128,7 @@ } from '@0xsequence/transactions' | ||
const coder = ethers.utils.defaultAbiCoder | ||
const encoded = coder.encode([MetaTransactionsType], [sequenceTxAbiEncode(transactions)]) | ||
const res = await this.service.getMetaTxnNetworkFeeOptions({ | ||
walletConfig: { ...config, address: addr }, | ||
payload: packMetaTransactionsData(...transactions) | ||
payload: encoded | ||
}) | ||
@@ -134,0 +135,0 @@ |
@@ -8,11 +8,10 @@ /* eslint-disable */ | ||
// WebRPC description and code-gen version | ||
export const WebRPCVersion = "v1" | ||
export const WebRPCVersion = 'v1' | ||
// Schema version of your RIDL schema | ||
export const WebRPCSchemaVersion = "v0.4.0" | ||
export const WebRPCSchemaVersion = 'v0.4.0' | ||
// Schema hash generated from your RIDL schema | ||
export const WebRPCSchemaHash = "fc9652e2bc0c3df8d1ce0b4a8e24ab8790e4dae2" | ||
export const WebRPCSchemaHash = 'fc9652e2bc0c3df8d1ce0b4a8e24ab8790e4dae2' | ||
// | ||
@@ -75,4 +74,3 @@ // Types | ||
export interface RuntimeChecks { | ||
} | ||
export interface RuntimeChecks {} | ||
@@ -114,4 +112,4 @@ export interface SequenceContext { | ||
input: string | ||
txnArgs: {[key: string]: any} | ||
txnReceipt?: {[key: string]: any} | ||
txnArgs: { [key: string]: any } | ||
txnReceipt?: { [key: string]: any } | ||
walletAddress: string | ||
@@ -159,3 +157,3 @@ metaTxnNonce: string | ||
transfers?: Array<TxnLogTransfer> | ||
users?: {[key: string]: TxnLogUser} | ||
users?: { [key: string]: TxnLogUser } | ||
timestamp: string | ||
@@ -232,31 +230,26 @@ } | ||
export interface PingArgs { | ||
} | ||
export interface PingArgs {} | ||
export interface PingReturn { | ||
status: boolean | ||
status: boolean | ||
} | ||
export interface VersionArgs { | ||
} | ||
export interface VersionArgs {} | ||
export interface VersionReturn { | ||
version: Version | ||
version: Version | ||
} | ||
export interface RuntimeStatusArgs { | ||
} | ||
export interface RuntimeStatusArgs {} | ||
export interface RuntimeStatusReturn { | ||
status: RuntimeStatus | ||
status: RuntimeStatus | ||
} | ||
export interface GetSequenceContextArgs { | ||
} | ||
export interface GetSequenceContextArgs {} | ||
export interface GetSequenceContextReturn { | ||
data: SequenceContext | ||
data: SequenceContext | ||
} | ||
export interface GetChainIDArgs { | ||
} | ||
export interface GetChainIDArgs {} | ||
export interface GetChainIDReturn { | ||
chainID: number | ||
chainID: number | ||
} | ||
@@ -269,3 +262,3 @@ export interface SendMetaTxnArgs { | ||
status: boolean | ||
txnHash: string | ||
txnHash: string | ||
} | ||
@@ -278,3 +271,3 @@ export interface GetMetaTxnNonceArgs { | ||
export interface GetMetaTxnNonceReturn { | ||
nonce: string | ||
nonce: string | ||
} | ||
@@ -286,3 +279,3 @@ export interface GetMetaTxnReceiptArgs { | ||
export interface GetMetaTxnReceiptReturn { | ||
receipt: MetaTxnReceipt | ||
receipt: MetaTxnReceipt | ||
} | ||
@@ -296,10 +289,9 @@ export interface UpdateMetaTxnGasLimitsArgs { | ||
export interface UpdateMetaTxnGasLimitsReturn { | ||
payload: string | ||
payload: string | ||
} | ||
export interface FeeTokensArgs { | ||
} | ||
export interface FeeTokensArgs {} | ||
export interface FeeTokensReturn { | ||
isFeeRequired: boolean | ||
tokens: Array<FeeToken> | ||
tokens: Array<FeeToken> | ||
} | ||
@@ -312,3 +304,3 @@ export interface GetMetaTxnNetworkFeeOptionsArgs { | ||
export interface GetMetaTxnNetworkFeeOptionsReturn { | ||
options: Array<FeeOption> | ||
options: Array<FeeOption> | ||
} | ||
@@ -322,3 +314,3 @@ export interface SentTransactionsArgs { | ||
page: Page | ||
transactions: Array<Transaction> | ||
transactions: Array<Transaction> | ||
} | ||
@@ -331,7 +323,5 @@ export interface PendingTransactionsArgs { | ||
page: Page | ||
transactions: Array<Transaction> | ||
transactions: Array<Transaction> | ||
} | ||
// | ||
@@ -353,11 +343,8 @@ // Client | ||
} | ||
ping = (headers?: object): Promise<PingReturn> => { | ||
return this.fetch( | ||
this.url('Ping'), | ||
createHTTPRequest({}, headers) | ||
).then((res) => { | ||
return this.fetch(this.url('Ping'), createHTTPRequest({}, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: <boolean>(_data.status) | ||
status: <boolean>_data.status | ||
} | ||
@@ -367,11 +354,8 @@ }) | ||
} | ||
version = (headers?: object): Promise<VersionReturn> => { | ||
return this.fetch( | ||
this.url('Version'), | ||
createHTTPRequest({}, headers) | ||
).then((res) => { | ||
return this.fetch(this.url('Version'), createHTTPRequest({}, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
version: <Version>(_data.version) | ||
version: <Version>_data.version | ||
} | ||
@@ -381,11 +365,8 @@ }) | ||
} | ||
runtimeStatus = (headers?: object): Promise<RuntimeStatusReturn> => { | ||
return this.fetch( | ||
this.url('RuntimeStatus'), | ||
createHTTPRequest({}, headers) | ||
).then((res) => { | ||
return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: <RuntimeStatus>(_data.status) | ||
status: <RuntimeStatus>_data.status | ||
} | ||
@@ -395,11 +376,8 @@ }) | ||
} | ||
getSequenceContext = (headers?: object): Promise<GetSequenceContextReturn> => { | ||
return this.fetch( | ||
this.url('GetSequenceContext'), | ||
createHTTPRequest({}, headers) | ||
).then((res) => { | ||
return this.fetch(this.url('GetSequenceContext'), createHTTPRequest({}, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
data: <SequenceContext>(_data.data) | ||
data: <SequenceContext>_data.data | ||
} | ||
@@ -409,11 +387,8 @@ }) | ||
} | ||
getChainID = (headers?: object): Promise<GetChainIDReturn> => { | ||
return this.fetch( | ||
this.url('GetChainID'), | ||
createHTTPRequest({}, headers) | ||
).then((res) => { | ||
return this.fetch(this.url('GetChainID'), createHTTPRequest({}, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
chainID: <number>(_data.chainID) | ||
chainID: <number>_data.chainID | ||
} | ||
@@ -423,11 +398,9 @@ }) | ||
} | ||
sendMetaTxn = (args: SendMetaTxnArgs, headers?: object): Promise<SendMetaTxnReturn> => { | ||
return this.fetch( | ||
this.url('SendMetaTxn'), | ||
createHTTPRequest(args, headers)).then((res) => { | ||
return this.fetch(this.url('SendMetaTxn'), createHTTPRequest(args, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: <boolean>(_data.status), | ||
txnHash: <string>(_data.txnHash) | ||
status: <boolean>_data.status, | ||
txnHash: <string>_data.txnHash | ||
} | ||
@@ -437,10 +410,8 @@ }) | ||
} | ||
getMetaTxnNonce = (args: GetMetaTxnNonceArgs, headers?: object): Promise<GetMetaTxnNonceReturn> => { | ||
return this.fetch( | ||
this.url('GetMetaTxnNonce'), | ||
createHTTPRequest(args, headers)).then((res) => { | ||
return this.fetch(this.url('GetMetaTxnNonce'), createHTTPRequest(args, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
nonce: <string>(_data.nonce) | ||
nonce: <string>_data.nonce | ||
} | ||
@@ -450,10 +421,8 @@ }) | ||
} | ||
getMetaTxnReceipt = (args: GetMetaTxnReceiptArgs, headers?: object): Promise<GetMetaTxnReceiptReturn> => { | ||
return this.fetch( | ||
this.url('GetMetaTxnReceipt'), | ||
createHTTPRequest(args, headers)).then((res) => { | ||
return this.fetch(this.url('GetMetaTxnReceipt'), createHTTPRequest(args, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
receipt: <MetaTxnReceipt>(_data.receipt) | ||
receipt: <MetaTxnReceipt>_data.receipt | ||
} | ||
@@ -463,10 +432,8 @@ }) | ||
} | ||
updateMetaTxnGasLimits = (args: UpdateMetaTxnGasLimitsArgs, headers?: object): Promise<UpdateMetaTxnGasLimitsReturn> => { | ||
return this.fetch( | ||
this.url('UpdateMetaTxnGasLimits'), | ||
createHTTPRequest(args, headers)).then((res) => { | ||
return this.fetch(this.url('UpdateMetaTxnGasLimits'), createHTTPRequest(args, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
payload: <string>(_data.payload) | ||
payload: <string>_data.payload | ||
} | ||
@@ -476,12 +443,9 @@ }) | ||
} | ||
feeTokens = (headers?: object): Promise<FeeTokensReturn> => { | ||
return this.fetch( | ||
this.url('FeeTokens'), | ||
createHTTPRequest({}, headers) | ||
).then((res) => { | ||
return this.fetch(this.url('FeeTokens'), createHTTPRequest({}, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
isFeeRequired: <boolean>(_data.isFeeRequired), | ||
tokens: <Array<FeeToken>>(_data.tokens) | ||
isFeeRequired: <boolean>_data.isFeeRequired, | ||
tokens: <Array<FeeToken>>_data.tokens | ||
} | ||
@@ -491,10 +455,11 @@ }) | ||
} | ||
getMetaTxnNetworkFeeOptions = (args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object): Promise<GetMetaTxnNetworkFeeOptionsReturn> => { | ||
return this.fetch( | ||
this.url('GetMetaTxnNetworkFeeOptions'), | ||
createHTTPRequest(args, headers)).then((res) => { | ||
getMetaTxnNetworkFeeOptions = ( | ||
args: GetMetaTxnNetworkFeeOptionsArgs, | ||
headers?: object | ||
): Promise<GetMetaTxnNetworkFeeOptionsReturn> => { | ||
return this.fetch(this.url('GetMetaTxnNetworkFeeOptions'), createHTTPRequest(args, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
options: <Array<FeeOption>>(_data.options) | ||
options: <Array<FeeOption>>_data.options | ||
} | ||
@@ -504,11 +469,9 @@ }) | ||
} | ||
sentTransactions = (args: SentTransactionsArgs, headers?: object): Promise<SentTransactionsReturn> => { | ||
return this.fetch( | ||
this.url('SentTransactions'), | ||
createHTTPRequest(args, headers)).then((res) => { | ||
return this.fetch(this.url('SentTransactions'), createHTTPRequest(args, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
page: <Page>(_data.page), | ||
transactions: <Array<Transaction>>(_data.transactions) | ||
page: <Page>_data.page, | ||
transactions: <Array<Transaction>>_data.transactions | ||
} | ||
@@ -518,11 +481,9 @@ }) | ||
} | ||
pendingTransactions = (args: PendingTransactionsArgs, headers?: object): Promise<PendingTransactionsReturn> => { | ||
return this.fetch( | ||
this.url('PendingTransactions'), | ||
createHTTPRequest(args, headers)).then((res) => { | ||
return this.fetch(this.url('PendingTransactions'), createHTTPRequest(args, headers)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
page: <Page>(_data.page), | ||
transactions: <Array<Transaction>>(_data.transactions) | ||
page: <Page>_data.page, | ||
transactions: <Array<Transaction>>_data.transactions | ||
} | ||
@@ -532,10 +493,8 @@ }) | ||
} | ||
} | ||
export interface WebRPCError extends Error { | ||
code: string | ||
msg: string | ||
status: number | ||
status: number | ||
} | ||
@@ -556,3 +515,3 @@ | ||
data = JSON.parse(text) | ||
} catch(err) { | ||
} catch (err) { | ||
throw { code: 'unknown', msg: `expecting JSON, got: ${text}`, status: res.status } as WebRPCError | ||
@@ -559,0 +518,0 @@ } |
141350
3180