@rhinestone/sdk 2.0.0-beta.1 → 2.0.0-beta.10
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/README.md +42 -1
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +6 -34
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +3 -3
- package/dist/src/execution/error.d.ts +2 -2
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +3 -3
- package/dist/src/execution/index.d.ts +9 -9
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +18 -32
- package/dist/src/execution/utils.d.ts +11 -9
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +94 -29
- package/dist/src/index.d.ts +17 -12
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -39
- package/dist/src/modules/index.d.ts +2 -2
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +2 -2
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +2 -4
- package/dist/src/modules/validators/index.d.ts +2 -2
- package/dist/src/modules/validators/index.d.ts.map +1 -1
- package/dist/src/modules/validators/index.js +2 -2
- package/dist/src/modules/validators/permissions.d.ts +5 -0
- package/dist/src/modules/validators/permissions.d.ts.map +1 -0
- package/dist/src/modules/validators/permissions.js +111 -0
- package/dist/src/modules/validators/policies/claim/permit2.d.ts +29 -3
- package/dist/src/modules/validators/policies/claim/permit2.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.d.ts +14 -27
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +71 -17
- package/dist/src/orchestrator/caip2.d.ts +9 -3
- package/dist/src/orchestrator/caip2.d.ts.map +1 -1
- package/dist/src/orchestrator/caip2.js +40 -5
- package/dist/src/orchestrator/client.d.ts +2 -1
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +41 -18
- package/dist/src/orchestrator/consts.d.ts +1 -1
- package/dist/src/orchestrator/consts.d.ts.map +1 -1
- package/dist/src/orchestrator/consts.js +1 -1
- package/dist/src/orchestrator/destinations.d.ts +23 -0
- package/dist/src/orchestrator/destinations.d.ts.map +1 -0
- package/dist/src/orchestrator/destinations.js +36 -0
- package/dist/src/orchestrator/index.d.ts +5 -4
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +3 -2
- package/dist/src/orchestrator/registry.d.ts +3 -9
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +11 -26
- package/dist/src/orchestrator/types.d.ts +47 -15
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/types.d.ts +124 -33
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts +2 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +2 -1
- package/dist/src/utils/walletClient.d.ts.map +1 -0
- package/dist/src/{accounts → utils}/walletClient.js +1 -1
- package/package.json +2 -6
- package/dist/src/accounts/passport.d.ts +0 -9
- package/dist/src/accounts/passport.d.ts.map +0 -1
- package/dist/src/accounts/passport.js +0 -78
- package/dist/src/accounts/walletClient.d.ts.map +0 -1
- package/dist/src/actions/compact.d.ts +0 -15
- package/dist/src/actions/compact.d.ts.map +0 -1
- package/dist/src/actions/compact.js +0 -200
- package/dist/src/actions/deployment.d.ts +0 -19
- package/dist/src/actions/deployment.d.ts.map +0 -1
- package/dist/src/actions/deployment.js +0 -76
- package/dist/src/execution/permit2.d.ts +0 -7
- package/dist/src/execution/permit2.d.ts.map +0 -1
- package/dist/src/execution/permit2.js +0 -51
- /package/dist/src/{accounts → utils}/walletClient.d.ts +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Chain } from 'viem';
|
|
2
|
+
import type { Caip2ChainId } from './caip2.js';
|
|
3
|
+
interface NativeCurrency {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly symbol: string;
|
|
6
|
+
readonly decimals: number;
|
|
7
|
+
}
|
|
8
|
+
type NonEvmAddress = string;
|
|
9
|
+
interface NonEvmChain {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly caip2: Caip2ChainId;
|
|
12
|
+
readonly kind: 'svm' | 'tvm';
|
|
13
|
+
readonly nativeCurrency: NativeCurrency;
|
|
14
|
+
readonly testnet?: boolean;
|
|
15
|
+
}
|
|
16
|
+
type DestinationChain = Chain | NonEvmChain;
|
|
17
|
+
declare const solanaMainnet: NonEvmChain;
|
|
18
|
+
declare const tronMainnet: NonEvmChain;
|
|
19
|
+
declare function isNonEvmChain(chain: DestinationChain): chain is NonEvmChain;
|
|
20
|
+
declare function getChainId(chain: DestinationChain): number;
|
|
21
|
+
export type { DestinationChain, NativeCurrency, NonEvmAddress, NonEvmChain };
|
|
22
|
+
export { getChainId, isNonEvmChain, solanaMainnet, tronMainnet };
|
|
23
|
+
//# sourceMappingURL=destinations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"destinations.d.ts","sourceRoot":"","sources":["../../../orchestrator/destinations.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C,UAAU,cAAc;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAMD,KAAK,aAAa,GAAG,MAAM,CAAA;AAE3B,UAAU,WAAW;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;IAC5B,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAAA;IAC5B,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,KAAK,gBAAgB,GAAG,KAAK,GAAG,WAAW,CAAA;AAE3C,QAAA,MAAM,aAAa,EAAE,WAKpB,CAAA;AAED,QAAA,MAAM,WAAW,EAAE,WAKlB,CAAA;AAED,iBAAS,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,KAAK,IAAI,WAAW,CAEpE;AAKD,iBAAS,UAAU,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAEnD;AAED,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Public non-EVM destination chain descriptors. Mirrors the minimal shape
|
|
2
|
+
// of viem's `Chain` (name, nativeCurrency) so callers can pass them
|
|
3
|
+
// anywhere a destination chain is expected — `targetChain: solanaMainnet`
|
|
4
|
+
// reads the same as `targetChain: optimism`.
|
|
5
|
+
//
|
|
6
|
+
// The `kind` field discriminates these from viem `Chain` objects; viem
|
|
7
|
+
// chains don't carry a `kind` field, so the `isNonEvmChain` helper
|
|
8
|
+
// narrows a `Chain | NonEvmChain` union structurally.
|
|
9
|
+
//
|
|
10
|
+
// The wire format is the CAIP-2 string. Internally the SDK and the
|
|
11
|
+
// orchestrator also use a synthetic numeric chain id derived from the
|
|
12
|
+
// CAIP-2 mapping, but it is non-standard and intentionally not exposed
|
|
13
|
+
// on this type — use `getChainId` if you need a numeric id.
|
|
14
|
+
import { fromCaip2 } from './caip2.js';
|
|
15
|
+
const solanaMainnet = {
|
|
16
|
+
name: 'Solana',
|
|
17
|
+
caip2: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
|
|
18
|
+
kind: 'svm',
|
|
19
|
+
nativeCurrency: { name: 'Solana', symbol: 'SOL', decimals: 9 },
|
|
20
|
+
};
|
|
21
|
+
const tronMainnet = {
|
|
22
|
+
name: 'Tron',
|
|
23
|
+
caip2: 'tron:0x2b6653dc',
|
|
24
|
+
kind: 'tvm',
|
|
25
|
+
nativeCurrency: { name: 'Tron', symbol: 'TRX', decimals: 6 },
|
|
26
|
+
};
|
|
27
|
+
function isNonEvmChain(chain) {
|
|
28
|
+
return 'kind' in chain && (chain.kind === 'svm' || chain.kind === 'tvm');
|
|
29
|
+
}
|
|
30
|
+
// Numeric chain id for either chain kind. EVM uses viem's `id`; non-EVM
|
|
31
|
+
// derives the synthetic id from the CAIP-2 string. Used for the wire
|
|
32
|
+
// format and for SDK-internal lookups keyed by chain id.
|
|
33
|
+
function getChainId(chain) {
|
|
34
|
+
return isNonEvmChain(chain) ? fromCaip2(chain.caip2) : chain.id;
|
|
35
|
+
}
|
|
36
|
+
export { getChainId, isNonEvmChain, solanaMainnet, tronMainnet };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { AuthProvider } from '../auth/provider.js';
|
|
2
2
|
import { Orchestrator } from './client.js';
|
|
3
3
|
import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts.js';
|
|
4
|
+
import { type DestinationChain, isNonEvmChain, type NonEvmAddress, type NonEvmChain, solanaMainnet, tronMainnet } from './destinations.js';
|
|
4
5
|
import { ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isValidationError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, UnsupportedChainError, UnsupportedTokenError, ValidationError } from './error.js';
|
|
5
|
-
import {
|
|
6
|
-
import type { ApprovalRequired, AuxiliaryFunds, Cost, CostTokenEntry, EstimatedFillTime, Execution, FeeBreakdown, Fees,
|
|
6
|
+
import { getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry.js';
|
|
7
|
+
import type { ApprovalRequired, AuxiliaryFunds, BridgeFill, Cost, CostTokenEntry, EstimatedFillTime, Execution, FeeBreakdown, Fees, FillTransactionHash, IntentInput, IntentOpStatus, IntentOptions, IntentSubmitRequest, IntentSubmitResponse, Portfolio, Price, Quote, QuoteResponse, SettlementLayer, SettlementLayerFilter, SignatureMode, SignData, SignedAuthorization, SplitIntentsInput, SplitIntentsResult, SponsorSettings, SupportedChain, TokenConfig, TokenRequirements, TypedDataDefinition, UsdAmount, WrapRequired } from './types.js';
|
|
7
8
|
import { INTENT_STATUS_CLAIMED, INTENT_STATUS_COMPLETED, INTENT_STATUS_EXPIRED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED, INTENT_STATUS_PENDING, INTENT_STATUS_PRECONFIRMED } from './types.js';
|
|
8
9
|
declare function getOrchestrator(authProvider: AuthProvider, orchestratorUrl?: string, headers?: Record<string, string>): Orchestrator;
|
|
9
|
-
export type { ApprovalRequired, AuxiliaryFunds, Cost, CostTokenEntry, EstimatedFillTime, Execution, FeeBreakdown, Fees,
|
|
10
|
-
export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_CLAIMED, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, UnsupportedChainError, UnsupportedTokenError, ValidationError, getOrchestrator, getWethAddress, getTokenSymbol,
|
|
10
|
+
export type { ApprovalRequired, AuxiliaryFunds, BridgeFill, Cost, CostTokenEntry, DestinationChain, NonEvmAddress, NonEvmChain, EstimatedFillTime, Execution, FeeBreakdown, Fees, FillTransactionHash, IntentInput, IntentOpStatus, IntentOptions, IntentSubmitRequest, IntentSubmitResponse, Portfolio, Price, Quote, QuoteResponse, SettlementLayer, SettlementLayerFilter, SignatureMode, SignData, SignedAuthorization, SplitIntentsInput, SplitIntentsResult, SponsorSettings, SupportedChain, TokenConfig, TokenRequirements, TypedDataDefinition, UsdAmount, WrapRequired, };
|
|
11
|
+
export { isNonEvmChain, solanaMainnet, tronMainnet, INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_CLAIMED, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, UnsupportedChainError, UnsupportedTokenError, ValidationError, getOrchestrator, getWethAddress, getTokenSymbol, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isTokenAddressSupported, };
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,cAAc,EACd,0BAA0B,EAC1B,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EAChB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EACL,KAAK,gBAAgB,EACrB,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,aAAa,EACb,WAAW,EACZ,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,cAAc,EACd,0BAA0B,EAC1B,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EAChB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,cAAc,EACd,cAAc,EACd,uBAAuB,EACxB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,IAAI,EACJ,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,IAAI,EACJ,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,KAAK,EACL,KAAK,EACL,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf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AAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,uBAAuB,GACxB,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Orchestrator } from './client.js';
|
|
2
2
|
import { PROD_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS } from './consts.js';
|
|
3
|
+
import { isNonEvmChain, solanaMainnet, tronMainnet, } from './destinations.js';
|
|
3
4
|
import { ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isValidationError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, UnsupportedChainError, UnsupportedTokenError, ValidationError, } from './error.js';
|
|
4
|
-
import {
|
|
5
|
+
import { getTokenSymbol, getWethAddress, isTokenAddressSupported, } from './registry.js';
|
|
5
6
|
import { INTENT_STATUS_CLAIMED, INTENT_STATUS_COMPLETED, INTENT_STATUS_EXPIRED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED, INTENT_STATUS_PENDING, INTENT_STATUS_PRECONFIRMED, } from './types.js';
|
|
6
7
|
function getOrchestrator(authProvider, orchestratorUrl, headers) {
|
|
7
8
|
return new Orchestrator(orchestratorUrl ?? PROD_ORCHESTRATOR_URL, authProvider, headers);
|
|
8
9
|
}
|
|
9
|
-
export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_CLAIMED, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, UnsupportedChainError, UnsupportedTokenError, ValidationError, getOrchestrator, getWethAddress, getTokenSymbol,
|
|
10
|
+
export { isNonEvmChain, solanaMainnet, tronMainnet, INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_CLAIMED, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, UnsupportedChainError, UnsupportedTokenError, ValidationError, getOrchestrator, getWethAddress, getTokenSymbol, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isTokenAddressSupported, };
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { type Address, type Chain } from 'viem';
|
|
2
2
|
import type { TokenSymbol } from '../types.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { NonEvmAddress } from './destinations.js';
|
|
4
4
|
declare function getSupportedChainIds(): number[];
|
|
5
5
|
declare function getWethAddress(chain: Chain): Address;
|
|
6
6
|
declare function getWrappedTokenAddress(chain: Chain): Address;
|
|
7
7
|
declare function getTokenSymbol(tokenAddress: Address, chainId: number): string | undefined;
|
|
8
8
|
declare function getTokenAddress(tokenSymbol: TokenSymbol, chainId: number): Address;
|
|
9
|
-
declare function getTokenDecimals(tokenSymbol: TokenSymbol, chainId: number): number;
|
|
10
9
|
declare function getChainById(chainId: number): Chain;
|
|
11
10
|
declare function isTestnet(chainId: number): boolean;
|
|
12
11
|
declare function isTokenAddressSupported(address: Address, chainId: number): boolean;
|
|
13
|
-
declare function getSupportedTokens(chainId: number): TokenConfig[];
|
|
14
12
|
declare function getDefaultAccountAccessList(onTestnets?: boolean): {
|
|
15
13
|
chainIds: number[];
|
|
16
14
|
};
|
|
17
|
-
declare function resolveTokenAddress(token: TokenSymbol | Address, chainId: number): Address;
|
|
18
|
-
|
|
19
|
-
chainId: number;
|
|
20
|
-
tokens: TokenConfig[];
|
|
21
|
-
}[];
|
|
22
|
-
export { getTokenSymbol, getTokenAddress, getTokenDecimals, getWethAddress, getWrappedTokenAddress, getChainById, getSupportedTokens, getSupportedChainIds, isTestnet, isTokenAddressSupported, getDefaultAccountAccessList, resolveTokenAddress, getAllSupportedChainsAndTokens, };
|
|
15
|
+
declare function resolveTokenAddress(token: TokenSymbol | Address | NonEvmAddress, chainId: number): Address | NonEvmAddress;
|
|
16
|
+
export { getTokenSymbol, getTokenAddress, getWethAddress, getWrappedTokenAddress, getChainById, getSupportedChainIds, isTestnet, isTokenAddressSupported, getDefaultAccountAccessList, resolveTokenAddress, };
|
|
23
17
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAa,MAAM,MAAM,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAa,MAAM,MAAM,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAGnD,iBAAS,oBAAoB,IAAI,MAAM,EAAE,CAExC;AAMD,iBAAS,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAY7C;AAED,iBAAS,sBAAsB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAarD;AAED,iBAAS,cAAc,CACrB,YAAY,EAAE,OAAO,EACrB,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAWpB;AAED,iBAAS,eAAe,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAY3E;AAED,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAM5C;AAED,iBAAS,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG3C;AAED,iBAAS,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAS3E;AAED,iBAAS,2BAA2B,CAAC,UAAU,CAAC,EAAE,OAAO;;EAaxD;AAED,iBAAS,mBAAmB,CAC1B,KAAK,EAAE,WAAW,GAAG,OAAO,GAAG,aAAa,EAC5C,OAAO,EAAE,MAAM,GACd,OAAO,GAAG,aAAa,CAczB;AAED,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,uBAAuB,EACvB,2BAA2B,EAC3B,mBAAmB,GACpB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { chainRegistry, chains, } from '@rhinestone/shared-configs';
|
|
2
2
|
import { isAddress } from 'viem';
|
|
3
|
+
import { isNonEvmChainId } from './caip2.js';
|
|
3
4
|
import { UnsupportedChainError, UnsupportedTokenError } from './error.js';
|
|
4
5
|
function getSupportedChainIds() {
|
|
5
6
|
return chains.map((chain) => chain.id);
|
|
@@ -49,17 +50,6 @@ function getTokenAddress(tokenSymbol, chainId) {
|
|
|
49
50
|
}
|
|
50
51
|
return token.address;
|
|
51
52
|
}
|
|
52
|
-
function getTokenDecimals(tokenSymbol, chainId) {
|
|
53
|
-
const chainEntry = getChainEntry(chainId);
|
|
54
|
-
if (!chainEntry) {
|
|
55
|
-
throw new UnsupportedChainError(chainId);
|
|
56
|
-
}
|
|
57
|
-
const token = chainEntry.tokens.find((t) => t.symbol === tokenSymbol);
|
|
58
|
-
if (!token) {
|
|
59
|
-
throw new UnsupportedTokenError(tokenSymbol, chainId);
|
|
60
|
-
}
|
|
61
|
-
return token.decimals;
|
|
62
|
-
}
|
|
63
53
|
function getChainById(chainId) {
|
|
64
54
|
const chain = chains.find((chain) => chain.id === chainId);
|
|
65
55
|
if (!chain) {
|
|
@@ -78,13 +68,6 @@ function isTokenAddressSupported(address, chainId) {
|
|
|
78
68
|
}
|
|
79
69
|
return chainEntry.tokens.some((token) => token.address.toLowerCase() === address.toLowerCase());
|
|
80
70
|
}
|
|
81
|
-
function getSupportedTokens(chainId) {
|
|
82
|
-
const chainEntry = getChainEntry(chainId);
|
|
83
|
-
if (!chainEntry) {
|
|
84
|
-
throw new UnsupportedChainError(chainId);
|
|
85
|
-
}
|
|
86
|
-
return chainEntry.tokens;
|
|
87
|
-
}
|
|
88
71
|
function getDefaultAccountAccessList(onTestnets) {
|
|
89
72
|
const supportedChainIds = getSupportedChainIds();
|
|
90
73
|
const filteredChainIds = supportedChainIds.filter((chainId) => {
|
|
@@ -103,13 +86,15 @@ function resolveTokenAddress(token, chainId) {
|
|
|
103
86
|
if (isAddress(token)) {
|
|
104
87
|
return token;
|
|
105
88
|
}
|
|
89
|
+
// Non-EVM destinations carry SPL mints (base58) / Tron T-prefixed
|
|
90
|
+
// addresses that don't satisfy viem's `isAddress`. The orchestrator's
|
|
91
|
+
// wire schema accepts the raw string for non-EVM chains, so pass it
|
|
92
|
+
// through unchanged.
|
|
93
|
+
if (isNonEvmChainId(chainId)) {
|
|
94
|
+
return token;
|
|
95
|
+
}
|
|
96
|
+
// For EVM chains that aren't a hex address, the value must be a known
|
|
97
|
+
// token symbol. `getTokenAddress` throws if it isn't.
|
|
106
98
|
return getTokenAddress(token, chainId);
|
|
107
99
|
}
|
|
108
|
-
|
|
109
|
-
const supportedChainIds = getSupportedChainIds();
|
|
110
|
-
return supportedChainIds.map((chainId) => ({
|
|
111
|
-
chainId,
|
|
112
|
-
tokens: getSupportedTokens(chainId),
|
|
113
|
-
}));
|
|
114
|
-
}
|
|
115
|
-
export { getTokenSymbol, getTokenAddress, getTokenDecimals, getWethAddress, getWrappedTokenAddress, getChainById, getSupportedTokens, getSupportedChainIds, isTestnet, isTokenAddressSupported, getDefaultAccountAccessList, resolveTokenAddress, getAllSupportedChainsAndTokens, };
|
|
100
|
+
export { getTokenSymbol, getTokenAddress, getWethAddress, getWrappedTokenAddress, getChainById, getSupportedChainIds, isTestnet, isTokenAddressSupported, getDefaultAccountAccessList, resolveTokenAddress, };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SettlementLayer as CrossChainSettlementLayer, SupportedChain, SupportedMainnet, SupportedOPStackMainnet, SupportedOPStackTestnet, SupportedTestnet } from '@rhinestone/shared-configs';
|
|
2
2
|
import type { Address, Chain, Hex, TypedDataDefinition } from 'viem';
|
|
3
|
+
import type { NonEvmAddress } from './destinations.js';
|
|
3
4
|
type SupportedTokenSymbol = 'ETH' | 'WETH' | 'USDC' | 'USDT' | 'USDT0';
|
|
4
5
|
type SupportedToken = SupportedTokenSymbol | Address;
|
|
5
6
|
type AccountType = 'GENERIC' | 'ERC7579' | 'EOA';
|
|
@@ -38,6 +39,11 @@ interface Execution {
|
|
|
38
39
|
data: Hex;
|
|
39
40
|
}
|
|
40
41
|
type SettlementLayer = 'SAME_CHAIN' | 'INTENT_EXECUTOR' | CrossChainSettlementLayer;
|
|
42
|
+
type SettlementLayerFilter = {
|
|
43
|
+
include: SettlementLayer[];
|
|
44
|
+
} | {
|
|
45
|
+
exclude: SettlementLayer[];
|
|
46
|
+
};
|
|
41
47
|
declare const SIG_MODE_EMISSARY = 0;
|
|
42
48
|
declare const SIG_MODE_ERC1271 = 1;
|
|
43
49
|
declare const SIG_MODE_EMISSARY_ERC1271 = 2;
|
|
@@ -52,7 +58,7 @@ type AuxiliaryFunds = {
|
|
|
52
58
|
interface IntentOptions {
|
|
53
59
|
feeToken?: Address | SupportedTokenSymbol;
|
|
54
60
|
sponsorSettings?: SponsorSettings;
|
|
55
|
-
settlementLayers?:
|
|
61
|
+
settlementLayers?: SettlementLayerFilter;
|
|
56
62
|
signatureMode?: SignatureMode;
|
|
57
63
|
auxiliaryFunds?: AuxiliaryFunds;
|
|
58
64
|
}
|
|
@@ -67,8 +73,7 @@ interface PortfolioToken {
|
|
|
67
73
|
chain: number;
|
|
68
74
|
address: Address;
|
|
69
75
|
decimals: number;
|
|
70
|
-
|
|
71
|
-
unlocked: bigint;
|
|
76
|
+
amount: bigint;
|
|
72
77
|
}[];
|
|
73
78
|
}
|
|
74
79
|
type Portfolio = PortfolioToken[];
|
|
@@ -78,7 +83,7 @@ interface IntentInput {
|
|
|
78
83
|
destinationExecutions: Execution[];
|
|
79
84
|
destinationGasUnits?: bigint;
|
|
80
85
|
tokenRequests: {
|
|
81
|
-
tokenAddress: Address;
|
|
86
|
+
tokenAddress: Address | NonEvmAddress;
|
|
82
87
|
amount?: bigint;
|
|
83
88
|
}[];
|
|
84
89
|
recipient?: Account;
|
|
@@ -111,14 +116,9 @@ interface Fees {
|
|
|
111
116
|
total: UsdAmount;
|
|
112
117
|
breakdown: FeeBreakdown;
|
|
113
118
|
}
|
|
114
|
-
interface FeeToken {
|
|
115
|
-
chainId: number;
|
|
116
|
-
tokenAddress: Address;
|
|
117
|
-
}
|
|
118
119
|
interface Cost {
|
|
119
120
|
input: CostTokenEntry[];
|
|
120
121
|
output: CostTokenEntry[];
|
|
121
|
-
feeToken?: FeeToken;
|
|
122
122
|
fees: Fees;
|
|
123
123
|
}
|
|
124
124
|
interface EstimatedFillTime {
|
|
@@ -129,6 +129,27 @@ interface SignData {
|
|
|
129
129
|
destination: TypedDataDefinition;
|
|
130
130
|
targetExecution?: TypedDataDefinition;
|
|
131
131
|
}
|
|
132
|
+
type BridgeFill = {
|
|
133
|
+
type: 'OFT';
|
|
134
|
+
destinationChainId: number;
|
|
135
|
+
} | {
|
|
136
|
+
type: 'RELAY';
|
|
137
|
+
destinationChainId: number;
|
|
138
|
+
requestId: string;
|
|
139
|
+
} | {
|
|
140
|
+
type: 'NEAR';
|
|
141
|
+
destinationChainId: number;
|
|
142
|
+
depositAddress: Address;
|
|
143
|
+
} | {
|
|
144
|
+
type: 'RHINO';
|
|
145
|
+
destinationChainId: number;
|
|
146
|
+
commitmentId: string;
|
|
147
|
+
} | {
|
|
148
|
+
type: 'CCTP';
|
|
149
|
+
destinationChainId: number;
|
|
150
|
+
sourceDomainId: number;
|
|
151
|
+
destinationDomainId: number;
|
|
152
|
+
};
|
|
132
153
|
interface Quote {
|
|
133
154
|
intentId: string;
|
|
134
155
|
expiresAt: number;
|
|
@@ -137,6 +158,7 @@ interface Quote {
|
|
|
137
158
|
signData: SignData;
|
|
138
159
|
cost: Cost;
|
|
139
160
|
tokenRequirements?: TokenRequirements;
|
|
161
|
+
bridgeFill?: BridgeFill;
|
|
140
162
|
}
|
|
141
163
|
interface QuoteResponse {
|
|
142
164
|
routes: Quote[];
|
|
@@ -188,9 +210,18 @@ type AccountContext = {
|
|
|
188
210
|
accountType: 'EOA';
|
|
189
211
|
};
|
|
190
212
|
interface Account {
|
|
191
|
-
address: Address;
|
|
192
|
-
|
|
193
|
-
|
|
213
|
+
address: Address | NonEvmAddress;
|
|
214
|
+
/**
|
|
215
|
+
* Account type — required for EVM accounts. Omitted for non-EVM
|
|
216
|
+
* recipients (Solana / Tron) where smart-account semantics don't apply
|
|
217
|
+
* and the orchestrator schema requires it unset.
|
|
218
|
+
*/
|
|
219
|
+
accountType?: AccountType;
|
|
220
|
+
/**
|
|
221
|
+
* Per-chain account-setup operations — required for EVM accounts.
|
|
222
|
+
* Omitted for non-EVM recipients for the same reason as `accountType`.
|
|
223
|
+
*/
|
|
224
|
+
setupOps?: Pick<Execution, 'to' | 'data'>[];
|
|
194
225
|
delegations?: Delegations;
|
|
195
226
|
/** Per-chain SSX mock signatures keyed by decimal chainId string. */
|
|
196
227
|
mockSignatures?: Record<`${number}`, Hex>;
|
|
@@ -243,19 +274,20 @@ export type OPNetworkParams = {
|
|
|
243
274
|
interface SplitIntentsInput {
|
|
244
275
|
chain: Chain;
|
|
245
276
|
tokens: Record<Address, bigint>;
|
|
246
|
-
settlementLayers?:
|
|
277
|
+
settlementLayers?: SettlementLayerFilter;
|
|
247
278
|
}
|
|
248
279
|
interface SplitIntentsResult {
|
|
249
280
|
intents: Record<Address, bigint>[];
|
|
250
281
|
}
|
|
282
|
+
type FillTransactionHash = string;
|
|
251
283
|
interface IntentOpStatus {
|
|
252
284
|
status: IntentStatus;
|
|
253
285
|
claims: Claim[];
|
|
254
286
|
destinationChainId: number;
|
|
255
287
|
accountAddress: Address;
|
|
256
288
|
fillTimestamp?: number;
|
|
257
|
-
fillTransactionHash?:
|
|
289
|
+
fillTransactionHash?: FillTransactionHash;
|
|
258
290
|
}
|
|
259
|
-
export type { Account, AccountType, AccountWithContext, AuxiliaryFunds, TokenConfig, SupportedChain, SettlementLayer, SignatureMode, IntentInput, Quote, QuoteResponse, Cost, CostTokenEntry, FeeBreakdown,
|
|
291
|
+
export type { Account, AccountType, AccountWithContext, AuxiliaryFunds, TokenConfig, SupportedChain, SettlementLayer, SettlementLayerFilter, SignatureMode, IntentInput, BridgeFill, Quote, QuoteResponse, Cost, CostTokenEntry, FeeBreakdown, Fees, Price, UsdAmount, EstimatedFillTime, SignData, IntentSubmitRequest, IntentSubmitRequestInternal, IntentSubmitResponse, IntentOpStatus, FillTransactionHash, IntentOptions, SponsorSettings, SignedAuthorization, SplitIntentsInput, SplitIntentsResult, Portfolio, PortfolioToken, Execution, AccountAccessList, MappedChainTokenAccessList, UnmappedChainTokenAccessList, OriginSignature, TokenRequirements, WrapRequired, ApprovalRequired, TypedDataDefinition, };
|
|
260
292
|
export { INTENT_STATUS_PENDING, INTENT_STATUS_FAILED, INTENT_STATUS_EXPIRED, INTENT_STATUS_CLAIMED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_PRECONFIRMED, SIG_MODE_EMISSARY, SIG_MODE_ERC1271, SIG_MODE_EMISSARY_ERC1271, SIG_MODE_ERC1271_EMISSARY, SIG_MODE_EMISSARY_EXECUTION, SIG_MODE_EMISSARY_EXECUTION_ERC1271, SIG_MODE_ERC1271_EMISSARY_EXECUTION, };
|
|
261
293
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../orchestrator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,IAAI,yBAAyB,EAC5C,cAAc,EACd,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../orchestrator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,IAAI,yBAAyB,EAC5C,cAAc,EACd,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,KAAK,oBAAoB,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AACtE,KAAK,cAAc,GAAG,oBAAoB,GAAG,OAAO,CAAA;AAEpD,KAAK,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,KAAK,CAAA;AAEhD,QAAA,MAAM,qBAAqB,YAAY,CAAA;AACvC,QAAA,MAAM,oBA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,EAC1B,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,EAC3B,mCAAmC,EACnC,mCAAmC,GACpC,CAAA"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Account, Address, Chain, Hex } from 'viem';
|
|
1
|
+
import type { Abi, AbiFunction, Account, Address, Chain, Hex } from 'viem';
|
|
2
2
|
import type { WebAuthnAccount } from 'viem/account-abstraction';
|
|
3
3
|
import type { ModuleType } from './modules/common.js';
|
|
4
|
-
import type {
|
|
5
|
-
type
|
|
4
|
+
import type { NonEvmAddress, NonEvmChain } from './orchestrator/destinations.js';
|
|
5
|
+
import type { AuxiliaryFunds, SettlementLayerFilter } from './orchestrator/types.js';
|
|
6
|
+
type AccountType = 'safe' | 'nexus' | 'kernel' | 'startale' | 'eoa';
|
|
6
7
|
interface SafeAccount {
|
|
7
8
|
type: 'safe';
|
|
8
9
|
version?: '1.4.1';
|
|
@@ -23,13 +24,10 @@ interface StartaleAccount {
|
|
|
23
24
|
type: 'startale';
|
|
24
25
|
salt?: Hex;
|
|
25
26
|
}
|
|
26
|
-
interface PassportAccount {
|
|
27
|
-
type: 'passport';
|
|
28
|
-
}
|
|
29
27
|
interface EoaAccount {
|
|
30
28
|
type: 'eoa';
|
|
31
29
|
}
|
|
32
|
-
type AccountProviderConfig = SafeAccount | NexusAccount | KernelAccount | StartaleAccount |
|
|
30
|
+
type AccountProviderConfig = SafeAccount | NexusAccount | KernelAccount | StartaleAccount | EoaAccount;
|
|
33
31
|
interface OwnableValidatorConfig {
|
|
34
32
|
type: 'ecdsa';
|
|
35
33
|
accounts: Account[];
|
|
@@ -116,55 +114,129 @@ interface IntentExecutionPolicy {
|
|
|
116
114
|
type: 'intent-execution';
|
|
117
115
|
}
|
|
118
116
|
interface Permit2ClaimPolicy {
|
|
119
|
-
type: 'permit2
|
|
117
|
+
type: 'permit2';
|
|
120
118
|
/** Whitelisted Permit2 spender addresses */
|
|
121
|
-
|
|
119
|
+
spenders?: Address[];
|
|
122
120
|
/** Permitted input tokens per origin chain */
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
sourceTokens?: {
|
|
122
|
+
chain: Chain;
|
|
123
|
+
address: Address;
|
|
126
124
|
}[];
|
|
127
125
|
/** Permitted output tokens per destination chain */
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
destinationTokens?: {
|
|
127
|
+
chain: Chain;
|
|
128
|
+
address: Address;
|
|
131
129
|
}[];
|
|
132
130
|
/** Permitted recipients per destination chain (use `'any'` to allow all) */
|
|
133
131
|
recipients?: {
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
chain: Chain;
|
|
133
|
+
address: Address | 'any';
|
|
136
134
|
}[];
|
|
137
|
-
/** Enforce that recipient
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
|
|
135
|
+
/** Enforce that the destination recipient is the smart account */
|
|
136
|
+
recipientIsAccount?: boolean;
|
|
137
|
+
/** Bounds for the Permit2 signature deadline */
|
|
138
|
+
permitDeadline?: {
|
|
141
139
|
min?: bigint;
|
|
142
140
|
max?: bigint;
|
|
143
141
|
};
|
|
144
|
-
/**
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
/** Bounds for the mandate target fill deadline, per destination chain */
|
|
143
|
+
fillDeadline?: {
|
|
144
|
+
chain: Chain;
|
|
147
145
|
min?: bigint;
|
|
148
146
|
max?: bigint;
|
|
149
147
|
}[];
|
|
150
148
|
}
|
|
151
149
|
type Policy = SudoPolicy | UniversalActionPolicy | SpendingLimitsPolicy | TimeFramePolicy | UsageLimitPolicy | ValueLimitPolicy | IntentExecutionPolicy;
|
|
150
|
+
/** @internal */
|
|
152
151
|
interface FallbackAction {
|
|
153
152
|
policies?: Policy[];
|
|
154
153
|
}
|
|
154
|
+
/** @internal */
|
|
155
155
|
interface ScopedAction {
|
|
156
156
|
target: Address;
|
|
157
157
|
selector: Hex;
|
|
158
158
|
policies?: Policy[];
|
|
159
159
|
}
|
|
160
|
+
/** @internal */
|
|
160
161
|
type Action = FallbackAction | ScopedAction;
|
|
161
|
-
|
|
162
|
+
/** Extract function names from an ABI. */
|
|
163
|
+
type FunctionNames<TAbi extends Abi> = Extract<TAbi[number], {
|
|
164
|
+
type: 'function';
|
|
165
|
+
}>['name'];
|
|
166
|
+
/** Pull the AbiFunction entry for a given name (union if overloaded). */
|
|
167
|
+
type GetFunction<TAbi extends Abi, TName extends string> = Extract<TAbi[number], {
|
|
168
|
+
type: 'function';
|
|
169
|
+
name: TName;
|
|
170
|
+
}>;
|
|
171
|
+
/**
|
|
172
|
+
* Map a Solidity type string to the TypeScript value a developer provides as
|
|
173
|
+
* `value` in a param constraint. Dynamic types resolve to `never` so the
|
|
174
|
+
* compiler prevents rules on params the on-chain policy cannot compare.
|
|
175
|
+
*/
|
|
176
|
+
type AbiTypeToValue<T extends string> = T extends 'address' ? Address : T extends 'bool' ? boolean : T extends `uint${string}` ? bigint : T extends `int${string}` ? bigint : T extends `bytes${infer N}` ? N extends '' ? never : Hex : never;
|
|
177
|
+
type ParamValue<TFn extends AbiFunction, TParamName extends string> = AbiTypeToValue<Extract<TFn['inputs'][number], {
|
|
178
|
+
name: TParamName;
|
|
179
|
+
}>['type']>;
|
|
180
|
+
type NamedInputs<TFn extends AbiFunction> = Extract<TFn['inputs'][number], {
|
|
181
|
+
name: string;
|
|
182
|
+
}>;
|
|
183
|
+
interface ParamConstraint<TValue> {
|
|
184
|
+
condition: UniversalActionPolicyParamCondition;
|
|
185
|
+
value: TValue;
|
|
186
|
+
usageLimit?: bigint;
|
|
187
|
+
}
|
|
188
|
+
interface PermissionFunctionConfig<TFn extends AbiFunction> {
|
|
189
|
+
policies?: Policy[];
|
|
190
|
+
valueLimitPerUse?: bigint;
|
|
191
|
+
params?: {
|
|
192
|
+
[K in NamedInputs<TFn>['name']]?: ParamConstraint<ParamValue<TFn, K>>;
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
interface Permission<TAbi extends Abi = Abi> {
|
|
196
|
+
abi: TAbi;
|
|
197
|
+
address: Address;
|
|
198
|
+
functions: {
|
|
199
|
+
[K in FunctionNames<TAbi>]?: PermissionFunctionConfig<GetFunction<TAbi, K> & AbiFunction>;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
type PermissionsForAbis<TAbis extends readonly Abi[]> = {
|
|
203
|
+
[K in keyof TAbis]: TAbis[K] extends Abi ? Permission<TAbis[K]> : never;
|
|
204
|
+
};
|
|
205
|
+
interface SessionDefinition<TAbis extends readonly Abi[] = readonly Abi[]> {
|
|
206
|
+
chain: Chain;
|
|
162
207
|
owners: OwnerSet;
|
|
163
|
-
|
|
164
|
-
claimPolicies?: [
|
|
208
|
+
permissions?: readonly [...PermissionsForAbis<TAbis>];
|
|
209
|
+
claimPolicies?: readonly Permit2ClaimPolicy[];
|
|
165
210
|
}
|
|
166
|
-
|
|
211
|
+
type SessionInput<TAbis extends readonly Abi[] = readonly Abi[]> = Omit<SessionDefinition<TAbis>, 'chain'>;
|
|
212
|
+
interface ResolvedERC7739Content {
|
|
213
|
+
appDomainSeparator: Hex;
|
|
214
|
+
contentNames: readonly string[];
|
|
215
|
+
}
|
|
216
|
+
interface ResolvedPolicy {
|
|
217
|
+
policy: Address;
|
|
218
|
+
initData: Hex;
|
|
219
|
+
}
|
|
220
|
+
interface ResolvedERC7739Policies {
|
|
221
|
+
allowedERC7739Content: readonly ResolvedERC7739Content[];
|
|
222
|
+
erc1271Policies: readonly ResolvedPolicy[];
|
|
223
|
+
}
|
|
224
|
+
interface ResolvedAction {
|
|
225
|
+
actionTargetSelector: Hex;
|
|
226
|
+
actionTarget: Address;
|
|
227
|
+
actionPolicies: readonly ResolvedPolicy[];
|
|
228
|
+
}
|
|
229
|
+
interface Session {
|
|
167
230
|
chain: Chain;
|
|
231
|
+
owners: OwnerSet;
|
|
232
|
+
hasExplicitPermissions: boolean;
|
|
233
|
+
permissionId: Hex;
|
|
234
|
+
sessionValidator: Address;
|
|
235
|
+
sessionValidatorInitData: Hex;
|
|
236
|
+
salt: Hex;
|
|
237
|
+
erc7739Policies: ResolvedERC7739Policies;
|
|
238
|
+
actions: readonly ResolvedAction[];
|
|
239
|
+
claimPolicies: readonly Permit2ClaimPolicy[];
|
|
168
240
|
}
|
|
169
241
|
interface Recovery {
|
|
170
242
|
guardians: Account[];
|
|
@@ -271,6 +343,16 @@ interface TokenRequestWithoutAmount {
|
|
|
271
343
|
}
|
|
272
344
|
type TokenRequest = TokenRequestWithAmount | TokenRequestWithoutAmount;
|
|
273
345
|
type TokenRequests = [TokenRequestWithoutAmount] | TokenRequestWithAmount[];
|
|
346
|
+
interface NonEvmTokenRequestWithAmount {
|
|
347
|
+
address: NonEvmAddress;
|
|
348
|
+
amount: bigint;
|
|
349
|
+
}
|
|
350
|
+
interface NonEvmTokenRequestWithoutAmount {
|
|
351
|
+
address: NonEvmAddress;
|
|
352
|
+
amount?: undefined;
|
|
353
|
+
}
|
|
354
|
+
type NonEvmTokenRequest = NonEvmTokenRequestWithAmount | NonEvmTokenRequestWithoutAmount;
|
|
355
|
+
type NonEvmTokenRequests = [NonEvmTokenRequestWithoutAmount] | NonEvmTokenRequestWithAmount[];
|
|
274
356
|
export type SimpleTokenList = (Address | TokenSymbol)[];
|
|
275
357
|
export type ChainTokenMap = Record<number, SimpleTokenList>;
|
|
276
358
|
export type ExactInputConfig = {
|
|
@@ -340,15 +422,13 @@ type Sponsorship = boolean | {
|
|
|
340
422
|
};
|
|
341
423
|
interface BaseTransaction {
|
|
342
424
|
calls?: CallInput[];
|
|
343
|
-
tokenRequests?: TokenRequests;
|
|
344
|
-
recipient?: RhinestoneAccountConfig | Address;
|
|
345
425
|
gasLimit?: bigint;
|
|
346
426
|
signers?: SignerSet;
|
|
347
427
|
sponsored?: Sponsorship;
|
|
348
428
|
eip7702InitSignature?: Hex;
|
|
349
429
|
sourceAssets?: SourceAssetInput;
|
|
350
430
|
feeAsset?: Address | TokenSymbol;
|
|
351
|
-
settlementLayers?:
|
|
431
|
+
settlementLayers?: SettlementLayerFilter;
|
|
352
432
|
auxiliaryFunds?: AuxiliaryFunds;
|
|
353
433
|
experimental_accountOverride?: {
|
|
354
434
|
setupOps?: {
|
|
@@ -359,11 +439,22 @@ interface BaseTransaction {
|
|
|
359
439
|
}
|
|
360
440
|
interface SameChainTransaction extends BaseTransaction {
|
|
361
441
|
chain: Chain;
|
|
442
|
+
tokenRequests?: TokenRequests;
|
|
443
|
+
recipient?: RhinestoneAccountConfig | Address;
|
|
362
444
|
}
|
|
363
|
-
interface
|
|
445
|
+
interface CrossChainEvmTransaction extends BaseTransaction {
|
|
364
446
|
sourceChains?: Chain[];
|
|
365
447
|
targetChain: Chain;
|
|
448
|
+
tokenRequests?: TokenRequests;
|
|
449
|
+
recipient?: RhinestoneAccountConfig | Address;
|
|
450
|
+
}
|
|
451
|
+
interface CrossChainNonEvmTransaction extends BaseTransaction {
|
|
452
|
+
sourceChains?: Chain[];
|
|
453
|
+
targetChain: NonEvmChain;
|
|
454
|
+
tokenRequests?: NonEvmTokenRequests;
|
|
455
|
+
recipient?: NonEvmAddress;
|
|
366
456
|
}
|
|
457
|
+
type CrossChainTransaction = CrossChainEvmTransaction | CrossChainNonEvmTransaction;
|
|
367
458
|
interface UserOperationTransaction {
|
|
368
459
|
calls: CallInput[];
|
|
369
460
|
gasLimit?: bigint;
|
|
@@ -371,5 +462,5 @@ interface UserOperationTransaction {
|
|
|
371
462
|
chain: Chain;
|
|
372
463
|
}
|
|
373
464
|
type Transaction = SameChainTransaction | CrossChainTransaction;
|
|
374
|
-
export type { AccountType, SafeAccount, NexusAccount, KernelAccount, StartaleAccount,
|
|
465
|
+
export type { AccountType, SafeAccount, NexusAccount, KernelAccount, StartaleAccount, EoaAccount, RhinestoneAccountConfig, RhinestoneSDKConfig, RhinestoneConfig, AccountProviderConfig, ProviderConfig, BundlerConfig, PaymasterConfig, Transaction, UserOperationTransaction, TokenSymbol, CalldataInput, LazyCallInput, CallInput, CallResolveContext, Call, Sponsorship, TokenRequest, TokenRequests, NonEvmTokenRequest, NonEvmTokenRequests, SourceAssetInput, OwnerSet, OwnableValidatorConfig, ENSValidatorConfig, WebauthnValidatorConfig, MultiFactorValidatorConfig, SignerSet, ChainSessionConfig, SingleSessionSignerSet, PerChainSessionSignerSet, SessionSignerSet, SessionDefinition, SessionInput, SessionEnableData, Session, Recovery, ModuleType, ModuleInput, Action, ScopedAction, FallbackAction, Permission, PermissionsForAbis, PermissionFunctionConfig, ParamConstraint, ResolvedAction, ResolvedERC7739Content, ResolvedERC7739Policies, ResolvedPolicy, Policy, Permit2ClaimPolicy, UniversalActionPolicyParamCondition, ApiKeyAuth, JwtAuth, AuthConfig, };
|
|
375
466
|
//# sourceMappingURL=types.d.ts.map
|