@xo-cash/engine
    Preparing search index...

    Class InvitationBuilder

    Builder for the XOInvitation

    Index

    Constructors

    Methods

    • Add a commit to the invitation.

      Parameters

      • commit: XOInvitationCommit

        The commit to add.

      Returns this

      The builder instance.

    • Creates an unsigned commit without adding it to the invitation. This allows for atomic commit creation with signature.

      Parameters

      • params: {
            expiresAtTimestamp?: number;
            inputs?: XOInvitationInput[];
            outputs?: XOInvitationOutput[];
            transactionLocktime?: number;
            transactionVersion?: number;
            variables?: XOInvitationVariable[];
        }

        Parameters for creating the commit

        • OptionalexpiresAtTimestamp?: number

          Optional expiration timestamp (defaults to now + DEFAULT_COMMIT_EXPIRATION_IN_MILLISECONDS)

        • Optionalinputs?: XOInvitationInput[]

          Optional array of inputs to add

        • Optionaloutputs?: XOInvitationOutput[]

          Optional array of outputs to add

        • OptionaltransactionLocktime?: number

          Optional transaction locktime

        • OptionaltransactionVersion?: number

          Optional transaction version

        • Optionalvariables?: XOInvitationVariable[]

          Optional array of variables to add

      Returns Omit<XOInvitationCommit, "signature" | "entityIdentifier">

      The unsigned commit (without signature)

    • Returns the last InvitationCommit in the invitation.

      Returns XOInvitationCommit

      The last InvitationCommit object, or undefined if there are no commits.

    • Returns the commitIdentifier of the last commit in the invitation.

      Returns string

      The commitIdentifier as a string, or undefined if there are no commits.

    • Fully validates a given XOInvitation.

      Parameters

      • template: XOTemplate

        The template to validate against.

      Returns this

      If the invitation has expired.

      If the entity identifiers are invalid.

      If the requirements are invalid.

      If the commit signatures are invalid.

    Properties

    actionIdentifier: string

    The identifier of the action for the invitation.

    invitationIdentifier: string

    The identifier of the current invitation.

    TODO: Add validations and type checks to the identifier e.g length.

    templateIdentifier: string

    The identifier of the template for the invitation.

    TODO: Add validations and type checks to the identifier e.g it should be a 32 byte hex string, etc.