From f88ad6236f9870d784f0ad05b163526f4805c5af Mon Sep 17 00:00:00 2001 From: jobotics Date: Tue, 22 Jul 2025 01:23:34 +0100 Subject: [PATCH 1/4] refactor: migrate publishIntent utils --- src/features/machines/swapIntentMachine.ts | 7 ++- .../machines/tokenMigrationMachine.ts | 9 ++- src/sdk/solverRelay/publishIntent.ts | 50 --------------- .../utils/parseFailedPublishError.ts | 61 +++++++++++++++++++ 4 files changed, 72 insertions(+), 55 deletions(-) delete mode 100644 src/sdk/solverRelay/publishIntent.ts diff --git a/src/features/machines/swapIntentMachine.ts b/src/features/machines/swapIntentMachine.ts index bf31416c..8083c39a 100644 --- a/src/features/machines/swapIntentMachine.ts +++ b/src/features/machines/swapIntentMachine.ts @@ -1,10 +1,11 @@ import type { FeeEstimation } from "@defuse-protocol/bridge-sdk" +import { solverRelay } from "@defuse-protocol/internal-utils" import { secp256k1 } from "@noble/curves/secp256k1" import type { providers } from "near-api-js" import { assign, fromPromise, setup } from "xstate" import { settings } from "../../constants/settings" import { logger } from "../../logger" -import { publishIntent } from "../../sdk/solverRelay/publishIntent" +import { convertPublishIntentToLegacyFormat } from "../../sdk/solverRelay/utils/parseFailedPublishError" import { emitEvent } from "../../services/emitter" import type { AggregatedQuote } from "../../services/quoteService" import type { AuthMethod } from "../../types/authHandle" @@ -263,7 +264,9 @@ export const swapIntentMachine = setup({ quoteHashes: string[] } }) => - publishIntent(input.signatureData, input.userInfo, input.quoteHashes) + solverRelay + .publishIntent(input.signatureData, input.userInfo, input.quoteHashes) + .then(convertPublishIntentToLegacyFormat) ), }, guards: { diff --git a/src/features/tokenMigration/machines/tokenMigrationMachine.ts b/src/features/tokenMigration/machines/tokenMigrationMachine.ts index eee0a98f..cfefa7f5 100644 --- a/src/features/tokenMigration/machines/tokenMigrationMachine.ts +++ b/src/features/tokenMigration/machines/tokenMigrationMachine.ts @@ -1,9 +1,10 @@ +import { solverRelay } from "@defuse-protocol/internal-utils" import { assign, fromPromise, setup } from "xstate" import { config } from "../../../config" import { nearClient } from "../../../constants/nearClient" import type { SignerCredentials } from "../../../core/formatters" import { logger } from "../../../logger" -import { publishIntent } from "../../../sdk/solverRelay/publishIntent" +import { convertPublishIntentToLegacyFormat } from "../../../sdk/solverRelay/utils/parseFailedPublishError" import { type IntentSettlementResult, waitForIntentSettlement, @@ -56,8 +57,10 @@ export const tokenMigrationMachine = setup({ signIntent: signIntentMachine, publishIntent: fromPromise( - ({ input }: { input: Parameters }) => - publishIntent(...input) + ({ input }: { input: Parameters }) => + solverRelay + .publishIntent(...input) + .then(convertPublishIntentToLegacyFormat) ), waitForIntentSettlement: fromPromise( diff --git a/src/sdk/solverRelay/publishIntent.ts b/src/sdk/solverRelay/publishIntent.ts deleted file mode 100644 index 19e44108..00000000 --- a/src/sdk/solverRelay/publishIntent.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { retry } from "@lifeomic/attempt" -import type { AuthMethod } from "../../types/authHandle" -import type { WalletSignatureResult } from "../../types/walletMessage" -import { prepareSwapSignedData } from "../../utils/prepareBroadcastRequest" -import * as solverRelayClient from "./solverRelayHttpClient" -import type * as types from "./solverRelayHttpClient/types" -import { - type ParsedPublishErrors, - parseFailedPublishError, -} from "./utils/parseFailedPublishError" - -export type PublishIntentResult = - | { tag: "ok"; value: string } - | { - tag: "err" - value: ParsedPublishErrors - } - -export async function publishIntent( - signatureData: WalletSignatureResult, - userInfo: { userAddress: string; userChainType: AuthMethod }, - quoteHashes: string[] -): Promise { - const result = await retry( - () => - solverRelayClient.publishIntent( - { - signed_data: prepareSwapSignedData(signatureData, userInfo), - quote_hashes: quoteHashes, - }, - { timeout: 30000 } - ), - { - delay: 1000, - factor: 1.5, - maxAttempts: 7, - jitter: true, - minDelay: 1000, - } - ) - if (result.status === "OK") { - return { tag: "ok", value: result.intent_hash } - } - - if (result.status === "FAILED" && result.reason === "already processed") { - return { tag: "ok", value: result.intent_hash } - } - - return { tag: "err", value: parseFailedPublishError(result) } -} diff --git a/src/sdk/solverRelay/utils/parseFailedPublishError.ts b/src/sdk/solverRelay/utils/parseFailedPublishError.ts index 9327bde4..eac30401 100644 --- a/src/sdk/solverRelay/utils/parseFailedPublishError.ts +++ b/src/sdk/solverRelay/utils/parseFailedPublishError.ts @@ -1,3 +1,5 @@ +import type { solverRelay } from "@defuse-protocol/internal-utils" +import type { Result } from "@thames/monads" import { assert } from "../../../utils/assert" import type * as solverRelayClient from "../solverRelayHttpClient" @@ -55,3 +57,62 @@ export function parseFailedPublishError( serverReason: response.reason, } } + +/** + * Adapter function that converts the new Result + * from internal-utils into the legacy format used by the SDK. + */ +export function convertPublishIntentToLegacyFormat( + result: Result +): + | { tag: "ok"; value: string } + | { + tag: "err" + value: { reason: "ERR_CANNOT_PUBLISH_INTENT"; server_reason: string } + } { + if (result.isOk()) { + return { tag: "ok", value: result.unwrap() } + } + + const error = result.unwrapErr() + const errorCode = error.code + + // Map new PublishErrorCode to old ParsedPublishErrors format + let serverReason: string + switch (errorCode) { + case "SIGNATURE_EXPIRED": + serverReason = "RELAY_PUBLISH_SIGNATURE_EXPIRED" + break + case "INTERNAL_ERROR": + serverReason = "RELAY_PUBLISH_INTERNAL_ERROR" + break + case "SIGNATURE_INVALID": + serverReason = "RELAY_PUBLISH_SIGNATURE_INVALID" + break + case "NONCE_USED": + serverReason = "RELAY_PUBLISH_NONCE_USED" + break + case "INSUFFICIENT_BALANCE": + serverReason = "RELAY_PUBLISH_INSUFFICIENT_BALANCE" + break + case "PUBLIC_KEY_NOT_EXIST": + serverReason = "RELAY_PUBLISH_PUBLIC_NOT_EXIST" + break + case "UNKNOWN_ERROR": + serverReason = "RELAY_PUBLISH_UNKNOWN_ERROR" + break + case "NETWORK_ERROR": + serverReason = "RELAY_PUBLISH_NETWORK_ERROR" + break + default: + serverReason = errorCode + } + + return { + tag: "err", + value: { + reason: "ERR_CANNOT_PUBLISH_INTENT", + server_reason: serverReason, + }, + } +} From 283586e6f2317c70ecda3885625343cc58e0fb2a Mon Sep 17 00:00:00 2001 From: jobotics Date: Tue, 22 Jul 2025 01:48:14 +0100 Subject: [PATCH 2/4] fix: correct publish intent legacy reasons --- .../utils/parseFailedPublishError.ts | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/sdk/solverRelay/utils/parseFailedPublishError.ts b/src/sdk/solverRelay/utils/parseFailedPublishError.ts index eac30401..2c0b4d9b 100644 --- a/src/sdk/solverRelay/utils/parseFailedPublishError.ts +++ b/src/sdk/solverRelay/utils/parseFailedPublishError.ts @@ -68,7 +68,7 @@ export function convertPublishIntentToLegacyFormat( | { tag: "ok"; value: string } | { tag: "err" - value: { reason: "ERR_CANNOT_PUBLISH_INTENT"; server_reason: string } + value: ParsedPublishErrors } { if (result.isOk()) { return { tag: "ok", value: result.unwrap() } @@ -78,41 +78,41 @@ export function convertPublishIntentToLegacyFormat( const errorCode = error.code // Map new PublishErrorCode to old ParsedPublishErrors format - let serverReason: string + let reason: ParsedPublishErrors["reason"] switch (errorCode) { case "SIGNATURE_EXPIRED": - serverReason = "RELAY_PUBLISH_SIGNATURE_EXPIRED" + reason = "RELAY_PUBLISH_SIGNATURE_EXPIRED" break case "INTERNAL_ERROR": - serverReason = "RELAY_PUBLISH_INTERNAL_ERROR" + reason = "RELAY_PUBLISH_INTERNAL_ERROR" break case "SIGNATURE_INVALID": - serverReason = "RELAY_PUBLISH_SIGNATURE_INVALID" + reason = "RELAY_PUBLISH_SIGNATURE_INVALID" break case "NONCE_USED": - serverReason = "RELAY_PUBLISH_NONCE_USED" + reason = "RELAY_PUBLISH_NONCE_USED" break case "INSUFFICIENT_BALANCE": - serverReason = "RELAY_PUBLISH_INSUFFICIENT_BALANCE" + reason = "RELAY_PUBLISH_INSUFFICIENT_BALANCE" break case "PUBLIC_KEY_NOT_EXIST": - serverReason = "RELAY_PUBLISH_PUBLIC_NOT_EXIST" + reason = "RELAY_PUBLISH_PUBLIC_NOT_EXIST" break case "UNKNOWN_ERROR": - serverReason = "RELAY_PUBLISH_UNKNOWN_ERROR" + reason = "RELAY_PUBLISH_UNKNOWN_ERROR" break case "NETWORK_ERROR": - serverReason = "RELAY_PUBLISH_NETWORK_ERROR" + reason = "RELAY_PUBLISH_UNKNOWN_ERROR" break default: - serverReason = errorCode + reason = "RELAY_PUBLISH_UNKNOWN_ERROR" } return { tag: "err", - value: { - reason: "ERR_CANNOT_PUBLISH_INTENT", - server_reason: serverReason, - }, + value: + reason === "RELAY_PUBLISH_UNKNOWN_ERROR" + ? { reason, serverReason: errorCode } + : { reason }, } } From 75c76c06d96f91e17b3a6644b5a02912fdfd60bf Mon Sep 17 00:00:00 2001 From: jobotics Date: Tue, 22 Jul 2025 10:47:00 +0100 Subject: [PATCH 3/4] refactor: migrate publishIntents utils --- .../gift/actors/giftMakerPublishingActor.ts | 28 +++--- .../gift/actors/shared/giftClaimActor.ts | 13 ++- .../actors/otcMakerOrderCancellationActor.ts | 30 +++--- .../otcDesk/hooks/useOtcTakerConfirmTrade.ts | 13 ++- src/sdk/solverRelay/publishIntents.ts | 92 +++++++++---------- .../solverRelay/solverRelayHttpClient/apis.ts | 13 --- .../utils/parseFailedPublishError.ts | 42 --------- 7 files changed, 91 insertions(+), 140 deletions(-) diff --git a/src/features/gift/actors/giftMakerPublishingActor.ts b/src/features/gift/actors/giftMakerPublishingActor.ts index 39c653b6..fbb64a89 100644 --- a/src/features/gift/actors/giftMakerPublishingActor.ts +++ b/src/features/gift/actors/giftMakerPublishingActor.ts @@ -1,8 +1,9 @@ +import { solverRelay } from "@defuse-protocol/internal-utils" import { assign, fromPromise, setup } from "xstate" import { logger } from "../../../logger" import { type PublishIntentsErr, - publishIntents, + convertPublishIntentsToLegacyFormat, } from "../../../sdk/solverRelay/publishIntents" import type { MultiPayload } from "../../../types/defuse-contracts-types" import { assert } from "../../../utils/assert" @@ -41,17 +42,20 @@ export const giftMakerPublishingActor = setup({ }, actors: { publishActor: fromPromise(({ input }: { input: MultiPayload }) => { - return publishIntents({ - quote_hashes: [], - signed_datas: [input], - }).then((result) => { - if (result.isErr()) { - return { tag: "err" as const, value: result.unwrapErr() } - } - const intentHashes = result.unwrap() - assert(intentHashes != null) - return { tag: "ok" as const, value: intentHashes } - }) + return solverRelay + .publishIntents({ + quote_hashes: [], + signed_datas: [input], + }) + .then(convertPublishIntentsToLegacyFormat) + .then((result) => { + if (result.isErr()) { + return { tag: "err" as const, value: result.unwrapErr() } + } + const intentHashes = result.unwrap() + assert(intentHashes != null) + return { tag: "ok" as const, value: intentHashes } + }) }), }, actions: { diff --git a/src/features/gift/actors/shared/giftClaimActor.ts b/src/features/gift/actors/shared/giftClaimActor.ts index d69b526c..91712a24 100644 --- a/src/features/gift/actors/shared/giftClaimActor.ts +++ b/src/features/gift/actors/shared/giftClaimActor.ts @@ -1,10 +1,11 @@ +import { solverRelay } from "@defuse-protocol/internal-utils" import { type SignerCredentials, formatSignedIntent } from "src/core/formatters" import type { MultiPayload } from "src/types/defuse-contracts-types" import { assertEvent, assign, fromPromise, setup } from "xstate" import { logger } from "../../../../logger" import { type PublishIntentsErr, - publishIntents, + convertPublishIntentsToLegacyFormat, } from "../../../../sdk/solverRelay/publishIntents" import { waitForIntentSettlement } from "../../../../sdk/solverRelay/waitForIntentSettlement" import { assert } from "../../../../utils/assert" @@ -114,10 +115,12 @@ export const giftClaimActor = setup({ }: { input: { multiPayload: MultiPayload } }): Promise => { - const result = await publishIntents({ - quote_hashes: [], - signed_datas: [input.multiPayload], - }) + const result = await solverRelay + .publishIntents({ + quote_hashes: [], + signed_datas: [input.multiPayload], + }) + .then(convertPublishIntentsToLegacyFormat) if (result.isErr()) { return { tag: "err" as const, value: result.unwrapErr() } } diff --git a/src/features/otcDesk/actors/otcMakerOrderCancellationActor.ts b/src/features/otcDesk/actors/otcMakerOrderCancellationActor.ts index ae0c644b..b7d81dda 100644 --- a/src/features/otcDesk/actors/otcMakerOrderCancellationActor.ts +++ b/src/features/otcDesk/actors/otcMakerOrderCancellationActor.ts @@ -1,3 +1,4 @@ +import { solverRelay } from "@defuse-protocol/internal-utils" import { base64 } from "@scure/base" import { createEmptyIntentMessage } from "src/core/messages" import { assertEvent, assign, fromPromise, setup } from "xstate" @@ -5,7 +6,7 @@ import type { SignerCredentials } from "../../../core/formatters" import { logger } from "../../../logger" import { type PublishIntentsErr, - publishIntents, + convertPublishIntentsToLegacyFormat, } from "../../../sdk/solverRelay/publishIntents" import type { MultiPayload } from "../../../types/defuse-contracts-types" import type { WalletSignatureResult } from "../../../types/walletMessage" @@ -65,18 +66,21 @@ export const otcMakerOrderCancellationActor = setup({ signActor: signIntentMachine, publishActor: fromPromise( ({ input }: { input: { multiPayload: MultiPayload } }) => { - return publishIntents({ - quote_hashes: [], - signed_datas: [input.multiPayload], - }).then((result) => { - if (result.isErr()) { - return { tag: "err" as const, value: result.unwrapErr() } - } - const intentHashes = result.unwrap() - const intentHash = intentHashes[0] - assert(intentHash != null) - return { tag: "ok" as const, value: intentHash } - }) + return solverRelay + .publishIntents({ + quote_hashes: [], + signed_datas: [input.multiPayload], + }) + .then(convertPublishIntentsToLegacyFormat) + .then((result) => { + if (result.isErr()) { + return { tag: "err" as const, value: result.unwrapErr() } + } + const intentHashes = result.unwrap() + const intentHash = intentHashes[0] + assert(intentHash != null) + return { tag: "ok" as const, value: intentHash } + }) } ), }, diff --git a/src/features/otcDesk/hooks/useOtcTakerConfirmTrade.ts b/src/features/otcDesk/hooks/useOtcTakerConfirmTrade.ts index 699b87de..14b35905 100644 --- a/src/features/otcDesk/hooks/useOtcTakerConfirmTrade.ts +++ b/src/features/otcDesk/hooks/useOtcTakerConfirmTrade.ts @@ -1,3 +1,4 @@ +import { solverRelay } from "@defuse-protocol/internal-utils" import { useMutation } from "@tanstack/react-query" import { Err, type Result } from "@thames/monads" import { useContext } from "react" @@ -8,7 +9,7 @@ import { import { createSwapIntentMessage } from "../../../core/messages" import { type PublishIntentsErr, - publishIntents, + convertPublishIntentsToLegacyFormat, } from "../../../sdk/solverRelay/publishIntents" import { emitEvent } from "../../../services/emitter" import type { MultiPayload } from "../../../types/defuse-contracts-types" @@ -95,10 +96,12 @@ export function useOtcTakerConfirmTrade({ signerCredentials ) - const result = await publishIntents({ - quote_hashes: quoteHashesResult.unwrap(), - signed_datas: [multiPayload, makerMultiPayload], - }) + const result = await solverRelay + .publishIntents({ + quote_hashes: quoteHashesResult.unwrap(), + signed_datas: [multiPayload, makerMultiPayload], + }) + .then(convertPublishIntentsToLegacyFormat) return result.map((intentHashes) => { return { diff --git a/src/sdk/solverRelay/publishIntents.ts b/src/sdk/solverRelay/publishIntents.ts index 47a26661..a34daaf7 100644 --- a/src/sdk/solverRelay/publishIntents.ts +++ b/src/sdk/solverRelay/publishIntents.ts @@ -1,62 +1,54 @@ -import { retry } from "@lifeomic/attempt" +import type { solverRelay } from "@defuse-protocol/internal-utils" import { Err, Ok, type Result } from "@thames/monads" -import { logger } from "../../logger" -import * as solverRelayClient from "./solverRelayHttpClient" -import { - type ParsedPublishErrors, - parseFailedPublishError, -} from "./utils/parseFailedPublishError" - -export async function publishIntents( - ...args: Parameters -): Promise> { - const [params, requestConfig] = args - return retry( - () => - solverRelayClient.publishIntents(params, { - timeout: 30000, - ...requestConfig, - }), - { - delay: 1000, - factor: 1.5, - maxAttempts: 7, - jitter: true, - minDelay: 1000, - } - ) - .then(parsePublishIntentsResponse, (err) => { - logger.error(new Error("Failed to publish intents", { cause: err })) - return Err({ - reason: "RELAY_PUBLISH_NETWORK_ERROR", - }) - }) - .then((result) => { - if (result.isErr()) { - const err = result.unwrapErr() - if (err.reason === "RELAY_PUBLISH_UNKNOWN_ERROR") { - logger.error(err.serverReason) - } - } - return result - }) -} +import type { ParsedPublishErrors } from "./utils/parseFailedPublishError" export type PublishIntentsOk = string[] export type PublishIntentsErr = | ParsedPublishErrors | { reason: "RELAY_PUBLISH_NETWORK_ERROR" } -function parsePublishIntentsResponse( - response: Awaited> -): Result { - if (response.status === "OK") { - return Ok(response.intent_hashes) +export function convertPublishIntentsToLegacyFormat( + result: Result< + solverRelay.PublishIntentsReturnType, + solverRelay.PublishIntentsErrorType + > +): Promise> { + if (result.isOk()) { + return Promise.resolve(Ok(result.unwrap())) } - if (response.reason === "already processed") { - return Ok(response.intent_hashes) + const error = result.unwrapErr() + const errorCode = error.code + + // Map new PublishErrorCode to old ParsedPublishErrors format + let reason: ParsedPublishErrors["reason"] + switch (errorCode) { + case "SIGNATURE_EXPIRED": + reason = "RELAY_PUBLISH_SIGNATURE_EXPIRED" + break + case "INTERNAL_ERROR": + reason = "RELAY_PUBLISH_INTERNAL_ERROR" + break + case "SIGNATURE_INVALID": + reason = "RELAY_PUBLISH_SIGNATURE_INVALID" + break + case "NONCE_USED": + reason = "RELAY_PUBLISH_NONCE_USED" + break + case "INSUFFICIENT_BALANCE": + reason = "RELAY_PUBLISH_INSUFFICIENT_BALANCE" + break + case "PUBLIC_KEY_NOT_EXIST": + reason = "RELAY_PUBLISH_PUBLIC_NOT_EXIST" + break + default: + reason = "RELAY_PUBLISH_UNKNOWN_ERROR" } - return Err(parseFailedPublishError(response)) + return Promise.resolve( + Err({ + reason, + serverReason: errorCode, + }) + ) } diff --git a/src/sdk/solverRelay/solverRelayHttpClient/apis.ts b/src/sdk/solverRelay/solverRelayHttpClient/apis.ts index 9684ee56..971e6fed 100644 --- a/src/sdk/solverRelay/solverRelayHttpClient/apis.ts +++ b/src/sdk/solverRelay/solverRelayHttpClient/apis.ts @@ -27,19 +27,6 @@ export async function publishIntent( return result as any } -export async function publishIntents( - params: types.PublishIntentsRequest["params"][0], - config: types.RequestConfig = {} -): Promise { - const result = await jsonRPCRequest( - "publish_intents", - params, - config - ) - // biome-ignore lint/suspicious/noExplicitAny: - return result as any -} - export async function getStatus( params: types.GetStatusRequest["params"][0], config: types.RequestConfig = {} diff --git a/src/sdk/solverRelay/utils/parseFailedPublishError.ts b/src/sdk/solverRelay/utils/parseFailedPublishError.ts index 2c0b4d9b..71079928 100644 --- a/src/sdk/solverRelay/utils/parseFailedPublishError.ts +++ b/src/sdk/solverRelay/utils/parseFailedPublishError.ts @@ -1,7 +1,5 @@ import type { solverRelay } from "@defuse-protocol/internal-utils" import type { Result } from "@thames/monads" -import { assert } from "../../../utils/assert" -import type * as solverRelayClient from "../solverRelayHttpClient" export type ParsedPublishErrors = | { @@ -18,46 +16,6 @@ export type ParsedPublishErrors = serverReason: string } -export function parseFailedPublishError( - response: - | Awaited> - | Awaited> -): ParsedPublishErrors { - assert(response.status === "FAILED", "Expected response to be failed") - - if ( - response.reason === "expired" || - response.reason.includes("deadline has expired") - ) { - return { reason: "RELAY_PUBLISH_SIGNATURE_EXPIRED" } - } - - if (response.reason === "internal") { - return { reason: "RELAY_PUBLISH_INTERNAL_ERROR" } - } - - if (response.reason.includes("invalid signature")) { - return { reason: "RELAY_PUBLISH_SIGNATURE_INVALID" } - } - - if (response.reason.includes("nonce was already used")) { - return { reason: "RELAY_PUBLISH_NONCE_USED" } - } - - if (response.reason.includes("insufficient balance or overflow")) { - return { reason: "RELAY_PUBLISH_INSUFFICIENT_BALANCE" } - } - - if (response.reason.includes("public key doesn't exist")) { - return { reason: "RELAY_PUBLISH_PUBLIC_NOT_EXIST" } - } - - return { - reason: "RELAY_PUBLISH_UNKNOWN_ERROR", - serverReason: response.reason, - } -} - /** * Adapter function that converts the new Result * from internal-utils into the legacy format used by the SDK. From 06c1f2b1282aaa30c786a40e7282a4e696f3beeb Mon Sep 17 00:00:00 2001 From: jobotics Date: Tue, 22 Jul 2025 10:52:14 +0100 Subject: [PATCH 4/4] chore: remove legacy function publishIntent --- src/sdk/solverRelay/solverRelayHttpClient/apis.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/sdk/solverRelay/solverRelayHttpClient/apis.ts b/src/sdk/solverRelay/solverRelayHttpClient/apis.ts index 971e6fed..34f574ea 100644 --- a/src/sdk/solverRelay/solverRelayHttpClient/apis.ts +++ b/src/sdk/solverRelay/solverRelayHttpClient/apis.ts @@ -14,19 +14,6 @@ export async function quote( return result as any } -export async function publishIntent( - params: types.PublishIntentRequest["params"][0], - config: types.RequestConfig = {} -): Promise { - const result = await jsonRPCRequest( - "publish_intent", - params, - config - ) - // biome-ignore lint/suspicious/noExplicitAny: - return result as any -} - export async function getStatus( params: types.GetStatusRequest["params"][0], config: types.RequestConfig = {}