Skip to content

NEARIntentsBackend

SIP Protocol API Reference v0.7.0


SIP Protocol API Reference / NEARIntentsBackend

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4849

NEAR Intents Settlement Backend

Provides privacy-preserving cross-chain swaps via NEAR 1Click API.

const backend = new NEARIntentsBackend({
jwtToken: process.env.NEAR_INTENTS_JWT,
})
// Get quote
const quote = await backend.getQuote({
fromChain: 'ethereum',
toChain: 'solana',
fromToken: 'USDC',
toToken: 'SOL',
amount: 1000000n, // 1 USDC
privacyLevel: PrivacyLevel.SHIELDED,
recipientMetaAddress: 'sip:solana:0x...:0x...',
senderAddress: '0xYourEthAddress',
})
// Execute swap
const result = await backend.executeSwap({
quoteId: quote.quoteId,
})
// Check status
const status = await backend.getStatus(result.swapId)

new NEARIntentsBackend(config?): NEARIntentsBackend

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4854

NEARIntentsAdapterConfig

NEARIntentsBackend

readonly name: "near-intents"

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4850

Backend name (e.g., ‘near-intents’, ‘zcash’, ‘thorchain’)

SettlementBackend.name


readonly capabilities: BackendCapabilities

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4851

Backend capabilities

SettlementBackend.capabilities

getQuote(params): Promise<SettlementQuote>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4858

Get quote for a cross-chain swap

SettlementQuoteParams

Promise<SettlementQuote>

SettlementBackend.getQuote


executeSwap(params): Promise<SettlementSwapResult>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4862

Execute swap using a quote

SettlementSwapParams

Promise<SettlementSwapResult>

SettlementBackend.executeSwap


getStatus(swapId): Promise<SwapStatusResponse>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4866

Get current swap status

string

Promise<SwapStatusResponse>

SettlementBackend.getStatus


waitForCompletion(swapId, options?): Promise<SwapStatusResponse>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4870

Wait for swap completion (optional)

string

number

number

(status) => void

Promise<SwapStatusResponse>

SettlementBackend.waitForCompletion


getDryQuote(params): Promise<SettlementQuote>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4878

Get dry quote (preview without creating deposit address)

SettlementQuoteParams

Promise<SettlementQuote>

SettlementBackend.getDryQuote


notifyDeposit(swapId, txHash, metadata?): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4882

Notify backend of deposit transaction

string

string

Record<string, unknown>

Promise<void>

SettlementBackend.notifyDeposit