@across-protocol/sdk 4.1.23 → 4.1.24
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/cjs/relayFeeCalculator/chain-queries/factory.d.ts +20 -0
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +20 -0
- package/dist/cjs/utils/AddressUtils.d.ts +33 -0
- package/dist/cjs/utils/AddressUtils.js +132 -4
- package/dist/cjs/utils/AddressUtils.js.map +1 -1
- package/dist/cjs/utils/NetworkUtils.d.ts +1 -0
- package/dist/cjs/utils/NetworkUtils.js +8 -3
- package/dist/cjs/utils/NetworkUtils.js.map +1 -1
- package/dist/cjs/utils/TokenUtils.d.ts +40 -0
- package/dist/esm/relayFeeCalculator/chain-queries/factory.d.ts +20 -0
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +20 -0
- package/dist/esm/utils/AddressUtils.d.ts +40 -0
- package/dist/esm/utils/AddressUtils.js +174 -2
- package/dist/esm/utils/AddressUtils.js.map +1 -1
- package/dist/esm/utils/NetworkUtils.d.ts +6 -0
- package/dist/esm/utils/NetworkUtils.js +12 -3
- package/dist/esm/utils/NetworkUtils.js.map +1 -1
- package/dist/esm/utils/TokenUtils.d.ts +40 -0
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts +20 -0
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +20 -0
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
- package/dist/types/utils/AddressUtils.d.ts +40 -0
- package/dist/types/utils/AddressUtils.d.ts.map +1 -1
- package/dist/types/utils/NetworkUtils.d.ts +6 -0
- package/dist/types/utils/NetworkUtils.d.ts.map +1 -1
- package/dist/types/utils/TokenUtils.d.ts +40 -0
- package/dist/types/utils/TokenUtils.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/utils/AddressUtils.ts +179 -1
- package/src/utils/NetworkUtils.ts +11 -3
|
@@ -147,6 +147,16 @@ export declare class QueryBase__factory {
|
|
|
147
147
|
};
|
|
148
148
|
coingeckoId: string;
|
|
149
149
|
};
|
|
150
|
+
SOL: {
|
|
151
|
+
name: string;
|
|
152
|
+
symbol: string;
|
|
153
|
+
decimals: number;
|
|
154
|
+
addresses: {
|
|
155
|
+
[x: number]: string;
|
|
156
|
+
133268194659241: string;
|
|
157
|
+
};
|
|
158
|
+
coingeckoId: string;
|
|
159
|
+
};
|
|
150
160
|
UMA: {
|
|
151
161
|
name: string;
|
|
152
162
|
symbol: string;
|
|
@@ -256,5 +266,15 @@ export declare class QueryBase__factory {
|
|
|
256
266
|
};
|
|
257
267
|
coingeckoId: string;
|
|
258
268
|
};
|
|
269
|
+
WSOL: {
|
|
270
|
+
name: string;
|
|
271
|
+
symbol: string;
|
|
272
|
+
decimals: number;
|
|
273
|
+
addresses: {
|
|
274
|
+
[x: number]: string;
|
|
275
|
+
133268194659241: string;
|
|
276
|
+
};
|
|
277
|
+
coingeckoId: string;
|
|
278
|
+
};
|
|
259
279
|
}, spokePoolAddress?: string | undefined, simulatedRelayerAddress?: string, coingeckoProApiKey?: string, logger?: Logger, coingeckoBaseCurrency?: string): QueryBase;
|
|
260
280
|
}
|
|
@@ -231,6 +231,16 @@ export declare class RelayFeeCalculator {
|
|
|
231
231
|
};
|
|
232
232
|
coingeckoId: string;
|
|
233
233
|
};
|
|
234
|
+
SOL: {
|
|
235
|
+
name: string;
|
|
236
|
+
symbol: string;
|
|
237
|
+
decimals: number;
|
|
238
|
+
addresses: {
|
|
239
|
+
[x: number]: string;
|
|
240
|
+
133268194659241: string;
|
|
241
|
+
};
|
|
242
|
+
coingeckoId: string;
|
|
243
|
+
};
|
|
234
244
|
UMA: {
|
|
235
245
|
name: string;
|
|
236
246
|
symbol: string;
|
|
@@ -340,6 +350,16 @@ export declare class RelayFeeCalculator {
|
|
|
340
350
|
};
|
|
341
351
|
coingeckoId: string;
|
|
342
352
|
};
|
|
353
|
+
WSOL: {
|
|
354
|
+
name: string;
|
|
355
|
+
symbol: string;
|
|
356
|
+
decimals: number;
|
|
357
|
+
addresses: {
|
|
358
|
+
[x: number]: string;
|
|
359
|
+
133268194659241: string;
|
|
360
|
+
};
|
|
361
|
+
coingeckoId: string;
|
|
362
|
+
};
|
|
343
363
|
}, gasPrice?: BigNumberish, gasLimit?: BigNumberish, _tokenGasCost?: BigNumberish, transport?: Transport): Promise<BigNumber>;
|
|
344
364
|
capitalFeePercent(_amountToRelay: BigNumberish, _tokenSymbol: string, _originRoute?: ChainIdAsString, _destinationRoute?: ChainIdAsString): BigNumber;
|
|
345
365
|
relayerFeeDetails(deposit: Deposit, amountToRelay?: BigNumberish, simulateZeroFill?: boolean, relayerAddress?: string, _tokenPrice?: number, gasPrice?: BigNumberish, gasUnits?: BigNumberish, tokenGasCost?: BigNumberish): Promise<RelayerFeeDetails>;
|
|
@@ -1,7 +1,40 @@
|
|
|
1
1
|
import { providers } from "ethers";
|
|
2
|
+
import { BigNumber } from "./";
|
|
2
3
|
export declare function isContractDeployedToAddress(address: string, provider: providers.Provider): Promise<boolean>;
|
|
3
4
|
export declare function compareAddresses(addressA: string, addressB: string): 1 | -1 | 0;
|
|
4
5
|
export declare function compareAddressesSimple(addressA?: string, addressB?: string): boolean;
|
|
5
6
|
export declare function toBytes32(address: string): string;
|
|
6
7
|
export declare function toAddress(hexString: string): string;
|
|
7
8
|
export declare function isValidEvmAddress(address: string): boolean;
|
|
9
|
+
export declare function toAddressType(address: string, chainId: number): Address | EvmAddress | SvmAddress;
|
|
10
|
+
export declare class Address {
|
|
11
|
+
readonly rawAddress: Uint8Array;
|
|
12
|
+
evmAddress: string | undefined;
|
|
13
|
+
bytes32Address: string | undefined;
|
|
14
|
+
svmAddress: string | undefined;
|
|
15
|
+
bnAddress: BigNumber | undefined;
|
|
16
|
+
constructor(_rawAddress: Uint8Array);
|
|
17
|
+
toBytes32(): string;
|
|
18
|
+
toBase58(): string;
|
|
19
|
+
toBigNumber(): BigNumber;
|
|
20
|
+
toEvmAddress(): string;
|
|
21
|
+
toAddress(): string;
|
|
22
|
+
toHexString(): string;
|
|
23
|
+
isValidEvmAddress(): boolean;
|
|
24
|
+
isValidOn(chainId: number): boolean;
|
|
25
|
+
static isAddress(obj: unknown): boolean;
|
|
26
|
+
toString(): string;
|
|
27
|
+
isZeroAddress(): boolean;
|
|
28
|
+
eq(other: Address): boolean;
|
|
29
|
+
compare(otherAddress: Address): 1 | -1 | 0;
|
|
30
|
+
}
|
|
31
|
+
export declare class EvmAddress extends Address {
|
|
32
|
+
constructor(rawAddress: Uint8Array);
|
|
33
|
+
toAddress(): string;
|
|
34
|
+
static from(hexString: string): EvmAddress;
|
|
35
|
+
}
|
|
36
|
+
export declare class SvmAddress extends Address {
|
|
37
|
+
constructor(rawAddress: Uint8Array);
|
|
38
|
+
toAddress(): string;
|
|
39
|
+
static from(bs58Address: string): SvmAddress;
|
|
40
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isValidEvmAddress = exports.toAddress = exports.toBytes32 = exports.compareAddressesSimple = exports.compareAddresses = exports.isContractDeployedToAddress = void 0;
|
|
3
|
+
exports.SvmAddress = exports.EvmAddress = exports.Address = exports.toAddressType = exports.isValidEvmAddress = exports.toAddress = exports.toBytes32 = exports.compareAddressesSimple = exports.compareAddresses = exports.isContractDeployedToAddress = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var ethers_1 = require("ethers");
|
|
6
|
-
var
|
|
6
|
+
var bs58_1 = tslib_1.__importDefault(require("bs58"));
|
|
7
|
+
var _1 = require("./");
|
|
7
8
|
function isContractDeployedToAddress(address, provider) {
|
|
8
9
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
9
10
|
var code;
|
|
@@ -23,8 +24,8 @@ function isContractDeployedToAddress(address, provider) {
|
|
|
23
24
|
}
|
|
24
25
|
exports.isContractDeployedToAddress = isContractDeployedToAddress;
|
|
25
26
|
function compareAddresses(addressA, addressB) {
|
|
26
|
-
var bnAddressA =
|
|
27
|
-
var bnAddressB =
|
|
27
|
+
var bnAddressA = _1.BigNumber.from(addressA);
|
|
28
|
+
var bnAddressB = _1.BigNumber.from(addressB);
|
|
28
29
|
if (bnAddressA.gt(bnAddressB)) {
|
|
29
30
|
return 1;
|
|
30
31
|
}
|
|
@@ -65,4 +66,131 @@ function isValidEvmAddress(address) {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
exports.isValidEvmAddress = isValidEvmAddress;
|
|
69
|
+
function toAddressType(address, chainId) {
|
|
70
|
+
try {
|
|
71
|
+
if ((0, _1.chainIsEvm)(chainId)) {
|
|
72
|
+
return EvmAddress.from(address);
|
|
73
|
+
}
|
|
74
|
+
return SvmAddress.from(address);
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
return new Address(ethers_1.utils.arrayify(address));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.toAddressType = toAddressType;
|
|
81
|
+
var Address = (function () {
|
|
82
|
+
function Address(_rawAddress) {
|
|
83
|
+
this.evmAddress = undefined;
|
|
84
|
+
this.bytes32Address = undefined;
|
|
85
|
+
this.svmAddress = undefined;
|
|
86
|
+
this.bnAddress = undefined;
|
|
87
|
+
if (_rawAddress.length > 32) {
|
|
88
|
+
throw new Error("Address ".concat(ethers_1.utils.hexlify(_rawAddress), " cannot be longer than 32 bytes."));
|
|
89
|
+
}
|
|
90
|
+
this.rawAddress = ethers_1.utils.zeroPad(_rawAddress, 32);
|
|
91
|
+
}
|
|
92
|
+
Address.prototype.toBytes32 = function () {
|
|
93
|
+
var _a;
|
|
94
|
+
return ((_a = this.bytes32Address) !== null && _a !== void 0 ? _a : (this.bytes32Address = ethers_1.utils.hexZeroPad(ethers_1.utils.hexlify(this.rawAddress), 32).toLowerCase()));
|
|
95
|
+
};
|
|
96
|
+
Address.prototype.toBase58 = function () {
|
|
97
|
+
var _a;
|
|
98
|
+
return ((_a = this.svmAddress) !== null && _a !== void 0 ? _a : (this.svmAddress = bs58_1.default.encode(this.rawAddress)));
|
|
99
|
+
};
|
|
100
|
+
Address.prototype.toBigNumber = function () {
|
|
101
|
+
var _a;
|
|
102
|
+
return ((_a = this.bnAddress) !== null && _a !== void 0 ? _a : (this.bnAddress = _1.BigNumber.from(this.toBytes32())));
|
|
103
|
+
};
|
|
104
|
+
Address.prototype.toEvmAddress = function () {
|
|
105
|
+
var _this = this;
|
|
106
|
+
var _a;
|
|
107
|
+
var parseRawAddress = function () {
|
|
108
|
+
var hexString = ethers_1.utils.hexlify(_this.rawAddress);
|
|
109
|
+
var rawAddress = ethers_1.utils.hexZeroPad(ethers_1.utils.hexStripZeros(hexString), 20);
|
|
110
|
+
return ethers_1.utils.getAddress(rawAddress);
|
|
111
|
+
};
|
|
112
|
+
return ((_a = this.evmAddress) !== null && _a !== void 0 ? _a : (this.evmAddress = parseRawAddress()));
|
|
113
|
+
};
|
|
114
|
+
Address.prototype.toAddress = function () {
|
|
115
|
+
return this.toBytes32();
|
|
116
|
+
};
|
|
117
|
+
Address.prototype.toHexString = function () {
|
|
118
|
+
return this.toBytes32();
|
|
119
|
+
};
|
|
120
|
+
Address.prototype.isValidEvmAddress = function () {
|
|
121
|
+
try {
|
|
122
|
+
this.toAddress();
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
catch (_a) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
Address.prototype.isValidOn = function (chainId) {
|
|
130
|
+
if ((0, _1.chainIsEvm)(chainId)) {
|
|
131
|
+
return this.isValidEvmAddress();
|
|
132
|
+
}
|
|
133
|
+
return true;
|
|
134
|
+
};
|
|
135
|
+
Address.isAddress = function (obj) {
|
|
136
|
+
return obj instanceof this;
|
|
137
|
+
};
|
|
138
|
+
Address.prototype.toString = function () {
|
|
139
|
+
return this.toHexString();
|
|
140
|
+
};
|
|
141
|
+
Address.prototype.isZeroAddress = function () {
|
|
142
|
+
return ethers_1.utils.stripZeros(this.rawAddress).length === 0;
|
|
143
|
+
};
|
|
144
|
+
Address.prototype.eq = function (other) {
|
|
145
|
+
return this.toString() === other.toString();
|
|
146
|
+
};
|
|
147
|
+
Address.prototype.compare = function (otherAddress) {
|
|
148
|
+
var bnAddressA = this.toBigNumber();
|
|
149
|
+
var bnAddressB = otherAddress.toBigNumber();
|
|
150
|
+
if (bnAddressA.gt(bnAddressB)) {
|
|
151
|
+
return 1;
|
|
152
|
+
}
|
|
153
|
+
else if (bnAddressA.lt(bnAddressB)) {
|
|
154
|
+
return -1;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
return 0;
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
return Address;
|
|
161
|
+
}());
|
|
162
|
+
exports.Address = Address;
|
|
163
|
+
var EvmAddress = (function (_super) {
|
|
164
|
+
tslib_1.__extends(EvmAddress, _super);
|
|
165
|
+
function EvmAddress(rawAddress) {
|
|
166
|
+
var _this = _super.call(this, rawAddress) || this;
|
|
167
|
+
var hexString = ethers_1.utils.hexlify(rawAddress);
|
|
168
|
+
if (!_this.isValidEvmAddress()) {
|
|
169
|
+
throw new Error("".concat(hexString, " is not a valid EVM address"));
|
|
170
|
+
}
|
|
171
|
+
return _this;
|
|
172
|
+
}
|
|
173
|
+
EvmAddress.prototype.toAddress = function () {
|
|
174
|
+
return this.toEvmAddress();
|
|
175
|
+
};
|
|
176
|
+
EvmAddress.from = function (hexString) {
|
|
177
|
+
return new this(ethers_1.utils.arrayify(hexString));
|
|
178
|
+
};
|
|
179
|
+
return EvmAddress;
|
|
180
|
+
}(Address));
|
|
181
|
+
exports.EvmAddress = EvmAddress;
|
|
182
|
+
var SvmAddress = (function (_super) {
|
|
183
|
+
tslib_1.__extends(SvmAddress, _super);
|
|
184
|
+
function SvmAddress(rawAddress) {
|
|
185
|
+
return _super.call(this, rawAddress) || this;
|
|
186
|
+
}
|
|
187
|
+
SvmAddress.prototype.toAddress = function () {
|
|
188
|
+
return this.toBase58();
|
|
189
|
+
};
|
|
190
|
+
SvmAddress.from = function (bs58Address) {
|
|
191
|
+
return new this(bs58_1.default.decode(bs58Address));
|
|
192
|
+
};
|
|
193
|
+
return SvmAddress;
|
|
194
|
+
}(Address));
|
|
195
|
+
exports.SvmAddress = SvmAddress;
|
|
68
196
|
//# sourceMappingURL=AddressUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressUtils.js","sourceRoot":"","sources":["../../../src/utils/AddressUtils.ts"],"names":[],"mappings":";;;;AAAA,iCAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"AddressUtils.js","sourceRoot":"","sources":["../../../src/utils/AddressUtils.ts"],"names":[],"mappings":";;;;AAAA,iCAA0C;AAC1C,sDAAwB;AACxB,uBAA2C;AAQ3C,SAAsB,2BAA2B,CAAC,OAAe,EAAE,QAA4B;;;;;;oBAE7F,IAAI,CAAC,OAAO,IAAI,CAAC,cAAK,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;wBACzC,WAAO,KAAK,EAAC;qBACd;oBAEY,WAAM,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAA;;oBAAtC,IAAI,GAAG,SAA+B;oBAE5C,WAAO,IAAI,KAAK,IAAI,EAAC;;;;CACtB;AATD,kEASC;AAED,SAAgB,gBAAgB,CAAC,QAAgB,EAAE,QAAgB;IAGjE,IAAM,UAAU,GAAG,YAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAM,UAAU,GAAG,YAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE;QAC7B,OAAO,CAAC,CAAC;KACV;SAAM,IAAI,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE;QACpC,OAAO,CAAC,CAAC,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AAO,GAgBtC;AAhBY,gCAAU"}
|
|
@@ -13,6 +13,7 @@ export declare function chainIsLens(chainId: number): boolean;
|
|
|
13
13
|
export declare function chainIsLinea(chainId: number): boolean;
|
|
14
14
|
export declare function chainIsL1(chainId: number): boolean;
|
|
15
15
|
export declare function chainIsEvm(chainId: number): boolean;
|
|
16
|
+
export declare function chainIsSvm(chainId: number): boolean;
|
|
16
17
|
export declare function chainIsCCTPEnabled(chainId: number): boolean;
|
|
17
18
|
export declare function chainRequiresL1ToL2Finalization(chainId: number): boolean;
|
|
18
19
|
export declare function getOriginFromURL(url: string): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOriginFromURL = exports.chainRequiresL1ToL2Finalization = exports.chainIsCCTPEnabled = exports.chainIsEvm = exports.chainIsL1 = exports.chainIsLinea = exports.chainIsLens = exports.chainIsAlephZero = exports.chainIsArbitrum = exports.chainIsOrbit = exports.chainIsZkStack = exports.chainIsOPStack = exports.chainIsMatic = exports.chainIsTestnet = exports.chainIsProd = exports.getNativeTokenSymbol = exports.getNetworkName = exports.hreNetworks = void 0;
|
|
3
|
+
exports.getOriginFromURL = exports.chainRequiresL1ToL2Finalization = exports.chainIsCCTPEnabled = exports.chainIsSvm = exports.chainIsEvm = exports.chainIsL1 = exports.chainIsLinea = exports.chainIsLens = exports.chainIsAlephZero = exports.chainIsArbitrum = exports.chainIsOrbit = exports.chainIsZkStack = exports.chainIsOPStack = exports.chainIsMatic = exports.chainIsTestnet = exports.chainIsProd = exports.getNativeTokenSymbol = exports.getNetworkName = exports.hreNetworks = void 0;
|
|
4
4
|
var constants_1 = require("../constants");
|
|
5
5
|
exports.hreNetworks = {
|
|
6
6
|
666: "Hardhat1",
|
|
@@ -66,10 +66,15 @@ function chainIsL1(chainId) {
|
|
|
66
66
|
}
|
|
67
67
|
exports.chainIsL1 = chainIsL1;
|
|
68
68
|
function chainIsEvm(chainId) {
|
|
69
|
-
|
|
70
|
-
return
|
|
69
|
+
var _a;
|
|
70
|
+
return ((_a = constants_1.PUBLIC_NETWORKS[chainId]) === null || _a === void 0 ? void 0 : _a.family) !== constants_1.ChainFamily.SVM;
|
|
71
71
|
}
|
|
72
72
|
exports.chainIsEvm = chainIsEvm;
|
|
73
|
+
function chainIsSvm(chainId) {
|
|
74
|
+
var _a;
|
|
75
|
+
return ((_a = constants_1.PUBLIC_NETWORKS[chainId]) === null || _a === void 0 ? void 0 : _a.family) === constants_1.ChainFamily.SVM;
|
|
76
|
+
}
|
|
77
|
+
exports.chainIsSvm = chainIsSvm;
|
|
73
78
|
function chainIsCCTPEnabled(chainId) {
|
|
74
79
|
return [
|
|
75
80
|
constants_1.CHAIN_IDs.ARBITRUM,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkUtils.js","sourceRoot":"","sources":["../../../src/utils/NetworkUtils.ts"],"names":[],"mappings":";;;AAAA,0CAA6G;AAEhG,QAAA,WAAW,GAA2B;IACjD,GAAG,EAAE,UAAU;IACf,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AAOF,SAAgB,cAAc,CAAC,SAA0B;;IACvD,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC9B,OAAO,MAAA,MAAA,MAAA,2BAAe,CAAC,SAAS,CAAC,0CAAE,IAAI,mCAAI,mBAAW,CAAC,SAAS,CAAC,mCAAI,SAAS,CAAC;AACjF,CAAC;AAHD,wCAGC;AAOD,SAAgB,oBAAoB,CAAC,OAAwB;;IAC3D,OAAO,MAAA,MAAA,2BAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,0CAAE,WAAW,mCAAI,KAAK,CAAC;AAChE,CAAC;AAFD,oDAEC;AAOD,SAAgB,WAAW,CAAC,OAAe;IACzC,OAAO,MAAM,CAAC,MAAM,CAAC,6BAAiB,CAAC,CAAC,QAAQ,CAAC,OAAO,CA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
153
153
|
};
|
|
154
154
|
coingeckoId: string;
|
|
155
155
|
};
|
|
156
|
+
SOL: {
|
|
157
|
+
name: string;
|
|
158
|
+
symbol: string;
|
|
159
|
+
decimals: number;
|
|
160
|
+
addresses: {
|
|
161
|
+
[x: number]: string;
|
|
162
|
+
133268194659241: string;
|
|
163
|
+
};
|
|
164
|
+
coingeckoId: string;
|
|
165
|
+
};
|
|
156
166
|
UMA: {
|
|
157
167
|
name: string;
|
|
158
168
|
symbol: string;
|
|
@@ -262,6 +272,16 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
262
272
|
};
|
|
263
273
|
coingeckoId: string;
|
|
264
274
|
};
|
|
275
|
+
WSOL: {
|
|
276
|
+
name: string;
|
|
277
|
+
symbol: string;
|
|
278
|
+
decimals: number;
|
|
279
|
+
addresses: {
|
|
280
|
+
[x: number]: string;
|
|
281
|
+
133268194659241: string;
|
|
282
|
+
};
|
|
283
|
+
coingeckoId: string;
|
|
284
|
+
};
|
|
265
285
|
}) => string | undefined;
|
|
266
286
|
export declare function getTokenInformationFromAddress(address: string, tokenMapping?: {
|
|
267
287
|
ACX: {
|
|
@@ -408,6 +428,16 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
408
428
|
};
|
|
409
429
|
coingeckoId: string;
|
|
410
430
|
};
|
|
431
|
+
SOL: {
|
|
432
|
+
name: string;
|
|
433
|
+
symbol: string;
|
|
434
|
+
decimals: number;
|
|
435
|
+
addresses: {
|
|
436
|
+
[x: number]: string;
|
|
437
|
+
133268194659241: string;
|
|
438
|
+
};
|
|
439
|
+
coingeckoId: string;
|
|
440
|
+
};
|
|
411
441
|
UMA: {
|
|
412
442
|
name: string;
|
|
413
443
|
symbol: string;
|
|
@@ -517,6 +547,16 @@ export declare function getTokenInformationFromAddress(address: string, tokenMap
|
|
|
517
547
|
};
|
|
518
548
|
coingeckoId: string;
|
|
519
549
|
};
|
|
550
|
+
WSOL: {
|
|
551
|
+
name: string;
|
|
552
|
+
symbol: string;
|
|
553
|
+
decimals: number;
|
|
554
|
+
addresses: {
|
|
555
|
+
[x: number]: string;
|
|
556
|
+
133268194659241: string;
|
|
557
|
+
};
|
|
558
|
+
coingeckoId: string;
|
|
559
|
+
};
|
|
520
560
|
}): L1Token | undefined;
|
|
521
561
|
export declare function getCoingeckoTokenIdByAddress(contractAddress: string): string;
|
|
522
562
|
export declare function getTokenBalance(address: string, tokenAddress: string, signerOrProvider: SignerOrProvider, blockTag?: BlockTag): Promise<BigNumber>;
|
|
@@ -147,6 +147,16 @@ export declare class QueryBase__factory {
|
|
|
147
147
|
};
|
|
148
148
|
coingeckoId: string;
|
|
149
149
|
};
|
|
150
|
+
SOL: {
|
|
151
|
+
name: string;
|
|
152
|
+
symbol: string;
|
|
153
|
+
decimals: number;
|
|
154
|
+
addresses: {
|
|
155
|
+
[x: number]: string;
|
|
156
|
+
133268194659241: string;
|
|
157
|
+
};
|
|
158
|
+
coingeckoId: string;
|
|
159
|
+
};
|
|
150
160
|
UMA: {
|
|
151
161
|
name: string;
|
|
152
162
|
symbol: string;
|
|
@@ -256,5 +266,15 @@ export declare class QueryBase__factory {
|
|
|
256
266
|
};
|
|
257
267
|
coingeckoId: string;
|
|
258
268
|
};
|
|
269
|
+
WSOL: {
|
|
270
|
+
name: string;
|
|
271
|
+
symbol: string;
|
|
272
|
+
decimals: number;
|
|
273
|
+
addresses: {
|
|
274
|
+
[x: number]: string;
|
|
275
|
+
133268194659241: string;
|
|
276
|
+
};
|
|
277
|
+
coingeckoId: string;
|
|
278
|
+
};
|
|
259
279
|
}, spokePoolAddress?: string | undefined, simulatedRelayerAddress?: string, coingeckoProApiKey?: string, logger?: Logger, coingeckoBaseCurrency?: string): QueryBase;
|
|
260
280
|
}
|
|
@@ -269,6 +269,16 @@ export declare class RelayFeeCalculator {
|
|
|
269
269
|
};
|
|
270
270
|
coingeckoId: string;
|
|
271
271
|
};
|
|
272
|
+
SOL: {
|
|
273
|
+
name: string;
|
|
274
|
+
symbol: string;
|
|
275
|
+
decimals: number;
|
|
276
|
+
addresses: {
|
|
277
|
+
[x: number]: string;
|
|
278
|
+
133268194659241: string;
|
|
279
|
+
};
|
|
280
|
+
coingeckoId: string;
|
|
281
|
+
};
|
|
272
282
|
UMA: {
|
|
273
283
|
name: string;
|
|
274
284
|
symbol: string;
|
|
@@ -378,6 +388,16 @@ export declare class RelayFeeCalculator {
|
|
|
378
388
|
};
|
|
379
389
|
coingeckoId: string;
|
|
380
390
|
};
|
|
391
|
+
WSOL: {
|
|
392
|
+
name: string;
|
|
393
|
+
symbol: string;
|
|
394
|
+
decimals: number;
|
|
395
|
+
addresses: {
|
|
396
|
+
[x: number]: string;
|
|
397
|
+
133268194659241: string;
|
|
398
|
+
};
|
|
399
|
+
coingeckoId: string;
|
|
400
|
+
};
|
|
381
401
|
}, gasPrice?: BigNumberish, gasLimit?: BigNumberish, _tokenGasCost?: BigNumberish, transport?: Transport): Promise<BigNumber>;
|
|
382
402
|
capitalFeePercent(_amountToRelay: BigNumberish, _tokenSymbol: string, _originRoute?: ChainIdAsString, _destinationRoute?: ChainIdAsString): BigNumber;
|
|
383
403
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { providers } from "ethers";
|
|
2
|
+
import { BigNumber } from "./";
|
|
2
3
|
/**
|
|
3
4
|
* Checks if a contract is deployed at the given address
|
|
4
5
|
* @param address The ETH address to check
|
|
@@ -11,3 +12,42 @@ export declare function compareAddressesSimple(addressA?: string, addressB?: str
|
|
|
11
12
|
export declare function toBytes32(address: string): string;
|
|
12
13
|
export declare function toAddress(hexString: string): string;
|
|
13
14
|
export declare function isValidEvmAddress(address: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Creates the proper address type given the input chain ID corresponding to the address's origin network.
|
|
17
|
+
* @param address Stringified address type to convert. Can be either hex encoded or base58 encoded.
|
|
18
|
+
* @param chainId Network ID corresponding to the input address, used to determine which address type to output.
|
|
19
|
+
* @returns a child `Address` type most fitting for the chain ID.
|
|
20
|
+
* @todo: Change this to `toAddress` once we remove the other `toAddress` function.
|
|
21
|
+
*/
|
|
22
|
+
export declare function toAddressType(address: string, chainId: number): Address | EvmAddress | SvmAddress;
|
|
23
|
+
export declare class Address {
|
|
24
|
+
readonly rawAddress: Uint8Array;
|
|
25
|
+
evmAddress: string | undefined;
|
|
26
|
+
bytes32Address: string | undefined;
|
|
27
|
+
svmAddress: string | undefined;
|
|
28
|
+
bnAddress: BigNumber | undefined;
|
|
29
|
+
constructor(_rawAddress: Uint8Array);
|
|
30
|
+
toBytes32(): string;
|
|
31
|
+
toBase58(): string;
|
|
32
|
+
toBigNumber(): BigNumber;
|
|
33
|
+
toEvmAddress(): string;
|
|
34
|
+
toAddress(): string;
|
|
35
|
+
toHexString(): string;
|
|
36
|
+
isValidEvmAddress(): boolean;
|
|
37
|
+
isValidOn(chainId: number): boolean;
|
|
38
|
+
static isAddress(obj: unknown): boolean;
|
|
39
|
+
toString(): string;
|
|
40
|
+
isZeroAddress(): boolean;
|
|
41
|
+
eq(other: Address): boolean;
|
|
42
|
+
compare(otherAddress: Address): 1 | -1 | 0;
|
|
43
|
+
}
|
|
44
|
+
export declare class EvmAddress extends Address {
|
|
45
|
+
constructor(rawAddress: Uint8Array);
|
|
46
|
+
toAddress(): string;
|
|
47
|
+
static from(hexString: string): EvmAddress;
|
|
48
|
+
}
|
|
49
|
+
export declare class SvmAddress extends Address {
|
|
50
|
+
constructor(rawAddress: Uint8Array);
|
|
51
|
+
toAddress(): string;
|
|
52
|
+
static from(bs58Address: string): SvmAddress;
|
|
53
|
+
}
|