Skip to content

Commit 5b3ec91

Browse files
matzuky3fers0n
andauthored
feat: add originalMethod param for some sign blockchain methods (#654)
* feat: add originalMethod param for some sign blockchain methods * feat: review fixes * chore: Adding build scripts --------- Co-authored-by: Yeferson Licet <[email protected]>
1 parent e94d1c5 commit 5b3ec91

File tree

5 files changed

+7291
-6
lines changed

5 files changed

+7291
-6
lines changed

android/lib/src/main/res/raw/trust_min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ethereum/MobileAdapter.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,19 @@ export class MobileAdapter {
8484
return this.ethSignTypedData(
8585
args.params as [string, string],
8686
SignTypedDataVersion.V3,
87+
'eth_signTypedData_v3',
8788
);
8889
case 'eth_signTypedData_v4':
8990
return this.ethSignTypedData(
9091
args.params as [string, string],
9192
SignTypedDataVersion.V4,
93+
'eth_signTypedData_v4',
9294
);
9395
case 'eth_signTypedData':
9496
return this.ethSignTypedData(
9597
args.params as [string, string],
9698
SignTypedDataVersion.V1,
99+
'eth_signTypedData',
97100
);
98101
case 'eth_sendTransaction':
99102
return this.provider.internalRequest({
@@ -222,6 +225,7 @@ export class MobileAdapter {
222225
data:
223226
buffer.length === 0 ? MobileAdapter.bufferToHex(message) : message,
224227
address,
228+
originalMethod: 'personal_sign'
225229
},
226230
});
227231
}
@@ -240,13 +244,19 @@ export class MobileAdapter {
240244
method: MobileAdapter.isUTF8(buffer)
241245
? 'signPersonalMessage'
242246
: 'signMessage',
243-
params: { data, address, isEthSign: true },
247+
params: {
248+
data,
249+
address,
250+
isEthSign: true,
251+
originalMethod: 'eth_sign'
252+
},
244253
});
245254
}
246255

247256
private async ethSignTypedData<T>(
248257
params: [string, string],
249258
version: SignTypedDataVersion,
259+
originalMethod: string,
250260
): Promise<T> {
251261
const [originalAddress] = await this.provider.request<string[]>({
252262
method: 'eth_accounts',
@@ -293,6 +303,7 @@ export class MobileAdapter {
293303
raw: typeof data === 'string' ? data : JSON.stringify(data),
294304
address,
295305
version,
306+
originalMethod,
296307
},
297308
});
298309
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:e617351ded83fa70b56327bc39a882fa5cffa19a3e76e35bf3618cd74b16b757
3-
size 1123827
2+
oid sha256:276a944f09cac25fbbc9908e55a37b36906eebec3b6b600b1e1543adf505e322
3+
size 1124036

packages/solana/SolanaProvider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@ export class SolanaProvider extends BaseProvider implements ISolanaProvider {
190190

191191
const res = await this.#privateRequest<string>({
192192
method: 'signMessage',
193-
params: { data },
193+
params: {
194+
data,
195+
originalMethod: 'signMessage'
196+
},
194197
});
195198

196199
return {

0 commit comments

Comments
 (0)