> For the complete documentation index, see [llms.txt](https://docs.zk.link/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zk.link/developer/sdk/changelog/transactions/4-forced-exit.md).

# ForcedExit

### type ForcedExitBuilder

```go
type ForcedExitBuilder struct {
    ToChainId             ChainId
    InitiatorAccountId    AccountId
    InitiatorSubAccountId SubAccountId
    Target                ZkLinkAddress
    TargetSubAccountId    SubAccountId
    L2SourceToken         TokenId
    L1TargetToken         TokenId
    InitiatorNonce        Nonce
    ExitAmount            BigUint
    WithdrawToL1          bool
    Timestamp             TimeStamp
}
```

Builder used to create ForcedExit transaction.

### type ForcedExit

[ForcedExit](/developer/api-and-sdk/transaction/forced_exit.md) transaction type, it's a opaque data type.

#### func NewForcedExit

```go
func NewForcedExit(builder ForcedExitBuilder) *ForcedExit
```

Create a new [ForcedExit](#type-forcedexit) transaction.

#### func (\*ForcedExit) GetBytes

```go
func (_self *ForcedExit) GetBytes() []uint8
```

Get the encoded bytes used to create the L3 signature.

#### func (\*ForcedExit) TxHash

```go
func (*ForcedExit) TxHash() []uint8
```

Get the transaction hash of [ForcedExit](#type-forcedexit) transaction.

#### func (\*ForcedExit) JsonStr

```go
func (*ForcedExit) JsonStr() string
```

Get the json string of the [ForcedExit](#type-forcedexit) transaction.

#### func (\*ForcedExit) IsValid

```go
func (_self *ForcedExit) IsValid() bool
```

Check if all the fields in Withdraw are valid. For example, if the `ChainId` is exceeded the maximum ChainId, it will return false.

#### func (\*ForcedExit) CreateSignedTx

```go
func (*ForcedExit) CreateSignedTx(signer *ZkLinkSigner) (*ForcedExit, error)
```

Sign the Transfer transaction with the [ZkLinkSigner](/developer/sdk/changelog/signer.md#type-zklinksigner), L1 signature and L3 signature will be created.

#### func (\*ForcedExit) GetSignature

```go
func (*ForcedExit) GetSignature() ZkLinkSignature
```

Get the signature in the [Transfer](#type-transfer) transaction.

#### func (\*ForcedExit) IsSignatureValid

```go
func (*ForcedExit) IsSignatureValid() bool
```

Check if the L3 signature in the Transfer transaction is valid or not.

#### func (\*ForcedExit) SubmitterSignature

```go
func (*ForcedExit) SubmitterSignature(signer *ZkLinkSigner) (ZkLinkSignature, error)
```

Create the submitter signature.

**input:**

* signer: [ZkLinkSigner](/developer/sdk/changelog/signer.md#type-zklinksigner)

#### func (\*ForcedExit) ToZklinkTx

```go
func (*ForcedExit) ToZklinkTx() ZkLinkTx
```

Change the transaction to the [ZkLinkTx](/developer/sdk/changelog/basic_types.md#zklinktx)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zk.link/developer/sdk/changelog/transactions/4-forced-exit.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
