Skip to content

Commit d02c241

Browse files
committed
less agressive, jeeze
1 parent c5b4526 commit d02c241

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

notes.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Docs and test coverage is lacking.
3131

3232
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.
3333

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.
3535

3636
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".
3737

@@ -41,17 +41,17 @@ This would constitute a large change since the Network type is a generic paramet
4141

4242
### Definitions
4343

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.
4545

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">`
4747

4848
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:
4949

5050
```ts
5151
(await ChainContext<"Mainnet", "Solana">.getRpc()) satisfies Connection
5252
```
5353

54-
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:
5555

5656
- Which contracts are required (eg `Required<Contracts, 'tokenBridge' | 'coreBridge'>`)
5757
- The protocol name/payload names ([issue here](https://github.com/wormhole-foundation/wormhole-sdk-ts/issues/564))
@@ -76,19 +76,19 @@ y satisfies x;
7676

7777
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.
7878

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).
8080

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.
8282

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.
8484

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.
8686

8787
## Platforms
8888

8989
Every Protocol implementation defines its own private `createUnsignedTransaction` function, which, kinda sucks.
9090

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.
9292

9393

9494
### Evm
@@ -103,15 +103,15 @@ A lot of the code here was copy/pasted without regard to what was actually neces
103103

104104
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.
105105

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).
107107

108108
### Cosmwasm
109109

110110
There are some awkward [consts](./platforms/cosmwasm/src/constants.ts) for address prefix and average prices (??)
111111

112112
The IBC channel consts need to be updated with the [fetch-registry](./platforms/cosmwasm/scripts/fetch-registry.ts) script occasionally.
113113

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.
115115

116116
### Sui
117117

0 commit comments

Comments
 (0)