NEARIntentsBackend
SIP Protocol API Reference v0.7.0
SIP Protocol API Reference / NEARIntentsBackend
Class: NEARIntentsBackend
Section titled “Class: 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.
Example
Section titled “Example”const backend = new NEARIntentsBackend({ jwtToken: process.env.NEAR_INTENTS_JWT,})
// Get quoteconst 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 swapconst result = await backend.executeSwap({ quoteId: quote.quoteId,})
// Check statusconst status = await backend.getStatus(result.swapId)Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NEARIntentsBackend(
config?):NEARIntentsBackend
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4854
Parameters
Section titled “Parameters”config?
Section titled “config?”Returns
Section titled “Returns”NEARIntentsBackend
Properties
Section titled “Properties”
readonlyname:"near-intents"
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4850
Backend name (e.g., ‘near-intents’, ‘zcash’, ‘thorchain’)
Implementation of
Section titled “Implementation of”capabilities
Section titled “capabilities”
readonlycapabilities:BackendCapabilities
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4851
Backend capabilities
Implementation of
Section titled “Implementation of”SettlementBackend.capabilities
Methods
Section titled “Methods”getQuote()
Section titled “getQuote()”getQuote(
params):Promise<SettlementQuote>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4858
Get quote for a cross-chain swap
Parameters
Section titled “Parameters”params
Section titled “params”Returns
Section titled “Returns”Promise<SettlementQuote>
Implementation of
Section titled “Implementation of”executeSwap()
Section titled “executeSwap()”executeSwap(
params):Promise<SettlementSwapResult>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4862
Execute swap using a quote
Parameters
Section titled “Parameters”params
Section titled “params”Returns
Section titled “Returns”Promise<SettlementSwapResult>
Implementation of
Section titled “Implementation of”getStatus()
Section titled “getStatus()”getStatus(
swapId):Promise<SwapStatusResponse>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4866
Get current swap status
Parameters
Section titled “Parameters”swapId
Section titled “swapId”string
Returns
Section titled “Returns”Promise<SwapStatusResponse>
Implementation of
Section titled “Implementation of”waitForCompletion()
Section titled “waitForCompletion()”waitForCompletion(
swapId,options?):Promise<SwapStatusResponse>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4870
Wait for swap completion (optional)
Parameters
Section titled “Parameters”swapId
Section titled “swapId”string
options?
Section titled “options?”interval?
Section titled “interval?”number
timeout?
Section titled “timeout?”number
onStatusChange?
Section titled “onStatusChange?”(status) => void
Returns
Section titled “Returns”Promise<SwapStatusResponse>
Implementation of
Section titled “Implementation of”SettlementBackend.waitForCompletion
getDryQuote()
Section titled “getDryQuote()”getDryQuote(
params):Promise<SettlementQuote>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4878
Get dry quote (preview without creating deposit address)
Parameters
Section titled “Parameters”params
Section titled “params”Returns
Section titled “Returns”Promise<SettlementQuote>
Implementation of
Section titled “Implementation of”notifyDeposit()
Section titled “notifyDeposit()”notifyDeposit(
swapId,txHash,metadata?):Promise<void>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4882
Notify backend of deposit transaction
Parameters
Section titled “Parameters”swapId
Section titled “swapId”string
txHash
Section titled “txHash”string
metadata?
Section titled “metadata?”Record<string, unknown>
Returns
Section titled “Returns”Promise<void>