@rhinestone/sdk 0.0.0-dev-20260917224650 → 0.0.0-dev-20260921165705

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.
Files changed (75) hide show
  1. package/README.md +11 -26
  2. package/dist/src/actions/runtime.d.ts.map +1 -1
  3. package/dist/src/api/account.d.ts +62 -91
  4. package/dist/src/api/account.d.ts.map +1 -1
  5. package/dist/src/api/account.js +47 -736
  6. package/dist/src/api/accounts.d.ts +1 -1
  7. package/dist/src/api/accounts.d.ts.map +1 -1
  8. package/dist/src/api/accounts.js +3 -121
  9. package/dist/src/api/compose-types.d.ts +0 -9
  10. package/dist/src/api/compose-types.d.ts.map +1 -1
  11. package/dist/src/api/compose.d.ts.map +1 -1
  12. package/dist/src/api/compose.js +5 -50
  13. package/dist/src/api/sdk.d.ts +2 -2
  14. package/dist/src/api/sdk.d.ts.map +1 -1
  15. package/dist/src/api/sdk.js +1 -1
  16. package/dist/src/chains/caip2.d.ts.map +1 -1
  17. package/dist/src/chains/caip2.js +0 -5
  18. package/dist/src/chains/non-evm.d.ts +12 -132
  19. package/dist/src/chains/non-evm.d.ts.map +1 -1
  20. package/dist/src/chains/non-evm.js +1 -30
  21. package/dist/src/clients/orchestrator/auth.d.ts +1 -1
  22. package/dist/src/clients/orchestrator/auth.d.ts.map +1 -1
  23. package/dist/src/clients/orchestrator/auth.js +2 -2
  24. package/dist/src/clients/orchestrator/client.js +6 -6
  25. package/dist/src/clients/orchestrator/errors.d.ts +2 -22
  26. package/dist/src/clients/orchestrator/errors.d.ts.map +1 -1
  27. package/dist/src/clients/orchestrator/errors.js +6 -61
  28. package/dist/src/clients/orchestrator/mappers.d.ts +0 -2
  29. package/dist/src/clients/orchestrator/mappers.d.ts.map +1 -1
  30. package/dist/src/clients/orchestrator/mappers.js +2 -87
  31. package/dist/src/clients/orchestrator/port.d.ts +3 -3
  32. package/dist/src/clients/orchestrator/port.d.ts.map +1 -1
  33. package/dist/src/clients/orchestrator/public.d.ts +7 -55
  34. package/dist/src/clients/orchestrator/public.d.ts.map +1 -1
  35. package/dist/src/clients/orchestrator/types.d.ts +5 -23
  36. package/dist/src/clients/orchestrator/types.d.ts.map +1 -1
  37. package/dist/src/clients/orchestrator/wire.d.ts +19 -1
  38. package/dist/src/clients/orchestrator/wire.d.ts.map +1 -1
  39. package/dist/src/config/account.d.ts +13 -216
  40. package/dist/src/config/account.d.ts.map +1 -1
  41. package/dist/src/errors/execution.d.ts +1 -11
  42. package/dist/src/errors/execution.d.ts.map +1 -1
  43. package/dist/src/errors/execution.js +1 -27
  44. package/dist/src/errors/index.d.ts +3 -4
  45. package/dist/src/errors/index.d.ts.map +1 -1
  46. package/dist/src/errors/index.js +4 -7
  47. package/dist/src/hypercore/market.d.ts +1 -1
  48. package/dist/src/hypercore/market.js +1 -1
  49. package/dist/src/index.d.ts +7 -7
  50. package/dist/src/index.d.ts.map +1 -1
  51. package/dist/src/index.js +2 -2
  52. package/dist/src/transactions/intents/normalize.d.ts.map +1 -1
  53. package/dist/src/transactions/intents/normalize.js +2 -9
  54. package/dist/src/transactions/intents/prepare.d.ts.map +1 -1
  55. package/dist/src/transactions/intents/prepare.js +6 -11
  56. package/dist/src/transactions/intents/submit.d.ts.map +1 -1
  57. package/dist/src/transactions/intents/submit.js +0 -4
  58. package/dist/src/transactions/intents/types.d.ts +3 -61
  59. package/dist/src/transactions/intents/types.d.ts.map +1 -1
  60. package/dist/src/utils/index.d.ts +9 -9
  61. package/dist/src/utils/index.d.ts.map +1 -1
  62. package/dist/src/utils/index.js +6 -6
  63. package/package.json +13 -8
  64. package/dist/src/accounts/solana/address.d.ts +0 -28
  65. package/dist/src/accounts/solana/address.d.ts.map +0 -1
  66. package/dist/src/accounts/solana/address.js +0 -105
  67. package/dist/src/errors/capability.d.ts +0 -23
  68. package/dist/src/errors/capability.d.ts.map +0 -1
  69. package/dist/src/errors/capability.js +0 -41
  70. package/dist/src/transactions/intents/solana-instructions.d.ts +0 -14
  71. package/dist/src/transactions/intents/solana-instructions.d.ts.map +0 -1
  72. package/dist/src/transactions/intents/solana-instructions.js +0 -114
  73. package/dist/src/transactions/intents/solana.d.ts +0 -89
  74. package/dist/src/transactions/intents/solana.d.ts.map +0 -1
  75. package/dist/src/transactions/intents/solana.js +0 -305
@@ -1,105 +0,0 @@
1
- import { ed25519 } from '@noble/curves/ed25519';
2
- import { base58 } from '@scure/base';
3
- import { isAddress, sha256 } from 'viem';
4
- import { solanaAddress } from '../../chains/non-evm.js';
5
- const textEncoder = new TextEncoder();
6
- const PROGRAM_DERIVED_ADDRESS_MARKER = textEncoder.encode('ProgramDerivedAddress');
7
- const SWIG_SEED = textEncoder.encode('swig');
8
- const SWIG_WALLET_SEED = textEncoder.encode('swig-wallet-address');
9
- const MAX_SEEDS = 16;
10
- const MAX_SEED_LENGTH = 32;
11
- /** Program used by classic Swig accounts on Solana. */
12
- const SWIG_PROGRAM_ADDRESS = solanaAddress('swigypWHEksbC64pWKwah1WTeh9JXwx8H1rJHLdbQMB');
13
- class OnCurveAddressError extends Error {
14
- }
15
- function concatBytes(values) {
16
- const result = new Uint8Array(values.reduce((length, value) => length + value.length, 0));
17
- let offset = 0;
18
- for (const value of values) {
19
- result.set(value, offset);
20
- offset += value.length;
21
- }
22
- return result;
23
- }
24
- function decodeAddress(value) {
25
- const bytes = base58.decode(value);
26
- if (bytes.length !== 32) {
27
- throw new TypeError('Invalid Solana address: expected 32 bytes');
28
- }
29
- return bytes;
30
- }
31
- function isOnCurve(bytes) {
32
- try {
33
- ed25519.ExtendedPoint.fromHex(bytes);
34
- return true;
35
- }
36
- catch {
37
- return false;
38
- }
39
- }
40
- function createProgramAddress(seeds, programAddress) {
41
- if (seeds.length > MAX_SEEDS) {
42
- throw new TypeError(`Too many PDA seeds: expected at most ${MAX_SEEDS}`);
43
- }
44
- for (const seed of seeds) {
45
- if (seed.length > MAX_SEED_LENGTH) {
46
- throw new TypeError(`Invalid PDA seed: expected at most ${MAX_SEED_LENGTH} bytes`);
47
- }
48
- }
49
- const bytes = sha256(concatBytes([
50
- ...seeds,
51
- decodeAddress(programAddress),
52
- PROGRAM_DERIVED_ADDRESS_MARKER,
53
- ]), 'bytes');
54
- if (isOnCurve(bytes)) {
55
- throw new OnCurveAddressError('Invalid PDA seeds: address must fall off the curve');
56
- }
57
- return solanaAddress(base58.encode(bytes));
58
- }
59
- function findProgramAddress(seeds, programAddress) {
60
- if (seeds.length >= MAX_SEEDS) {
61
- throw new TypeError(`Too many PDA seeds: expected at most ${MAX_SEEDS - 1} before the bump`);
62
- }
63
- for (let bump = 255; bump >= 0; bump--) {
64
- try {
65
- return {
66
- address: createProgramAddress([...seeds, Uint8Array.of(bump)], programAddress),
67
- bump,
68
- };
69
- }
70
- catch (error) {
71
- if (!(error instanceof OnCurveAddressError))
72
- throw error;
73
- }
74
- }
75
- /* v8 ignore next -- exhausting every SHA-256 bump is not constructible */
76
- throw new Error('Unable to find a viable program address bump');
77
- }
78
- function asSwigNamespace(value) {
79
- if (!/^[a-z0-9-]{1,32}$/.test(value)) {
80
- throw new TypeError(`Invalid Swig namespace "${value}": expected 1-32 chars of [a-z0-9-]`);
81
- }
82
- return value;
83
- }
84
- function swigId(namespace, evmAccount) {
85
- if (!isAddress(evmAccount, { strict: false })) {
86
- throw new TypeError(`Invalid EVM account address: ${evmAccount}`);
87
- }
88
- return sha256(textEncoder.encode(`rhinestone:swig:v1:${namespace}:${evmAccount.toLowerCase()}`), 'bytes');
89
- }
90
- function locateSwig(namespace, evmAccount) {
91
- const normalizedAccount = evmAccount.toLowerCase();
92
- const id = swigId(namespace, normalizedAccount);
93
- const swig = findProgramAddress([SWIG_SEED, id], SWIG_PROGRAM_ADDRESS);
94
- const wallet = findProgramAddress([SWIG_WALLET_SEED, decodeAddress(swig.address)], SWIG_PROGRAM_ADDRESS);
95
- return {
96
- namespace,
97
- evmAccount: normalizedAccount,
98
- id,
99
- swig: swig.address,
100
- swigBump: swig.bump,
101
- wallet: wallet.address,
102
- walletBump: wallet.bump,
103
- };
104
- }
105
- export { SWIG_PROGRAM_ADDRESS, asSwigNamespace, createProgramAddress, findProgramAddress, locateSwig, };
@@ -1,23 +0,0 @@
1
- declare class AccountCapabilityError extends Error {
2
- readonly context: Readonly<Record<string, unknown>>;
3
- constructor(message: string, context?: Readonly<Record<string, unknown>>);
4
- }
5
- /** Thrown when a composite account configuration is malformed. */
6
- declare class InvalidAccountConfigError extends AccountCapabilityError {
7
- constructor(message: string);
8
- }
9
- /** Thrown when managed Solana capability is requested outside development. */
10
- declare class ManagedSolanaAccountNotSupportedError extends AccountCapabilityError {
11
- constructor(message?: string);
12
- }
13
- /** Thrown when an address is requested for a VM absent from the account. */
14
- declare class AccountVmNotConfiguredError extends AccountCapabilityError {
15
- constructor(vm: string);
16
- }
17
- /** Thrown when a transaction requests an unsupported account capability. */
18
- declare class UnsupportedAccountCapabilityError extends AccountCapabilityError {
19
- constructor(message: string, context?: Readonly<Record<string, unknown>>);
20
- }
21
- declare function isAccountCapabilityError(error: unknown): error is AccountCapabilityError;
22
- export { AccountCapabilityError, AccountVmNotConfiguredError, InvalidAccountConfigError, ManagedSolanaAccountNotSupportedError, UnsupportedAccountCapabilityError, isAccountCapabilityError, };
23
- //# sourceMappingURL=capability.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../../errors/capability.ts"],"names":[],"mappings":"AAAA,cAAM,sBAAuB,SAAQ,KAAK;IACxC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;gBAGjD,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;CAMlD;AAED,kEAAkE;AAClE,cAAM,yBAA0B,SAAQ,sBAAsB;gBAChD,OAAO,EAAE,MAAM;CAI5B;AAED,8EAA8E;AAC9E,cAAM,qCAAsC,SAAQ,sBAAsB;gBAC5D,OAAO,CAAC,EAAE,MAAM;CAQ7B;AAED,4EAA4E;AAC5E,cAAM,2BAA4B,SAAQ,sBAAsB;gBAClD,EAAE,EAAE,MAAM;CAIvB;AAED,4EAA4E;AAC5E,cAAM,iCAAkC,SAAQ,sBAAsB;gBACxD,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAIzE;AAED,iBAAS,wBAAwB,CAC/B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,sBAAsB,CAEjC;AAED,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,yBAAyB,EACzB,qCAAqC,EACrC,iCAAiC,EACjC,wBAAwB,GACzB,CAAA"}
@@ -1,41 +0,0 @@
1
- class AccountCapabilityError extends Error {
2
- context;
3
- constructor(message, context = {}) {
4
- super(message);
5
- this.name = 'AccountCapabilityError';
6
- this.context = context;
7
- }
8
- }
9
- /** Thrown when a composite account configuration is malformed. */
10
- class InvalidAccountConfigError extends AccountCapabilityError {
11
- constructor(message) {
12
- super(`Invalid account configuration: ${message}`);
13
- this.name = 'InvalidAccountConfigError';
14
- }
15
- }
16
- /** Thrown when managed Solana capability is requested outside development. */
17
- class ManagedSolanaAccountNotSupportedError extends AccountCapabilityError {
18
- constructor(message) {
19
- super(message ??
20
- 'Managed Solana accounts are available only when `useDevContracts: true`. Production has no enabled Swig namespace; use an address-only Solana receiver instead.', { vm: 'solana' });
21
- this.name = 'ManagedSolanaAccountNotSupportedError';
22
- }
23
- }
24
- /** Thrown when an address is requested for a VM absent from the account. */
25
- class AccountVmNotConfiguredError extends AccountCapabilityError {
26
- constructor(vm) {
27
- super(`The ${vm} VM is not configured on this account.`, { vm });
28
- this.name = 'AccountVmNotConfiguredError';
29
- }
30
- }
31
- /** Thrown when a transaction requests an unsupported account capability. */
32
- class UnsupportedAccountCapabilityError extends AccountCapabilityError {
33
- constructor(message, context) {
34
- super(message, context);
35
- this.name = 'UnsupportedAccountCapabilityError';
36
- }
37
- }
38
- function isAccountCapabilityError(error) {
39
- return error instanceof AccountCapabilityError;
40
- }
41
- export { AccountCapabilityError, AccountVmNotConfiguredError, InvalidAccountConfigError, ManagedSolanaAccountNotSupportedError, UnsupportedAccountCapabilityError, isAccountCapabilityError, };
@@ -1,14 +0,0 @@
1
- import type { SolanaInstruction, SolanaInstructionInput } from '../../chains/non-evm.js';
2
- /**
3
- * Normalizes caller-supplied instructions to the orchestrator's wire shape.
4
- * The result is JSON-round-trippable, so a prepared transaction can be
5
- * persisted and restored without a Solana runtime.
6
- */
7
- export declare function normalizeSolanaInstructions(input: readonly SolanaInstructionInput[]): readonly SolanaInstruction[];
8
- /**
9
- * Normalizes the address lookup tables the instructions resolve accounts
10
- * through. Returns `undefined` when there are none, so the wire field is
11
- * omitted rather than sent empty.
12
- */
13
- export declare function normalizeSolanaAddressLookupTables(input: readonly string[] | undefined): readonly string[] | undefined;
14
- //# sourceMappingURL=solana-instructions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"solana-instructions.d.ts","sourceRoot":"","sources":["../../../../transactions/intents/solana-instructions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,sBAAsB,CAAA;AA6F7B;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,sBAAsB,EAAE,GACvC,SAAS,iBAAiB,EAAE,CAoB9B;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GACnC,SAAS,MAAM,EAAE,GAAG,SAAS,CAc/B"}
@@ -1,114 +0,0 @@
1
- import { base64 } from '@scure/base';
2
- import { solanaAddress } from '../../chains/non-evm.js';
3
- import { InvalidSolanaTransactionArtifactError } from '../../errors/execution.js';
4
- // Mirrors the limits the orchestrator publishes on the quote request, so an
5
- // oversized instruction set fails before a round trip.
6
- const MAX_INSTRUCTIONS = 32;
7
- const MAX_ACCOUNTS_PER_INSTRUCTION = 64;
8
- const MAX_INSTRUCTION_DATA_BYTES = 1232;
9
- const MAX_ADDRESS_LOOKUP_TABLES = 8;
10
- const BASE64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
11
- const ACCEPTED_SHAPES = 'an instruction must be either `{ programId, accounts, data }` with base58 addresses and base64 data, or a `@solana/web3.js` instruction with `programId`, `keys` and `data`';
12
- function fail(message) {
13
- throw new InvalidSolanaTransactionArtifactError(message);
14
- }
15
- function base58(value, label) {
16
- if (typeof value === 'object' && value !== null) {
17
- const encode = value.toBase58;
18
- if (typeof encode === 'function') {
19
- return base58(encode.call(value), label);
20
- }
21
- }
22
- if (typeof value !== 'string')
23
- fail(`${label} must be a base58 address`);
24
- try {
25
- return solanaAddress(value);
26
- }
27
- catch {
28
- return fail(`${label} must be a base58 address`);
29
- }
30
- }
31
- function accountMeta(value, label) {
32
- if (!value || typeof value !== 'object' || Array.isArray(value)) {
33
- fail(`${label} must be an object`);
34
- }
35
- const entry = value;
36
- if (typeof entry.isSigner !== 'boolean' ||
37
- typeof entry.isWritable !== 'boolean') {
38
- fail(`${label}.isSigner and ${label}.isWritable must be booleans`);
39
- }
40
- return Object.freeze({
41
- pubkey: base58(entry.pubkey, `${label}.pubkey`),
42
- isSigner: entry.isSigner,
43
- isWritable: entry.isWritable,
44
- });
45
- }
46
- function instructionData(value, label) {
47
- if (value instanceof Uint8Array)
48
- return base64.encode(value);
49
- if (typeof value !== 'string' || !BASE64.test(value)) {
50
- fail(`${label} must be base64-encoded instruction data`);
51
- }
52
- return value;
53
- }
54
- function dataByteLength(value) {
55
- if (value.length === 0)
56
- return 0;
57
- const padding = value.endsWith('==') ? 2 : value.endsWith('=') ? 1 : 0;
58
- return (value.length / 4) * 3 - padding;
59
- }
60
- function instruction(value, label) {
61
- if (!value || typeof value !== 'object' || Array.isArray(value)) {
62
- fail(`${label} must be an object; ${ACCEPTED_SHAPES}`);
63
- }
64
- const entry = value;
65
- const accounts = 'keys' in entry ? entry.keys : entry.accounts;
66
- if (!Array.isArray(accounts)) {
67
- fail(`${label} is not a recognized Solana instruction; ${ACCEPTED_SHAPES}`);
68
- }
69
- if (accounts.length > MAX_ACCOUNTS_PER_INSTRUCTION) {
70
- fail(`${label} references more than ${MAX_ACCOUNTS_PER_INSTRUCTION} accounts`);
71
- }
72
- return Object.freeze({
73
- programId: base58(entry.programId, `${label}.programId`),
74
- accounts: Object.freeze(accounts.map((account, index) => accountMeta(account, `${label}.accounts[${index}]`))),
75
- data: instructionData(entry.data, `${label}.data`),
76
- });
77
- }
78
- /**
79
- * Normalizes caller-supplied instructions to the orchestrator's wire shape.
80
- * The result is JSON-round-trippable, so a prepared transaction can be
81
- * persisted and restored without a Solana runtime.
82
- */
83
- export function normalizeSolanaInstructions(input) {
84
- if (!Array.isArray(input) || input.length === 0) {
85
- fail('a Solana instruction execution requires at least one instruction');
86
- }
87
- if (input.length > MAX_INSTRUCTIONS) {
88
- fail(`a Solana intent carries at most ${MAX_INSTRUCTIONS} instructions`);
89
- }
90
- const instructions = input.map((entry, index) => instruction(entry, `instructions[${index}]`));
91
- const bytes = instructions.reduce((total, entry) => total + dataByteLength(entry.data), 0);
92
- if (bytes > MAX_INSTRUCTION_DATA_BYTES) {
93
- fail(`Solana instruction data must total at most ${MAX_INSTRUCTION_DATA_BYTES} bytes`);
94
- }
95
- return Object.freeze(instructions);
96
- }
97
- /**
98
- * Normalizes the address lookup tables the instructions resolve accounts
99
- * through. Returns `undefined` when there are none, so the wire field is
100
- * omitted rather than sent empty.
101
- */
102
- export function normalizeSolanaAddressLookupTables(input) {
103
- if (input === undefined)
104
- return undefined;
105
- if (!Array.isArray(input)) {
106
- fail('addressLookupTables must be an array of base58 addresses');
107
- }
108
- if (input.length === 0)
109
- return undefined;
110
- if (input.length > MAX_ADDRESS_LOOKUP_TABLES) {
111
- fail(`a Solana intent carries at most ${MAX_ADDRESS_LOOKUP_TABLES} address lookup tables`);
112
- }
113
- return Object.freeze(input.map((table, index) => base58(table, `addressLookupTables[${index}]`)));
114
- }
@@ -1,89 +0,0 @@
1
- import { type Account, type Address, type Hex } from 'viem';
2
- import type { SolanaAddress, SolanaChain, SolanaInstruction } from '../../chains/non-evm.js';
3
- import type { IntentQuotePort, IntentSubmissionPort } from '../../clients/orchestrator/port.js';
4
- import type { AppFeeRate, PersonalSignOriginSignData, ProtocolFeeRate, SerializedIntentInput } from '../../clients/orchestrator/public.js';
5
- import type { OrchestratorIntentOptions, OrchestratorIntentRequest, OrchestratorQuote } from '../../clients/orchestrator/types.js';
6
- /**
7
- * Where a Solana-origin spend lands. The two arms are exclusive on purpose:
8
- * every validation site has to state which direction it is checking, so a
9
- * same-chain rule cannot silently apply to a cross-chain quote.
10
- */
11
- export type SolanaDelivery = {
12
- readonly kind: 'same-chain';
13
- readonly recipient: SolanaAddress;
14
- } | {
15
- readonly kind: 'cross-chain';
16
- readonly chainId: number;
17
- readonly token: Address;
18
- readonly recipient: Address;
19
- };
20
- /**
21
- * What a Solana-origin intent does: move one SPL mint, or run caller-supplied
22
- * instructions out of the account's own wallet. The arms are exclusive — an
23
- * instruction execution is tokenless and names no recipient.
24
- */
25
- export type SolanaAction = {
26
- readonly kind: 'transfer';
27
- readonly mint: SolanaAddress;
28
- readonly amount?: bigint;
29
- readonly delivery: SolanaDelivery;
30
- } | {
31
- readonly kind: 'instructions';
32
- readonly instructions: readonly SolanaInstruction[];
33
- readonly addressLookupTables?: readonly string[];
34
- };
35
- export interface SolanaTransferInput {
36
- readonly chain: SolanaChain;
37
- readonly action: SolanaAction;
38
- readonly accountAddress: Address;
39
- readonly accountType: 'GENERIC' | 'ERC7579' | 'EOA';
40
- readonly authority: Address;
41
- readonly walletAddress: SolanaAddress;
42
- readonly swigAddress: SolanaAddress;
43
- readonly namespace: 'dev-v1';
44
- readonly endpoint: string;
45
- readonly appFees?: AppFeeRate;
46
- readonly protocolFees?: ProtocolFeeRate;
47
- readonly sponsorSettings?: OrchestratorIntentOptions['sponsorSettings'];
48
- }
49
- export interface PreparedSolanaIntent {
50
- readonly traceId: string;
51
- readonly input: SolanaTransferInput;
52
- readonly request: OrchestratorIntentRequest;
53
- readonly quote: OrchestratorQuote;
54
- readonly quotes: readonly OrchestratorQuote[];
55
- }
56
- export interface SignedSolanaIntent {
57
- readonly prepared: PreparedSolanaIntent;
58
- readonly signature: Hex;
59
- }
60
- export interface SolanaWorkflowContext {
61
- readonly quoteClient: IntentQuotePort;
62
- readonly submissionClient: IntentSubmissionPort;
63
- readonly now: () => number;
64
- }
65
- export declare function solanaChainId(chain: SolanaChain): number;
66
- export declare function buildSolanaIntentRequest(input: SolanaTransferInput): OrchestratorIntentRequest;
67
- export declare function prepareSolanaIntent(context: SolanaWorkflowContext, input: SolanaTransferInput): Promise<PreparedSolanaIntent>;
68
- export declare function reconstructSolanaIntent(input: {
69
- readonly traceId: string;
70
- readonly transfer: SolanaTransferInput;
71
- readonly intentInput: SerializedIntentInput;
72
- readonly quote: OrchestratorQuote;
73
- readonly quotes: readonly OrchestratorQuote[];
74
- }): PreparedSolanaIntent;
75
- export declare function assertSolanaNotExpired(now: number, quote: OrchestratorQuote): void;
76
- export declare function signSolanaIntent(input: {
77
- readonly prepared: PreparedSolanaIntent;
78
- readonly owner: Account;
79
- readonly now: () => number;
80
- }): Promise<SignedSolanaIntent>;
81
- export declare function validateSolanaSignature(authority: Address, payload: PersonalSignOriginSignData, signature: Hex): Promise<void>;
82
- export declare function submitSolanaIntent(context: SolanaWorkflowContext, signed: SignedSolanaIntent): Promise<{
83
- type: "intent";
84
- traceId: string;
85
- intentId: string;
86
- sourceChains: number[];
87
- targetChain: number;
88
- }>;
89
- //# sourceMappingURL=solana.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../../transactions/intents/solana.ts"],"names":[],"mappings":"AAAA,OAAO,E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