Skip to content

Commit 53679c7

Browse files
authored
refactor: rename typedata package to typeddata (#811)
* refactor: rename typedata package to typeddata and update references * chore: update CHANGELOG to reflect the renaming of the typedata package to typeddata
1 parent 9f00140 commit 53679c7

18 files changed

+10
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ with the version implemented by the starknet.go provider or not.
2727
- The `rpc.NewProvider` function now returns an error if the node RPC version is different from the version
2828
implemented by the starknet.go provider. The returned Provider instance is still valid, but there might be
2929
unexpected behaviour.
30+
- The `typedata` pkg was renamed to `typeddata`, fixing the typo in the package name introduced in v0.16.0.
3031

3132
### Removed
3233
- The warning message when the node RPC version is different from the version implemented by the

examples/typedData/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/NethermindEth/starknet.go/account"
99
setup "github.com/NethermindEth/starknet.go/examples/internal"
1010
"github.com/NethermindEth/starknet.go/rpc"
11-
"github.com/NethermindEth/starknet.go/typedata"
11+
"github.com/NethermindEth/starknet.go/typeddata"
1212
"github.com/NethermindEth/starknet.go/utils"
1313
)
1414

@@ -20,7 +20,7 @@ func main() {
2020
fmt.Println("Account address:", accnt.Address)
2121

2222
// This is how you can initialise a typed data from a JSON file
23-
ttd, err := utils.UnmarshalJSONFileToType[typedata.TypedData]("./baseExample.json", "")
23+
ttd, err := utils.UnmarshalJSONFileToType[typeddata.TypedData]("./baseExample.json", "")
2424
if err != nil {
2525
panic(fmt.Errorf("fail to unmarshal TypedData: %w", err))
2626
}

paymaster/build_txn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
"github.com/NethermindEth/juno/core/felt"
1010
"github.com/NethermindEth/starknet.go/client/rpcerr"
11-
"github.com/NethermindEth/starknet.go/typedata"
11+
"github.com/NethermindEth/starknet.go/typeddata"
1212
)
1313

1414
// BuildTransaction receives the transaction the user wants to execute. Returns the typed
@@ -389,7 +389,7 @@ type BuildTransactionResponse struct {
389389
Parameters *UserParameters `json:"parameters"`
390390
// The typed data for for `invoke` and `deploy_and_invoke` transaction types.
391391
// It's `nil` for `deploy` transaction types.
392-
TypedData *typedata.TypedData `json:"typed_data,omitempty"`
392+
TypedData *typeddata.TypedData `json:"typed_data,omitempty"`
393393
// The fee estimation for the transaction
394394
Fee *FeeEstimate `json:"fee"`
395395
}

paymaster/execute_txn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/NethermindEth/juno/core/felt"
77
"github.com/NethermindEth/starknet.go/client/rpcerr"
8-
"github.com/NethermindEth/starknet.go/typedata"
8+
"github.com/NethermindEth/starknet.go/typeddata"
99
)
1010

1111
// ExecuteTransaction sends the signed typed data to the paymaster service for execution
@@ -75,7 +75,7 @@ type ExecutableUserInvoke struct {
7575
// The address of the user account
7676
UserAddress *felt.Felt `json:"user_address"`
7777
// Typed data returned by the endpoint paymaster_buildTransaction
78-
TypedData *typedata.TypedData `json:"typed_data"`
78+
TypedData *typeddata.TypedData `json:"typed_data"`
7979
// Signature of the associated Typed Data
8080
Signature []*felt.Felt `json:"signature"`
8181
}

typedata/revision.go renamed to typeddata/revision.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package typedata
1+
package typeddata
22

33
import (
44
"errors"
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)