Skip to content

Commit

Permalink
Update docs and README for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-maj committed Nov 14, 2022
1 parent c2453da commit fc54364
Show file tree
Hide file tree
Showing 17 changed files with 180 additions and 61 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
To install the SDK with the `go get` command, run the following:

```bash
go get github.com/thirdweb-dev/go-sdk/thirdweb
go get github.com/thirdweb-dev/go-sdk/v2/thirdweb
```

## Getting Started
Expand All @@ -29,8 +29,8 @@ package main

import (
"fmt"
"github.com/thirdweb-dev/go-sdk/thirdweb"

"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)

func main() {
Expand Down Expand Up @@ -62,7 +62,7 @@ package main
import (
"fmt"

"github.com/thirdweb-dev/go-sdk/thirdweb"
"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)

func main() {
Expand Down Expand Up @@ -103,7 +103,7 @@ import (
"fmt"
"encoding/json"

"github.com/thirdweb-dev/go-sdk/thirdweb"
"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion docs/contract_deployer.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The contract deployer lets you deploy new contracts to the blockchain using just

```
import (
"github.com/thirdweb-dev/go-sdk/thirdweb"
"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)
privateKey = "..."
Expand Down
65 changes: 63 additions & 2 deletions docs/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Let's take a look at how you can get a custom contract instance for one of your

```
import (
"github.com/thirdweb-dev/go-sdk/thirdweb"
"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)
privateKey = "..."
Expand All @@ -31,7 +31,7 @@ Alternatively, if you didn't deploy your contract with thirdweb deploy, you can

```
import (
"github.com/thirdweb-dev/go-sdk/thirdweb"
"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)
privateKey = "..."
Expand Down Expand Up @@ -89,3 +89,64 @@ balance, err := contract.Call("balanceOf", "{{wallet_address}}")
// You can also make a transaction to your contract with the call method
tx, err := contract.Call(context.Background(), "mintTo", "{{wallet_address}}", "ipfs://...")
```

## type [SnapshotClaim](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/snapshots.go#L17-L21>)

```go
type SnapshotClaim struct {
Address string `json:"address"`
MaxClaimable int `json:"maxClaimable"`
Proof []string `json:"proof"`
}
```

## type [SnapshotEntry](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L573-L578>)

```go
type SnapshotEntry struct {
Address string `json:"address"`
MaxClaimable string `json:"maxClaimable"`
Price string `json:"price"`
CurrencyAddress string `json:"currencyAddress"`
}
```

## type [SnapshotEntryWithProof](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L551-L557>)

```go
type SnapshotEntryWithProof struct {
Address string
MaxClaimable string
Price string
CurrencyAddress string
Proof [][32]byte
}
```

## type [SnapshotInfo](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/snapshots.go#L23-L26>)

```go
type SnapshotInfo struct {
MerkleRoot string `json:"merkleRoot"`
Claims []SnapshotClaim `json:"claims"`
}
```

## type [SnapshotInfos](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/snapshots.go#L28-L32>)

```go
type SnapshotInfos struct {
Snapshot SnapshotInfo
MerkleRoot string
SnapshotUri string
}
```

## type [SnapshotInput](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/snapshots.go#L12-L15>)

```go
type SnapshotInput struct {
Address string
MaxClaimable int
}
```
2 changes: 1 addition & 1 deletion docs/edition.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ You can access the Edition interface from the SDK as follows:

```
import (
"github.com/thirdweb-dev/go-sdk/thirdweb"
"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)
privateKey = "..."
Expand Down
6 changes: 3 additions & 3 deletions docs/edition_drop.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ You can access the Edition Drop interface from the SDK as follows:

```
import (
"github.com/thirdweb-dev/go-sdk/thirdweb"
"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)
privateKey = "..."
Expand All @@ -25,7 +25,7 @@ type EditionDrop struct {
}
```

### func \(\*EditionDrop\) [Claim](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/edition_drop.go#L150>)
### func \(\*EditionDrop\) [Claim](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/edition_drop.go#L151>)

```go
func (drop *EditionDrop) Claim(ctx context.Context, tokenId int, quantity int) (*types.Transaction, error)
Expand All @@ -39,7 +39,7 @@ quantity: the number of NFTs to claim

returns: the transaction receipt of the claim

### func \(\*EditionDrop\) [ClaimTo](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/edition_drop.go#L172>)
### func \(\*EditionDrop\) [ClaimTo](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/edition_drop.go#L173>)

```go
func (drop *EditionDrop) ClaimTo(ctx context.Context, destinationAddress string, tokenId int, quantity int) (*types.Transaction, error)
Expand Down
10 changes: 8 additions & 2 deletions docs/edition_drop_claim_conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This interface is currently accessible from the Edition Drop contract contract t
type EditionDropClaimConditions struct {}
```

### func \(\*EditionDropClaimConditions\) [GetActive](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/edition_drop_claim_conditions.go#L52>)
### func \(\*EditionDropClaimConditions\) [GetActive](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/edition_drop_claim_conditions.go#L53>)

```go
func (claim *EditionDropClaimConditions) GetActive(ctx context.Context, tokenId int) (*ClaimConditionOutput, error)
Expand All @@ -34,7 +34,7 @@ fmt.Println("Price:", condition.Price)
fmt.Println("Wait In Seconds", condition.WaitInSeconds)
```

### func \(\*EditionDropClaimConditions\) [GetAll](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/edition_drop_claim_conditions.go#L96>)
### func \(\*EditionDropClaimConditions\) [GetAll](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/edition_drop_claim_conditions.go#L103>)

```go
func (claim *EditionDropClaimConditions) GetAll(ctx context.Context, tokenId int) ([]*ClaimConditionOutput, error)
Expand All @@ -61,3 +61,9 @@ fmt.Println("Quantity Limit:", condition.QuantityLimitPerTransaction)
fmt.Println("Price:", condition.Price)
fmt.Println("Wait In Seconds", condition.WaitInSeconds)
```

### func \(\*EditionDropClaimConditions\) [GetMerkleMetadata](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/edition_drop_claim_conditions.go#L142>)

```go
func (claim *EditionDropClaimConditions) GetMerkleMetadata() (*map[string]string, error)
```
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
To install the SDK with the `go get` command, run the following:

```bash
go get github.com/thirdweb-dev/go-sdk/thirdweb
go get github.com/thirdweb-dev/go-sdk/v2/thirdweb
```

## Getting Started
Expand All @@ -29,8 +29,8 @@ package main

import (
"fmt"
"github.com/thirdweb-dev/go-sdk/thirdweb"

"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)

func main() {
Expand Down Expand Up @@ -62,7 +62,7 @@ package main
import (
"fmt"

"github.com/thirdweb-dev/go-sdk/thirdweb"
"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)

func main() {
Expand Down Expand Up @@ -103,7 +103,7 @@ import (
"fmt"
"encoding/json"

"github.com/thirdweb-dev/go-sdk/thirdweb"
"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion docs/marketplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ You can access the Marketplace interface from the SDK as follows:

```
import (
"github.com/thirdweb-dev/go-sdk/thirdweb"
"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)
privateKey = "..."
Expand Down
36 changes: 33 additions & 3 deletions docs/marketplace_encoder.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You can access the Marketplace interface from the SDK as follows:

```
import (
"github.com/thirdweb-dev/go-sdk/thirdweb"
"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)
privateKey = "..."
Expand Down Expand Up @@ -212,7 +212,7 @@ fmt.Println(tx.Data()) // Ex: get the data field or the nonce field (others are
fmt.Println(tx.Nonce())
```

## type [MarketplaceFilter](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L509-L514>)
## type [MarketplaceFilter](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L515-L520>)

```go
type MarketplaceFilter struct {
Expand All @@ -223,7 +223,37 @@ type MarketplaceFilter struct {
}
```

## type [Metadata](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L13-L16>)
## type [MerkleContent](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/snapshots.go#L34-L36>)

```go
type MerkleContent struct {}
```

### func \(MerkleContent\) [CalculateHash](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/snapshots.go#L38>)

```go
func (t MerkleContent) CalculateHash() ([]byte, error)
```

### func \(MerkleContent\) [Equals](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/snapshots.go#L47>)

```go
func (t MerkleContent) Equals(other merkletree.Content) (bool, error)
```

## type [MerkleNode](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/sharded_merkle_tree.go#L259-L261>)

```go
type MerkleNode struct {}
```

### func \(\*MerkleNode\) [Serialize](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/sharded_merkle_tree.go#L263>)

```go
func (t *MerkleNode) Serialize() ([]byte, error)
```

## type [Metadata](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L17-L20>)

```go
type Metadata struct {
Expand Down
10 changes: 5 additions & 5 deletions docs/multiwrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ You can access the Multiwrap interface from the SDK as follows:

```
import (
"github.com/thirdweb-dev/go-sdk/thirdweb"
"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)
privateKey = "..."
Expand Down Expand Up @@ -116,7 +116,7 @@ wrappedTokenMetadata := &thirdweb.NFTMetadataInput{
tx, err := contract.Wrap(context.Background(), contents, wrappedTokenMetadata, "")
```

## type [MultiwrapBundle](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L210-L214>)
## type [MultiwrapBundle](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L216-L220>)

```go
type MultiwrapBundle struct {
Expand All @@ -126,7 +126,7 @@ type MultiwrapBundle struct {
}
```

## type [MultiwrapERC1155](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L204-L208>)
## type [MultiwrapERC1155](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L210-L214>)

```go
type MultiwrapERC1155 struct {
Expand All @@ -136,7 +136,7 @@ type MultiwrapERC1155 struct {
}
```

## type [MultiwrapERC20](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L194-L197>)
## type [MultiwrapERC20](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L200-L203>)

```go
type MultiwrapERC20 struct {
Expand All @@ -145,7 +145,7 @@ type MultiwrapERC20 struct {
}
```

## type [MultiwrapERC721](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L199-L202>)
## type [MultiwrapERC721](<https://github.com/thirdweb-dev/go-sdk/blob/main/thirdweb/types.go#L205-L208>)

```go
type MultiwrapERC721 struct {
Expand Down
2 changes: 1 addition & 1 deletion docs/nft_collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ You can access the NFT Collection interface from the SDK as follows:

```
import (
"github.com/thirdweb-dev/go-sdk/thirdweb"
"github.com/thirdweb-dev/go-sdk/v2/thirdweb"
)
privateKey = "..."
Expand Down
Loading

0 comments on commit fc54364

Please sign in to comment.