@gelatonetwork/relay-sdk
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -62,3 +62,3 @@ "use strict"; | ||
const struct = yield mapRequestToStruct(request, parametersToOverride); | ||
const signature = yield (0, utils_2.signTypedDataV4)(provider, request.user, JSON.stringify(getPayloadToSign(struct))); | ||
const signature = yield (0, utils_2.signTypedDataV4)(provider, request.user, getPayloadToSign(struct)); | ||
const postResponse = yield (0, utils_2.postSponsoredCall)(types_1.RelayCall.SponsoredCallERC2771, Object.assign(Object.assign(Object.assign({}, struct), options), { userSignature: signature, sponsorApiKey })); | ||
@@ -65,0 +65,0 @@ return postResponse; |
import { providers } from "ethers"; | ||
export declare const signTypedDataV4: (provider: providers.Web3Provider, address: string, payload: string) => Promise<string>; | ||
import { SponsoredCallERC2771PayloadToSign } from "../lib/sponsoredCallERC2771/types"; | ||
export declare const signTypedDataV4: (provider: providers.Web3Provider, address: string, payload: SponsoredCallERC2771PayloadToSign) => Promise<string>; |
@@ -15,4 +15,11 @@ "use strict"; | ||
const signTypedDataV4 = (provider, address, payload) => __awaiter(void 0, void 0, void 0, function* () { | ||
return yield provider.send(constants_1.SIGN_TYPED_DATA_V4, [address, payload]); | ||
// Magic Connect accepts payload as an object | ||
if (provider.provider.isMagic) { | ||
return yield provider.send(constants_1.SIGN_TYPED_DATA_V4, [address, payload]); | ||
} | ||
return yield provider.send(constants_1.SIGN_TYPED_DATA_V4, [ | ||
address, | ||
JSON.stringify(payload), | ||
]); | ||
}); | ||
exports.signTypedDataV4 = signTypedDataV4; |
{ | ||
"name": "@gelatonetwork/relay-sdk", | ||
"version": "3.0.0", | ||
"version": "3.1.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
44283
830