@rhinestone/sdk 0.7.10 → 0.8.1
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/{src/accounts → accounts}/index.d.ts +2 -2
- package/dist/accounts/index.d.ts.map +1 -0
- package/dist/{src/accounts → accounts}/index.js +55 -45
- package/dist/accounts/nexus.d.ts.map +1 -0
- package/dist/{src/accounts → accounts}/nexus.js +48 -42
- package/dist/accounts/safe.d.ts.map +1 -0
- package/dist/{src/accounts → accounts}/safe.js +35 -29
- package/dist/accounts/utils.d.ts.map +1 -0
- package/dist/{src/accounts → accounts}/utils.js +23 -19
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/{src/execution → execution}/index.js +72 -61
- package/dist/execution/smart-session.d.ts.map +1 -0
- package/dist/execution/smart-session.js +85 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/{src/index.js → index.js} +10 -8
- package/dist/modules/abi/smart-sessions.d.ts.map +1 -0
- package/dist/modules/common.d.ts.map +1 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/omni-account.d.ts.map +1 -0
- package/dist/modules/validators/core.d.ts.map +1 -0
- package/dist/modules/validators/index.d.ts.map +1 -0
- package/dist/modules/validators/smart-sessions.d.ts.map +1 -0
- package/dist/orchestrator/client.d.ts.map +1 -0
- package/dist/{cjs/orchestrator → orchestrator}/consts.d.ts +2 -2
- package/dist/orchestrator/consts.d.ts.map +1 -0
- package/dist/{cjs/orchestrator → orchestrator}/consts.js +2 -2
- package/dist/orchestrator/error.d.ts.map +1 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/registry.d.ts.map +1 -0
- package/dist/{src/orchestrator → orchestrator}/types.d.ts +14 -15
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/utils.d.ts.map +1 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +13 -13
- package/dist/cjs/modules/abi/smart-sessions.d.ts.map +0 -1
- package/dist/cjs/modules/common.d.ts.map +0 -1
- package/dist/cjs/modules/index.d.ts.map +0 -1
- package/dist/cjs/modules/omni-account.d.ts.map +0 -1
- package/dist/cjs/modules/validators/core.d.ts.map +0 -1
- package/dist/cjs/modules/validators/index.d.ts.map +0 -1
- package/dist/cjs/modules/validators/smart-sessions.d.ts.map +0 -1
- package/dist/cjs/orchestrator/client.d.ts.map +0 -1
- package/dist/cjs/orchestrator/consts.d.ts.map +0 -1
- package/dist/cjs/orchestrator/error.d.ts.map +0 -1
- package/dist/cjs/orchestrator/index.d.ts.map +0 -1
- package/dist/cjs/orchestrator/registry.d.ts.map +0 -1
- package/dist/cjs/orchestrator/types.d.ts +0 -222
- package/dist/cjs/orchestrator/types.d.ts.map +0 -1
- package/dist/cjs/orchestrator/utils.d.ts.map +0 -1
- package/dist/cjs/types.d.ts.map +0 -1
- package/dist/src/accounts/index.d.ts.map +0 -1
- package/dist/src/accounts/nexus.d.ts.map +0 -1
- package/dist/src/accounts/safe.d.ts.map +0 -1
- package/dist/src/accounts/utils.d.ts.map +0 -1
- package/dist/src/execution/index.d.ts.map +0 -1
- package/dist/src/execution/smart-session.d.ts.map +0 -1
- package/dist/src/execution/smart-session.js +0 -81
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/modules/abi/smart-sessions.d.ts +0 -42
- package/dist/src/modules/abi/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/abi/smart-sessions.js +0 -128
- package/dist/src/modules/common.d.ts +0 -16
- package/dist/src/modules/common.d.ts.map +0 -1
- package/dist/src/modules/common.js +0 -5
- package/dist/src/modules/index.d.ts +0 -33
- package/dist/src/modules/index.d.ts.map +0 -1
- package/dist/src/modules/index.js +0 -146
- package/dist/src/modules/omni-account.d.ts +0 -9
- package/dist/src/modules/omni-account.d.ts.map +0 -1
- package/dist/src/modules/omni-account.js +0 -7
- package/dist/src/modules/validators/core.d.ts +0 -23
- package/dist/src/modules/validators/core.d.ts.map +0 -1
- package/dist/src/modules/validators/core.js +0 -112
- package/dist/src/modules/validators/index.d.ts +0 -4
- package/dist/src/modules/validators/index.d.ts.map +0 -1
- package/dist/src/modules/validators/index.js +0 -3
- package/dist/src/modules/validators/smart-sessions.d.ts +0 -29
- package/dist/src/modules/validators/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.js +0 -414
- package/dist/src/orchestrator/client.d.ts +0 -29
- package/dist/src/orchestrator/client.d.ts.map +0 -1
- package/dist/src/orchestrator/client.js +0 -243
- package/dist/src/orchestrator/consts.d.ts +0 -5
- package/dist/src/orchestrator/consts.d.ts.map +0 -1
- package/dist/src/orchestrator/consts.js +0 -4
- package/dist/src/orchestrator/error.d.ts +0 -18
- package/dist/src/orchestrator/error.d.ts.map +0 -1
- package/dist/src/orchestrator/error.js +0 -28
- package/dist/src/orchestrator/index.d.ts +0 -11
- package/dist/src/orchestrator/index.d.ts.map +0 -1
- package/dist/src/orchestrator/index.js +0 -10
- package/dist/src/orchestrator/registry.d.ts +0 -17
- package/dist/src/orchestrator/registry.d.ts.map +0 -1
- package/dist/src/orchestrator/registry.js +0 -344
- package/dist/src/orchestrator/types.d.ts.map +0 -1
- package/dist/src/orchestrator/types.js +0 -9
- package/dist/src/orchestrator/utils.d.ts +0 -29
- package/dist/src/orchestrator/utils.d.ts.map +0 -1
- package/dist/src/orchestrator/utils.js +0 -303
- package/dist/src/types.d.ts +0 -113
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -1
- package/dist/test/modules/validators/smart-sessions.test.d.ts +0 -2
- package/dist/test/modules/validators/smart-sessions.test.d.ts.map +0 -1
- package/dist/test/modules/validators/smart-sessions.test.js +0 -20
- /package/dist/{src/accounts → accounts}/nexus.d.ts +0 -0
- /package/dist/{src/accounts → accounts}/safe.d.ts +0 -0
- /package/dist/{src/accounts → accounts}/utils.d.ts +0 -0
- /package/dist/{src/execution → execution}/index.d.ts +0 -0
- /package/dist/{src/execution → execution}/smart-session.d.ts +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{cjs/modules → modules}/abi/smart-sessions.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/abi/smart-sessions.js +0 -0
- /package/dist/{cjs/modules → modules}/common.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/common.js +0 -0
- /package/dist/{cjs/modules → modules}/index.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/index.js +0 -0
- /package/dist/{cjs/modules → modules}/omni-account.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/omni-account.js +0 -0
- /package/dist/{cjs/modules → modules}/validators/core.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/validators/core.js +0 -0
- /package/dist/{cjs/modules → modules}/validators/index.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/validators/index.js +0 -0
- /package/dist/{cjs/modules → modules}/validators/smart-sessions.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/validators/smart-sessions.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/client.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/client.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/error.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/error.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/index.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/index.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/registry.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/registry.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/types.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/utils.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/utils.js +0 -0
- /package/dist/{cjs/types.d.ts → types.d.ts} +0 -0
- /package/dist/{cjs/types.js → types.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../orchestrator/consts.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,qBAAqB,wCAAwC,CAAA;AACnE,QAAA,MAAM,oBAAoB,4CAA4C,CAAA;AACtE,QAAA,MAAM,6BAA6B,+CACW,CAAA;AAE9C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,GAC9B,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const PROD_ORCHESTRATOR_URL = 'https://orchestrator.rhinestone.wtf';
|
|
2
|
-
const DEV_ORCHESTRATOR_URL = 'https://dev.orchestrator.rhinestone.wtf';
|
|
3
|
-
const RHINESTONE_SPOKE_POOL_ADDRESS = '0x000000000060f6e853447881951574cdd0663530';
|
|
4
|
-
export { PROD_ORCHESTRATOR_URL, DEV_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare class OrchestratorError extends Error {
|
|
2
|
-
private readonly _message;
|
|
3
|
-
private readonly _context;
|
|
4
|
-
private readonly _errorType;
|
|
5
|
-
private readonly _traceId;
|
|
6
|
-
constructor(params?: {
|
|
7
|
-
message?: string;
|
|
8
|
-
context?: any;
|
|
9
|
-
errorType?: string;
|
|
10
|
-
traceId?: string;
|
|
11
|
-
});
|
|
12
|
-
get message(): string;
|
|
13
|
-
get context(): any;
|
|
14
|
-
get errorType(): string;
|
|
15
|
-
get traceId(): string;
|
|
16
|
-
}
|
|
17
|
-
export declare function isOrchestratorError(error: Error): error is OrchestratorError;
|
|
18
|
-
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../orchestrator/error.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;IAQD,IAAI,OAAO,WAEV;IAED,IAAI,OAAO,QAEV;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO,WAEV;CACF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,iBAAiB,CAE5E"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export class OrchestratorError extends Error {
|
|
2
|
-
_message;
|
|
3
|
-
_context;
|
|
4
|
-
_errorType;
|
|
5
|
-
_traceId;
|
|
6
|
-
constructor(params) {
|
|
7
|
-
super();
|
|
8
|
-
this._message = params?.message || 'OrchestratorError ';
|
|
9
|
-
this._context = params?.context || {};
|
|
10
|
-
this._errorType = params?.errorType || 'Unknown';
|
|
11
|
-
this._traceId = params?.traceId || '';
|
|
12
|
-
}
|
|
13
|
-
get message() {
|
|
14
|
-
return this._message;
|
|
15
|
-
}
|
|
16
|
-
get context() {
|
|
17
|
-
return this._context;
|
|
18
|
-
}
|
|
19
|
-
get errorType() {
|
|
20
|
-
return this._errorType;
|
|
21
|
-
}
|
|
22
|
-
get traceId() {
|
|
23
|
-
return this._traceId;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export function isOrchestratorError(error) {
|
|
27
|
-
return error instanceof OrchestratorError;
|
|
28
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Orchestrator } from './client';
|
|
2
|
-
import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts';
|
|
3
|
-
import { isOrchestratorError, OrchestratorError } from './error';
|
|
4
|
-
import { getHookAddress, getRhinestoneSpokePoolAddress, getSameChainModuleAddress, getSupportedTokens, getTargetModuleAddress, getTokenAddress, getTokenBalanceSlot, getTokenRootBalanceSlot, getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry';
|
|
5
|
-
import type { BundleResult, Execution, MetaIntent, MultiChainCompact, OrderCost, OrderCostResult, OrderFeeInput, OrderPath, PostOrderBundleResult, SignedMultiChainCompact, UserTokenBalance } from './types';
|
|
6
|
-
import { BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_PENDING, BUNDLE_STATUS_PRECONFIRMED, BUNDLE_STATUS_UNKNOWN } from './types';
|
|
7
|
-
import { applyInjectedExecutions, BundleStatusEnum, getEmptyUserOp, getOrderBundleHash } from './utils';
|
|
8
|
-
declare function getOrchestrator(apiKey: string, orchestratorUrl?: string): Orchestrator;
|
|
9
|
-
export type { Execution, BundleResult, MetaIntent, MultiChainCompact, OrderPath, SignedMultiChainCompact, PostOrderBundleResult, OrderCost, OrderCostResult, OrderFeeInput, UserTokenBalance, };
|
|
10
|
-
export { BundleStatusEnum as BundleStatus, BUNDLE_STATUS_PENDING, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_PRECONFIRMED, BUNDLE_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, OrchestratorError, getOrchestrator, getOrderBundleHash, getEmptyUserOp, getWethAddress, getTokenBalanceSlot, getTokenRootBalanceSlot, getTokenSymbol, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getTokenAddress, getSupportedTokens, isOrchestratorError, isTokenAddressSupported, applyInjectedExecutions, };
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,EACL,cAAc,EACd,6BAA6B,EAC7B,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,uBAAuB,EACxB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,SAAS,EACT,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,iCAAiC,EACjC,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAEhB,iBAAS,eAAe,CACtB,MAAM,EAAE,MAAM,EACd,eAAe,CAAC,EAAE,MAAM,GACvB,YAAY,CAEd;AAED,YAAY,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,uBAAuB,EACvB,qBAAqB,EACrB,SAAS,EACT,eAAe,EACf,aAAa,EACb,gBAAgB,GACjB,CAAA;AACD,OAAO,EACL,gBAAgB,IAAI,YAAY,EAChC,qBAAqB,EACrB,qBAAqB,EACrB,iCAAiC,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,GACxB,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Orchestrator } from './client.js';
|
|
2
|
-
import { PROD_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS } from './consts.js';
|
|
3
|
-
import { isOrchestratorError, OrchestratorError } from './error.js';
|
|
4
|
-
import { getHookAddress, getRhinestoneSpokePoolAddress, getSameChainModuleAddress, getSupportedTokens, getTargetModuleAddress, getTokenAddress, getTokenBalanceSlot, getTokenRootBalanceSlot, getTokenSymbol, getWethAddress, isTokenAddressSupported, } from './registry.js';
|
|
5
|
-
import { BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_PENDING, BUNDLE_STATUS_PRECONFIRMED, BUNDLE_STATUS_UNKNOWN, } from './types.js';
|
|
6
|
-
import { applyInjectedExecutions, BundleStatusEnum, getEmptyUserOp, getOrderBundleHash, } from './utils.js';
|
|
7
|
-
function getOrchestrator(apiKey, orchestratorUrl) {
|
|
8
|
-
return new Orchestrator(orchestratorUrl ?? PROD_ORCHESTRATOR_URL, apiKey);
|
|
9
|
-
}
|
|
10
|
-
export { BundleStatusEnum as BundleStatus, BUNDLE_STATUS_PENDING, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_PRECONFIRMED, BUNDLE_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, OrchestratorError, getOrchestrator, getOrderBundleHash, getEmptyUserOp, getWethAddress, getTokenBalanceSlot, getTokenRootBalanceSlot, getTokenSymbol, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getTokenAddress, getSupportedTokens, isOrchestratorError, isTokenAddressSupported, applyInjectedExecutions, };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Address, type Chain, type Hex } from 'viem';
|
|
2
|
-
import { TokenConfig } from './types';
|
|
3
|
-
declare function getWethAddress(chain: Chain): "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" | "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14" | "0x4200000000000000000000000000000000000006" | "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" | "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73" | "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619" | "0x52eF3d68BaB452a294342DC3e5f464d7f610f72E";
|
|
4
|
-
declare function getTokenRootBalanceSlot(chain: Chain, tokenAddress: Address): bigint | null;
|
|
5
|
-
declare function getTokenBalanceSlot(tokenSymbol: string, chainId: number, accountAddress: Address): Hex;
|
|
6
|
-
declare function getHookAddress(_chainId?: number): Address;
|
|
7
|
-
declare function getSameChainModuleAddress(_chainId?: number): Address;
|
|
8
|
-
declare function getTargetModuleAddress(_chainId?: number): Address;
|
|
9
|
-
declare function getRhinestoneSpokePoolAddress(_chainId?: number): Address;
|
|
10
|
-
declare function getTokenSymbol(tokenAddress: Address, chainId: number): string;
|
|
11
|
-
declare function getTokenAddress(tokenSymbol: string, chainId: number): Address;
|
|
12
|
-
declare function getChainById(chainId: number): Chain | undefined;
|
|
13
|
-
declare function isTestnet(chainId: number): boolean;
|
|
14
|
-
declare function isTokenAddressSupported(address: Address, chainId: number): boolean;
|
|
15
|
-
declare function getSupportedTokens(chainId: number): TokenConfig[];
|
|
16
|
-
export { getTokenSymbol, getTokenAddress, getTokenRootBalanceSlot, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getChainById, getSupportedTokens, isTestnet, isTokenAddressSupported, };
|
|
17
|
-
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;AAcb,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,iBAAS,cAAc,CAAC,KAAK,EAAE,KAAK,0UAoCnC;AAwCD,iBAAS,uBAAuB,CAC9B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,OAAO,GACpB,MAAM,GAAG,IAAI,CAqJf;AAED,iBAAS,mBAAmB,CAC1B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,OAAO,GACtB,GAAG,CAgBL;AAED,iBAAS,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,iBAAS,yBAAyB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,iBAAS,sBAAsB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,iBAAS,6BAA6B,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED,iBAAS,cAAc,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAWtE;AAED,iBAAS,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAetE;AAED,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,qBAkBpC;AAED,iBAAS,SAAS,CAAC,OAAO,EAAE,MAAM,WAMjC;AAED,iBAAS,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAW3E;AAED,iBAAS,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,CAkB1D;AAkBD,OAAO,EACL,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,uBAAuB,GACxB,CAAA"}
|
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
import { encodeAbiParameters, keccak256, zeroAddress, } from 'viem';
|
|
2
|
-
import { arbitrum, arbitrumSepolia, base, baseSepolia, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, sepolia, } from 'viem/chains';
|
|
3
|
-
function getWethAddress(chain) {
|
|
4
|
-
switch (chain.id) {
|
|
5
|
-
case mainnet.id: {
|
|
6
|
-
return '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2';
|
|
7
|
-
}
|
|
8
|
-
case sepolia.id: {
|
|
9
|
-
return '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14';
|
|
10
|
-
}
|
|
11
|
-
case base.id: {
|
|
12
|
-
return '0x4200000000000000000000000000000000000006';
|
|
13
|
-
}
|
|
14
|
-
case baseSepolia.id: {
|
|
15
|
-
return '0x4200000000000000000000000000000000000006';
|
|
16
|
-
}
|
|
17
|
-
case arbitrum.id: {
|
|
18
|
-
return '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1';
|
|
19
|
-
}
|
|
20
|
-
case arbitrumSepolia.id: {
|
|
21
|
-
return '0x980B62Da83eFf3D4576C647993b0c1D7faf17c73';
|
|
22
|
-
}
|
|
23
|
-
case optimism.id: {
|
|
24
|
-
return '0x4200000000000000000000000000000000000006';
|
|
25
|
-
}
|
|
26
|
-
case optimismSepolia.id: {
|
|
27
|
-
return '0x4200000000000000000000000000000000000006';
|
|
28
|
-
}
|
|
29
|
-
case polygon.id: {
|
|
30
|
-
return '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619';
|
|
31
|
-
}
|
|
32
|
-
case polygonAmoy.id: {
|
|
33
|
-
return '0x52eF3d68BaB452a294342DC3e5f464d7f610f72E';
|
|
34
|
-
}
|
|
35
|
-
default: {
|
|
36
|
-
throw new Error(`Unsupported chain ${chain.id}`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function getUsdcAddress(chain) {
|
|
41
|
-
switch (chain.id) {
|
|
42
|
-
case mainnet.id: {
|
|
43
|
-
return '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48';
|
|
44
|
-
}
|
|
45
|
-
case sepolia.id: {
|
|
46
|
-
return '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238';
|
|
47
|
-
}
|
|
48
|
-
case base.id: {
|
|
49
|
-
return '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
|
|
50
|
-
}
|
|
51
|
-
case baseSepolia.id: {
|
|
52
|
-
return '0x036CbD53842c5426634e7929541eC2318f3dCF7e';
|
|
53
|
-
}
|
|
54
|
-
case arbitrum.id: {
|
|
55
|
-
return '0xaf88d065e77c8cC2239327C5EDb3A432268e5831';
|
|
56
|
-
}
|
|
57
|
-
case arbitrumSepolia.id: {
|
|
58
|
-
return '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d';
|
|
59
|
-
}
|
|
60
|
-
case optimism.id: {
|
|
61
|
-
return '0x0b2c639c533813f4aa9d7837caf62653d097ff85';
|
|
62
|
-
}
|
|
63
|
-
case optimismSepolia.id: {
|
|
64
|
-
return '0x5fd84259d66Cd46123540766Be93DFE6D43130D7';
|
|
65
|
-
}
|
|
66
|
-
case polygon.id: {
|
|
67
|
-
return '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359';
|
|
68
|
-
}
|
|
69
|
-
case polygonAmoy.id: {
|
|
70
|
-
return '0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582';
|
|
71
|
-
}
|
|
72
|
-
default: {
|
|
73
|
-
throw new Error(`Unsupported chain ${chain.id}`);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function getTokenRootBalanceSlot(chain, tokenAddress) {
|
|
78
|
-
switch (chain.id) {
|
|
79
|
-
case mainnet.id: {
|
|
80
|
-
// ETH
|
|
81
|
-
if (tokenAddress === zeroAddress) {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
// USDC
|
|
85
|
-
if (tokenAddress === '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') {
|
|
86
|
-
return 9n;
|
|
87
|
-
}
|
|
88
|
-
// WETH
|
|
89
|
-
if (tokenAddress === '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2') {
|
|
90
|
-
return 3n;
|
|
91
|
-
}
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
case sepolia.id: {
|
|
95
|
-
// ETH
|
|
96
|
-
if (tokenAddress === zeroAddress) {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
// USDC
|
|
100
|
-
if (tokenAddress === '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238') {
|
|
101
|
-
return 9n;
|
|
102
|
-
}
|
|
103
|
-
// WETH
|
|
104
|
-
if (tokenAddress === '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14') {
|
|
105
|
-
return 3n;
|
|
106
|
-
}
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
case base.id: {
|
|
110
|
-
// ETH
|
|
111
|
-
if (tokenAddress === zeroAddress) {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
// USDC
|
|
115
|
-
if (tokenAddress === '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913') {
|
|
116
|
-
return 9n;
|
|
117
|
-
}
|
|
118
|
-
// WETH
|
|
119
|
-
if (tokenAddress === '0x4200000000000000000000000000000000000006') {
|
|
120
|
-
return 3n;
|
|
121
|
-
}
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
case baseSepolia.id: {
|
|
125
|
-
// ETH
|
|
126
|
-
if (tokenAddress === zeroAddress) {
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
// USDC
|
|
130
|
-
if (tokenAddress === '0x036CbD53842c5426634e7929541eC2318f3dCF7e') {
|
|
131
|
-
return 9n;
|
|
132
|
-
}
|
|
133
|
-
// WETH
|
|
134
|
-
if (tokenAddress === '0x4200000000000000000000000000000000000006') {
|
|
135
|
-
return 3n;
|
|
136
|
-
}
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
case arbitrum.id: {
|
|
140
|
-
// ETH
|
|
141
|
-
if (tokenAddress === zeroAddress) {
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
// USDC
|
|
145
|
-
if (tokenAddress === '0xaf88d065e77c8cC2239327C5EDb3A432268e5831') {
|
|
146
|
-
return 9n;
|
|
147
|
-
}
|
|
148
|
-
// WETH
|
|
149
|
-
if (tokenAddress === '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1') {
|
|
150
|
-
return 51n;
|
|
151
|
-
}
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
case arbitrumSepolia.id: {
|
|
155
|
-
// ETH
|
|
156
|
-
if (tokenAddress === zeroAddress) {
|
|
157
|
-
return null;
|
|
158
|
-
}
|
|
159
|
-
// USDC
|
|
160
|
-
if (tokenAddress === '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d') {
|
|
161
|
-
return 9n;
|
|
162
|
-
}
|
|
163
|
-
// WETH
|
|
164
|
-
if (tokenAddress === '0x980B62Da83eFf3D4576C647993b0c1D7faf17c73') {
|
|
165
|
-
return 51n;
|
|
166
|
-
}
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
case optimism.id: {
|
|
170
|
-
// ETH
|
|
171
|
-
if (tokenAddress === zeroAddress) {
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
// USDC
|
|
175
|
-
if (tokenAddress === '0x0b2c639c533813f4aa9d7837caf62653d097ff85') {
|
|
176
|
-
return 9n;
|
|
177
|
-
}
|
|
178
|
-
// WETH
|
|
179
|
-
if (tokenAddress === '0x4200000000000000000000000000000000000006') {
|
|
180
|
-
return 3n;
|
|
181
|
-
}
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
case optimismSepolia.id: {
|
|
185
|
-
// ETH
|
|
186
|
-
if (tokenAddress === zeroAddress) {
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
189
|
-
// USDC
|
|
190
|
-
if (tokenAddress === '0x5fd84259d66Cd46123540766Be93DFE6D43130D7') {
|
|
191
|
-
return 9n;
|
|
192
|
-
}
|
|
193
|
-
// WETH
|
|
194
|
-
if (tokenAddress === '0x4200000000000000000000000000000000000006') {
|
|
195
|
-
return 3n;
|
|
196
|
-
}
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
case polygon.id: {
|
|
200
|
-
// USDC
|
|
201
|
-
if (tokenAddress === '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359') {
|
|
202
|
-
return 9n;
|
|
203
|
-
}
|
|
204
|
-
// WETH
|
|
205
|
-
if (tokenAddress === '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619') {
|
|
206
|
-
return 3n;
|
|
207
|
-
}
|
|
208
|
-
break;
|
|
209
|
-
}
|
|
210
|
-
case polygonAmoy.id: {
|
|
211
|
-
// USDC
|
|
212
|
-
if (tokenAddress === '0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582') {
|
|
213
|
-
return 9n;
|
|
214
|
-
}
|
|
215
|
-
// WETH
|
|
216
|
-
if (tokenAddress === '0x52eF3d68BaB452a294342DC3e5f464d7f610f72E') {
|
|
217
|
-
return 3n;
|
|
218
|
-
}
|
|
219
|
-
break;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
throw new Error(`Unsupported token address ${tokenAddress} for chain ${chain.id}`);
|
|
223
|
-
}
|
|
224
|
-
function getTokenBalanceSlot(tokenSymbol, chainId, accountAddress) {
|
|
225
|
-
const tokenAddress = getTokenAddress(tokenSymbol, chainId);
|
|
226
|
-
const chain = getChainById(chainId);
|
|
227
|
-
if (!chain) {
|
|
228
|
-
throw new Error(`Unsupported chain: ${chainId}`);
|
|
229
|
-
}
|
|
230
|
-
const rootBalanceSlot = getTokenRootBalanceSlot(chain, tokenAddress);
|
|
231
|
-
const balanceSlot = rootBalanceSlot
|
|
232
|
-
? keccak256(encodeAbiParameters([{ type: 'address' }, { type: 'uint256' }], [accountAddress, rootBalanceSlot]))
|
|
233
|
-
: '0x';
|
|
234
|
-
return balanceSlot;
|
|
235
|
-
}
|
|
236
|
-
function getHookAddress(_chainId) {
|
|
237
|
-
return '0x0000000000f6Ed8Be424d673c63eeFF8b9267420';
|
|
238
|
-
}
|
|
239
|
-
function getSameChainModuleAddress(_chainId) {
|
|
240
|
-
return '0x000000000043ff16d5776c7F0f65Ec485C17Ca04';
|
|
241
|
-
}
|
|
242
|
-
function getTargetModuleAddress(_chainId) {
|
|
243
|
-
return '0x0000000000E5a37279A001301A837a91b5de1D5E';
|
|
244
|
-
}
|
|
245
|
-
function getRhinestoneSpokePoolAddress(_chainId) {
|
|
246
|
-
return '0x000000000060f6e853447881951574CDd0663530';
|
|
247
|
-
}
|
|
248
|
-
function getTokenSymbol(tokenAddress, chainId) {
|
|
249
|
-
const knownSymbols = getKnownSymbols();
|
|
250
|
-
for (const symbol of knownSymbols) {
|
|
251
|
-
const address = getTokenAddress(symbol, chainId);
|
|
252
|
-
if (address.toLowerCase() === tokenAddress.toLowerCase()) {
|
|
253
|
-
return symbol;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
throw new Error(`Unsupported token address ${tokenAddress} for chain ${chainId}`);
|
|
257
|
-
}
|
|
258
|
-
function getTokenAddress(tokenSymbol, chainId) {
|
|
259
|
-
if (tokenSymbol === 'ETH') {
|
|
260
|
-
return zeroAddress;
|
|
261
|
-
}
|
|
262
|
-
const chain = getChainById(chainId);
|
|
263
|
-
if (!chain) {
|
|
264
|
-
throw new Error(`Unsupported chain ${chainId}`);
|
|
265
|
-
}
|
|
266
|
-
if (tokenSymbol === 'WETH') {
|
|
267
|
-
return getWethAddress(chain);
|
|
268
|
-
}
|
|
269
|
-
if (tokenSymbol === 'USDC') {
|
|
270
|
-
return getUsdcAddress(chain);
|
|
271
|
-
}
|
|
272
|
-
throw new Error(`Unsupported token symbol ${tokenSymbol}`);
|
|
273
|
-
}
|
|
274
|
-
function getChainById(chainId) {
|
|
275
|
-
const supportedChains = [
|
|
276
|
-
mainnet,
|
|
277
|
-
sepolia,
|
|
278
|
-
base,
|
|
279
|
-
baseSepolia,
|
|
280
|
-
arbitrum,
|
|
281
|
-
arbitrumSepolia,
|
|
282
|
-
optimism,
|
|
283
|
-
optimismSepolia,
|
|
284
|
-
polygon,
|
|
285
|
-
polygonAmoy,
|
|
286
|
-
];
|
|
287
|
-
for (const chain of supportedChains) {
|
|
288
|
-
if (chain.id === chainId) {
|
|
289
|
-
return chain;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
function isTestnet(chainId) {
|
|
294
|
-
const chain = getChainById(chainId);
|
|
295
|
-
if (!chain) {
|
|
296
|
-
throw new Error(`Chain not supported: ${chainId}`);
|
|
297
|
-
}
|
|
298
|
-
return chain.testnet ?? false;
|
|
299
|
-
}
|
|
300
|
-
function isTokenAddressSupported(address, chainId) {
|
|
301
|
-
const chain = getChainById(chainId);
|
|
302
|
-
if (!chain) {
|
|
303
|
-
throw new Error(`Chain not supported: ${chainId}`);
|
|
304
|
-
}
|
|
305
|
-
try {
|
|
306
|
-
getTokenSymbol(address, chainId);
|
|
307
|
-
return true;
|
|
308
|
-
}
|
|
309
|
-
catch {
|
|
310
|
-
return false;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
function getSupportedTokens(chainId) {
|
|
314
|
-
const chain = getChainById(chainId);
|
|
315
|
-
if (!chain) {
|
|
316
|
-
throw new Error(`Chain not supported: ${chainId}`);
|
|
317
|
-
}
|
|
318
|
-
const knownSymbols = getKnownSymbols();
|
|
319
|
-
return knownSymbols.map((symbol) => {
|
|
320
|
-
const decimals = getTokenDecimals(symbol);
|
|
321
|
-
const address = getTokenAddress(symbol, chainId);
|
|
322
|
-
return {
|
|
323
|
-
symbol,
|
|
324
|
-
address,
|
|
325
|
-
decimals,
|
|
326
|
-
balanceSlot: (accountAddress) => getTokenBalanceSlot(symbol, chainId, accountAddress),
|
|
327
|
-
};
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
function getKnownSymbols() {
|
|
331
|
-
return ['ETH', 'WETH', 'USDC'];
|
|
332
|
-
}
|
|
333
|
-
function getTokenDecimals(symbol) {
|
|
334
|
-
switch (symbol) {
|
|
335
|
-
case 'ETH':
|
|
336
|
-
case 'WETH':
|
|
337
|
-
return 18;
|
|
338
|
-
case 'USDC':
|
|
339
|
-
return 6;
|
|
340
|
-
default:
|
|
341
|
-
throw new Error(`Symbol not supported: ${symbol}`);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
export { getTokenSymbol, getTokenAddress, getTokenRootBalanceSlot, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getChainById, getSupportedTokens, isTestnet, isTokenAddressSupported, };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../orchestrator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,IAAI,EACJ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ARTIALLY_COMPLETED';
|
|
5
|
-
const BUNDLE_STATUS_COMPLETED = 'COMPLETED';
|
|
6
|
-
const BUNDLE_STATUS_FILLED = 'FILLED';
|
|
7
|
-
const BUNDLE_STATUS_PRECONFIRMED = 'PRECONFIRMED';
|
|
8
|
-
const BUNDLE_STATUS_UNKNOWN = 'UNKNOWN';
|
|
9
|
-
export { BUNDLE_STATUS_PENDING, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_PRECONFIRMED, BUNDLE_STATUS_UNKNOWN, };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type Hex } from 'viem';
|
|
2
|
-
import type { UserOperation } from 'viem/account-abstraction';
|
|
3
|
-
import { type BundleEvent, type Execution, type InsufficientBalanceResult, type MultiChainCompact, type OrderCost, type OrderCostResult, type UserChainBalances } from './types';
|
|
4
|
-
declare enum BundleStatusEnum {
|
|
5
|
-
PENDING = "PENDING",
|
|
6
|
-
EXPIRED = "EXPIRED",
|
|
7
|
-
PARTIALLY_COMPLETED = "PARTIALLY_COMPLETED",
|
|
8
|
-
PRECONFIRMED = "PRECONFIRMED",
|
|
9
|
-
COMPLETED = "COMPLETED",
|
|
10
|
-
FILLED = "FILLED",
|
|
11
|
-
FAILED = "FAILED",
|
|
12
|
-
UNKNOWN = "UNKNOWN"
|
|
13
|
-
}
|
|
14
|
-
declare function getEmptyUserOp(): UserOperation<'0.7'>;
|
|
15
|
-
declare function getOrderBundleHash(orderBundle: MultiChainCompact): Hex;
|
|
16
|
-
declare function convertBigIntFields(obj: any): any;
|
|
17
|
-
declare function parseCompactResponse(response: any): MultiChainCompact;
|
|
18
|
-
declare function parseUseChainBalances(response: any): UserChainBalances;
|
|
19
|
-
declare function parseOrderCost(response: any): OrderCost;
|
|
20
|
-
declare function parseInsufficientBalanceResult(response: any): InsufficientBalanceResult;
|
|
21
|
-
declare function parseOrderCostResult(response: any): OrderCostResult;
|
|
22
|
-
declare function parsePendingBundleEvent(response: any): BundleEvent;
|
|
23
|
-
declare function hashMultichainCompactWithoutDomainSeparator(multiChainCompact: MultiChainCompact): Hex;
|
|
24
|
-
declare function applyInjectedExecutions(orderPath: {
|
|
25
|
-
orderBundle: MultiChainCompact;
|
|
26
|
-
injectedExecutions: Execution[];
|
|
27
|
-
}): MultiChainCompact;
|
|
28
|
-
export { BundleStatusEnum, getEmptyUserOp, getOrderBundleHash, convertBigIntFields, parseCompactResponse, parsePendingBundleEvent, hashMultichainCompactWithoutDomainSeparator, parseUseChainBalances, parseOrderCost, parseInsufficientBalanceResult, parseOrderCostResult, applyInjectedExecutions, };
|
|
29
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../orchestrator/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,GAAG,EAIT,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAI7D,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,eAAe,EAIpB,KAAK,iBAAiB,EAEvB,MAAM,SAAS,CAAA;AAWhB,aAAK,gBAAgB;IACnB,OAAO,YAAwB;IAC/B,OAAO,YAAwB;IAC/B,mBAAmB,wBAAoC;IACvD,YAAY,iBAA6B;IACzC,SAAS,cAA0B;IACnC,MAAM,WAAuB;IAC7B,MAAM,WAAuB;IAC7B,OAAO,YAAwB;CAChC;AAED,iBAAS,cAAc,IAAI,aAAa,CAAC,KAAK,CAAC,CAY9C;AAED,iBAAS,kBAAkB,CAAC,WAAW,EAAE,iBAAiB,GAAG,GAAG,CAM/D;AAED,iBAAS,mBAAmB,CAAC,GAAG,EAAE,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