PaymentBuilder
SIP Protocol API Reference v0.7.0
SIP Protocol API Reference / PaymentBuilder
Class: PaymentBuilder
Section titled “Class: PaymentBuilder”Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:6065
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-BYZbDjal.d.ts:6085
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-BYZbDjal.d.ts:6091
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-BYZbDjal.d.ts:6097
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-BYZbDjal.d.ts:6101
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-BYZbDjal.d.ts:6105
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-BYZbDjal.d.ts:6109
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-BYZbDjal.d.ts:6113
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-BYZbDjal.d.ts:6117
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-BYZbDjal.d.ts:6121
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-BYZbDjal.d.ts:6125
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-BYZbDjal.d.ts:6129
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-BYZbDjal.d.ts:6133
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-BYZbDjal.d.ts:6137
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-BYZbDjal.d.ts:6141
Build the shielded payment
Returns
Section titled “Returns”Promise<ShieldedPayment>