You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/sdk-coin-icp/src/lib/utils.ts
+93-5Lines changed: 93 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -20,14 +20,24 @@ import {
20
20
SendArgs,
21
21
PayloadsData,
22
22
CurveType,
23
+
AccountIdentifierHash,
24
+
CborUnsignedTransaction,
23
25
}from'./iface';
24
26
import{KeyPairasIcpKeyPair}from'./keyPair';
25
-
const{ encode, decode }=require('cbor-x/index-no-eval');// The "cbor-x" library is used here because it supports modern features like BigInt. do not replace it with "cbor as "cbor" is not compatible with Rust's serde_cbor when handling big numbers.
27
+
const{ encode, decode, Encoder}=require('cbor-x/index-no-eval');// The "cbor-x" library is used here because it supports modern features like BigInt. do not replace it with "cbor as "cbor" is not compatible with Rust's serde_cbor when handling big numbers.
26
28
importjs_sha256from'js-sha256';
27
29
importBigNumberfrom'bignumber.js';
28
30
import{secp256k1}from'@noble/curves/secp256k1';
29
31
importprotobuffrom'protobufjs';
30
32
33
+
//custom encoder that avoids tagging
34
+
constencoder=newEncoder({
35
+
structuredClone: false,
36
+
useToJSON: false,
37
+
mapsAsObjects: false,
38
+
largeBigIntToFloat: false,
39
+
});
40
+
31
41
exportclassUtilsimplementsBaseUtils{
32
42
/** @inheritdoc */
33
43
isValidSignature(signature: string): boolean{
@@ -603,18 +613,18 @@ export class Utils implements BaseUtils {
0 commit comments