@uniswap/conedison
Advanced tools
Comparing version 1.7.0 to 1.7.1
@@ -86,3 +86,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
error_1 = _a.sent(); | ||
if (!(typeof error_1.message === 'string' && error_1.message.match(/not (found|implemented)/i))) return [3 /*break*/, 7]; | ||
if (!(typeof error_1.message === 'string' && | ||
(error_1.message.match(/not (found|implemented)/i) || error_1.message.match(/TrustWalletConnect.WCError error 1/)))) return [3 /*break*/, 7]; | ||
console.warn('signTypedData: wallet does not implement EIP-712, falling back to eth_sign', error_1.message); | ||
@@ -89,0 +90,0 @@ hash = _TypedDataEncoder.hash(populated.domain, types, populated.value); |
@@ -197,3 +197,31 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}); | ||
describe('TrustWallet fallback for eth_signTypedData_v4', function () { | ||
beforeEach(function () { | ||
var web3Provider = signer.provider; | ||
web3Provider.provider = { | ||
isWalletConnect: true, | ||
connector: { peerMeta: { name: 'Trust Wallet' } }, | ||
}; | ||
}); | ||
it('signs using eth_sign', function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var send; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
send = jest.spyOn(signer.provider, 'send').mockImplementation(function (method, params) { | ||
if (method === 'eth_sign') | ||
return Promise.resolve(); | ||
throw new Error('TrustWalletConnect.WCError error 1'); | ||
}); | ||
return [4 /*yield*/, signTypedData(signer, domain, types, value)]; | ||
case 1: | ||
_a.sent(); | ||
expect(send).toHaveBeenCalledTimes(2); | ||
expect(send).toHaveBeenCalledWith('eth_sign', [wallet, expect.anything()]); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); }); | ||
}); | ||
}); | ||
}); |
{ | ||
"name": "@uniswap/conedison", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"description": "Utilities for Uniswap front-end development", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/Uniswap/conedison", |
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
62230
1241