Create Wallet Address
Overview
createWalletAddress API creates a new wallet address associated with an existing AddressBookEntry.
Params
The CreateAddressBookWalletAddressParams used to initialize and perform createWalletAddress API.
- address book id: id referencing the parent
AddressBookEntry. - wallet address: wallet address details to create. For more informations check
CreateAddressBookWalletAddressdefinition.
Result
The CreateAddressBookWalletAddressResult contains the complete AddressBookWalletAddress with id's.
- wallet address: the newly created wallet address with full details.
Errors
List of the possible errors that can be returned by this API:
AddressBookNotFound: Address Book entry specified wasn't foundAddressAlreadyUsed: Wallet Address already present in one Address Book entryWalletAddressInvalidParameters: invalid parameters provided to create an Address Book Wallet Address entryWalletAddressValidationError: unable to create/update an Address Book Wallet Address because the provided parameters are not conformed to the Travel Rule / Agenzia delle Entrate requirementsInvalidCountry: theVasp.countryprovided does not match the ISO 3166-1 alpha-2 standard.
Code
iOS
let params = CreateAddressBookWalletAddressParams.make(
addressBookId: ...,
CreateAddressBookWalletAddress.make(
walletAddress: ...,
isForeign: ...,
isUnhostedWallet: ...,
vasp: ...,
proofOfOwnership: ...,
label: ...,
threshold: ...
)
)
addressBookService
.createWalletAddress(params: params)
.asPublisher()
.sink { result in
// ...
}
Android
// val vasp = Vasp.buildWithDid(
// name = "...",
// did = "..."
// )
val vasp = Vasp.buildWithWebsite(
name = "...",
websiteUrl = "..."
)
val proofOfOwnership = ProofOfOwnership(
message = ProofOfOwnershipMessage(
value = "..."
),
signature = ProofOfOwnershipSignature(
value = "..."
)
)
val walletAddress = CreateAddressBookWalletAddress(
walletAddress = "...",
isForeign = false,
isUnhostedWallet = false,
vasp = vasp,
proofOfOwnership = proofOfOwnership,
label = "...",
threshold = FiatAmount(1000)
)
val params = CreateAddressBookWalletAddressParams(
addressBookId = "...",
walletAddress = walletAddress
)
conio.addressBookService
.createWalletAddress(params)
.asFlow()
.collect { result ->
//...
}