MCPcopy Index your code
hub / github.com/chain/Core / ReceiverBuilder

Class ReceiverBuilder

sdk/java/src/main/java/com/chain/api/Account.java:329–396  ·  view source on GitHub ↗

Use this class to create a Receiver under an account.

Source from the content-addressed store, hash-verified

327 * Use this class to create a {@link Receiver} under an account.
328 */
329 public static class ReceiverBuilder {
330 @SerializedName("account_alias")
331 public String accountAlias;
332
333 @SerializedName("account_id")
334 public String accountId;
335
336 @SerializedName("expires_at")
337 public Date expiresAt;
338
339 /**
340 * Specifies the account under which the receiver is created. You must use
341 * this method or @{link ReceiverBuilder#setAccountId}, but not both.
342 *
343 * @param alias the unique alias of the account
344 * @return this ReceiverBuilder object
345 */
346 public ReceiverBuilder setAccountAlias(String alias) {
347 this.accountAlias = alias;
348 return this;
349 }
350
351 /**
352 * Specifies the account under which the receiver is created. You must use
353 * this method or @{link ReceiverBuilder#setAccountAlias}, but not both.
354 *
355 * @param id the unique ID of the account
356 * @return this ReceiverBuilder object
357 */
358 public ReceiverBuilder setAccountId(String id) {
359 this.accountId = id;
360 return this;
361 }
362
363 /**
364 * Specifies when the receiver will expire. This defaults to 30 days in the
365 * future.
366 *
367 * Payments to expired receivers should not be considered valid, and may or
368 * may not be indexed by your Chain Core instance. In general, as long as
369 * the contents of receiver objects are not tampered with, the transaction
370 * builder will ensure that transactions that pay to expired receivers will
371 * be rejected by the blockchain.
372 *
373 * @param date the date when the receiver expires
374 * @return this ReceiverBuilder object
375 */
376 public ReceiverBuilder setExpiresAt(Date date) {
377 this.expiresAt = date;
378 return this;
379 }
380
381 /**
382 * Creates a single Receiver object under an account.
383 *
384 * @param client the client object providing access to an instance of Chain Core
385 * @return a new Receiver object
386 * @throws APIException This exception is raised if the api returns errors while creating the control programs.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected