@onekeyfe/hd-core 1.1.10-alpha.1 → 1.1.10-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/aptos/AptosSignInMessage.d.ts +13 -0
- package/dist/api/aptos/AptosSignInMessage.d.ts.map +1 -0
- package/dist/api/evm/EVMSignTransaction.d.ts +10 -0
- package/dist/api/evm/EVMSignTransaction.d.ts.map +1 -1
- package/dist/api/evm/legacyV1/signTransaction.d.ts +4 -3
- package/dist/api/evm/legacyV1/signTransaction.d.ts.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/tron/TronSignMessage.d.ts +8 -0
- package/dist/api/tron/TronSignMessage.d.ts.map +1 -1
- package/dist/index.d.ts +20 -2
- package/dist/index.js +237 -135
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/aptosSignInMessage.d.ts +11 -0
- package/dist/types/api/aptosSignInMessage.d.ts.map +1 -0
- package/dist/types/api/export.d.ts +2 -0
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +2 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/tronSignMessage.d.ts +1 -0
- package/dist/types/api/tronSignMessage.d.ts.map +1 -1
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/api/aptos/AptosSignInMessage.ts +54 -0
- package/src/api/evm/EVMSignTransaction.ts +11 -13
- package/src/api/evm/legacyV1/signTransaction.ts +25 -12
- package/src/api/index.ts +1 -0
- package/src/api/tron/TronSignMessage.ts +35 -1
- package/src/data/messages/messages.json +156 -127
- package/src/inject.ts +2 -0
- package/src/types/api/aptosSignInMessage.ts +17 -0
- package/src/types/api/export.ts +5 -0
- package/src/types/api/index.ts +2 -0
- package/src/types/api/tronSignMessage.ts +1 -0
|
@@ -341,6 +341,23 @@
|
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
},
|
|
344
|
+
"AptosSignSIWAMessage": {
|
|
345
|
+
"fields": {
|
|
346
|
+
"address_n": {
|
|
347
|
+
"rule": "repeated",
|
|
348
|
+
"type": "uint32",
|
|
349
|
+
"id": 1,
|
|
350
|
+
"options": {
|
|
351
|
+
"packed": false
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
"siwa_payload": {
|
|
355
|
+
"rule": "required",
|
|
356
|
+
"type": "string",
|
|
357
|
+
"id": 2
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
},
|
|
344
361
|
"BenfenGetAddress": {
|
|
345
362
|
"fields": {
|
|
346
363
|
"address_n": {
|
|
@@ -5241,6 +5258,20 @@
|
|
|
5241
5258
|
}
|
|
5242
5259
|
}
|
|
5243
5260
|
},
|
|
5261
|
+
"EthereumAccessListOneKey": {
|
|
5262
|
+
"fields": {
|
|
5263
|
+
"address": {
|
|
5264
|
+
"rule": "required",
|
|
5265
|
+
"type": "string",
|
|
5266
|
+
"id": 1
|
|
5267
|
+
},
|
|
5268
|
+
"storage_keys": {
|
|
5269
|
+
"rule": "repeated",
|
|
5270
|
+
"type": "bytes",
|
|
5271
|
+
"id": 2
|
|
5272
|
+
}
|
|
5273
|
+
}
|
|
5274
|
+
},
|
|
5244
5275
|
"EthereumSignTxEIP1559OneKey": {
|
|
5245
5276
|
"fields": {
|
|
5246
5277
|
"address_n": {
|
|
@@ -5305,19 +5336,124 @@
|
|
|
5305
5336
|
"type": "EthereumAccessListOneKey",
|
|
5306
5337
|
"id": 11
|
|
5307
5338
|
}
|
|
5339
|
+
}
|
|
5340
|
+
},
|
|
5341
|
+
"EthereumAuthorizationSignature": {
|
|
5342
|
+
"fields": {
|
|
5343
|
+
"y_parity": {
|
|
5344
|
+
"rule": "required",
|
|
5345
|
+
"type": "uint32",
|
|
5346
|
+
"id": 1
|
|
5347
|
+
},
|
|
5348
|
+
"r": {
|
|
5349
|
+
"rule": "required",
|
|
5350
|
+
"type": "bytes",
|
|
5351
|
+
"id": 2
|
|
5352
|
+
},
|
|
5353
|
+
"s": {
|
|
5354
|
+
"rule": "required",
|
|
5355
|
+
"type": "bytes",
|
|
5356
|
+
"id": 3
|
|
5357
|
+
}
|
|
5358
|
+
}
|
|
5359
|
+
},
|
|
5360
|
+
"EthereumSignTxEIP7702OneKey": {
|
|
5361
|
+
"fields": {
|
|
5362
|
+
"address_n": {
|
|
5363
|
+
"rule": "repeated",
|
|
5364
|
+
"type": "uint32",
|
|
5365
|
+
"id": 1,
|
|
5366
|
+
"options": {
|
|
5367
|
+
"packed": false
|
|
5368
|
+
}
|
|
5369
|
+
},
|
|
5370
|
+
"nonce": {
|
|
5371
|
+
"rule": "required",
|
|
5372
|
+
"type": "bytes",
|
|
5373
|
+
"id": 2
|
|
5374
|
+
},
|
|
5375
|
+
"max_gas_fee": {
|
|
5376
|
+
"rule": "required",
|
|
5377
|
+
"type": "bytes",
|
|
5378
|
+
"id": 3
|
|
5379
|
+
},
|
|
5380
|
+
"max_priority_fee": {
|
|
5381
|
+
"rule": "required",
|
|
5382
|
+
"type": "bytes",
|
|
5383
|
+
"id": 4
|
|
5384
|
+
},
|
|
5385
|
+
"gas_limit": {
|
|
5386
|
+
"rule": "required",
|
|
5387
|
+
"type": "bytes",
|
|
5388
|
+
"id": 5
|
|
5389
|
+
},
|
|
5390
|
+
"to": {
|
|
5391
|
+
"rule": "required",
|
|
5392
|
+
"type": "string",
|
|
5393
|
+
"id": 6
|
|
5394
|
+
},
|
|
5395
|
+
"value": {
|
|
5396
|
+
"rule": "required",
|
|
5397
|
+
"type": "bytes",
|
|
5398
|
+
"id": 7
|
|
5399
|
+
},
|
|
5400
|
+
"data_initial_chunk": {
|
|
5401
|
+
"type": "bytes",
|
|
5402
|
+
"id": 8,
|
|
5403
|
+
"options": {
|
|
5404
|
+
"default": ""
|
|
5405
|
+
}
|
|
5406
|
+
},
|
|
5407
|
+
"data_length": {
|
|
5408
|
+
"rule": "required",
|
|
5409
|
+
"type": "uint32",
|
|
5410
|
+
"id": 9
|
|
5411
|
+
},
|
|
5412
|
+
"chain_id": {
|
|
5413
|
+
"rule": "required",
|
|
5414
|
+
"type": "uint64",
|
|
5415
|
+
"id": 10
|
|
5416
|
+
},
|
|
5417
|
+
"access_list": {
|
|
5418
|
+
"rule": "repeated",
|
|
5419
|
+
"type": "EthereumAccessListOneKey",
|
|
5420
|
+
"id": 11
|
|
5421
|
+
},
|
|
5422
|
+
"authorization_list": {
|
|
5423
|
+
"rule": "repeated",
|
|
5424
|
+
"type": "EthereumAuthorizationOneKey",
|
|
5425
|
+
"id": 12
|
|
5426
|
+
}
|
|
5308
5427
|
},
|
|
5309
5428
|
"nested": {
|
|
5310
|
-
"
|
|
5429
|
+
"EthereumAuthorizationOneKey": {
|
|
5311
5430
|
"fields": {
|
|
5431
|
+
"address_n": {
|
|
5432
|
+
"rule": "repeated",
|
|
5433
|
+
"type": "uint32",
|
|
5434
|
+
"id": 1,
|
|
5435
|
+
"options": {
|
|
5436
|
+
"packed": false
|
|
5437
|
+
}
|
|
5438
|
+
},
|
|
5439
|
+
"chain_id": {
|
|
5440
|
+
"rule": "required",
|
|
5441
|
+
"type": "uint64",
|
|
5442
|
+
"id": 2
|
|
5443
|
+
},
|
|
5312
5444
|
"address": {
|
|
5313
5445
|
"rule": "required",
|
|
5314
5446
|
"type": "string",
|
|
5315
|
-
"id":
|
|
5447
|
+
"id": 3
|
|
5316
5448
|
},
|
|
5317
|
-
"
|
|
5318
|
-
"rule": "
|
|
5449
|
+
"nonce": {
|
|
5450
|
+
"rule": "required",
|
|
5319
5451
|
"type": "bytes",
|
|
5320
|
-
"id":
|
|
5452
|
+
"id": 4
|
|
5453
|
+
},
|
|
5454
|
+
"signature": {
|
|
5455
|
+
"type": "EthereumAuthorizationSignature",
|
|
5456
|
+
"id": 5
|
|
5321
5457
|
}
|
|
5322
5458
|
}
|
|
5323
5459
|
}
|
|
@@ -5454,127 +5590,6 @@
|
|
|
5454
5590
|
}
|
|
5455
5591
|
}
|
|
5456
5592
|
},
|
|
5457
|
-
"EthereumSignTxEIP7702OneKey": {
|
|
5458
|
-
"fields": {
|
|
5459
|
-
"address_n": {
|
|
5460
|
-
"rule": "repeated",
|
|
5461
|
-
"type": "uint32",
|
|
5462
|
-
"id": 1,
|
|
5463
|
-
"options": {
|
|
5464
|
-
"packed": false
|
|
5465
|
-
}
|
|
5466
|
-
},
|
|
5467
|
-
"nonce": {
|
|
5468
|
-
"rule": "required",
|
|
5469
|
-
"type": "bytes",
|
|
5470
|
-
"id": 2
|
|
5471
|
-
},
|
|
5472
|
-
"max_gas_fee": {
|
|
5473
|
-
"rule": "required",
|
|
5474
|
-
"type": "bytes",
|
|
5475
|
-
"id": 3
|
|
5476
|
-
},
|
|
5477
|
-
"max_priority_fee": {
|
|
5478
|
-
"rule": "required",
|
|
5479
|
-
"type": "bytes",
|
|
5480
|
-
"id": 4
|
|
5481
|
-
},
|
|
5482
|
-
"gas_limit": {
|
|
5483
|
-
"rule": "required",
|
|
5484
|
-
"type": "bytes",
|
|
5485
|
-
"id": 5
|
|
5486
|
-
},
|
|
5487
|
-
"to": {
|
|
5488
|
-
"rule": "required",
|
|
5489
|
-
"type": "string",
|
|
5490
|
-
"id": 6
|
|
5491
|
-
},
|
|
5492
|
-
"value": {
|
|
5493
|
-
"rule": "required",
|
|
5494
|
-
"type": "bytes",
|
|
5495
|
-
"id": 7
|
|
5496
|
-
},
|
|
5497
|
-
"data_initial_chunk": {
|
|
5498
|
-
"type": "bytes",
|
|
5499
|
-
"id": 8,
|
|
5500
|
-
"options": {
|
|
5501
|
-
"default": ""
|
|
5502
|
-
}
|
|
5503
|
-
},
|
|
5504
|
-
"data_length": {
|
|
5505
|
-
"rule": "required",
|
|
5506
|
-
"type": "uint32",
|
|
5507
|
-
"id": 9
|
|
5508
|
-
},
|
|
5509
|
-
"chain_id": {
|
|
5510
|
-
"rule": "required",
|
|
5511
|
-
"type": "uint64",
|
|
5512
|
-
"id": 10
|
|
5513
|
-
},
|
|
5514
|
-
"access_list": {
|
|
5515
|
-
"rule": "repeated",
|
|
5516
|
-
"type": "EthereumAccessListOneKey",
|
|
5517
|
-
"id": 11
|
|
5518
|
-
},
|
|
5519
|
-
"authorization_list": {
|
|
5520
|
-
"rule": "repeated",
|
|
5521
|
-
"type": "EthereumAuthorizationOneKey",
|
|
5522
|
-
"id": 12
|
|
5523
|
-
}
|
|
5524
|
-
},
|
|
5525
|
-
"nested": {
|
|
5526
|
-
"EthereumAuthorizationOneKey": {
|
|
5527
|
-
"fields": {
|
|
5528
|
-
"address_n": {
|
|
5529
|
-
"rule": "repeated",
|
|
5530
|
-
"type": "uint32",
|
|
5531
|
-
"id": 1,
|
|
5532
|
-
"options": {
|
|
5533
|
-
"packed": false
|
|
5534
|
-
}
|
|
5535
|
-
},
|
|
5536
|
-
"chain_id": {
|
|
5537
|
-
"rule": "required",
|
|
5538
|
-
"type": "uint64",
|
|
5539
|
-
"id": 2
|
|
5540
|
-
},
|
|
5541
|
-
"address": {
|
|
5542
|
-
"rule": "required",
|
|
5543
|
-
"type": "string",
|
|
5544
|
-
"id": 3
|
|
5545
|
-
},
|
|
5546
|
-
"nonce": {
|
|
5547
|
-
"rule": "required",
|
|
5548
|
-
"type": "bytes",
|
|
5549
|
-
"id": 4
|
|
5550
|
-
},
|
|
5551
|
-
"signature": {
|
|
5552
|
-
"type": "EthereumAuthorizationSignature",
|
|
5553
|
-
"id": 5
|
|
5554
|
-
}
|
|
5555
|
-
}
|
|
5556
|
-
}
|
|
5557
|
-
}
|
|
5558
|
-
},
|
|
5559
|
-
"EthereumAuthorizationSignature": {
|
|
5560
|
-
"fields": {
|
|
5561
|
-
"y_parity": {
|
|
5562
|
-
"rule": "required",
|
|
5563
|
-
"type": "uint32",
|
|
5564
|
-
"id": 1
|
|
5565
|
-
},
|
|
5566
|
-
"r": {
|
|
5567
|
-
"rule": "required",
|
|
5568
|
-
"type": "bytes",
|
|
5569
|
-
"id": 2
|
|
5570
|
-
},
|
|
5571
|
-
"s": {
|
|
5572
|
-
"rule": "required",
|
|
5573
|
-
"type": "bytes",
|
|
5574
|
-
"id": 3
|
|
5575
|
-
}
|
|
5576
|
-
}
|
|
5577
|
-
},
|
|
5578
5593
|
"EthereumSignMessageEIP712": {
|
|
5579
5594
|
"fields": {
|
|
5580
5595
|
"address_n": {
|
|
@@ -11707,6 +11722,12 @@
|
|
|
11707
11722
|
}
|
|
11708
11723
|
}
|
|
11709
11724
|
},
|
|
11725
|
+
"TronMessageType": {
|
|
11726
|
+
"values": {
|
|
11727
|
+
"V1": 1,
|
|
11728
|
+
"V2": 2
|
|
11729
|
+
}
|
|
11730
|
+
},
|
|
11710
11731
|
"TronSignMessage": {
|
|
11711
11732
|
"fields": {
|
|
11712
11733
|
"address_n": {
|
|
@@ -11721,6 +11742,13 @@
|
|
|
11721
11742
|
"rule": "required",
|
|
11722
11743
|
"type": "bytes",
|
|
11723
11744
|
"id": 2
|
|
11745
|
+
},
|
|
11746
|
+
"message_type": {
|
|
11747
|
+
"type": "TronMessageType",
|
|
11748
|
+
"id": 3,
|
|
11749
|
+
"options": {
|
|
11750
|
+
"default": "V1"
|
|
11751
|
+
}
|
|
11724
11752
|
}
|
|
11725
11753
|
}
|
|
11726
11754
|
},
|
|
@@ -12026,7 +12054,6 @@
|
|
|
12026
12054
|
"MessageType_EthereumAddressOneKey": 20103,
|
|
12027
12055
|
"MessageType_EthereumSignTxOneKey": 20104,
|
|
12028
12056
|
"MessageType_EthereumSignTxEIP1559OneKey": 20105,
|
|
12029
|
-
"MessageType_EthereumSignTxEIP7702OneKey": 20120,
|
|
12030
12057
|
"MessageType_EthereumTxRequestOneKey": 20106,
|
|
12031
12058
|
"MessageType_EthereumTxAckOneKey": 20107,
|
|
12032
12059
|
"MessageType_EthereumSignMessageOneKey": 20108,
|
|
@@ -12041,6 +12068,7 @@
|
|
|
12041
12068
|
"MessageType_EthereumSignTypedHashOneKey": 20117,
|
|
12042
12069
|
"MessageType_EthereumGnosisSafeTxAck": 20118,
|
|
12043
12070
|
"MessageType_EthereumGnosisSafeTxRequest": 20119,
|
|
12071
|
+
"MessageType_EthereumSignTxEIP7702OneKey": 20120,
|
|
12044
12072
|
"MessageType_NEMGetAddress": 67,
|
|
12045
12073
|
"MessageType_NEMAddress": 68,
|
|
12046
12074
|
"MessageType_NEMSignTx": 69,
|
|
@@ -12182,6 +12210,7 @@
|
|
|
12182
12210
|
"MessageType_AptosSignedTx": 10603,
|
|
12183
12211
|
"MessageType_AptosSignMessage": 10604,
|
|
12184
12212
|
"MessageType_AptosMessageSignature": 10605,
|
|
12213
|
+
"MessageType_AptosSignSIWAMessage": 10606,
|
|
12185
12214
|
"MessageType_WebAuthnListResidentCredentials": 800,
|
|
12186
12215
|
"MessageType_WebAuthnCredentials": 801,
|
|
12187
12216
|
"MessageType_WebAuthnAddResidentCredential": 802,
|
package/src/inject.ts
CHANGED
|
@@ -288,6 +288,8 @@ export const createCoreApi = (
|
|
|
288
288
|
call({ ...params, connectId, deviceId, method: 'aptosGetPublicKey' }),
|
|
289
289
|
aptosSignMessage: (connectId, deviceId, params) =>
|
|
290
290
|
call({ ...params, connectId, deviceId, method: 'aptosSignMessage' }),
|
|
291
|
+
aptosSignInMessage: (connectId, deviceId, params) =>
|
|
292
|
+
call({ ...params, connectId, deviceId, method: 'aptosSignInMessage' }),
|
|
291
293
|
aptosSignTransaction: (connectId, deviceId, params) =>
|
|
292
294
|
call({ ...params, connectId, deviceId, method: 'aptosSignTransaction' }),
|
|
293
295
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AptosMessageSignature as HardwareAptosMessageSignature } from '@onekeyfe/hd-transport';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
|
+
|
|
4
|
+
export type AptosSignInMessageSignature = {
|
|
5
|
+
path: string;
|
|
6
|
+
} & HardwareAptosMessageSignature;
|
|
7
|
+
|
|
8
|
+
export type AptosSignInMessageParams = {
|
|
9
|
+
path: string | number[];
|
|
10
|
+
payload: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export declare function aptosSignInMessage(
|
|
14
|
+
connectId: string,
|
|
15
|
+
deviceId: string,
|
|
16
|
+
params: CommonParams & AptosSignInMessageParams
|
|
17
|
+
): Response<AptosSignInMessageSignature>;
|
package/src/types/api/export.ts
CHANGED
|
@@ -118,6 +118,7 @@ export type { NearSignTransactionParams } from './nearSignTransaction';
|
|
|
118
118
|
export type { AptosAddress, AptosGetAddressParams } from './aptosGetAddress';
|
|
119
119
|
export type { AptosPublicKey, AptosGetPublicKeyParams } from './aptosGetPublicKey';
|
|
120
120
|
export type { AptosMessageSignature, AptosSignMessageParams } from './aptosSignMessage';
|
|
121
|
+
export type { AptosSignInMessageSignature, AptosSignInMessageParams } from './aptosSignInMessage';
|
|
121
122
|
export type { AptosSignedTx, AptosSignTransactionParams } from './aptosSignTransaction';
|
|
122
123
|
|
|
123
124
|
export type { AlgoAddress, AlgoGetAddressParams } from './algoGetAddress';
|
|
@@ -137,6 +138,10 @@ export type {
|
|
|
137
138
|
CardanoAddress,
|
|
138
139
|
CardanoGetAddressParams,
|
|
139
140
|
} from './cardanoGetAddress';
|
|
141
|
+
export type {
|
|
142
|
+
CardanoSignMessageMethodParams,
|
|
143
|
+
CardanoSignMessageParams,
|
|
144
|
+
} from './cardanoSignMessage';
|
|
140
145
|
export type { CardanoSignTransaction, CardanoSignedTxData } from './cardano';
|
|
141
146
|
|
|
142
147
|
export type { FilecoinAddress, FilecoinGetAddressParams } from './filecoinGetAddress';
|
package/src/types/api/index.ts
CHANGED
|
@@ -92,6 +92,7 @@ import { nearSignTransaction } from './nearSignTransaction';
|
|
|
92
92
|
import { aptosGetAddress } from './aptosGetAddress';
|
|
93
93
|
import { aptosGetPublicKey } from './aptosGetPublicKey';
|
|
94
94
|
import { aptosSignMessage } from './aptosSignMessage';
|
|
95
|
+
import { aptosSignInMessage } from './aptosSignInMessage';
|
|
95
96
|
import { aptosSignTransaction } from './aptosSignTransaction';
|
|
96
97
|
|
|
97
98
|
import { algoGetAddress } from './algoGetAddress';
|
|
@@ -309,6 +310,7 @@ export type CoreApi = {
|
|
|
309
310
|
aptosGetAddress: typeof aptosGetAddress;
|
|
310
311
|
aptosGetPublicKey: typeof aptosGetPublicKey;
|
|
311
312
|
aptosSignMessage: typeof aptosSignMessage;
|
|
313
|
+
aptosSignInMessage: typeof aptosSignInMessage;
|
|
312
314
|
aptosSignTransaction: typeof aptosSignTransaction;
|
|
313
315
|
|
|
314
316
|
/**
|