Skip to content

Commit

Permalink
fix: rename paths to gateway-fm
Browse files Browse the repository at this point in the history
  • Loading branch information
andskur committed Oct 4, 2021
1 parent 52ec888 commit 94d8ccb
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 33 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ We're currently relying on [our fork of go-ethereum's JSON RPC client](https://g
## Install

```
go get github.com/textileio/near-api-go
go get github.com/gateway-fm/near-api-go
```

## Usage
Expand All @@ -30,10 +30,10 @@ Import the required modules.

```golang
import (
api "github.com/textileio/near-api-go"
"github.com/textileio/near-api-go/keys"
"github.com/textileio/near-api-go/transaction"
"github.com/textileio/near-api-go/types"
api "github.com/gateway-fm/near-api-go"
"github.com/gateway-fm/near-api-go/keys"
"github.com/gateway-fm/near-api-go/transaction"
"github.com/gateway-fm/near-api-go/types"
"github.com/ethereum/go-ethereum/rpc"
)

Expand Down Expand Up @@ -84,11 +84,11 @@ res, err := client.Account("<client account id>").FunctionCall(
)
```

Check out the [API docs](https://pkg.go.dev/github.com/textileio/near-api-go) to see all that is possible.
Check out the [API docs](https://pkg.go.dev/github.com/gateway-fm/near-api-go) to see all that is possible.

## API

[https://pkg.go.dev/github.com/textileio/near-api-go](https://pkg.go.dev/github.com/textileio/near-api-go)
[https://pkg.go.dev/github.com/gateway-fm/near-api-go](https://pkg.go.dev/github.com/gateway-fm/near-api-go)

## Maintainers

Expand Down
10 changes: 5 additions & 5 deletions account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import (
"time"

"github.com/ethereum/go-ethereum/rpc"
itypes "github.com/gateway-fm/near-api-go/internal/types"
"github.com/gateway-fm/near-api-go/keys"
"github.com/gateway-fm/near-api-go/transaction"
"github.com/gateway-fm/near-api-go/types"
"github.com/gateway-fm/near-api-go/util"
"github.com/mr-tron/base58/base58"
"github.com/near/borsh-go"
logging "github.com/textileio/go-log/v2"
itypes "github.com/textileio/near-api-go/internal/types"
"github.com/textileio/near-api-go/keys"
"github.com/textileio/near-api-go/transaction"
"github.com/textileio/near-api-go/types"
"github.com/textileio/near-api-go/util"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions account/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"

"github.com/ethereum/go-ethereum/rpc"
"github.com/gateway-fm/near-api-go/keys"
"github.com/gateway-fm/near-api-go/types"
"github.com/stretchr/testify/require"
"github.com/textileio/near-api-go/keys"
"github.com/textileio/near-api-go/types"

"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion account/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package account
import (
"encoding/base64"

itypes "github.com/textileio/near-api-go/internal/types"
itypes "github.com/gateway-fm/near-api-go/internal/types"
)

// ViewStateOption controls the behavior when calling ViewState.
Expand Down
2 changes: 1 addition & 1 deletion account/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package account
import (
"encoding/json"

"github.com/textileio/near-api-go/internal/types"
"github.com/gateway-fm/near-api-go/internal/types"
)

// Value models a state key-value pair.
Expand Down
58 changes: 53 additions & 5 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"fmt"

"github.com/ethereum/go-ethereum/rpc"
"github.com/textileio/near-api-go/account"
itypes "github.com/textileio/near-api-go/internal/types"
"github.com/textileio/near-api-go/types"
"github.com/textileio/near-api-go/util"
"github.com/gateway-fm/near-api-go/account"
itypes "github.com/gateway-fm/near-api-go/internal/types"
"github.com/gateway-fm/near-api-go/types"
"github.com/gateway-fm/near-api-go/util"
)

// CallFunctionResponse holds information about the result of a function call.
Expand Down Expand Up @@ -63,9 +63,57 @@ type SyncInfo struct {
LatestBlockTime string `json:"latest_block_time"`
}

// Version struct
type Version struct {
Build string `json:"build"`
Version string `json:"version"`
}

// Validators array
type Validators []Validator

// ValidatorsResponse struct
type ValidatorsResponse struct {
CurrentFishermans []Fisherman `json:"current_fishermen,omitempty"`
NextFishermans []Fisherman `json:"next_fishermen,omitempty"`
CurrentValidators Validators `json:"current_validators,omitempty"`
NextValidators Validators `json:"next_validators,omitempty"`
CurrentProposal string `json:"current_proposal,omitempty"`
EpochStartHeight int64 `json:"epoch_start_height"`
PrevEpochKickout []EpochKickout `json:"prev_epoch_kickout"`
}

// EpochKickout struct
type EpochKickout struct {
AccountID string `json:"account_id"`
Reason map[string]interface{} `json:"reason"`
}

// Fisherman struct
type Fisherman struct {
AccountID string `json:"account_id"`
PublicKey string `json:"public_key"`
Stake string `json:"stake"`
}

// Validator struct
type Validator struct {
AccountID string `json:"account_id"`
IsSlashed bool `json:"is_slashed"`
ExpectedBlocksNum int64 `json:"num_expected_blocks,omitempty"`
ProducedBlocksNum int64 `json:"num_produced_blocks,omitempty"`
PublicKey string `json:"public_key,omitempty"`
Shards []int64 `json:"shards,omitempty"`
Stake string `json:"stake,omitempty"`
}

// NodeStatusResponse holds information about node status.
type NodeStatusResponse struct {
SyncInfo *SyncInfo `json:"sync_info"`
ChainID string `json:"chain_id"`
RPCAddr string `json:"rpc_addr"`
SyncInfo SyncInfo `json:"sync_info"`
Validators Validators `json:"validators"`
Version Version `json:"version"`
}

// Client communicates with the NEAR API.
Expand Down
2 changes: 1 addition & 1 deletion api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"

"github.com/ethereum/go-ethereum/rpc"
"github.com/gateway-fm/near-api-go/types"
"github.com/stretchr/testify/require"
"github.com/textileio/near-api-go/types"

"testing"
)
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
module github.com/textileio/near-api-go
module github.com/gateway-fm/near-api-go

go 1.16

require (
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/ethereum/go-ethereum v1.10.6
github.com/ethereum/go-ethereum v1.10.9
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/mr-tron/base58 v1.2.0
github.com/near/borsh-go v0.3.0
github.com/stretchr/testify v1.7.0
github.com/textileio/go-log/v2 v2.1.3-gke-1
go.uber.org/zap v1.18.1 // indirect
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect
golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef // indirect
golang.org/x/tools v0.1.4 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -492,8 +492,8 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef h1:fPxZ3Umkct3LZ8gK9nbk+DWDJ9fstZa2grBn+lWVKPs=
golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
2 changes: 1 addition & 1 deletion transaction/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"math/big"

"github.com/gateway-fm/near-api-go/keys"
"github.com/near/borsh-go"
"github.com/textileio/near-api-go/keys"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion transaction/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"encoding/base64"
"testing"

"github.com/gateway-fm/near-api-go/keys"
"github.com/near/borsh-go"
"github.com/stretchr/testify/require"
"github.com/textileio/near-api-go/keys"
)

func TestIt(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package types

import (
"github.com/ethereum/go-ethereum/rpc"
"github.com/textileio/near-api-go/keys"
"github.com/gateway-fm/near-api-go/keys"
)

// Config configures the NEAR client.
Expand Down

0 comments on commit 94d8ccb

Please sign in to comment.