Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gelatonetwork/relay-sdk

Package Overview
Dependencies
Maintainers
16
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gelatonetwork/relay-sdk - npm Package Compare versions

Comparing version 5.1.0 to 5.2.0

dist/lib/erc2771/getDataToSignERC2771/index.d.ts

14

dist/index.d.ts
import { ethers } from "ethers";
import { CallWithSyncFeeRequest } from "./lib/callWithSyncFee/types";
import { SponsoredCallRequest } from "./lib/sponsoredCall/types";
import { SignatureData, CallWithERC2771Request, ERC2771Type, CallWithSyncFeeERC2771Request, CallWithSyncFeeConcurrentERC2771Request, CallWithConcurrentERC2771Request } from "./lib/erc2771/types";
import { SignatureData, PayloadToSign, CallWithERC2771Request, ERC2771Type, CallWithSyncFeeERC2771Request, CallWithSyncFeeConcurrentERC2771Request, CallWithConcurrentERC2771Request } from "./lib/erc2771/types";
import { TransactionStatusResponse } from "./lib/status/types";
import { BaseCallWithSyncFeeParams, Config, RelayRequestOptions, RelayResponse } from "./lib/types";
export { CallWithSyncFeeRequest, CallWithERC2771Request, SponsoredCallRequest, RelayRequestOptions, TransactionStatusResponse, RelayResponse, SignatureData, ERC2771Type, CallWithSyncFeeERC2771Request, BaseCallWithSyncFeeParams, CallWithSyncFeeConcurrentERC2771Request, CallWithConcurrentERC2771Request, Config, };
export { CallWithSyncFeeRequest, CallWithERC2771Request, SponsoredCallRequest, RelayRequestOptions, TransactionStatusResponse, RelayResponse, SignatureData, PayloadToSign, ERC2771Type, CallWithSyncFeeERC2771Request, BaseCallWithSyncFeeParams, CallWithSyncFeeConcurrentERC2771Request, CallWithConcurrentERC2771Request, Config, };
export declare class GelatoRelay {

@@ -52,3 +52,3 @@ #private;

* @param {ERC2771Type} type - ERC2771Type.CallWithSyncFee or ERC2771Type.SponsoredCall
* @returns {Promise<SignatureData>} Response object with taskId parameter
* @returns {Promise<SignatureData>} Response object with struct and signature
*

@@ -58,2 +58,10 @@ */

/**
* @param {CallWithERC2771Request | CallWithConcurrentERC2771Request} request - Sequential ERC2771 or Concurrent ERC2771 request to be relayed by Gelato Executors
* @param {ethers.BrowserProvider | ethers.Wallet} [walletOrProvider] - Optional BrowserProvider [front-end] or Wallet [back-end] to sign the payload
* @param {ERC2771Type} type - ERC2771Type.CallWithSyncFee or ERC2771Type.SponsoredCall
* @returns {Promise<PayloadToSign>} Response object with struct and typed data
*
*/
getDataToSignERC2771: (request: CallWithERC2771Request | CallWithConcurrentERC2771Request, type: ERC2771Type, walletOrProvider?: ethers.BrowserProvider | ethers.Wallet) => Promise<PayloadToSign>;
/**
* @param {SignatureData["struct"]} struct - Struct that can be obtained from getSignatureDataERC2771

@@ -60,0 +68,0 @@ * @param {SignatureData["signature"]} signature - Signature that can be obtained from getSignatureDataERC2771

@@ -113,3 +113,3 @@ "use strict";

* @param {ERC2771Type} type - ERC2771Type.CallWithSyncFee or ERC2771Type.SponsoredCall
* @returns {Promise<SignatureData>} Response object with taskId parameter
* @returns {Promise<SignatureData>} Response object with struct and signature
*

@@ -119,2 +119,10 @@ */

/**
* @param {CallWithERC2771Request | CallWithConcurrentERC2771Request} request - Sequential ERC2771 or Concurrent ERC2771 request to be relayed by Gelato Executors
* @param {ethers.BrowserProvider | ethers.Wallet} [walletOrProvider] - Optional BrowserProvider [front-end] or Wallet [back-end] to sign the payload
* @param {ERC2771Type} type - ERC2771Type.CallWithSyncFee or ERC2771Type.SponsoredCall
* @returns {Promise<PayloadToSign>} Response object with struct and typed data
*
*/
this.getDataToSignERC2771 = (request, type, walletOrProvider) => library.getDataToSignERC2771({ request, walletOrProvider, type }, __classPrivateFieldGet(this, _GelatoRelay_config, "f"));
/**
* @param {SignatureData["struct"]} struct - Struct that can be obtained from getSignatureDataERC2771

@@ -121,0 +129,0 @@ * @param {SignatureData["signature"]} signature - Signature that can be obtained from getSignatureDataERC2771

@@ -11,20 +11,9 @@ "use strict";

};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.relayWithCallWithSyncFeeERC2771 = void 0;
const utils_1 = require("../../../utils");
const network_1 = require("../../network");
const types_1 = require("../../types");
const types_2 = require("../types");
const utils_2 = require("../utils");
const index_js_1 = require("../getSignatureDataERC2771/index.js");
const safeTransformStruct_js_1 = require("../utils/safeTransformStruct.js");
const relayWithCallWithSyncFeeERC2771 = (payload, config) => __awaiter(void 0, void 0, void 0, function* () {

@@ -36,25 +25,10 @@ try {

}
const { chainId } = request;
const isSupported = yield (0, network_1.isNetworkSupported)({ chainId }, config);
if (!isSupported) {
throw new Error(`Chain id [${chainId.toString()}] is not supported`);
}
const providerChainId = yield (0, utils_1.getProviderChainId)(walletOrProvider);
if (chainId !== providerChainId) {
throw new Error(`Request and provider chain id mismatch. Request: [${chainId.toString()}], provider: [${providerChainId.toString()}]`);
}
if (request.isConcurrent) {
const isConcurrent = true;
const { isRelayContext, feeToken } = request, callWithSyncFeeRequest = __rest(request, ["isRelayContext", "feeToken"]);
const { isRelayContext, feeToken } = request;
const type = types_2.ERC2771Type.ConcurrentCallWithSyncFee;
const parametersToOverride = yield (0, utils_1.populateOptionalUserParameters)({ request: callWithSyncFeeRequest, type, walletOrProvider }, config);
const struct = yield (0, utils_2.mapRequestToStruct)(callWithSyncFeeRequest, parametersToOverride);
const signature = yield (0, utils_1.signTypedDataV4)(walletOrProvider, callWithSyncFeeRequest.user, (0, utils_2.getPayloadToSign)({
struct: Object.assign(Object.assign({}, struct), { chainId: struct.chainId.toString() }),
type,
isWallet: (0, utils_1.isWallet)(walletOrProvider),
}, config));
const { struct, signature } = yield (0, index_js_1.getSignatureDataERC2771)({ request, walletOrProvider, type }, config);
return yield (0, utils_1.post)({
relayCall: types_1.RelayCall.CallWithSyncFeeERC2771,
request: Object.assign(Object.assign(Object.assign({}, struct), options), { feeToken, isRelayContext: isRelayContext !== null && isRelayContext !== void 0 ? isRelayContext : true, userSignature: signature, chainId: struct.chainId.toString(), isConcurrent }),
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 }),
}, config);

@@ -64,14 +38,8 @@ }

const isConcurrent = false;
const { isRelayContext, feeToken } = request, callWithSyncFeeRequest = __rest(request, ["isRelayContext", "feeToken"]);
const { isRelayContext, feeToken } = request;
const type = types_2.ERC2771Type.CallWithSyncFee;
const parametersToOverride = yield (0, utils_1.populateOptionalUserParameters)({ request: callWithSyncFeeRequest, type, walletOrProvider }, config);
const struct = yield (0, utils_2.mapRequestToStruct)(callWithSyncFeeRequest, parametersToOverride);
const signature = yield (0, utils_1.signTypedDataV4)(walletOrProvider, callWithSyncFeeRequest.user, (0, utils_2.getPayloadToSign)({
struct: Object.assign(Object.assign({}, struct), { chainId: struct.chainId.toString(), userNonce: struct.userNonce.toString() }),
type,
isWallet: (0, utils_1.isWallet)(walletOrProvider),
}, config));
const { struct, signature } = yield (0, index_js_1.getSignatureDataERC2771)({ request, walletOrProvider, type }, config);
return yield (0, utils_1.post)({
relayCall: types_1.RelayCall.CallWithSyncFeeERC2771,
request: Object.assign(Object.assign(Object.assign({}, struct), options), { feeToken, isRelayContext: isRelayContext !== null && isRelayContext !== void 0 ? isRelayContext : true, userSignature: signature, chainId: struct.chainId.toString(), userNonce: struct.userNonce.toString(), isConcurrent }),
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 }),
}, config);

@@ -78,0 +46,0 @@ }

@@ -16,2 +16,3 @@ "use strict";

const types_1 = require("../../types");
const safeTransformStruct_js_1 = require("../utils/safeTransformStruct.js");
const callWithSyncFeeERC2771WithSignature = (payload, config) => __awaiter(void 0, void 0, void 0, function* () {

@@ -29,3 +30,3 @@ var _a, _b;

relayCall: types_1.RelayCall.CallWithSyncFeeERC2771,
request: Object.assign(Object.assign(Object.assign(Object.assign({}, struct), syncFeeParams), options), { isRelayContext: (_a = syncFeeParams.isRelayContext) !== null && _a !== void 0 ? _a : true, userSignature: signature, chainId: struct.chainId.toString(), isConcurrent }),
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 }),
}, config);

@@ -37,3 +38,3 @@ }

relayCall: types_1.RelayCall.CallWithSyncFeeERC2771,
request: Object.assign(Object.assign(Object.assign(Object.assign({}, struct), syncFeeParams), options), { isRelayContext: (_b = syncFeeParams.isRelayContext) !== null && _b !== void 0 ? _b : true, userSignature: signature, chainId: struct.chainId.toString(), userNonce: struct.userNonce.toString(), isConcurrent }),
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 }),
}, config);

@@ -40,0 +41,0 @@ }

import { ethers } from "ethers";
import { Config } from "../../types";
import { SignatureData, CallWithERC2771Request, ERC2771Type, CallWithConcurrentERC2771Request } from "../types";
export declare const getSignatureDataERC2771: (payload: {
import { SignatureData, CallWithERC2771Request, ERC2771Type, CallWithConcurrentERC2771Request, SequentialSignatureData, ConcurrentSignatureData } from "../types";
export declare function getSignatureDataERC2771(payload: {
request: CallWithERC2771Request;
walletOrProvider: ethers.BrowserProvider | ethers.Wallet;
type: ERC2771Type.CallWithSyncFee | ERC2771Type.SponsoredCall;
}, config: Config): Promise<SequentialSignatureData>;
export declare function getSignatureDataERC2771(payload: {
request: CallWithConcurrentERC2771Request;
walletOrProvider: ethers.BrowserProvider | ethers.Wallet;
type: ERC2771Type.ConcurrentCallWithSyncFee | ERC2771Type.ConcurrentSponsoredCall;
}, config: Config): Promise<ConcurrentSignatureData>;
export declare function getSignatureDataERC2771(payload: {
request: CallWithERC2771Request | CallWithConcurrentERC2771Request;
walletOrProvider: ethers.BrowserProvider | ethers.Wallet;
type: ERC2771Type;
}, config: Config) => Promise<SignatureData>;
}, config: Config): Promise<SignatureData>;

@@ -14,53 +14,43 @@ "use strict";

const utils_1 = require("../../../utils");
const network_1 = require("../../network");
const utils_2 = require("../utils");
const getSignatureDataERC2771 = (payload, config) => __awaiter(void 0, void 0, void 0, function* () {
try {
const { request, type, walletOrProvider } = payload;
if (!walletOrProvider.provider) {
throw new Error(`Missing provider`);
const index_js_1 = require("../getDataToSignERC2771/index.js");
function getSignatureDataERC2771(payload, config) {
return __awaiter(this, void 0, void 0, function* () {
try {
const { request, walletOrProvider } = payload;
if (!walletOrProvider.provider) {
throw new Error(`Missing provider`);
}
if ((0, utils_1.isConcurrentRequest)(request)) {
const type = payload.type;
const { struct, typedData } = yield (0, index_js_1.getDataToSignERC2771)({
request,
walletOrProvider,
type,
}, config);
const signature = yield (0, utils_1.signTypedDataV4)(walletOrProvider, request.user, typedData);
return {
struct,
signature,
};
}
else {
const type = payload.type;
const { struct, typedData } = yield (0, index_js_1.getDataToSignERC2771)({
request,
walletOrProvider,
type,
}, config);
const signature = yield (0, utils_1.signTypedDataV4)(walletOrProvider, request.user, typedData);
return {
struct,
signature,
};
}
}
const { chainId } = request;
const isSupported = yield (0, network_1.isNetworkSupported)({ chainId }, config);
if (!isSupported) {
throw new Error(`Chain id [${chainId.toString()}] is not supported`);
catch (error) {
const errorMessage = error.message;
throw new Error(`GelatoRelaySDK/getSignatureDataERC2771: Failed with error: ${errorMessage}`);
}
const providerChainId = yield (0, utils_1.getProviderChainId)(walletOrProvider);
if (chainId !== providerChainId) {
throw new Error(`Request and provider chain id mismatch. Request: [${chainId.toString()}], provider: [${providerChainId.toString()}]`);
}
if ((0, utils_1.isConcurrentRequest)(request)) {
const concurrentType = type;
const parametersToOverride = yield (0, utils_1.populateOptionalUserParameters)({ request, type: concurrentType, walletOrProvider }, config);
const struct = yield (0, utils_2.mapRequestToStruct)(request, parametersToOverride);
const signature = yield (0, utils_1.signTypedDataV4)(walletOrProvider, request.user, (0, utils_2.getPayloadToSign)({
struct: Object.assign(Object.assign({}, struct), { chainId: struct.chainId.toString() }),
type,
isWallet: (0, utils_1.isWallet)(walletOrProvider),
}, config));
return {
struct,
signature,
};
}
else {
const nonConcurrentType = type;
const parametersToOverride = yield (0, utils_1.populateOptionalUserParameters)({ request, type: nonConcurrentType, walletOrProvider }, config);
const struct = yield (0, utils_2.mapRequestToStruct)(request, parametersToOverride);
const signature = yield (0, utils_1.signTypedDataV4)(walletOrProvider, request.user, (0, utils_2.getPayloadToSign)({
struct: Object.assign(Object.assign({}, struct), { chainId: struct.chainId.toString(), userNonce: struct.userNonce.toString() }),
type,
isWallet: (0, utils_1.isWallet)(walletOrProvider),
}, config));
return {
struct,
signature,
};
}
}
catch (error) {
const errorMessage = error.message;
throw new Error(`GelatoRelaySDK/getSignatureDataERC2771: Failed with error: ${errorMessage}`);
}
});
});
}
exports.getSignatureDataERC2771 = getSignatureDataERC2771;
export { getSignatureDataERC2771 } from "./getSignatureDataERC2771";
export { getDataToSignERC2771 } from "./getDataToSignERC2771";
export { relayWithSponsoredCallERC2771 } from "./sponsoredCallERC2771";

@@ -3,0 +4,0 @@ export { sponsoredCallERC2771WithSignature } from "./sponsoredCallERC2771WithSignature";

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.callWithSyncFeeERC2771WithSignature = exports.relayWithCallWithSyncFeeERC2771 = exports.sponsoredCallERC2771WithSignature = exports.relayWithSponsoredCallERC2771 = exports.getSignatureDataERC2771 = void 0;
exports.callWithSyncFeeERC2771WithSignature = exports.relayWithCallWithSyncFeeERC2771 = exports.sponsoredCallERC2771WithSignature = exports.relayWithSponsoredCallERC2771 = exports.getDataToSignERC2771 = exports.getSignatureDataERC2771 = void 0;
var getSignatureDataERC2771_1 = require("./getSignatureDataERC2771");
Object.defineProperty(exports, "getSignatureDataERC2771", { enumerable: true, get: function () { return getSignatureDataERC2771_1.getSignatureDataERC2771; } });
var getDataToSignERC2771_1 = require("./getDataToSignERC2771");
Object.defineProperty(exports, "getDataToSignERC2771", { enumerable: true, get: function () { return getDataToSignERC2771_1.getDataToSignERC2771; } });
var sponsoredCallERC2771_1 = require("./sponsoredCallERC2771");

@@ -7,0 +9,0 @@ Object.defineProperty(exports, "relayWithSponsoredCallERC2771", { enumerable: true, get: function () { return sponsoredCallERC2771_1.relayWithSponsoredCallERC2771; } });

@@ -14,6 +14,6 @@ "use strict";

const utils_1 = require("../../../utils");
const network_1 = require("../../network");
const types_1 = require("../../types");
const types_2 = require("../types");
const utils_2 = require("../utils");
const index_js_1 = require("../getSignatureDataERC2771/index.js");
const safeTransformStruct_js_1 = require("../utils/safeTransformStruct.js");
const relayWithSponsoredCallERC2771 = (payload, config) => __awaiter(void 0, void 0, void 0, function* () {

@@ -29,24 +29,14 @@ return yield sponsoredCallERC2771(payload, config);

}
const { chainId } = request;
const isSupported = yield (0, network_1.isNetworkSupported)({ chainId }, config);
if (!isSupported) {
throw new Error(`Chain id [${chainId.toString()}] is not supported`);
}
const providerChainId = yield (0, utils_1.getProviderChainId)(walletOrProvider);
if (chainId !== providerChainId) {
throw new Error(`Request and provider chain id mismatch. Request: [${chainId.toString()}], provider: [${providerChainId.toString()}]`);
}
if ((0, utils_1.isConcurrentRequest)(request)) {
const isConcurrent = true;
const type = types_2.ERC2771Type.ConcurrentSponsoredCall;
const parametersToOverride = yield (0, utils_1.populateOptionalUserParameters)({ request, type, walletOrProvider }, config);
const struct = yield (0, utils_2.mapRequestToStruct)(request, parametersToOverride);
const signature = yield (0, utils_1.signTypedDataV4)(walletOrProvider, request.user, (0, utils_2.getPayloadToSign)({
struct: Object.assign(Object.assign({}, struct), { chainId: struct.chainId.toString() }),
const { struct, signature } = yield (0, index_js_1.getSignatureDataERC2771)({
request,
walletOrProvider,
type,
isWallet: (0, utils_1.isWallet)(walletOrProvider),
}, config));
}, config);
return yield (0, utils_1.post)({
relayCall: types_1.RelayCall.SponsoredCallERC2771,
request: Object.assign(Object.assign(Object.assign({}, struct), options), { userSignature: signature, sponsorApiKey, chainId: struct.chainId.toString(), isConcurrent }),
request: Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), options), { userSignature: signature, sponsorApiKey,
isConcurrent }),
}, config);

@@ -57,12 +47,11 @@ }

const type = types_2.ERC2771Type.SponsoredCall;
const parametersToOverride = yield (0, utils_1.populateOptionalUserParameters)({ request, type, walletOrProvider }, config);
const struct = yield (0, utils_2.mapRequestToStruct)(request, parametersToOverride);
const signature = yield (0, utils_1.signTypedDataV4)(walletOrProvider, request.user, (0, utils_2.getPayloadToSign)({
struct: Object.assign(Object.assign({}, struct), { chainId: struct.chainId.toString(), userNonce: struct.userNonce.toString() }),
const { struct, signature } = yield (0, index_js_1.getSignatureDataERC2771)({
request,
walletOrProvider,
type,
isWallet: (0, utils_1.isWallet)(walletOrProvider),
}, config));
}, config);
return yield (0, utils_1.post)({
relayCall: types_1.RelayCall.SponsoredCallERC2771,
request: Object.assign(Object.assign(Object.assign({}, struct), options), { userSignature: signature, sponsorApiKey, chainId: struct.chainId.toString(), userNonce: struct.userNonce.toString(), isConcurrent }),
request: Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), options), { userSignature: signature, sponsorApiKey,
isConcurrent }),
}, config);

@@ -69,0 +58,0 @@ }

@@ -16,2 +16,3 @@ "use strict";

const types_1 = require("../../types");
const safeTransformStruct_js_1 = require("../utils/safeTransformStruct.js");
const sponsoredCallERC2771WithSignature = (payload, config) => __awaiter(void 0, void 0, void 0, function* () {

@@ -28,3 +29,4 @@ try {

relayCall: types_1.RelayCall.SponsoredCallERC2771,
request: Object.assign(Object.assign(Object.assign({}, struct), options), { userSignature: signature, sponsorApiKey, chainId: struct.chainId.toString(), isConcurrent }),
request: Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), options), { userSignature: signature, sponsorApiKey,
isConcurrent }),
}, config);

@@ -36,3 +38,4 @@ }

relayCall: types_1.RelayCall.SponsoredCallERC2771,
request: Object.assign(Object.assign(Object.assign({}, struct), options), { userSignature: signature, sponsorApiKey, chainId: struct.chainId.toString(), userNonce: struct.userNonce.toString(), isConcurrent }),
request: Object.assign(Object.assign(Object.assign({}, (0, safeTransformStruct_js_1.safeTransformStruct)(struct)), options), { userSignature: signature, sponsorApiKey,
isConcurrent }),
}, config);

@@ -39,0 +42,0 @@ }

@@ -117,6 +117,20 @@ import { BaseCallWithSyncFeeParams, BaseRelayParams, EIP712Domain, Optional, SafeRequestPayload } from "../../types";

};
export type SignatureData = {
struct: CallWithERC2771Struct | CallWithConcurrentERC2771Struct;
export type ConcurrentSignatureData = {
struct: CallWithConcurrentERC2771Struct;
signature: string;
};
export type SequentialSignatureData = {
struct: CallWithERC2771Struct;
signature: string;
};
export type SignatureData = ConcurrentSignatureData | SequentialSignatureData;
export type ConcurrentPayloadToSign = {
struct: CallWithConcurrentERC2771Struct;
typedData: SponsoredCallConcurrentERC2771PayloadToSign | CallWithSyncFeeConcurrentERC2771PayloadToSign;
};
export type SequentialPayloadToSign = {
struct: CallWithERC2771Struct;
typedData: SponsoredCallERC2771PayloadToSign | CallWithSyncFeeERC2771PayloadToSign;
};
export type PayloadToSign = ConcurrentPayloadToSign | SequentialPayloadToSign;
export declare enum ERC2771Type {

@@ -123,0 +137,0 @@ CallWithSyncFee = "CallWithSyncFee",

import { Config, SafeRequestPayload } from "../../types";
import { SponsoredCallERC2771PayloadToSign, CallWithERC2771Struct, ERC2771Type, CallWithSyncFeeERC2771PayloadToSign, CallWithConcurrentERC2771Struct, SponsoredCallConcurrentERC2771PayloadToSign, CallWithSyncFeeConcurrentERC2771PayloadToSign } from "../types";
export declare function getPayloadToSign(payload: {
struct: SafeRequestPayload<CallWithERC2771Struct | CallWithConcurrentERC2771Struct>;
type: ERC2771Type;
isWallet: boolean;
}, config: Config): SponsoredCallERC2771PayloadToSign | CallWithSyncFeeERC2771PayloadToSign | SponsoredCallConcurrentERC2771PayloadToSign | CallWithSyncFeeConcurrentERC2771PayloadToSign;
struct: SafeRequestPayload<CallWithERC2771Struct>;
type: ERC2771Type.CallWithSyncFee | ERC2771Type.SponsoredCall;
isWallet?: boolean;
}, config: Config): SponsoredCallERC2771PayloadToSign | CallWithSyncFeeERC2771PayloadToSign;
export declare function getPayloadToSign(payload: {
struct: SafeRequestPayload<CallWithConcurrentERC2771Struct>;
type: ERC2771Type.ConcurrentCallWithSyncFee | ERC2771Type.ConcurrentSponsoredCall;
isWallet?: boolean;
}, config: Config): SponsoredCallConcurrentERC2771PayloadToSign | CallWithSyncFeeConcurrentERC2771PayloadToSign;

@@ -1,2 +0,1 @@

export { getPayloadToSign } from "./getPayloadToSign";
export { mapRequestToStruct } from "./mapRequestToStruct";
export { populatePayloadToSign } from "./populatePayloadToSign";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapRequestToStruct = exports.getPayloadToSign = void 0;
var getPayloadToSign_1 = require("./getPayloadToSign");
Object.defineProperty(exports, "getPayloadToSign", { enumerable: true, get: function () { return getPayloadToSign_1.getPayloadToSign; } });
var mapRequestToStruct_1 = require("./mapRequestToStruct");
Object.defineProperty(exports, "mapRequestToStruct", { enumerable: true, get: function () { return mapRequestToStruct_1.mapRequestToStruct; } });
exports.populatePayloadToSign = void 0;
var populatePayloadToSign_1 = require("./populatePayloadToSign");
Object.defineProperty(exports, "populatePayloadToSign", { enumerable: true, get: function () { return populatePayloadToSign_1.populatePayloadToSign; } });
export { relayWithSyncFee } from "./callWithSyncFee";
export { relayWithSponsoredCall } from "./sponsoredCall";
export { relayWithSponsoredCallERC2771, getSignatureDataERC2771, sponsoredCallERC2771WithSignature, callWithSyncFeeERC2771WithSignature, relayWithCallWithSyncFeeERC2771, } from "./erc2771";
export { relayWithSponsoredCallERC2771, getSignatureDataERC2771, getDataToSignERC2771, sponsoredCallERC2771WithSignature, callWithSyncFeeERC2771WithSignature, relayWithCallWithSyncFeeERC2771, } from "./erc2771";
export { getEstimatedFee, getGelatoOracles, getPaymentTokens, isOracleActive, } from "./oracle";
export { getSupportedNetworks, isNetworkSupported } from "./network";
export { getTaskStatus } from "./status";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTaskStatus = exports.isNetworkSupported = exports.getSupportedNetworks = exports.isOracleActive = exports.getPaymentTokens = exports.getGelatoOracles = exports.getEstimatedFee = exports.relayWithCallWithSyncFeeERC2771 = exports.callWithSyncFeeERC2771WithSignature = exports.sponsoredCallERC2771WithSignature = exports.getSignatureDataERC2771 = exports.relayWithSponsoredCallERC2771 = exports.relayWithSponsoredCall = exports.relayWithSyncFee = void 0;
exports.getTaskStatus = exports.isNetworkSupported = exports.getSupportedNetworks = exports.isOracleActive = exports.getPaymentTokens = exports.getGelatoOracles = exports.getEstimatedFee = exports.relayWithCallWithSyncFeeERC2771 = exports.callWithSyncFeeERC2771WithSignature = exports.sponsoredCallERC2771WithSignature = exports.getDataToSignERC2771 = exports.getSignatureDataERC2771 = exports.relayWithSponsoredCallERC2771 = exports.relayWithSponsoredCall = exports.relayWithSyncFee = void 0;
var callWithSyncFee_1 = require("./callWithSyncFee");

@@ -11,2 +11,3 @@ Object.defineProperty(exports, "relayWithSyncFee", { enumerable: true, get: function () { return callWithSyncFee_1.relayWithSyncFee; } });

Object.defineProperty(exports, "getSignatureDataERC2771", { enumerable: true, get: function () { return erc2771_1.getSignatureDataERC2771; } });
Object.defineProperty(exports, "getDataToSignERC2771", { enumerable: true, get: function () { return erc2771_1.getDataToSignERC2771; } });
Object.defineProperty(exports, "sponsoredCallERC2771WithSignature", { enumerable: true, get: function () { return erc2771_1.sponsoredCallERC2771WithSignature; } });

@@ -13,0 +14,0 @@ Object.defineProperty(exports, "callWithSyncFeeERC2771WithSignature", { enumerable: true, get: function () { return erc2771_1.callWithSyncFeeERC2771WithSignature; } });

@@ -21,9 +21,9 @@ "use strict";

exports.relayWithSponsoredCall = relayWithSponsoredCall;
const mapRequestToStruct = (request) => __awaiter(void 0, void 0, void 0, function* () {
const mapRequestToStruct = (request) => {
return {
chainId: request.chainId,
chainId: request.chainId.toString(),
target: (0, ethers_1.getAddress)(request.target),
data: request.data,
};
});
};
const sponsoredCall = (payload, config) => __awaiter(void 0, void 0, void 0, function* () {

@@ -39,3 +39,3 @@ try {

relayCall: types_1.RelayCall.SponsoredCall,
request: Object.assign(Object.assign(Object.assign({}, struct), options), { sponsorApiKey, chainId: struct.chainId.toString() }),
request: Object.assign(Object.assign(Object.assign({}, struct), options), { sponsorApiKey }),
}, config);

@@ -42,0 +42,0 @@ return postResponse;

@@ -7,3 +7,3 @@ import { ethers } from "ethers";

type: ERC2771Type.ConcurrentCallWithSyncFee | ERC2771Type.ConcurrentSponsoredCall;
walletOrProvider: ethers.BrowserProvider | ethers.Wallet;
walletOrProvider?: ethers.BrowserProvider | ethers.Wallet;
}, config: Config): Promise<Partial<CallWithConcurrentERC2771RequestOptionalParameters>>;

@@ -13,3 +13,3 @@ export declare function populateOptionalUserParameters(payload: {

type: ERC2771Type.CallWithSyncFee | ERC2771Type.SponsoredCall;
walletOrProvider: ethers.BrowserProvider | ethers.Wallet;
walletOrProvider?: ethers.BrowserProvider | ethers.Wallet;
}, config: Config): Promise<Partial<CallWithERC2771RequestOptionalParameters>>;

@@ -40,2 +40,5 @@ "use strict";

if (request.userNonce === undefined) {
if (!walletOrProvider) {
throw new Error("Missing provider.");
}
parametersToOverride.userNonce = yield (0, getUserNonce_1.getUserNonce)({

@@ -42,0 +45,0 @@ account: request.user,

{
"name": "@gelatonetwork/relay-sdk",
"version": "5.1.0",
"version": "5.2.0",
"description": "SDK to integrate with Gelato Relay",

@@ -17,2 +17,5 @@ "main": "dist/index.js",

},
"engines": {
"node": ">=14.0.0"
},
"keywords": [],

@@ -19,0 +22,0 @@ "author": "",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc