lampamazaza-new-internal-utils 0.24.3
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/LICENSE +21 -0
- package/dist/_virtual/rolldown_runtime.cjs +43 -0
- package/dist/_virtual/rolldown_runtime.js +18 -0
- package/dist/config.cjs +82 -0
- package/dist/config.d.cts +42 -0
- package/dist/config.d.ts +42 -0
- package/dist/config.js +72 -0
- package/dist/errors/assert.cjs +11 -0
- package/dist/errors/assert.d.cts +11 -0
- package/dist/errors/assert.d.ts +11 -0
- package/dist/errors/assert.js +11 -0
- package/dist/errors/base.cjs +34 -0
- package/dist/errors/base.d.cts +21 -0
- package/dist/errors/base.d.ts +21 -0
- package/dist/errors/base.js +33 -0
- package/dist/errors/index.cjs +23 -0
- package/dist/errors/index.d.cts +11 -0
- package/dist/errors/index.d.ts +11 -0
- package/dist/errors/index.js +18 -0
- package/dist/errors/request.cjs +48 -0
- package/dist/errors/request.d.cts +61 -0
- package/dist/errors/request.d.ts +61 -0
- package/dist/errors/request.js +46 -0
- package/dist/errors/utils/isNetworkError.cjs +23 -0
- package/dist/errors/utils/isNetworkError.js +22 -0
- package/dist/errors/utils/toError.cjs +8 -0
- package/dist/errors/utils/toError.d.cts +4 -0
- package/dist/errors/utils/toError.d.ts +4 -0
- package/dist/errors/utils/toError.js +7 -0
- package/dist/index.cjs +125 -0
- package/dist/index.d.cts +30 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +30 -0
- package/dist/logger.d.cts +11 -0
- package/dist/logger.d.ts +11 -0
- package/dist/nearClient.cjs +18 -0
- package/dist/nearClient.d.cts +8 -0
- package/dist/nearClient.d.ts +8 -0
- package/dist/nearClient.js +18 -0
- package/dist/poaBridge/constants/blockchains.cjs +57 -0
- package/dist/poaBridge/constants/blockchains.d.cts +86 -0
- package/dist/poaBridge/constants/blockchains.d.ts +86 -0
- package/dist/poaBridge/constants/blockchains.js +54 -0
- package/dist/poaBridge/errors/withdrawal.cjs +52 -0
- package/dist/poaBridge/errors/withdrawal.d.cts +34 -0
- package/dist/poaBridge/errors/withdrawal.d.ts +34 -0
- package/dist/poaBridge/errors/withdrawal.js +50 -0
- package/dist/poaBridge/getPendingDeposits.cjs +9 -0
- package/dist/poaBridge/getPendingDeposits.d.cts +12 -0
- package/dist/poaBridge/getPendingDeposits.d.ts +13 -0
- package/dist/poaBridge/getPendingDeposits.js +9 -0
- package/dist/poaBridge/index.cjs +23 -0
- package/dist/poaBridge/index.d.cts +11 -0
- package/dist/poaBridge/index.d.ts +11 -0
- package/dist/poaBridge/index.js +18 -0
- package/dist/poaBridge/poaBridgeHttpClient/apis.cjs +38 -0
- package/dist/poaBridge/poaBridgeHttpClient/apis.d.cts +12 -0
- package/dist/poaBridge/poaBridgeHttpClient/apis.d.ts +12 -0
- package/dist/poaBridge/poaBridgeHttpClient/apis.js +32 -0
- package/dist/poaBridge/poaBridgeHttpClient/index.cjs +21 -0
- package/dist/poaBridge/poaBridgeHttpClient/index.d.cts +9 -0
- package/dist/poaBridge/poaBridgeHttpClient/index.d.ts +9 -0
- package/dist/poaBridge/poaBridgeHttpClient/index.js +16 -0
- package/dist/poaBridge/poaBridgeHttpClient/runtime.cjs +49 -0
- package/dist/poaBridge/poaBridgeHttpClient/runtime.js +47 -0
- package/dist/poaBridge/poaBridgeHttpClient/types.d.cts +161 -0
- package/dist/poaBridge/poaBridgeHttpClient/types.d.ts +161 -0
- package/dist/poaBridge/waitForWithdrawalCompletion.cjs +57 -0
- package/dist/poaBridge/waitForWithdrawalCompletion.d.cts +31 -0
- package/dist/poaBridge/waitForWithdrawalCompletion.d.ts +31 -0
- package/dist/poaBridge/waitForWithdrawalCompletion.js +56 -0
- package/dist/services/blockchainBalanceService.cjs +40 -0
- package/dist/services/blockchainBalanceService.d.cts +21 -0
- package/dist/services/blockchainBalanceService.d.ts +21 -0
- package/dist/services/blockchainBalanceService.js +37 -0
- package/dist/solverRelay/errors/intentSettlement.cjs +20 -0
- package/dist/solverRelay/errors/intentSettlement.d.cts +13 -0
- package/dist/solverRelay/errors/intentSettlement.d.ts +13 -0
- package/dist/solverRelay/errors/intentSettlement.js +20 -0
- package/dist/solverRelay/errors/quote.cjs +18 -0
- package/dist/solverRelay/errors/quote.d.cts +21 -0
- package/dist/solverRelay/errors/quote.d.ts +22 -0
- package/dist/solverRelay/errors/quote.js +18 -0
- package/dist/solverRelay/getQuote.cjs +49 -0
- package/dist/solverRelay/getQuote.d.cts +14 -0
- package/dist/solverRelay/getQuote.d.ts +14 -0
- package/dist/solverRelay/getQuote.js +49 -0
- package/dist/solverRelay/getStatus.cjs +26 -0
- package/dist/solverRelay/getStatus.d.cts +17 -0
- package/dist/solverRelay/getStatus.d.ts +18 -0
- package/dist/solverRelay/getStatus.js +26 -0
- package/dist/solverRelay/index.cjs +27 -0
- package/dist/solverRelay/index.d.cts +16 -0
- package/dist/solverRelay/index.d.ts +16 -0
- package/dist/solverRelay/index.js +22 -0
- package/dist/solverRelay/publishIntent.cjs +20 -0
- package/dist/solverRelay/publishIntent.d.cts +15 -0
- package/dist/solverRelay/publishIntent.d.ts +16 -0
- package/dist/solverRelay/publishIntent.js +20 -0
- package/dist/solverRelay/publishIntents.cjs +43 -0
- package/dist/solverRelay/publishIntents.d.cts +10 -0
- package/dist/solverRelay/publishIntents.d.ts +11 -0
- package/dist/solverRelay/publishIntents.js +42 -0
- package/dist/solverRelay/solverRelayHttpClient/apis.cjs +21 -0
- package/dist/solverRelay/solverRelayHttpClient/apis.d.cts +9 -0
- package/dist/solverRelay/solverRelayHttpClient/apis.d.ts +9 -0
- package/dist/solverRelay/solverRelayHttpClient/apis.js +18 -0
- package/dist/solverRelay/solverRelayHttpClient/index.cjs +18 -0
- package/dist/solverRelay/solverRelayHttpClient/index.d.cts +9 -0
- package/dist/solverRelay/solverRelayHttpClient/index.d.ts +9 -0
- package/dist/solverRelay/solverRelayHttpClient/index.js +13 -0
- package/dist/solverRelay/solverRelayHttpClient/runtime.cjs +60 -0
- package/dist/solverRelay/solverRelayHttpClient/runtime.js +58 -0
- package/dist/solverRelay/solverRelayHttpClient/types.d.cts +109 -0
- package/dist/solverRelay/solverRelayHttpClient/types.d.ts +109 -0
- package/dist/solverRelay/utils/parseFailedPublishError.cjs +40 -0
- package/dist/solverRelay/utils/parseFailedPublishError.d.cts +25 -0
- package/dist/solverRelay/utils/parseFailedPublishError.d.ts +26 -0
- package/dist/solverRelay/utils/parseFailedPublishError.js +39 -0
- package/dist/solverRelay/utils/quoteWithLog.cjs +21 -0
- package/dist/solverRelay/utils/quoteWithLog.d.cts +12 -0
- package/dist/solverRelay/utils/quoteWithLog.d.ts +14 -0
- package/dist/solverRelay/utils/quoteWithLog.js +21 -0
- package/dist/solverRelay/waitForIntentSettlement.cjs +52 -0
- package/dist/solverRelay/waitForIntentSettlement.d.cts +30 -0
- package/dist/solverRelay/waitForIntentSettlement.d.ts +30 -0
- package/dist/solverRelay/waitForIntentSettlement.js +52 -0
- package/dist/types/authHandle.cjs +22 -0
- package/dist/types/authHandle.d.cts +25 -0
- package/dist/types/authHandle.d.ts +25 -0
- package/dist/types/authHandle.js +16 -0
- package/dist/types/base.d.cts +45 -0
- package/dist/types/base.d.ts +45 -0
- package/dist/types/intentsUserId.d.cts +10 -0
- package/dist/types/intentsUserId.d.ts +10 -0
- package/dist/types/walletMessage.cjs +11 -0
- package/dist/types/walletMessage.d.cts +106 -0
- package/dist/types/walletMessage.d.ts +106 -0
- package/dist/types/walletMessage.js +5 -0
- package/dist/utils/abortSignal.cjs +19 -0
- package/dist/utils/abortSignal.js +18 -0
- package/dist/utils/appFee.cjs +20 -0
- package/dist/utils/appFee.d.cts +9 -0
- package/dist/utils/appFee.d.ts +9 -0
- package/dist/utils/appFee.js +15 -0
- package/dist/utils/assert.cjs +9 -0
- package/dist/utils/assert.d.cts +7 -0
- package/dist/utils/assert.d.ts +7 -0
- package/dist/utils/assert.js +9 -0
- package/dist/utils/authIdentity.cjs +56 -0
- package/dist/utils/authIdentity.d.cts +34 -0
- package/dist/utils/authIdentity.d.ts +34 -0
- package/dist/utils/authIdentity.js +50 -0
- package/dist/utils/failover.cjs +22 -0
- package/dist/utils/failover.d.cts +16 -0
- package/dist/utils/failover.d.ts +16 -0
- package/dist/utils/failover.js +20 -0
- package/dist/utils/handleRPCResponse.cjs +30 -0
- package/dist/utils/handleRPCResponse.js +28 -0
- package/dist/utils/index.cjs +55 -0
- package/dist/utils/index.d.cts +13 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.js +50 -0
- package/dist/utils/messageFactory.cjs +137 -0
- package/dist/utils/messageFactory.d.cts +70 -0
- package/dist/utils/messageFactory.d.ts +70 -0
- package/dist/utils/messageFactory.js +132 -0
- package/dist/utils/multiPayload/webauthn.cjs +27 -0
- package/dist/utils/multiPayload/webauthn.js +26 -0
- package/dist/utils/near.cjs +58 -0
- package/dist/utils/near.d.cts +35 -0
- package/dist/utils/near.d.ts +35 -0
- package/dist/utils/near.js +53 -0
- package/dist/utils/poll.cjs +87 -0
- package/dist/utils/poll.d.cts +54 -0
- package/dist/utils/poll.d.ts +54 -0
- package/dist/utils/poll.js +85 -0
- package/dist/utils/prepareBroadcastRequest.cjs +98 -0
- package/dist/utils/prepareBroadcastRequest.d.cts +16 -0
- package/dist/utils/prepareBroadcastRequest.d.ts +16 -0
- package/dist/utils/prepareBroadcastRequest.js +90 -0
- package/dist/utils/promise/withTimeout.cjs +34 -0
- package/dist/utils/promise/withTimeout.d.cts +16 -0
- package/dist/utils/promise/withTimeout.d.ts +16 -0
- package/dist/utils/promise/withTimeout.js +34 -0
- package/dist/utils/request.cjs +100 -0
- package/dist/utils/request.d.cts +27 -0
- package/dist/utils/request.d.ts +27 -0
- package/dist/utils/request.js +99 -0
- package/dist/utils/requestShouldRetry.cjs +20 -0
- package/dist/utils/requestShouldRetry.js +20 -0
- package/dist/utils/retry.cjs +66 -0
- package/dist/utils/retry.d.cts +56 -0
- package/dist/utils/retry.d.ts +56 -0
- package/dist/utils/retry.js +64 -0
- package/dist/utils/serialize.cjs +82 -0
- package/dist/utils/serialize.d.cts +17 -0
- package/dist/utils/serialize.d.ts +17 -0
- package/dist/utils/serialize.js +81 -0
- package/dist/utils/stellarAddressToBytes.cjs +295 -0
- package/dist/utils/stellarAddressToBytes.js +294 -0
- package/dist/utils/token.cjs +8 -0
- package/dist/utils/token.js +7 -0
- package/dist/utils/tokenUtils.cjs +263 -0
- package/dist/utils/tokenUtils.d.cts +88 -0
- package/dist/utils/tokenUtils.d.ts +88 -0
- package/dist/utils/tokenUtils.js +238 -0
- package/dist/utils/tronAddressToHex.cjs +18 -0
- package/dist/utils/tronAddressToHex.js +17 -0
- package/dist/utils/uint8Array.cjs +15 -0
- package/dist/utils/uint8Array.d.cts +4 -0
- package/dist/utils/uint8Array.d.ts +4 -0
- package/dist/utils/uint8Array.js +14 -0
- package/dist/utils/webAuthn.cjs +91 -0
- package/dist/utils/webAuthn.js +89 -0
- package/package.json +56 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { BaseError } from "./base.js";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/request.d.ts
|
|
4
|
+
type HttpRequestErrorType = HttpRequestError & {
|
|
5
|
+
name: "HttpRequestError";
|
|
6
|
+
};
|
|
7
|
+
declare class HttpRequestError extends BaseError {
|
|
8
|
+
body?: unknown | undefined;
|
|
9
|
+
headers?: Headers | undefined;
|
|
10
|
+
status?: number | undefined;
|
|
11
|
+
url: string;
|
|
12
|
+
constructor({
|
|
13
|
+
body,
|
|
14
|
+
cause,
|
|
15
|
+
details,
|
|
16
|
+
headers,
|
|
17
|
+
status,
|
|
18
|
+
url
|
|
19
|
+
}: {
|
|
20
|
+
body?: unknown | undefined;
|
|
21
|
+
cause?: Error | undefined;
|
|
22
|
+
details?: string | undefined;
|
|
23
|
+
headers?: Headers | undefined;
|
|
24
|
+
status?: number | undefined;
|
|
25
|
+
url: string;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
type RpcRequestErrorType = RpcRequestError & {
|
|
29
|
+
name: "RpcRequestError";
|
|
30
|
+
};
|
|
31
|
+
declare class RpcRequestError extends BaseError {
|
|
32
|
+
code: number;
|
|
33
|
+
data?: unknown;
|
|
34
|
+
constructor({
|
|
35
|
+
body,
|
|
36
|
+
error,
|
|
37
|
+
url
|
|
38
|
+
}: {
|
|
39
|
+
body: unknown;
|
|
40
|
+
error: {
|
|
41
|
+
code: number;
|
|
42
|
+
data?: unknown;
|
|
43
|
+
message: string;
|
|
44
|
+
};
|
|
45
|
+
url: string;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
type TimeoutErrorType = TimeoutError & {
|
|
49
|
+
name: "TimeoutError";
|
|
50
|
+
};
|
|
51
|
+
declare class TimeoutError extends BaseError {
|
|
52
|
+
constructor({
|
|
53
|
+
body,
|
|
54
|
+
url
|
|
55
|
+
}: {
|
|
56
|
+
body: unknown;
|
|
57
|
+
url: string;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { HttpRequestError, HttpRequestErrorType, RpcRequestError, RpcRequestErrorType, TimeoutError, TimeoutErrorType };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { serialize } from "../utils/serialize.js";
|
|
2
|
+
import { BaseError } from "./base.js";
|
|
3
|
+
|
|
4
|
+
//#region src/errors/request.ts
|
|
5
|
+
var HttpRequestError = class extends BaseError {
|
|
6
|
+
constructor({ body, cause, details, headers, status, url }) {
|
|
7
|
+
super("HTTP request failed.", {
|
|
8
|
+
cause,
|
|
9
|
+
details,
|
|
10
|
+
metaMessages: [
|
|
11
|
+
status && `Status: ${status}`,
|
|
12
|
+
`URL: ${url}`,
|
|
13
|
+
body && `Request body: ${serialize(body)}`
|
|
14
|
+
].filter(Boolean),
|
|
15
|
+
name: "HttpRequestError"
|
|
16
|
+
});
|
|
17
|
+
this.body = body;
|
|
18
|
+
this.headers = headers;
|
|
19
|
+
this.status = status;
|
|
20
|
+
this.url = url;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var RpcRequestError = class extends BaseError {
|
|
24
|
+
constructor({ body, error, url }) {
|
|
25
|
+
super("RPC Request failed.", {
|
|
26
|
+
cause: error,
|
|
27
|
+
details: error.message,
|
|
28
|
+
metaMessages: [`URL: ${url}`, `Request body: ${serialize(body)}`],
|
|
29
|
+
name: "RpcRequestError"
|
|
30
|
+
});
|
|
31
|
+
this.code = error.code;
|
|
32
|
+
this.data = error.data;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var TimeoutError = class extends BaseError {
|
|
36
|
+
constructor({ body, url }) {
|
|
37
|
+
super("The request took too long to respond.", {
|
|
38
|
+
details: "The request timed out.",
|
|
39
|
+
metaMessages: [`URL: ${url}`, `Request body: ${serialize(body)}`],
|
|
40
|
+
name: "TimeoutError"
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { HttpRequestError, RpcRequestError, TimeoutError };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/errors/utils/isNetworkError.ts
|
|
3
|
+
const objectToString = Object.prototype.toString;
|
|
4
|
+
const isError = (value) => objectToString.call(value) === "[object Error]" || value instanceof Error;
|
|
5
|
+
const errorMessages = new Set([
|
|
6
|
+
"network error",
|
|
7
|
+
"Failed to fetch",
|
|
8
|
+
"NetworkError when attempting to fetch resource.",
|
|
9
|
+
"The Internet connection appears to be offline.",
|
|
10
|
+
"Load failed",
|
|
11
|
+
"Network request failed",
|
|
12
|
+
"fetch failed",
|
|
13
|
+
"terminated"
|
|
14
|
+
]);
|
|
15
|
+
function isNetworkError(error) {
|
|
16
|
+
if (error instanceof Error) {}
|
|
17
|
+
if (!(error && isError(error) && error.name === "TypeError" && typeof error.message === "string")) return false;
|
|
18
|
+
if (error.message === "Load failed") return error.stack === void 0;
|
|
19
|
+
return errorMessages.has(error.message);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.isNetworkError = isNetworkError;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/errors/utils/isNetworkError.ts
|
|
2
|
+
const objectToString = Object.prototype.toString;
|
|
3
|
+
const isError = (value) => objectToString.call(value) === "[object Error]" || value instanceof Error;
|
|
4
|
+
const errorMessages = new Set([
|
|
5
|
+
"network error",
|
|
6
|
+
"Failed to fetch",
|
|
7
|
+
"NetworkError when attempting to fetch resource.",
|
|
8
|
+
"The Internet connection appears to be offline.",
|
|
9
|
+
"Load failed",
|
|
10
|
+
"Network request failed",
|
|
11
|
+
"fetch failed",
|
|
12
|
+
"terminated"
|
|
13
|
+
]);
|
|
14
|
+
function isNetworkError(error) {
|
|
15
|
+
if (error instanceof Error) {}
|
|
16
|
+
if (!(error && isError(error) && error.name === "TypeError" && typeof error.message === "string")) return false;
|
|
17
|
+
if (error.message === "Load failed") return error.stack === void 0;
|
|
18
|
+
return errorMessages.has(error.message);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { isNetworkError };
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
const require_config = require('./config.cjs');
|
|
2
|
+
const require_serialize = require('./utils/serialize.cjs');
|
|
3
|
+
const require_base = require('./errors/base.cjs');
|
|
4
|
+
const require_request = require('./errors/request.cjs');
|
|
5
|
+
const require_withTimeout = require('./utils/promise/withTimeout.cjs');
|
|
6
|
+
const require_request$1 = require('./utils/request.cjs');
|
|
7
|
+
const require_retry = require('./utils/retry.cjs');
|
|
8
|
+
const require_withdrawal = require('./poaBridge/errors/withdrawal.cjs');
|
|
9
|
+
const require_blockchains = require('./poaBridge/constants/blockchains.cjs');
|
|
10
|
+
const require_index = require('./poaBridge/index.cjs');
|
|
11
|
+
const require_quote = require('./solverRelay/errors/quote.cjs');
|
|
12
|
+
const require_assert = require('./errors/assert.cjs');
|
|
13
|
+
const require_assert$1 = require('./utils/assert.cjs');
|
|
14
|
+
const require_authIdentity = require('./utils/authIdentity.cjs');
|
|
15
|
+
const require_prepareBroadcastRequest = require('./utils/prepareBroadcastRequest.cjs');
|
|
16
|
+
const require_index$1 = require('./utils/index.cjs');
|
|
17
|
+
const require_parseFailedPublishError = require('./solverRelay/utils/parseFailedPublishError.cjs');
|
|
18
|
+
const require_poll = require('./utils/poll.cjs');
|
|
19
|
+
const require_intentSettlement = require('./solverRelay/errors/intentSettlement.cjs');
|
|
20
|
+
const require_index$2 = require('./solverRelay/index.cjs');
|
|
21
|
+
const require_index$3 = require('./errors/index.cjs');
|
|
22
|
+
const require_messageFactory = require('./utils/messageFactory.cjs');
|
|
23
|
+
const require_appFee = require('./utils/appFee.cjs');
|
|
24
|
+
const require_walletMessage = require('./types/walletMessage.cjs');
|
|
25
|
+
const require_authHandle = require('./types/authHandle.cjs');
|
|
26
|
+
const require_blockchainBalanceService = require('./services/blockchainBalanceService.cjs');
|
|
27
|
+
const require_failover = require('./utils/failover.cjs');
|
|
28
|
+
const require_nearClient = require('./nearClient.cjs');
|
|
29
|
+
|
|
30
|
+
exports.AssertionError = require_assert.AssertionError;
|
|
31
|
+
exports.AuthMethod = require_authHandle.AuthMethod;
|
|
32
|
+
exports.BaseError = require_base.BaseError;
|
|
33
|
+
exports.BlockchainEnum = require_blockchains.BlockchainEnum;
|
|
34
|
+
exports.HttpRequestError = require_request.HttpRequestError;
|
|
35
|
+
exports.IntentSettlementError = require_intentSettlement.IntentSettlementError;
|
|
36
|
+
exports.POLL_PENDING = require_poll.POLL_PENDING;
|
|
37
|
+
exports.PUBLIC_NEAR_RPC_URLS = require_nearClient.PUBLIC_NEAR_RPC_URLS;
|
|
38
|
+
exports.PoaWithdrawalInvariantError = require_withdrawal.PoaWithdrawalInvariantError;
|
|
39
|
+
exports.PoaWithdrawalNotFoundError = require_withdrawal.PoaWithdrawalNotFoundError;
|
|
40
|
+
exports.PoaWithdrawalPendingError = require_withdrawal.PoaWithdrawalPendingError;
|
|
41
|
+
exports.PollTimeoutError = require_poll.PollTimeoutError;
|
|
42
|
+
exports.QuoteError = require_quote.QuoteError;
|
|
43
|
+
exports.RETRY_CONFIGS = require_retry.RETRY_CONFIGS;
|
|
44
|
+
exports.RelayPublishError = require_parseFailedPublishError.RelayPublishError;
|
|
45
|
+
exports.RpcRequestError = require_request.RpcRequestError;
|
|
46
|
+
exports.TimeoutError = require_request.TimeoutError;
|
|
47
|
+
Object.defineProperty(exports, 'appFee', {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () {
|
|
50
|
+
return require_appFee.appFee_exports;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
exports.assert = require_assert$1.assert;
|
|
54
|
+
Object.defineProperty(exports, 'authHandle', {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return require_authHandle.authHandle_exports;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, 'authIdentity', {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return require_authIdentity.authIdentity_exports;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
exports.calculateMaxAttempts = require_retry.calculateMaxAttempts;
|
|
67
|
+
Object.defineProperty(exports, 'config', {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function () {
|
|
70
|
+
return require_config.config;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
exports.configsByEnvironment = require_config.configsByEnvironment;
|
|
74
|
+
exports.configureSDK = require_config.configureSDK;
|
|
75
|
+
Object.defineProperty(exports, 'errors', {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function () {
|
|
78
|
+
return require_index$3.errors_exports;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
exports.getNearNep141MinStorageBalance = require_blockchainBalanceService.getNearNep141MinStorageBalance;
|
|
82
|
+
exports.getNearNep141StorageBalance = require_blockchainBalanceService.getNearNep141StorageBalance;
|
|
83
|
+
Object.defineProperty(exports, 'messageFactory', {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
get: function () {
|
|
86
|
+
return require_messageFactory.messageFactory_exports;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
exports.nearFailoverRpcProvider = require_failover.nearFailoverRpcProvider;
|
|
90
|
+
Object.defineProperty(exports, 'poaBridge', {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return require_index.poaBridge_exports;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
exports.poll = require_poll.poll;
|
|
97
|
+
Object.defineProperty(exports, 'prepareBroadcastRequest', {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function () {
|
|
100
|
+
return require_prepareBroadcastRequest.prepareBroadcastRequest_exports;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
exports.request = require_request$1.request;
|
|
104
|
+
exports.resolveEnvConfig = require_config.resolveEnvConfig;
|
|
105
|
+
exports.serialize = require_serialize.serialize;
|
|
106
|
+
Object.defineProperty(exports, 'solverRelay', {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function () {
|
|
109
|
+
return require_index$2.solverRelay_exports;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
exports.unwrapNearFailoverRpcProvider = require_failover.unwrapNearFailoverRpcProvider;
|
|
113
|
+
Object.defineProperty(exports, 'utils', {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
get: function () {
|
|
116
|
+
return require_index$1.utils_exports;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
Object.defineProperty(exports, 'walletMessage', {
|
|
120
|
+
enumerable: true,
|
|
121
|
+
get: function () {
|
|
122
|
+
return require_walletMessage.walletMessage_exports;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
exports.withTimeout = require_withTimeout.withTimeout;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BaseError, BaseErrorType } from "./errors/base.cjs";
|
|
2
|
+
import { HttpRequestError, HttpRequestErrorType, RpcRequestError, RpcRequestErrorType, TimeoutError, TimeoutErrorType } from "./errors/request.cjs";
|
|
3
|
+
import { ILogger } from "./logger.cjs";
|
|
4
|
+
import { RETRY_CONFIGS, RetryOptions, calculateMaxAttempts } from "./utils/retry.cjs";
|
|
5
|
+
import { RequestErrorType, request } from "./utils/request.cjs";
|
|
6
|
+
import { BlockchainEnum } from "./poaBridge/constants/blockchains.cjs";
|
|
7
|
+
import { PoaWithdrawalInvariantError, PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, PoaWithdrawalPendingErrorType } from "./poaBridge/errors/withdrawal.cjs";
|
|
8
|
+
import { index_d_exports as index_d_exports$1 } from "./poaBridge/index.cjs";
|
|
9
|
+
import { QuoteError, QuoteErrorType } from "./solverRelay/errors/quote.cjs";
|
|
10
|
+
import { AssertionError, AssertionErrorType } from "./errors/assert.cjs";
|
|
11
|
+
import { index_d_exports } from "./errors/index.cjs";
|
|
12
|
+
import { RelayPublishError, RelayPublishErrorType } from "./solverRelay/utils/parseFailedPublishError.cjs";
|
|
13
|
+
import { IntentSettlementError, IntentSettlementErrorType } from "./solverRelay/errors/intentSettlement.cjs";
|
|
14
|
+
import { AuthMethod, authHandle_d_exports } from "./types/authHandle.cjs";
|
|
15
|
+
import { walletMessage_d_exports } from "./types/walletMessage.cjs";
|
|
16
|
+
import { index_d_exports as index_d_exports$2 } from "./solverRelay/index.cjs";
|
|
17
|
+
import { assert } from "./utils/assert.cjs";
|
|
18
|
+
import { authIdentity_d_exports } from "./utils/authIdentity.cjs";
|
|
19
|
+
import { prepareBroadcastRequest_d_exports } from "./utils/prepareBroadcastRequest.cjs";
|
|
20
|
+
import { index_d_exports as index_d_exports$3 } from "./utils/index.cjs";
|
|
21
|
+
import { messageFactory_d_exports } from "./utils/messageFactory.cjs";
|
|
22
|
+
import { appFee_d_exports } from "./utils/appFee.cjs";
|
|
23
|
+
import { getNearNep141MinStorageBalance, getNearNep141StorageBalance } from "./services/blockchainBalanceService.cjs";
|
|
24
|
+
import { EnvConfig, NearIntentsEnv, config, configsByEnvironment, configureSDK, resolveEnvConfig } from "./config.cjs";
|
|
25
|
+
import { withTimeout } from "./utils/promise/withTimeout.cjs";
|
|
26
|
+
import { CompletionStats, POLL_PENDING, PollOptions, PollTimeoutError, PollTimeoutErrorType, poll } from "./utils/poll.cjs";
|
|
27
|
+
import { serialize } from "./utils/serialize.cjs";
|
|
28
|
+
import { nearFailoverRpcProvider, unwrapNearFailoverRpcProvider } from "./utils/failover.cjs";
|
|
29
|
+
import { PUBLIC_NEAR_RPC_URLS } from "./nearClient.cjs";
|
|
30
|
+
export { AssertionError, type AssertionErrorType, AuthMethod, BaseError, type BaseErrorType, BlockchainEnum, type CompletionStats, type EnvConfig, HttpRequestError, type HttpRequestErrorType, type ILogger, IntentSettlementError, type IntentSettlementErrorType, type NearIntentsEnv, POLL_PENDING, PUBLIC_NEAR_RPC_URLS, PoaWithdrawalInvariantError, type PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, type PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, type PoaWithdrawalPendingErrorType, type PollOptions, PollTimeoutError, type PollTimeoutErrorType, QuoteError, type QuoteErrorType, RETRY_CONFIGS, RelayPublishError, type RelayPublishErrorType, type RequestErrorType, type RetryOptions, RpcRequestError, type RpcRequestErrorType, TimeoutError, type TimeoutErrorType, appFee_d_exports as appFee, assert, authHandle_d_exports as authHandle, authIdentity_d_exports as authIdentity, calculateMaxAttempts, config, configsByEnvironment, configureSDK, index_d_exports as errors, getNearNep141MinStorageBalance, getNearNep141StorageBalance, messageFactory_d_exports as messageFactory, nearFailoverRpcProvider, index_d_exports$1 as poaBridge, poll, prepareBroadcastRequest_d_exports as prepareBroadcastRequest, request, resolveEnvConfig, serialize, index_d_exports$2 as solverRelay, unwrapNearFailoverRpcProvider, index_d_exports$3 as utils, walletMessage_d_exports as walletMessage, withTimeout };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BaseError, BaseErrorType } from "./errors/base.js";
|
|
2
|
+
import { HttpRequestError, HttpRequestErrorType, RpcRequestError, RpcRequestErrorType, TimeoutError, TimeoutErrorType } from "./errors/request.js";
|
|
3
|
+
import { ILogger } from "./logger.js";
|
|
4
|
+
import { RETRY_CONFIGS, RetryOptions, calculateMaxAttempts } from "./utils/retry.js";
|
|
5
|
+
import { RequestErrorType, request } from "./utils/request.js";
|
|
6
|
+
import { BlockchainEnum } from "./poaBridge/constants/blockchains.js";
|
|
7
|
+
import { PoaWithdrawalInvariantError, PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, PoaWithdrawalPendingErrorType } from "./poaBridge/errors/withdrawal.js";
|
|
8
|
+
import { index_d_exports as index_d_exports$1 } from "./poaBridge/index.js";
|
|
9
|
+
import { QuoteError, QuoteErrorType } from "./solverRelay/errors/quote.js";
|
|
10
|
+
import { AssertionError, AssertionErrorType } from "./errors/assert.js";
|
|
11
|
+
import { index_d_exports } from "./errors/index.js";
|
|
12
|
+
import { RelayPublishError, RelayPublishErrorType } from "./solverRelay/utils/parseFailedPublishError.js";
|
|
13
|
+
import { IntentSettlementError, IntentSettlementErrorType } from "./solverRelay/errors/intentSettlement.js";
|
|
14
|
+
import { AuthMethod, authHandle_d_exports } from "./types/authHandle.js";
|
|
15
|
+
import { walletMessage_d_exports } from "./types/walletMessage.js";
|
|
16
|
+
import { index_d_exports as index_d_exports$2 } from "./solverRelay/index.js";
|
|
17
|
+
import { assert } from "./utils/assert.js";
|
|
18
|
+
import { authIdentity_d_exports } from "./utils/authIdentity.js";
|
|
19
|
+
import { prepareBroadcastRequest_d_exports } from "./utils/prepareBroadcastRequest.js";
|
|
20
|
+
import { index_d_exports as index_d_exports$3 } from "./utils/index.js";
|
|
21
|
+
import { messageFactory_d_exports } from "./utils/messageFactory.js";
|
|
22
|
+
import { appFee_d_exports } from "./utils/appFee.js";
|
|
23
|
+
import { getNearNep141MinStorageBalance, getNearNep141StorageBalance } from "./services/blockchainBalanceService.js";
|
|
24
|
+
import { EnvConfig, NearIntentsEnv, config, configsByEnvironment, configureSDK, resolveEnvConfig } from "./config.js";
|
|
25
|
+
import { withTimeout } from "./utils/promise/withTimeout.js";
|
|
26
|
+
import { CompletionStats, POLL_PENDING, PollOptions, PollTimeoutError, PollTimeoutErrorType, poll } from "./utils/poll.js";
|
|
27
|
+
import { serialize } from "./utils/serialize.js";
|
|
28
|
+
import { nearFailoverRpcProvider, unwrapNearFailoverRpcProvider } from "./utils/failover.js";
|
|
29
|
+
import { PUBLIC_NEAR_RPC_URLS } from "./nearClient.js";
|
|
30
|
+
export { AssertionError, type AssertionErrorType, AuthMethod, BaseError, type BaseErrorType, BlockchainEnum, type CompletionStats, type EnvConfig, HttpRequestError, type HttpRequestErrorType, type ILogger, IntentSettlementError, type IntentSettlementErrorType, type NearIntentsEnv, POLL_PENDING, PUBLIC_NEAR_RPC_URLS, PoaWithdrawalInvariantError, type PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, type PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, type PoaWithdrawalPendingErrorType, type PollOptions, PollTimeoutError, type PollTimeoutErrorType, QuoteError, type QuoteErrorType, RETRY_CONFIGS, RelayPublishError, type RelayPublishErrorType, type RequestErrorType, type RetryOptions, RpcRequestError, type RpcRequestErrorType, TimeoutError, type TimeoutErrorType, appFee_d_exports as appFee, assert, authHandle_d_exports as authHandle, authIdentity_d_exports as authIdentity, calculateMaxAttempts, config, configsByEnvironment, configureSDK, index_d_exports as errors, getNearNep141MinStorageBalance, getNearNep141StorageBalance, messageFactory_d_exports as messageFactory, nearFailoverRpcProvider, index_d_exports$1 as poaBridge, poll, prepareBroadcastRequest_d_exports as prepareBroadcastRequest, request, resolveEnvConfig, serialize, index_d_exports$2 as solverRelay, unwrapNearFailoverRpcProvider, index_d_exports$3 as utils, walletMessage_d_exports as walletMessage, withTimeout };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { config, configsByEnvironment, configureSDK, resolveEnvConfig } from "./config.js";
|
|
2
|
+
import { serialize } from "./utils/serialize.js";
|
|
3
|
+
import { BaseError } from "./errors/base.js";
|
|
4
|
+
import { HttpRequestError, RpcRequestError, TimeoutError } from "./errors/request.js";
|
|
5
|
+
import { withTimeout } from "./utils/promise/withTimeout.js";
|
|
6
|
+
import { request } from "./utils/request.js";
|
|
7
|
+
import { RETRY_CONFIGS, calculateMaxAttempts } from "./utils/retry.js";
|
|
8
|
+
import { PoaWithdrawalInvariantError, PoaWithdrawalNotFoundError, PoaWithdrawalPendingError } from "./poaBridge/errors/withdrawal.js";
|
|
9
|
+
import { BlockchainEnum } from "./poaBridge/constants/blockchains.js";
|
|
10
|
+
import { poaBridge_exports } from "./poaBridge/index.js";
|
|
11
|
+
import { QuoteError } from "./solverRelay/errors/quote.js";
|
|
12
|
+
import { AssertionError } from "./errors/assert.js";
|
|
13
|
+
import { assert } from "./utils/assert.js";
|
|
14
|
+
import { authIdentity_exports } from "./utils/authIdentity.js";
|
|
15
|
+
import { prepareBroadcastRequest_exports } from "./utils/prepareBroadcastRequest.js";
|
|
16
|
+
import { utils_exports } from "./utils/index.js";
|
|
17
|
+
import { RelayPublishError } from "./solverRelay/utils/parseFailedPublishError.js";
|
|
18
|
+
import { POLL_PENDING, PollTimeoutError, poll } from "./utils/poll.js";
|
|
19
|
+
import { IntentSettlementError } from "./solverRelay/errors/intentSettlement.js";
|
|
20
|
+
import { solverRelay_exports } from "./solverRelay/index.js";
|
|
21
|
+
import { errors_exports } from "./errors/index.js";
|
|
22
|
+
import { messageFactory_exports } from "./utils/messageFactory.js";
|
|
23
|
+
import { appFee_exports } from "./utils/appFee.js";
|
|
24
|
+
import { walletMessage_exports } from "./types/walletMessage.js";
|
|
25
|
+
import { AuthMethod, authHandle_exports } from "./types/authHandle.js";
|
|
26
|
+
import { getNearNep141MinStorageBalance, getNearNep141StorageBalance } from "./services/blockchainBalanceService.js";
|
|
27
|
+
import { nearFailoverRpcProvider, unwrapNearFailoverRpcProvider } from "./utils/failover.js";
|
|
28
|
+
import { PUBLIC_NEAR_RPC_URLS } from "./nearClient.js";
|
|
29
|
+
|
|
30
|
+
export { AssertionError, AuthMethod, BaseError, BlockchainEnum, HttpRequestError, IntentSettlementError, POLL_PENDING, PUBLIC_NEAR_RPC_URLS, PoaWithdrawalInvariantError, PoaWithdrawalNotFoundError, PoaWithdrawalPendingError, PollTimeoutError, QuoteError, RETRY_CONFIGS, RelayPublishError, RpcRequestError, TimeoutError, appFee_exports as appFee, assert, authHandle_exports as authHandle, authIdentity_exports as authIdentity, calculateMaxAttempts, config, configsByEnvironment, configureSDK, errors_exports as errors, getNearNep141MinStorageBalance, getNearNep141StorageBalance, messageFactory_exports as messageFactory, nearFailoverRpcProvider, poaBridge_exports as poaBridge, poll, prepareBroadcastRequest_exports as prepareBroadcastRequest, request, resolveEnvConfig, serialize, solverRelay_exports as solverRelay, unwrapNearFailoverRpcProvider, utils_exports as utils, walletMessage_exports as walletMessage, withTimeout };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/logger.d.ts
|
|
2
|
+
type Context = Record<string, unknown>;
|
|
3
|
+
interface ILogger extends Pick<typeof console, "error" | "warn" | "info" | "debug" | "trace"> {
|
|
4
|
+
error(msg: string | Error, ctx?: Context): void;
|
|
5
|
+
warn(msg: string, ctx?: Context): void;
|
|
6
|
+
info(msg: string, ctx?: Context): void;
|
|
7
|
+
debug(msg: string, ctx?: Context): void;
|
|
8
|
+
trace(msg: string, ctx?: Context): void;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ILogger };
|
package/dist/logger.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/logger.d.ts
|
|
2
|
+
type Context = Record<string, unknown>;
|
|
3
|
+
interface ILogger extends Pick<typeof console, "error" | "warn" | "info" | "debug" | "trace"> {
|
|
4
|
+
error(msg: string | Error, ctx?: Context): void;
|
|
5
|
+
warn(msg: string, ctx?: Context): void;
|
|
6
|
+
info(msg: string, ctx?: Context): void;
|
|
7
|
+
debug(msg: string, ctx?: Context): void;
|
|
8
|
+
trace(msg: string, ctx?: Context): void;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ILogger };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_failover = require('./utils/failover.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/nearClient.ts
|
|
4
|
+
/**
|
|
5
|
+
* NEAR RPC providers list from official docs:
|
|
6
|
+
* https://docs.near.org/api/rpc/providers
|
|
7
|
+
*/
|
|
8
|
+
const PUBLIC_NEAR_RPC_URLS = [
|
|
9
|
+
"https://near-rpc.defuse.org",
|
|
10
|
+
"https://free.rpc.fastnear.com",
|
|
11
|
+
"https://1rpc.io/near",
|
|
12
|
+
"https://rpc.mainnet.pagoda.co",
|
|
13
|
+
"https://near.lava.build:443"
|
|
14
|
+
];
|
|
15
|
+
const nearClient = require_failover.nearFailoverRpcProvider({ urls: PUBLIC_NEAR_RPC_URLS });
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.PUBLIC_NEAR_RPC_URLS = PUBLIC_NEAR_RPC_URLS;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { nearFailoverRpcProvider } from "./utils/failover.js";
|
|
2
|
+
|
|
3
|
+
//#region src/nearClient.ts
|
|
4
|
+
/**
|
|
5
|
+
* NEAR RPC providers list from official docs:
|
|
6
|
+
* https://docs.near.org/api/rpc/providers
|
|
7
|
+
*/
|
|
8
|
+
const PUBLIC_NEAR_RPC_URLS = [
|
|
9
|
+
"https://near-rpc.defuse.org",
|
|
10
|
+
"https://free.rpc.fastnear.com",
|
|
11
|
+
"https://1rpc.io/near",
|
|
12
|
+
"https://rpc.mainnet.pagoda.co",
|
|
13
|
+
"https://near.lava.build:443"
|
|
14
|
+
];
|
|
15
|
+
const nearClient = nearFailoverRpcProvider({ urls: PUBLIC_NEAR_RPC_URLS });
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { PUBLIC_NEAR_RPC_URLS };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/poaBridge/constants/blockchains.ts
|
|
3
|
+
/**
|
|
4
|
+
* Values are PoA Bridge specific
|
|
5
|
+
* @see https://docs.near-intents.org/near-intents/market-makers/poa-bridge-api
|
|
6
|
+
*/
|
|
7
|
+
const PoaBridgeNetworkReference = {
|
|
8
|
+
NEAR: "near:mainnet",
|
|
9
|
+
ETHEREUM: "eth:1",
|
|
10
|
+
BASE: "eth:8453",
|
|
11
|
+
ARBITRUM: "eth:42161",
|
|
12
|
+
BITCOIN: "btc:mainnet",
|
|
13
|
+
BITCOINCASH: "bch:mainnet",
|
|
14
|
+
SOLANA: "sol:mainnet",
|
|
15
|
+
DOGECOIN: "doge:mainnet",
|
|
16
|
+
XRPLEDGER: "xrp:mainnet",
|
|
17
|
+
ZCASH: "zec:mainnet",
|
|
18
|
+
GNOSIS: "eth:100",
|
|
19
|
+
BERACHAIN: "eth:80094",
|
|
20
|
+
TRON: "tron:mainnet",
|
|
21
|
+
POLYGON: "eth:137",
|
|
22
|
+
BSC: "eth:56",
|
|
23
|
+
TON: "ton:mainnet",
|
|
24
|
+
OPTIMISM: "eth:10",
|
|
25
|
+
AVALANCHE: "eth:43114",
|
|
26
|
+
SUI: "sui:mainnet",
|
|
27
|
+
STELLAR: "stellar:mainnet",
|
|
28
|
+
APTOS: "aptos:mainnet",
|
|
29
|
+
CARDANO: "cardano:mainnet",
|
|
30
|
+
LITECOIN: "ltc:mainnet",
|
|
31
|
+
MONAD: "eth:143",
|
|
32
|
+
LAYERX: "eth:196",
|
|
33
|
+
STARKNET: "starknet:mainnet"
|
|
34
|
+
};
|
|
35
|
+
const VirtualNetworkReference = {
|
|
36
|
+
TURBOCHAIN: "eth:1313161567",
|
|
37
|
+
TUXAPPCHAIN: "eth:1313161573",
|
|
38
|
+
VERTEX: "eth:1313161587",
|
|
39
|
+
OPTIMA: "eth:1313161569",
|
|
40
|
+
EASYCHAIN: "eth:1313161752",
|
|
41
|
+
HAKO: "eth:1313161901",
|
|
42
|
+
AURORA: "eth:1313161554",
|
|
43
|
+
AURORA_DEVNET: "eth:1313161834"
|
|
44
|
+
};
|
|
45
|
+
const BlockchainEnum = {
|
|
46
|
+
...PoaBridgeNetworkReference,
|
|
47
|
+
...VirtualNetworkReference,
|
|
48
|
+
HYPERLIQUID: "hyperliquid:999",
|
|
49
|
+
ADI: "eth:36900",
|
|
50
|
+
PLASMA: "eth:9745",
|
|
51
|
+
SCROLL: "eth:534352"
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
exports.BlockchainEnum = BlockchainEnum;
|
|
56
|
+
exports.PoaBridgeNetworkReference = PoaBridgeNetworkReference;
|
|
57
|
+
exports.VirtualNetworkReference = VirtualNetworkReference;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
//#region src/poaBridge/constants/blockchains.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Values are PoA Bridge specific
|
|
4
|
+
* @see https://docs.near-intents.org/near-intents/market-makers/poa-bridge-api
|
|
5
|
+
*/
|
|
6
|
+
declare const PoaBridgeNetworkReference: {
|
|
7
|
+
readonly NEAR: "near:mainnet";
|
|
8
|
+
readonly ETHEREUM: "eth:1";
|
|
9
|
+
readonly BASE: "eth:8453";
|
|
10
|
+
readonly ARBITRUM: "eth:42161";
|
|
11
|
+
readonly BITCOIN: "btc:mainnet";
|
|
12
|
+
readonly BITCOINCASH: "bch:mainnet";
|
|
13
|
+
readonly SOLANA: "sol:mainnet";
|
|
14
|
+
readonly DOGECOIN: "doge:mainnet";
|
|
15
|
+
readonly XRPLEDGER: "xrp:mainnet";
|
|
16
|
+
readonly ZCASH: "zec:mainnet";
|
|
17
|
+
readonly GNOSIS: "eth:100";
|
|
18
|
+
readonly BERACHAIN: "eth:80094";
|
|
19
|
+
readonly TRON: "tron:mainnet";
|
|
20
|
+
readonly POLYGON: "eth:137";
|
|
21
|
+
readonly BSC: "eth:56";
|
|
22
|
+
readonly TON: "ton:mainnet";
|
|
23
|
+
readonly OPTIMISM: "eth:10";
|
|
24
|
+
readonly AVALANCHE: "eth:43114";
|
|
25
|
+
readonly SUI: "sui:mainnet";
|
|
26
|
+
readonly STELLAR: "stellar:mainnet";
|
|
27
|
+
readonly APTOS: "aptos:mainnet";
|
|
28
|
+
readonly CARDANO: "cardano:mainnet";
|
|
29
|
+
readonly LITECOIN: "ltc:mainnet";
|
|
30
|
+
readonly MONAD: "eth:143";
|
|
31
|
+
readonly LAYERX: "eth:196";
|
|
32
|
+
readonly STARKNET: "starknet:mainnet";
|
|
33
|
+
};
|
|
34
|
+
declare const VirtualNetworkReference: {
|
|
35
|
+
readonly TURBOCHAIN: "eth:1313161567";
|
|
36
|
+
readonly TUXAPPCHAIN: "eth:1313161573";
|
|
37
|
+
readonly VERTEX: "eth:1313161587";
|
|
38
|
+
readonly OPTIMA: "eth:1313161569";
|
|
39
|
+
readonly EASYCHAIN: "eth:1313161752";
|
|
40
|
+
readonly HAKO: "eth:1313161901";
|
|
41
|
+
readonly AURORA: "eth:1313161554";
|
|
42
|
+
readonly AURORA_DEVNET: "eth:1313161834";
|
|
43
|
+
};
|
|
44
|
+
declare const BlockchainEnum: {
|
|
45
|
+
readonly HYPERLIQUID: "hyperliquid:999";
|
|
46
|
+
readonly ADI: "eth:36900";
|
|
47
|
+
readonly PLASMA: "eth:9745";
|
|
48
|
+
readonly SCROLL: "eth:534352";
|
|
49
|
+
readonly TURBOCHAIN: "eth:1313161567";
|
|
50
|
+
readonly TUXAPPCHAIN: "eth:1313161573";
|
|
51
|
+
readonly VERTEX: "eth:1313161587";
|
|
52
|
+
readonly OPTIMA: "eth:1313161569";
|
|
53
|
+
readonly EASYCHAIN: "eth:1313161752";
|
|
54
|
+
readonly HAKO: "eth:1313161901";
|
|
55
|
+
readonly AURORA: "eth:1313161554";
|
|
56
|
+
readonly AURORA_DEVNET: "eth:1313161834";
|
|
57
|
+
readonly NEAR: "near:mainnet";
|
|
58
|
+
readonly ETHEREUM: "eth:1";
|
|
59
|
+
readonly BASE: "eth:8453";
|
|
60
|
+
readonly ARBITRUM: "eth:42161";
|
|
61
|
+
readonly BITCOIN: "btc:mainnet";
|
|
62
|
+
readonly BITCOINCASH: "bch:mainnet";
|
|
63
|
+
readonly SOLANA: "sol:mainnet";
|
|
64
|
+
readonly DOGECOIN: "doge:mainnet";
|
|
65
|
+
readonly XRPLEDGER: "xrp:mainnet";
|
|
66
|
+
readonly ZCASH: "zec:mainnet";
|
|
67
|
+
readonly GNOSIS: "eth:100";
|
|
68
|
+
readonly BERACHAIN: "eth:80094";
|
|
69
|
+
readonly TRON: "tron:mainnet";
|
|
70
|
+
readonly POLYGON: "eth:137";
|
|
71
|
+
readonly BSC: "eth:56";
|
|
72
|
+
readonly TON: "ton:mainnet";
|
|
73
|
+
readonly OPTIMISM: "eth:10";
|
|
74
|
+
readonly AVALANCHE: "eth:43114";
|
|
75
|
+
readonly SUI: "sui:mainnet";
|
|
76
|
+
readonly STELLAR: "stellar:mainnet";
|
|
77
|
+
readonly APTOS: "aptos:mainnet";
|
|
78
|
+
readonly CARDANO: "cardano:mainnet";
|
|
79
|
+
readonly LITECOIN: "ltc:mainnet";
|
|
80
|
+
readonly MONAD: "eth:143";
|
|
81
|
+
readonly LAYERX: "eth:196";
|
|
82
|
+
readonly STARKNET: "starknet:mainnet";
|
|
83
|
+
};
|
|
84
|
+
type BlockchainEnum = (typeof BlockchainEnum)[keyof typeof BlockchainEnum];
|
|
85
|
+
//#endregion
|
|
86
|
+
export { BlockchainEnum, PoaBridgeNetworkReference, VirtualNetworkReference };
|