You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: notes.md
+11-11
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ Docs and test coverage is lacking.
31
31
32
32
The [tokens](./core/base/src/constants/tokens) consts take up a lot of packed space in a widely used package for marginal benefit. Consider making these a wholly separate package that _can_ be installed and fetched when necessary.
33
33
34
-
The [nativeChainIds](./core/base/src/constants/nativeChainIds.ts) constants mix different chain id types, causing extra akward type checks to be done. Consider splitting these by platform so that when a `Chain` is passed, the type of chain id can be inferred. Also will help to distinguish between chain id _kinds_ (eip155 vs whatever) since they should be unique at least in that context.
34
+
The [nativeChainIds](./core/base/src/constants/nativeChainIds.ts) constants mix different chain id types, causing extra akward type checks to be done. Consider splitting these by platform so that when a `Chain` is passed, the type of chain id can be inferred. Also will help to distinguish between chain id _kinds_ (eip155 vs whatever) since they could be unique at least in that context.
35
35
36
36
The [Network](./core/base/src/constants/networks.ts) value "Devnet" is confusing to folks coming from Solana since it refers to some ci or local network configuration profile and what they actually want is "Testnet".
37
37
@@ -41,17 +41,17 @@ This would constitute a large change since the Network type is a generic paramet
41
41
42
42
### Definitions
43
43
44
-
The [layouts](./core/definitions/src/protocols/tokenBridge/tokenBridgeLayout.ts) for the protocols are very difficult to read/comprehend from just source. We should have some way to write out the full object produced so that the fields it contains are easier to read.
44
+
The [layouts](./core/definitions/src/protocols/tokenBridge/tokenBridgeLayout.ts) for the protocols are very difficult to read/comprehend from just source. We could have some way to write out the full object produced so that the fields it contains are easier to read.
45
45
46
-
The [Attestation/AttestationId](./core/definitions/src/attestation.ts)should be registered along with the protocol instead of having a hardcoded switch case. The current definition makes it very awkward to use for anything outside this repo, but since its used in the Routes, external "plugins" need to have _something_. This forces the Attestation type to be a punted `VAA<"Uint8Array">`
46
+
The [Attestation/AttestationId](./core/definitions/src/attestation.ts)could be registered along with the protocol instead of having a hardcoded switch case. The current definition makes it very awkward to use for anything outside this repo, but since its used in the Routes, external "plugins" need to have _something_. This forces the Attestation type to be a punted `VAA<"Uint8Array">`
47
47
48
48
The [RPC](./core/definitions/src/rpc.ts) is a punted `any` type. It could benefit from the same type registration as others, where the exact type is set in some namespace so that type inteference would be happy with something like:
The [protocols](./core/definitions/src/protocols/)should have **standard** fields in their respective `namespace` for things like:
54
+
The [protocols](./core/definitions/src/protocols/)could have **standard** fields in their respective `namespace` for things like:
55
55
56
56
- Which contracts are required (eg `Required<Contracts, 'tokenBridge' | 'coreBridge'>`)
57
57
- The protocol name/payload names ([issue here](https://github.com/wormhole-foundation/wormhole-sdk-ts/issues/564))
@@ -76,19 +76,19 @@ y satisfies x;
76
76
77
77
The [Wormhole](./connect/src/wormhole.ts) class has spotty coverage of util methods. Some of the methods are awkward to have on `Wormhole` like `canonicalAddress` which is already an exported method.
78
78
79
-
Getting decent typehints for the [Route](./connect/src/routes/route.ts) implementations has been rough. We should, in the route, provide a typeguard that can be called to narrow the type to itself. This would be helpful to understand the exact types required as input (specific options per route, etc) and what is returned on output (more detailed route specific quote details, etc).
79
+
Getting decent typehints for the [Route](./connect/src/routes/route.ts) implementations has been rough. We could, in the route, provide a typeguard that can be called to narrow the type to itself. This would be helpful to understand the exact types required as input (specific options per route, etc) and what is returned on output (more detailed route specific quote details, etc).
80
80
81
-
The [Receipt typeguards](./connect/src/types.ts)should also define `hasSourceInitiated`, `hasAttested`, etc for checking if the transfer is _past_ some step.
81
+
The [Receipt typeguards](./connect/src/types.ts)could also define `hasSourceInitiated`, `hasAttested`, etc for checking if the transfer is _past_ some step.
82
82
83
-
The [Wormholescan API](./connect/src/whscan-api.ts)should be better documented and possibly autogenerated from the swagger for the api.
83
+
The [Wormholescan API](./connect/src/whscan-api.ts)could be better documented and possibly autogenerated from the swagger for the api.
84
84
85
-
The classes that implement the [WormholeTransfer](./connect/src/protocols/wormholeTransfer.ts)should be deprecated in favor of the `Route` usage. The underlying code should be preserved and made available in a static context where all args are provided rather than keeping state in the `WormholeTransfer` object.
85
+
The classes that implement the [WormholeTransfer](./connect/src/protocols/wormholeTransfer.ts)could be deprecated in favor of the `Route` usage. The underlying code could be preserved and made available in a static context where all args are provided rather than keeping state in the `WormholeTransfer` object.
86
86
87
87
## Platforms
88
88
89
89
Every Protocol implementation defines its own private `createUnsignedTransaction` function, which, kinda sucks.
90
90
91
-
The Signer implementations are bad at things like gas estimation or handling errors. They should also provide support for transaction review prior to signing.
91
+
The Signer implementations are bad at things like gas estimation or handling errors. They could also provide support for transaction review prior to signing.
92
92
93
93
94
94
### Evm
@@ -103,15 +103,15 @@ A lot of the code here was copy/pasted without regard to what was actually neces
103
103
104
104
While the `Buffer` type has been kept out of most packages intentionally, the Solana packages have not been as strict. For web applications this can still be a pain, consider trying to purge it completely.
105
105
106
-
The [Unsigned Transaction](./platforms/solana/src/unsignedTransaction.ts) type can handle versioned transactions but we still only produce the legacy transaction type. We should produce the versioned transactions since they'll provide more features in the future, [issue here](https://github.com/wormhole-foundation/wormhole-sdk-ts/issues/163).
106
+
The [Unsigned Transaction](./platforms/solana/src/unsignedTransaction.ts) type can handle versioned transactions but we still only produce the legacy transaction type. We could produce the versioned transactions since they'll provide more features in the future, [issue here](https://github.com/wormhole-foundation/wormhole-sdk-ts/issues/163).
107
107
108
108
### Cosmwasm
109
109
110
110
There are some awkward [consts](./platforms/cosmwasm/src/constants.ts) for address prefix and average prices (??)
111
111
112
112
The IBC channel consts need to be updated with the [fetch-registry](./platforms/cosmwasm/scripts/fetch-registry.ts) script occasionally.
113
113
114
-
The IBC protocol should probably have just been `Gateway` instead, that is a new Protocol for `Gateway` specific methods should have been created instead of exposing ibc methods. The connect package `GatewayTransfer` is made awkard by the current setup.
114
+
The IBC protocol could probably have just been `Gateway` instead, that is a new Protocol for `Gateway` specific methods could have been created instead of exposing ibc methods. The connect package `GatewayTransfer` is made awkard by the current setup.
0 commit comments