@trustwallet/wallet-core 3.1.21 → 3.1.22
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.
@@ -11046,6 +11046,12 @@ export namespace TW {
|
|
11046
11046
|
/** Namespace Proto. */
|
11047
11047
|
namespace Proto {
|
11048
11048
|
|
11049
|
+
/** DerivationType enum. */
|
11050
|
+
enum DerivationType {
|
11051
|
+
SECP256K1 = 0,
|
11052
|
+
DELEGATED = 1
|
11053
|
+
}
|
11054
|
+
|
11049
11055
|
/** Properties of a SigningInput. */
|
11050
11056
|
interface ISigningInput {
|
11051
11057
|
|
@@ -11069,6 +11075,12 @@ export namespace TW {
|
|
11069
11075
|
|
11070
11076
|
/** SigningInput gasPremium */
|
11071
11077
|
gasPremium?: (Uint8Array|null);
|
11078
|
+
|
11079
|
+
/** SigningInput params */
|
11080
|
+
params?: (Uint8Array|null);
|
11081
|
+
|
11082
|
+
/** SigningInput derivation */
|
11083
|
+
derivation?: (TW.Filecoin.Proto.DerivationType|null);
|
11072
11084
|
}
|
11073
11085
|
|
11074
11086
|
/** Represents a SigningInput. */
|
@@ -11101,6 +11113,12 @@ export namespace TW {
|
|
11101
11113
|
/** SigningInput gasPremium. */
|
11102
11114
|
public gasPremium: Uint8Array;
|
11103
11115
|
|
11116
|
+
/** SigningInput params. */
|
11117
|
+
public params: Uint8Array;
|
11118
|
+
|
11119
|
+
/** SigningInput derivation. */
|
11120
|
+
public derivation: TW.Filecoin.Proto.DerivationType;
|
11121
|
+
|
11104
11122
|
/**
|
11105
11123
|
* Creates a new SigningInput instance using the specified properties.
|
11106
11124
|
* @param [properties] Properties to set
|
@@ -11160,6 +11178,9 @@ export namespace TW {
|
|
11160
11178
|
|
11161
11179
|
/** SigningOutput json */
|
11162
11180
|
json?: (string|null);
|
11181
|
+
|
11182
|
+
/** SigningOutput errorMessage */
|
11183
|
+
errorMessage?: (string|null);
|
11163
11184
|
}
|
11164
11185
|
|
11165
11186
|
/** Represents a SigningOutput. */
|
@@ -11174,6 +11195,9 @@ export namespace TW {
|
|
11174
11195
|
/** SigningOutput json. */
|
11175
11196
|
public json: string;
|
11176
11197
|
|
11198
|
+
/** SigningOutput errorMessage. */
|
11199
|
+
public errorMessage: string;
|
11200
|
+
|
11177
11201
|
/**
|
11178
11202
|
* Creates a new SigningOutput instance using the specified properties.
|
11179
11203
|
* @param [properties] Properties to set
|
@@ -32720,6 +32720,20 @@
|
|
32720
32720
|
*/
|
32721
32721
|
var Proto = {};
|
32722
32722
|
|
32723
|
+
/**
|
32724
|
+
* DerivationType enum.
|
32725
|
+
* @name TW.Filecoin.Proto.DerivationType
|
32726
|
+
* @enum {number}
|
32727
|
+
* @property {number} SECP256K1=0 SECP256K1 value
|
32728
|
+
* @property {number} DELEGATED=1 DELEGATED value
|
32729
|
+
*/
|
32730
|
+
Proto.DerivationType = (function() {
|
32731
|
+
var valuesById = {}, values = Object.create(valuesById);
|
32732
|
+
values[valuesById[0] = "SECP256K1"] = 0;
|
32733
|
+
values[valuesById[1] = "DELEGATED"] = 1;
|
32734
|
+
return values;
|
32735
|
+
})();
|
32736
|
+
|
32723
32737
|
Proto.SigningInput = (function() {
|
32724
32738
|
|
32725
32739
|
/**
|
@@ -32733,6 +32747,8 @@
|
|
32733
32747
|
* @property {Long|null} [gasLimit] SigningInput gasLimit
|
32734
32748
|
* @property {Uint8Array|null} [gasFeeCap] SigningInput gasFeeCap
|
32735
32749
|
* @property {Uint8Array|null} [gasPremium] SigningInput gasPremium
|
32750
|
+
* @property {Uint8Array|null} [params] SigningInput params
|
32751
|
+
* @property {TW.Filecoin.Proto.DerivationType|null} [derivation] SigningInput derivation
|
32736
32752
|
*/
|
32737
32753
|
|
32738
32754
|
/**
|
@@ -32806,6 +32822,22 @@
|
|
32806
32822
|
*/
|
32807
32823
|
SigningInput.prototype.gasPremium = $util.newBuffer([]);
|
32808
32824
|
|
32825
|
+
/**
|
32826
|
+
* SigningInput params.
|
32827
|
+
* @member {Uint8Array} params
|
32828
|
+
* @memberof TW.Filecoin.Proto.SigningInput
|
32829
|
+
* @instance
|
32830
|
+
*/
|
32831
|
+
SigningInput.prototype.params = $util.newBuffer([]);
|
32832
|
+
|
32833
|
+
/**
|
32834
|
+
* SigningInput derivation.
|
32835
|
+
* @member {TW.Filecoin.Proto.DerivationType} derivation
|
32836
|
+
* @memberof TW.Filecoin.Proto.SigningInput
|
32837
|
+
* @instance
|
32838
|
+
*/
|
32839
|
+
SigningInput.prototype.derivation = 0;
|
32840
|
+
|
32809
32841
|
/**
|
32810
32842
|
* Creates a new SigningInput instance using the specified properties.
|
32811
32843
|
* @function create
|
@@ -32844,6 +32876,10 @@
|
|
32844
32876
|
writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.gasFeeCap);
|
32845
32877
|
if (message.gasPremium != null && Object.hasOwnProperty.call(message, "gasPremium"))
|
32846
32878
|
writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.gasPremium);
|
32879
|
+
if (message.params != null && Object.hasOwnProperty.call(message, "params"))
|
32880
|
+
writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.params);
|
32881
|
+
if (message.derivation != null && Object.hasOwnProperty.call(message, "derivation"))
|
32882
|
+
writer.uint32(/* id 9, wireType 0 =*/72).int32(message.derivation);
|
32847
32883
|
return writer;
|
32848
32884
|
};
|
32849
32885
|
|
@@ -32886,6 +32922,12 @@
|
|
32886
32922
|
case 7:
|
32887
32923
|
message.gasPremium = reader.bytes();
|
32888
32924
|
break;
|
32925
|
+
case 8:
|
32926
|
+
message.params = reader.bytes();
|
32927
|
+
break;
|
32928
|
+
case 9:
|
32929
|
+
message.derivation = reader.int32();
|
32930
|
+
break;
|
32889
32931
|
default:
|
32890
32932
|
reader.skipType(tag & 7);
|
32891
32933
|
break;
|
@@ -32926,6 +32968,17 @@
|
|
32926
32968
|
if (message.gasPremium != null && message.hasOwnProperty("gasPremium"))
|
32927
32969
|
if (!(message.gasPremium && typeof message.gasPremium.length === "number" || $util.isString(message.gasPremium)))
|
32928
32970
|
return "gasPremium: buffer expected";
|
32971
|
+
if (message.params != null && message.hasOwnProperty("params"))
|
32972
|
+
if (!(message.params && typeof message.params.length === "number" || $util.isString(message.params)))
|
32973
|
+
return "params: buffer expected";
|
32974
|
+
if (message.derivation != null && message.hasOwnProperty("derivation"))
|
32975
|
+
switch (message.derivation) {
|
32976
|
+
default:
|
32977
|
+
return "derivation: enum value expected";
|
32978
|
+
case 0:
|
32979
|
+
case 1:
|
32980
|
+
break;
|
32981
|
+
}
|
32929
32982
|
return null;
|
32930
32983
|
};
|
32931
32984
|
|
@@ -32981,6 +33034,21 @@
|
|
32981
33034
|
$util.base64.decode(object.gasPremium, message.gasPremium = $util.newBuffer($util.base64.length(object.gasPremium)), 0);
|
32982
33035
|
else if (object.gasPremium.length)
|
32983
33036
|
message.gasPremium = object.gasPremium;
|
33037
|
+
if (object.params != null)
|
33038
|
+
if (typeof object.params === "string")
|
33039
|
+
$util.base64.decode(object.params, message.params = $util.newBuffer($util.base64.length(object.params)), 0);
|
33040
|
+
else if (object.params.length)
|
33041
|
+
message.params = object.params;
|
33042
|
+
switch (object.derivation) {
|
33043
|
+
case "SECP256K1":
|
33044
|
+
case 0:
|
33045
|
+
message.derivation = 0;
|
33046
|
+
break;
|
33047
|
+
case "DELEGATED":
|
33048
|
+
case 1:
|
33049
|
+
message.derivation = 1;
|
33050
|
+
break;
|
33051
|
+
}
|
32984
33052
|
return message;
|
32985
33053
|
};
|
32986
33054
|
|
@@ -33037,6 +33105,14 @@
|
|
33037
33105
|
if (options.bytes !== Array)
|
33038
33106
|
object.gasPremium = $util.newBuffer(object.gasPremium);
|
33039
33107
|
}
|
33108
|
+
if (options.bytes === String)
|
33109
|
+
object.params = "";
|
33110
|
+
else {
|
33111
|
+
object.params = [];
|
33112
|
+
if (options.bytes !== Array)
|
33113
|
+
object.params = $util.newBuffer(object.params);
|
33114
|
+
}
|
33115
|
+
object.derivation = options.enums === String ? "SECP256K1" : 0;
|
33040
33116
|
}
|
33041
33117
|
if (message.privateKey != null && message.hasOwnProperty("privateKey"))
|
33042
33118
|
object.privateKey = options.bytes === String ? $util.base64.encode(message.privateKey, 0, message.privateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.privateKey) : message.privateKey;
|
@@ -33058,6 +33134,10 @@
|
|
33058
33134
|
object.gasFeeCap = options.bytes === String ? $util.base64.encode(message.gasFeeCap, 0, message.gasFeeCap.length) : options.bytes === Array ? Array.prototype.slice.call(message.gasFeeCap) : message.gasFeeCap;
|
33059
33135
|
if (message.gasPremium != null && message.hasOwnProperty("gasPremium"))
|
33060
33136
|
object.gasPremium = options.bytes === String ? $util.base64.encode(message.gasPremium, 0, message.gasPremium.length) : options.bytes === Array ? Array.prototype.slice.call(message.gasPremium) : message.gasPremium;
|
33137
|
+
if (message.params != null && message.hasOwnProperty("params"))
|
33138
|
+
object.params = options.bytes === String ? $util.base64.encode(message.params, 0, message.params.length) : options.bytes === Array ? Array.prototype.slice.call(message.params) : message.params;
|
33139
|
+
if (message.derivation != null && message.hasOwnProperty("derivation"))
|
33140
|
+
object.derivation = options.enums === String ? $root.TW.Filecoin.Proto.DerivationType[message.derivation] : message.derivation;
|
33061
33141
|
return object;
|
33062
33142
|
};
|
33063
33143
|
|
@@ -33082,6 +33162,7 @@
|
|
33082
33162
|
* @memberof TW.Filecoin.Proto
|
33083
33163
|
* @interface ISigningOutput
|
33084
33164
|
* @property {string|null} [json] SigningOutput json
|
33165
|
+
* @property {string|null} [errorMessage] SigningOutput errorMessage
|
33085
33166
|
*/
|
33086
33167
|
|
33087
33168
|
/**
|
@@ -33107,6 +33188,14 @@
|
|
33107
33188
|
*/
|
33108
33189
|
SigningOutput.prototype.json = "";
|
33109
33190
|
|
33191
|
+
/**
|
33192
|
+
* SigningOutput errorMessage.
|
33193
|
+
* @member {string} errorMessage
|
33194
|
+
* @memberof TW.Filecoin.Proto.SigningOutput
|
33195
|
+
* @instance
|
33196
|
+
*/
|
33197
|
+
SigningOutput.prototype.errorMessage = "";
|
33198
|
+
|
33110
33199
|
/**
|
33111
33200
|
* Creates a new SigningOutput instance using the specified properties.
|
33112
33201
|
* @function create
|
@@ -33133,6 +33222,8 @@
|
|
33133
33222
|
writer = $Writer.create();
|
33134
33223
|
if (message.json != null && Object.hasOwnProperty.call(message, "json"))
|
33135
33224
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.json);
|
33225
|
+
if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage"))
|
33226
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage);
|
33136
33227
|
return writer;
|
33137
33228
|
};
|
33138
33229
|
|
@@ -33157,6 +33248,9 @@
|
|
33157
33248
|
case 1:
|
33158
33249
|
message.json = reader.string();
|
33159
33250
|
break;
|
33251
|
+
case 2:
|
33252
|
+
message.errorMessage = reader.string();
|
33253
|
+
break;
|
33160
33254
|
default:
|
33161
33255
|
reader.skipType(tag & 7);
|
33162
33256
|
break;
|
@@ -33179,6 +33273,9 @@
|
|
33179
33273
|
if (message.json != null && message.hasOwnProperty("json"))
|
33180
33274
|
if (!$util.isString(message.json))
|
33181
33275
|
return "json: string expected";
|
33276
|
+
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
33277
|
+
if (!$util.isString(message.errorMessage))
|
33278
|
+
return "errorMessage: string expected";
|
33182
33279
|
return null;
|
33183
33280
|
};
|
33184
33281
|
|
@@ -33196,6 +33293,8 @@
|
|
33196
33293
|
var message = new $root.TW.Filecoin.Proto.SigningOutput();
|
33197
33294
|
if (object.json != null)
|
33198
33295
|
message.json = String(object.json);
|
33296
|
+
if (object.errorMessage != null)
|
33297
|
+
message.errorMessage = String(object.errorMessage);
|
33199
33298
|
return message;
|
33200
33299
|
};
|
33201
33300
|
|
@@ -33212,10 +33311,14 @@
|
|
33212
33311
|
if (!options)
|
33213
33312
|
options = {};
|
33214
33313
|
var object = {};
|
33215
|
-
if (options.defaults)
|
33314
|
+
if (options.defaults) {
|
33216
33315
|
object.json = "";
|
33316
|
+
object.errorMessage = "";
|
33317
|
+
}
|
33217
33318
|
if (message.json != null && message.hasOwnProperty("json"))
|
33218
33319
|
object.json = message.json;
|
33320
|
+
if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
|
33321
|
+
object.errorMessage = message.errorMessage;
|
33219
33322
|
return object;
|
33220
33323
|
};
|
33221
33324
|
|
package/dist/lib/wallet-core.js
CHANGED
@@ -34,7 +34,7 @@ function Ua(){Qa++;g.monitorRunDependencies&&g.monitorRunDependencies(Qa);assert
|
|
34
34
|
function Va(){return G.startsWith("data:application/octet-stream;base64,")}function ma(a){return a.startsWith("file://")}function H(a){return function(){var b=g.asm;assert(Oa,"native function `"+a+"` called before runtime initialization");b[a]||assert(b[a],"exported native function `"+a+"` not found");return b[a].apply(null,arguments)}}var G;G="wallet-core.wasm";if(!Va()){var Wa=G;G=g.locateFile?g.locateFile(Wa,w):w+Wa}
|
35
35
|
function Xa(){var a=G;try{if(a==G&&qa)return new Uint8Array(qa);if(ka)return ka(a);throw"both async and sync fetching of the wasm failed";}catch(b){n(b)}}
|
36
36
|
function Ya(){if(!qa&&(ea||fa)){if("function"==typeof fetch&&!ma(G))return fetch(G,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+G+"'";return a.arrayBuffer()}).catch(function(){return Xa()});if(ja)return new Promise(function(a,b){ja(G,function(c){a(new Uint8Array(c))},b)})}return Promise.resolve().then(function(){return Xa()})}
|
37
|
-
var Za,$a,ab={
|
37
|
+
var Za,$a,ab={653860:()=>{if(void 0===g.ea)try{var a="object"===typeof window?window:self,b="undefined"!==typeof a.crypto?a.crypto:a.msCrypto;a=function(){var d=new Uint32Array(1);b.getRandomValues(d);return d[0]>>>0};a();g.ea=a}catch(d){try{var c=require("crypto");a=function(){var e=c.randomBytes(4);return(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0};a();g.ea=a}catch(e){throw"No secure random number generator found";}}},654582:()=>g.ea()};function bb(a){for(;0<a.length;)a.shift()(g)}
|
38
38
|
function va(a){assert("number"===typeof a);return"0x"+a.toString(16).padStart(8,"0")}function pa(a){cb||(cb={});cb[a]||(cb[a]=1,v&&(a="warning: "+a),y(a))}var cb,db=0;
|
39
39
|
function eb(a){this.l=a-24;this.Sa=function(b){F[this.l+4>>2]=b};this.Ca=function(){return F[this.l+4>>2]};this.Ia=function(b){F[this.l+8>>2]=b};this.Ja=function(){E[this.l>>2]=0};this.Ha=function(){C[this.l+12>>0]=0};this.Ma=function(){C[this.l+13>>0]=0};this.Da=function(b,c){this.F(0);this.Sa(b);this.Ia(c);this.Ja();this.Ha();this.Ma()};this.F=function(b){F[this.l+16>>2]=b}}
|
40
40
|
var fb=0,gb=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},hb=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=gb(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},ib=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b},jb=
|
Binary file
|
@@ -84,6 +84,7 @@ export class AnyAddress {
|
|
84
84
|
static createWithPublicKeyDerivation(publicKey: PublicKey, coin: CoinType, derivation: Derivation): AnyAddress;
|
85
85
|
static createBech32WithPublicKey(publicKey: PublicKey, coin: CoinType, hrp: string): AnyAddress;
|
86
86
|
static createSS58WithPublicKey(publicKey: PublicKey, coin: CoinType, ss58Prefix: number): AnyAddress;
|
87
|
+
static createWithPublicKeyFilecoinAddressType(publicKey: PublicKey, filecoinAddressType: FilecoinAddressType): AnyAddress;
|
87
88
|
description(): string;
|
88
89
|
coin(): CoinType;
|
89
90
|
data(): Uint8Array;
|
@@ -314,6 +315,7 @@ export class CoinType {
|
|
314
315
|
static agoric: CoinType;
|
315
316
|
static ton: CoinType;
|
316
317
|
static sui: CoinType;
|
318
|
+
static stargaze: CoinType;
|
317
319
|
static polygonzkEVM: CoinType;
|
318
320
|
}
|
319
321
|
export class CoinTypeConfiguration {
|
@@ -495,6 +497,15 @@ export class FIOAccount {
|
|
495
497
|
description(): string;
|
496
498
|
delete(): void;
|
497
499
|
}
|
500
|
+
export class FilecoinAddressConverter {
|
501
|
+
static convertToEthereum(filecoinAddress: string): string;
|
502
|
+
static convertFromEthereum(ethAddress: string): string;
|
503
|
+
}
|
504
|
+
export class FilecoinAddressType {
|
505
|
+
value: number;
|
506
|
+
static default: FilecoinAddressType;
|
507
|
+
static delegated: FilecoinAddressType;
|
508
|
+
}
|
498
509
|
export class GroestlcoinAddress {
|
499
510
|
static equal(lhs: GroestlcoinAddress, rhs: GroestlcoinAddress): boolean;
|
500
511
|
static isValidString(string: string): boolean;
|
@@ -579,6 +590,7 @@ export class HRP {
|
|
579
590
|
static nativeInjective: HRP;
|
580
591
|
static osmosis: HRP;
|
581
592
|
static terraV2: HRP;
|
593
|
+
static stargaze: HRP;
|
582
594
|
static nativeEvmos: HRP;
|
583
595
|
}
|
584
596
|
|
@@ -846,6 +858,8 @@ export interface WalletCore {
|
|
846
858
|
EthereumChainID: typeof EthereumChainID;
|
847
859
|
EthereumMessageSigner: typeof EthereumMessageSigner;
|
848
860
|
FIOAccount: typeof FIOAccount;
|
861
|
+
FilecoinAddressConverter: typeof FilecoinAddressConverter;
|
862
|
+
FilecoinAddressType: typeof FilecoinAddressType;
|
849
863
|
GroestlcoinAddress: typeof GroestlcoinAddress;
|
850
864
|
HDVersion: typeof HDVersion;
|
851
865
|
HDWallet: typeof HDWallet;
|