Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rename tx option #7

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/tsc/paymasterclient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type IsSponsorableResponse = {
SponsorWebsite: string;
};
export type SendRawTransactionOptions = {
UserAgent?: string;
WalletToTrace?: string;
};
export declare enum GaslessTransactionStatus {
New = 0,
Expand Down
6 changes: 3 additions & 3 deletions dist/tsc/paymasterclient.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/tsc/paymasterclient.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/paymasterclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type IsSponsorableResponse = {
}

export type SendRawTransactionOptions = {
UserAgent?: string
WalletToTrace?: string
}

export enum GaslessTransactionStatus { New = 0, Pending = 1, Confirmed = 2, Failed = 3, Invalid = 4}
Expand Down Expand Up @@ -109,11 +109,11 @@ export class PaymasterClient extends ethers.JsonRpcProvider {

async sendRawTransaction(signedTx: string, opts: SendRawTransactionOptions = {}): Promise<string> {
const policyUUID = this.privatePolicyUUID
if (opts.UserAgent || this.privatePolicyUUID) {
if (opts.WalletToTrace || this.privatePolicyUUID) {
const newConnection = this._getConnection()

if (opts.UserAgent) {
newConnection.setHeader("User-Agent", opts.UserAgent)
if (opts.WalletToTrace) {
newConnection.setHeader("User-Agent", opts.WalletToTrace)
}
if (policyUUID) {
newConnection.setHeader("X-MegaFuel-Policy-Uuid", policyUUID)
Expand Down
Loading