Associate Sender Info To Receive
Overview
associateSenderInfoToReceive API associates the sender of a receive — an address book contact with one of its wallet addresses — to the receive itself. It provides the sender information required by the Travel Rule validation process for receives in the waitingForValidationData status.
The typical flow is:
- Detect a receive waiting for sender data. Fetch the activities: a
ReceiveActivitywhosevalidationStatusiswaitingForValidationDatarequires the sender information. Keep itsreceiveId. - Create the sender contact. Create a new address book entry with the sender's wallet address (see Create Address Book Entry With Wallet Address), with
isVisible: falseso it does not appear in the user's address book list. - Associate the sender to the receive. Call
associateSenderInfoToReceivewith thereceiveId, theaddressBookIdand thewalletAddressId. - Track the validation. After the association the receive goes through the Conio validation process (
waitingForValidation), which can end with the received amount being credited (confirmed) or with the sender data being rejected (validationFailed). The updated status may not be visible immediately when re-fetching the activity.
Params
The AssociateSenderInfoToReceiveParams used to initialize and perform associateSenderInfoToReceive API.
- receive id: the unique identifier of the receive operation (from
ReceiveActivity.receiveId) - address book id: the unique identifier of the sender in the address book
- wallet address id: the unique identifier of the wallet address associated with the sender
Result
Success or error.
Code
iOS
let params = AssociateSenderInfoToReceiveParams.make(
receiveId: receiveId,
addressBookId: addressBookId,
walletAddressId: walletAddressId
)
addressBookService
.associateSenderInfoToReceive(with: params)
.asPublisher()
.sink { result in
// on success, re-fetch the activity to observe the updated status
}
Android
val params = AssociateSenderInfoToReceiveParams(
receiveId = "...",
addressBookId = "...",
walletAddressId = "..."
)
conio.addressBookService
.associateSenderInfoToReceive(params)
.asFlow()
.collect { result ->
// on success, re-fetch the activity to observe the updated status
}