PaymentBuilder
SIP Protocol API Reference v0.7.2
SIP Protocol API Reference / PaymentBuilder
Class: PaymentBuilder
Section titled “Class: PaymentBuilder”Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:6128
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-CzWPI6Le.d.ts:6148
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-CzWPI6Le.d.ts:6154
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-CzWPI6Le.d.ts:6160
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-CzWPI6Le.d.ts:6164
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-CzWPI6Le.d.ts:6168
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-CzWPI6Le.d.ts:6172
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-CzWPI6Le.d.ts:6176
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-CzWPI6Le.d.ts:6180
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-CzWPI6Le.d.ts:6184
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-CzWPI6Le.d.ts:6188
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-CzWPI6Le.d.ts:6192
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-CzWPI6Le.d.ts:6196
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-CzWPI6Le.d.ts:6200
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-CzWPI6Le.d.ts:6204
Build the shielded payment
Returns
Section titled “Returns”Promise<ShieldedPayment>