@gelatonetwork/relay-sdk
Advanced tools
Comparing version 5.2.0 to 5.3.0
@@ -19,6 +19,7 @@ import { ethers } from "ethers"; | ||
* @param {RelayRequestOptions} [options] - Optional Relay configuration | ||
* @param {string} [sponsorApiKey] Optional Sponsor API key to be used for the call | ||
* @returns {Promise<RelayResponse>} Response object with taskId parameter | ||
* | ||
*/ | ||
callWithSyncFee: (request: CallWithSyncFeeRequest, options?: RelayRequestOptions) => Promise<RelayResponse>; | ||
callWithSyncFee: (request: CallWithSyncFeeRequest, options?: RelayRequestOptions, sponsorApiKey?: string) => Promise<RelayResponse>; | ||
/** | ||
@@ -28,6 +29,7 @@ * @param {CallWithSyncFeeERC2771Request | CallWithSyncFeeConcurrentERC2771Request} request - Call with sync fee: Sequential ERC2771 or Concurrent ERC2771 request to be relayed by Gelato Executors | ||
* @param {RelayRequestOptions} [options] - Optional Relay configuration | ||
* @param {string} [sponsorApiKey] Optional Sponsor API key to be used for the call | ||
* @returns {Promise<RelayResponse>} Response object with taskId parameter | ||
* | ||
*/ | ||
callWithSyncFeeERC2771: (request: CallWithSyncFeeERC2771Request | CallWithSyncFeeConcurrentERC2771Request, walletOrProvider: ethers.BrowserProvider | ethers.Wallet, options?: RelayRequestOptions) => Promise<RelayResponse>; | ||
callWithSyncFeeERC2771: (request: CallWithSyncFeeERC2771Request | CallWithSyncFeeConcurrentERC2771Request, walletOrProvider: ethers.BrowserProvider | ethers.Wallet, options?: RelayRequestOptions, sponsorApiKey?: string) => Promise<RelayResponse>; | ||
/** | ||
@@ -80,6 +82,7 @@ * @param {SponsoredCallRequest} request SponsoredCallRequest to be relayed by the Gelato Executors. | ||
* @param {RelayRequestOptions} [options] - Optional Relay configuration | ||
* @param {string} [sponsorApiKey] Optional Sponsor API key to be used for the call | ||
* @returns {Promise<RelayResponse>} Response object with taskId parameter | ||
* | ||
*/ | ||
callWithSyncFeeERC2771WithSignature: (struct: SignatureData["struct"], syncFeeParams: BaseCallWithSyncFeeParams, signature: SignatureData["signature"], options?: RelayRequestOptions) => Promise<RelayResponse>; | ||
callWithSyncFeeERC2771WithSignature: (struct: SignatureData["struct"], syncFeeParams: BaseCallWithSyncFeeParams, signature: SignatureData["signature"], options?: RelayRequestOptions, sponsorApiKey?: string) => Promise<RelayResponse>; | ||
/** | ||
@@ -86,0 +89,0 @@ * @param {bigint} chainId - Chain Id |
@@ -71,6 +71,7 @@ "use strict"; | ||
* @param {RelayRequestOptions} [options] - Optional Relay configuration | ||
* @param {string} [sponsorApiKey] Optional Sponsor API key to be used for the call | ||
* @returns {Promise<RelayResponse>} Response object with taskId parameter | ||
* | ||
*/ | ||
this.callWithSyncFee = (request, options) => library.relayWithSyncFee({ request, options }, __classPrivateFieldGet(this, _GelatoRelay_config, "f")); | ||
this.callWithSyncFee = (request, options, sponsorApiKey) => library.relayWithSyncFee({ request, sponsorApiKey, options }, __classPrivateFieldGet(this, _GelatoRelay_config, "f")); | ||
/** | ||
@@ -80,8 +81,10 @@ * @param {CallWithSyncFeeERC2771Request | CallWithSyncFeeConcurrentERC2771Request} request - Call with sync fee: Sequential ERC2771 or Concurrent ERC2771 request to be relayed by Gelato Executors | ||
* @param {RelayRequestOptions} [options] - Optional Relay configuration | ||
* @param {string} [sponsorApiKey] Optional Sponsor API key to be used for the call | ||
* @returns {Promise<RelayResponse>} Response object with taskId parameter | ||
* | ||
*/ | ||
this.callWithSyncFeeERC2771 = (request, walletOrProvider, options) => library.relayWithCallWithSyncFeeERC2771({ | ||
this.callWithSyncFeeERC2771 = (request, walletOrProvider, options, sponsorApiKey) => library.relayWithCallWithSyncFeeERC2771({ | ||
request, | ||
walletOrProvider, | ||
sponsorApiKey, | ||
options, | ||
@@ -146,6 +149,7 @@ }, __classPrivateFieldGet(this, _GelatoRelay_config, "f")); | ||
* @param {RelayRequestOptions} [options] - Optional Relay configuration | ||
* @param {string} [sponsorApiKey] Optional Sponsor API key to be used for the call | ||
* @returns {Promise<RelayResponse>} Response object with taskId parameter | ||
* | ||
*/ | ||
this.callWithSyncFeeERC2771WithSignature = (struct, syncFeeParams, signature, options) => library.callWithSyncFeeERC2771WithSignature({ | ||
this.callWithSyncFeeERC2771WithSignature = (struct, syncFeeParams, signature, options, sponsorApiKey) => library.callWithSyncFeeERC2771WithSignature({ | ||
struct, | ||
@@ -155,2 +159,3 @@ syncFeeParams, | ||
options, | ||
sponsorApiKey, | ||
}, __classPrivateFieldGet(this, _GelatoRelay_config, "f")); | ||
@@ -157,0 +162,0 @@ /** |
@@ -5,3 +5,4 @@ import { Config, RelayRequestOptions, RelayResponse } from "../types"; | ||
request: CallWithSyncFeeRequest; | ||
sponsorApiKey?: string; | ||
options?: RelayRequestOptions; | ||
}, config: Config) => Promise<RelayResponse>; |
@@ -19,3 +19,3 @@ "use strict"; | ||
try { | ||
const { request, options } = payload; | ||
const { request, options, sponsorApiKey } = payload; | ||
const isSupported = yield (0, network_1.isNetworkSupported)({ chainId: request.chainId }, config); | ||
@@ -27,3 +27,3 @@ if (!isSupported) { | ||
relayCall: types_1.RelayCall.CallWithSyncFee, | ||
request: Object.assign(Object.assign(Object.assign(Object.assign({}, request), { isRelayContext: (_a = request.isRelayContext) !== null && _a !== void 0 ? _a : true }), options), { chainId: request.chainId.toString() }), | ||
request: Object.assign(Object.assign({}, request), { isRelayContext: (_a = request.isRelayContext) !== null && _a !== void 0 ? _a : true, sponsorApiKey, chainId: request.chainId.toString(), gasLimit: (options === null || options === void 0 ? void 0 : options.gasLimit) ? options.gasLimit.toString() : undefined, retries: options === null || options === void 0 ? void 0 : options.retries }), | ||
}, config); | ||
@@ -30,0 +30,0 @@ } |
@@ -7,3 +7,4 @@ import { ethers } from "ethers"; | ||
walletOrProvider: ethers.BrowserProvider | ethers.Wallet; | ||
sponsorApiKey?: string; | ||
options?: RelayRequestOptions; | ||
}, config: Config) => Promise<RelayResponse>; |
@@ -20,3 +20,3 @@ "use strict"; | ||
try { | ||
const { request, walletOrProvider, options } = payload; | ||
const { request, walletOrProvider, options, sponsorApiKey } = payload; | ||
if (!walletOrProvider.provider) { | ||
@@ -32,3 +32,6 @@ throw new Error(`Missing provider`); | ||
relayCall: types_1.RelayCall.CallWithSyncFeeERC2771, | ||
request: Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), options), { feeToken, isRelayContext: isRelayContext !== null && isRelayContext !== void 0 ? isRelayContext : true, userSignature: signature, isConcurrent }), | ||
request: Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), { feeToken, isRelayContext: isRelayContext !== null && isRelayContext !== void 0 ? isRelayContext : true, userSignature: signature, isConcurrent, | ||
sponsorApiKey, gasLimit: (options === null || options === void 0 ? void 0 : options.gasLimit) | ||
? options.gasLimit.toString() | ||
: undefined, retries: options === null || options === void 0 ? void 0 : options.retries }), | ||
}, config); | ||
@@ -43,3 +46,6 @@ } | ||
relayCall: types_1.RelayCall.CallWithSyncFeeERC2771, | ||
request: Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), options), { feeToken, isRelayContext: isRelayContext !== null && isRelayContext !== void 0 ? isRelayContext : true, userSignature: signature, isConcurrent }), | ||
request: Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), { feeToken, isRelayContext: isRelayContext !== null && isRelayContext !== void 0 ? isRelayContext : true, userSignature: signature, isConcurrent, | ||
sponsorApiKey, gasLimit: (options === null || options === void 0 ? void 0 : options.gasLimit) | ||
? options.gasLimit.toString() | ||
: undefined, retries: options === null || options === void 0 ? void 0 : options.retries }), | ||
}, config); | ||
@@ -46,0 +52,0 @@ } |
@@ -8,2 +8,3 @@ import { BaseCallWithSyncFeeParams, Config, RelayRequestOptions, RelayResponse } from "../../types"; | ||
options?: RelayRequestOptions; | ||
sponsorApiKey?: string; | ||
}, config: Config) => Promise<RelayResponse>; |
@@ -20,3 +20,3 @@ "use strict"; | ||
try { | ||
const { signature, struct, syncFeeParams, options } = payload; | ||
const { signature, struct, syncFeeParams, options, sponsorApiKey } = payload; | ||
const isSupported = yield (0, network_1.isNetworkSupported)({ chainId: struct.chainId }, config); | ||
@@ -30,3 +30,6 @@ if (!isSupported) { | ||
relayCall: types_1.RelayCall.CallWithSyncFeeERC2771, | ||
request: Object.assign(Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), syncFeeParams), options), { isRelayContext: (_a = syncFeeParams.isRelayContext) !== null && _a !== void 0 ? _a : true, userSignature: signature, isConcurrent }), | ||
request: Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), syncFeeParams), { isRelayContext: (_a = syncFeeParams.isRelayContext) !== null && _a !== void 0 ? _a : true, userSignature: signature, isConcurrent, | ||
sponsorApiKey, gasLimit: (options === null || options === void 0 ? void 0 : options.gasLimit) | ||
? options.gasLimit.toString() | ||
: undefined, retries: options === null || options === void 0 ? void 0 : options.retries }), | ||
}, config); | ||
@@ -38,3 +41,6 @@ } | ||
relayCall: types_1.RelayCall.CallWithSyncFeeERC2771, | ||
request: Object.assign(Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), syncFeeParams), options), { isRelayContext: (_b = syncFeeParams.isRelayContext) !== null && _b !== void 0 ? _b : true, userSignature: signature, isConcurrent }), | ||
request: Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), syncFeeParams), { isRelayContext: (_b = syncFeeParams.isRelayContext) !== null && _b !== void 0 ? _b : true, userSignature: signature, isConcurrent, | ||
sponsorApiKey, gasLimit: (options === null || options === void 0 ? void 0 : options.gasLimit) | ||
? options.gasLimit.toString() | ||
: undefined, retries: options === null || options === void 0 ? void 0 : options.retries }), | ||
}, config); | ||
@@ -41,0 +47,0 @@ } |
@@ -38,4 +38,6 @@ "use strict"; | ||
relayCall: types_1.RelayCall.SponsoredCallERC2771, | ||
request: Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), options), { userSignature: signature, sponsorApiKey, | ||
isConcurrent }), | ||
request: Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), { userSignature: signature, sponsorApiKey, | ||
isConcurrent, gasLimit: (options === null || options === void 0 ? void 0 : options.gasLimit) | ||
? options.gasLimit.toString() | ||
: undefined, retries: options === null || options === void 0 ? void 0 : options.retries }), | ||
}, config); | ||
@@ -53,4 +55,6 @@ } | ||
relayCall: types_1.RelayCall.SponsoredCallERC2771, | ||
request: Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), options), { userSignature: signature, sponsorApiKey, | ||
isConcurrent }), | ||
request: Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), { userSignature: signature, sponsorApiKey, | ||
isConcurrent, gasLimit: (options === null || options === void 0 ? void 0 : options.gasLimit) | ||
? options.gasLimit.toString() | ||
: undefined, retries: options === null || options === void 0 ? void 0 : options.retries }), | ||
}, config); | ||
@@ -57,0 +61,0 @@ } |
@@ -28,4 +28,6 @@ "use strict"; | ||
relayCall: types_1.RelayCall.SponsoredCallERC2771, | ||
request: Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), options), { userSignature: signature, sponsorApiKey, | ||
isConcurrent }), | ||
request: Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), { userSignature: signature, sponsorApiKey, | ||
isConcurrent, gasLimit: (options === null || options === void 0 ? void 0 : options.gasLimit) | ||
? options.gasLimit.toString() | ||
: undefined, retries: options === null || options === void 0 ? void 0 : options.retries }), | ||
}, config); | ||
@@ -37,4 +39,6 @@ } | ||
relayCall: types_1.RelayCall.SponsoredCallERC2771, | ||
request: Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), options), { userSignature: signature, sponsorApiKey, | ||
isConcurrent }), | ||
request: Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), { userSignature: signature, sponsorApiKey, | ||
isConcurrent, gasLimit: (options === null || options === void 0 ? void 0 : options.gasLimit) | ||
? options.gasLimit.toString() | ||
: undefined, retries: options === null || options === void 0 ? void 0 : options.retries }), | ||
}, config); | ||
@@ -41,0 +45,0 @@ } |
@@ -38,3 +38,3 @@ "use strict"; | ||
relayCall: types_1.RelayCall.SponsoredCall, | ||
request: Object.assign(Object.assign(Object.assign({}, struct), options), { sponsorApiKey }), | ||
request: Object.assign(Object.assign({}, struct), { sponsorApiKey, gasLimit: (options === null || options === void 0 ? void 0 : options.gasLimit) ? options.gasLimit.toString() : undefined, retries: options === null || options === void 0 ? void 0 : options.retries }), | ||
}, config); | ||
@@ -41,0 +41,0 @@ return postResponse; |
@@ -57,3 +57,3 @@ import { BytesLike } from "ethers"; | ||
export type SafeRequestPayload<T> = { | ||
[K in keyof T]: T[K] extends bigint ? string : T[K]; | ||
[K in keyof T]: T[K] extends bigint ? string : T[K] extends bigint | undefined ? string | undefined : T[K] extends object ? SafeRequestPayload<T[K]> : T[K]; | ||
}; |
{ | ||
"name": "@gelatonetwork/relay-sdk", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"description": "SDK to integrate with Gelato Relay", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
111310
2003