> For the complete documentation index, see [llms.txt](https://docs.gnoswap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gnoswap.io/contracts/gov/staker/delegation_withdraw.gno.md).

# delegation\_withdraw\.gno

{% embed url="<https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno>" %}

## Types

### DelegationWithdraw

```go
type DelegationWithdraw struct
```

DelegationWithdraw represents a pending withdrawal from a delegation. This struct tracks undelegated amounts that are subject to lockup periods and manages the collection process once the lockup period expires.

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L10)

#### Methods

**Clone**

```go
func (d *DelegationWithdraw) Clone() DelegationWithdraw
```

Clone creates a deep copy of the delegation withdraw.

#### Return Values

| Name                 | Type               | Description                               |
| -------------------- | ------------------ | ----------------------------------------- |
| `DelegationWithdraw` | DelegationWithdraw | independent copy of the withdrawal state. |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L181)

**CollectableTime**

```go
func (d *DelegationWithdraw) CollectableTime() int64
```

CollectableTime returns the timestamp when collection becomes available.

#### Return Values

| Name    | Type  | Description      |
| ------- | ----- | ---------------- |
| `int64` | int64 | collectable time |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L73)

**CollectedAmount**

```go
func (d *DelegationWithdraw) CollectedAmount() int64
```

CollectedAmount returns the amount that has already been collected.

#### Return Values

| Name    | Type  | Description      |
| ------- | ----- | ---------------- |
| `int64` | int64 | collected amount |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L65)

**CollectedAt**

```go
func (d *DelegationWithdraw) CollectedAt() int64
```

CollectedAt returns the timestamp when collection occurred.

#### Return Values

| Name    | Type  | Description          |
| ------- | ----- | -------------------- |
| `int64` | int64 | collection timestamp |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L81)

**DelegationID**

```go
func (d *DelegationWithdraw) DelegationID() int64
```

DelegationID returns the unique identifier of the associated delegation.

#### Return Values

| Name    | Type  | Description   |
| ------- | ----- | ------------- |
| `int64` | int64 | delegation ID |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L33)

**IsCollected**

```go
func (d *DelegationWithdraw) IsCollected() bool
```

IsCollected returns whether the withdrawal has been fully collected.

#### Return Values

| Name   | Type | Description                              |
| ------ | ---- | ---------------------------------------- |
| `bool` | bool | true if fully collected, false otherwise |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L89)

**SetCollected**

```go
func (d *DelegationWithdraw) SetCollected(
	collected bool
)
```

SetCollected sets the collected status.

#### Parameters

| Name        | Type | Description          |
| ----------- | ---- | -------------------- |
| `collected` | bool | new collected status |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L97)

**SetCollectedAmount**

```go
func (d *DelegationWithdraw) SetCollectedAmount(
	amount int64
)
```

SetCollectedAmount sets the collected amount.

#### Parameters

| Name     | Type  | Description      |
| -------- | ----- | ---------------- |
| `amount` | int64 | collected amount |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L113)

**SetCollectedAt**

```go
func (d *DelegationWithdraw) SetCollectedAt(
	collectedAt int64
)
```

SetCollectedAt sets the collection timestamp.

#### Parameters

| Name          | Type  | Description          |
| ------------- | ----- | -------------------- |
| `collectedAt` | int64 | collection timestamp |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L105)

**UnDelegateAmount**

```go
func (d *DelegationWithdraw) UnDelegateAmount() int64
```

UnDelegateAmount returns the total amount that was undelegated.

#### Return Values

| Name    | Type  | Description        |
| ------- | ----- | ------------------ |
| `int64` | int64 | undelegated amount |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L41)

**UnDelegatedAt**

```go
func (d *DelegationWithdraw) UnDelegatedAt() int64
```

UnDelegatedAt returns the timestamp when the undelegation occurred.

#### Return Values

| Name    | Type  | Description            |
| ------- | ----- | ---------------------- |
| `int64` | int64 | undelegation timestamp |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L49)

**UnDelegatedHeight**

```go
func (d *DelegationWithdraw) UnDelegatedHeight() int64
```

UnDelegatedHeight returns the height when the undelegation occurred.

#### Return Values

| Name    | Type  | Description         |
| ------- | ----- | ------------------- |
| `int64` | int64 | undelegation height |

[source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L57)

#### Constructors

* `func GetDelegationWithdraws(delegationID int64, offset int, count int) ([]DelegationWithdraw, error)` ([source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/getters.gno#L195))
* `func NewDelegationWithdraw(delegationID int64, unDelegateAmount int64, createdHeight int64, createdAt int64, unDelegationLockupPeriod int64) DelegationWithdraw` ([source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L129))
* `func NewDelegationWithdrawWithoutLockup(delegationID int64, unDelegateAmount int64, createdHeight int64, createdAt int64) DelegationWithdraw` ([source](https://github.com/gnoswap-labs/gnoswap/blob/d9d34bd345a36c3eedaccf491c6615b0ac4168cd/contract/r/gnoswap/gov/staker/delegation_withdraw.gno#L159))
