PaymentBuilder
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / PaymentBuilder
Class: PaymentBuilder
Section titled “Class: PaymentBuilder”Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9277
Builder class for creating shielded payments
Provides a fluent interface for constructing privacy-preserving payments.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PaymentBuilder():
PaymentBuilder
Returns
Section titled “Returns”PaymentBuilder
Methods
Section titled “Methods”token()
Section titled “token()”token(
tokenOrSymbol,chain?):this
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9297
Set the token to transfer
Parameters
Section titled “Parameters”tokenOrSymbol
Section titled “tokenOrSymbol”Asset object or stablecoin symbol
chain?
Section titled “chain?”Chain ID (required if using symbol)
Returns
Section titled “Returns”this
amount()
Section titled “amount()”amount(
amount):this
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9303
Set the amount to transfer (in smallest units)
Parameters
Section titled “Parameters”amount
Section titled “amount”bigint
Amount in token’s smallest units
Returns
Section titled “Returns”this
amountHuman()
Section titled “amountHuman()”amountHuman(
amount):this
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9309
Set the amount in human-readable format
Parameters
Section titled “Parameters”amount
Section titled “amount”number
Human-readable amount (e.g., 100.50)
Returns
Section titled “Returns”this
recipient()
Section titled “recipient()”recipient(
metaAddress):this
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9313
Set the recipient’s stealth meta-address (for privacy modes)
Parameters
Section titled “Parameters”metaAddress
Section titled “metaAddress”string
Returns
Section titled “Returns”this
recipientDirect()
Section titled “recipientDirect()”recipientDirect(
address):this
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9317
Set the recipient’s direct address (for transparent mode)
Parameters
Section titled “Parameters”address
Section titled “address”string
Returns
Section titled “Returns”this
privacy()
Section titled “privacy()”privacy(
level):this
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9321
Set the privacy level
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
viewingKey()
Section titled “viewingKey()”viewingKey(
key):this
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9325
Set the viewing key (required for compliant mode)
Parameters
Section titled “Parameters”`0x${string}`
Returns
Section titled “Returns”this
destinationChain()
Section titled “destinationChain()”destinationChain(
chain):this
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9329
Set the destination chain (for cross-chain payments)
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
purpose()
Section titled “purpose()”purpose(
purpose):this
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9333
Set the payment purpose
Parameters
Section titled “Parameters”purpose
Section titled “purpose”Returns
Section titled “Returns”this
memo()
Section titled “memo()”memo(
memo):this
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9337
Set an optional memo/reference
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”this
ttl(
seconds):this
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9341
Set time-to-live in seconds
Parameters
Section titled “Parameters”seconds
Section titled “seconds”number
Returns
Section titled “Returns”this
sender()
Section titled “sender()”sender(
address):this
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9345
Set the sender address
Parameters
Section titled “Parameters”address
Section titled “address”string
Returns
Section titled “Returns”this
withProvider()
Section titled “withProvider()”withProvider(
provider):this
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9349
Set the proof provider
Parameters
Section titled “Parameters”provider
Section titled “provider”Returns
Section titled “Returns”this
build()
Section titled “build()”build():
Promise<ShieldedPayment>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:9353
Build the shielded payment
Returns
Section titled “Returns”Promise<ShieldedPayment>