@onekeyfe/onekey-aptos-provider 2.2.19 → 2.2.20

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.
@@ -53,7 +53,12 @@ var ScriptArgumentType;
53
53
  })(ScriptArgumentType || (exports.ScriptArgumentType = ScriptArgumentType = {}));
54
54
  function serializeTransactionPayload(args) {
55
55
  const serializer = new ts_sdk_1.Serializer();
56
- if (!('type' in args) && 'function' in args && !('multisigAddress' in args)) {
56
+ if ('type' in args || ('arguments' in args && 'type_arguments' in args)) {
57
+ // Some Dapps do not pass the type parameter.
58
+ // V1 SDK Legacy Params
59
+ serializableTransactionPayloadV1Legacy(args, serializer);
60
+ }
61
+ else if (!('type' in args) && 'function' in args && !('multisigAddress' in args)) {
57
62
  // V2 SDK Entry Function Params
58
63
  serializeTransactionPayloadEntryFunction(args, serializer);
59
64
  }
@@ -72,10 +77,6 @@ function serializeTransactionPayload(args) {
72
77
  throw new Error('Invalid transaction payload type');
73
78
  }
74
79
  }
75
- else if ('type' in args) {
76
- // V1 SDK Legacy Params
77
- serializableTransactionPayloadV1Legacy(args, serializer);
78
- }
79
80
  else {
80
81
  throw new Error('Invalid transaction payload type');
81
82
  }
@@ -402,7 +403,7 @@ function deserializableTransactionPayloadV1ScriptLegacy(deserializer) {
402
403
  }
403
404
  // V1 SDK Legacy Params
404
405
  function serializableTransactionPayloadV1Legacy(args, serializer) {
405
- if (args.type === 'entry_function_payload') {
406
+ if (args.type === 'entry_function_payload' || ('arguments' in args && 'type_arguments' in args)) {
406
407
  serializer.serializeU32AsUleb128(TransactionPayloadType.ENTRY_FUNCTION_LEGACY);
407
408
  const { function: functionName, type_arguments, arguments: functionArguments, } = args;
408
409
  serializer.serializeOption(functionName);
@@ -44,7 +44,12 @@ export var ScriptArgumentType;
44
44
  })(ScriptArgumentType || (ScriptArgumentType = {}));
45
45
  export function serializeTransactionPayload(args) {
46
46
  const serializer = new Serializer();
47
- if (!('type' in args) && 'function' in args && !('multisigAddress' in args)) {
47
+ if ('type' in args || ('arguments' in args && 'type_arguments' in args)) {
48
+ // Some Dapps do not pass the type parameter.
49
+ // V1 SDK Legacy Params
50
+ serializableTransactionPayloadV1Legacy(args, serializer);
51
+ }
52
+ else if (!('type' in args) && 'function' in args && !('multisigAddress' in args)) {
48
53
  // V2 SDK Entry Function Params
49
54
  serializeTransactionPayloadEntryFunction(args, serializer);
50
55
  }
@@ -63,10 +68,6 @@ export function serializeTransactionPayload(args) {
63
68
  throw new Error('Invalid transaction payload type');
64
69
  }
65
70
  }
66
- else if ('type' in args) {
67
- // V1 SDK Legacy Params
68
- serializableTransactionPayloadV1Legacy(args, serializer);
69
- }
70
71
  else {
71
72
  throw new Error('Invalid transaction payload type');
72
73
  }
@@ -393,7 +394,7 @@ function deserializableTransactionPayloadV1ScriptLegacy(deserializer) {
393
394
  }
394
395
  // V1 SDK Legacy Params
395
396
  function serializableTransactionPayloadV1Legacy(args, serializer) {
396
- if (args.type === 'entry_function_payload') {
397
+ if (args.type === 'entry_function_payload' || ('arguments' in args && 'type_arguments' in args)) {
397
398
  serializer.serializeU32AsUleb128(TransactionPayloadType.ENTRY_FUNCTION_LEGACY);
398
399
  const { function: functionName, type_arguments, arguments: functionArguments, } = args;
399
400
  serializer.serializeOption(functionName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/onekey-aptos-provider",
3
- "version": "2.2.19",
3
+ "version": "2.2.20",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -29,10 +29,10 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@aptos-labs/wallet-standard": "^0.2.0",
32
- "@onekeyfe/cross-inpage-provider-core": "2.2.19",
33
- "@onekeyfe/cross-inpage-provider-errors": "2.2.19",
34
- "@onekeyfe/cross-inpage-provider-types": "2.2.19",
35
- "@onekeyfe/extension-bridge-injected": "2.2.19",
32
+ "@onekeyfe/cross-inpage-provider-core": "2.2.20",
33
+ "@onekeyfe/cross-inpage-provider-errors": "2.2.20",
34
+ "@onekeyfe/cross-inpage-provider-types": "2.2.20",
35
+ "@onekeyfe/extension-bridge-injected": "2.2.20",
36
36
  "@wallet-standard/core": "1.0.3",
37
37
  "eth-rpc-errors": "^4.0.3"
38
38
  },
@@ -43,5 +43,5 @@
43
43
  "@aptos-labs/ts-sdk": "^1.30.0",
44
44
  "aptos": "^1.3.17"
45
45
  },
46
- "gitHead": "f655c12ef639067becb3b9fede6000c864949538"
46
+ "gitHead": "0d2a4ceb23fd9c0b6ad4aa971f33e0f085d9dbe5"
47
47
  }