Allow gcclient to connect to chaincode from GC gateway URL
- Dominant language
- TypeScript
- Stars
- 138
- Forks
- 44
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 22
Description
Currently `gcclient` allows to connect to GC gateway with `forApiConfig` method, which requires the following parameters (assuming https://github.com/GalaChain/sdk/issues/231 is resolved):
```
export interface RestApiClientConfig {
apiUrl: string;
userId?: string;
userSecret?: string;
configPath: string;
}
```
We would like to allow an additional way of connecting to the contract, by contract URL. We should add `gcclient.forContractUrl(url)` method which accepts just a contract URL, like: `https://gateway.stage.galachain.com/api/hackathon03/gc-8c757ffb9ac963b04e45b5e6e8a298992c530c23-GalaChainToken`. Then it would use a similar flow as `RestApiClient`, just with no need of fetching contract API.
Probably the best way to approach is to:
1. add `gcclient.forContractUrl(url)` method
2. copy `RestApiClientBuilder` and remove non relevant code (duplication is good here)
3. copy `RestApiClient` and remove non relevant code (also duplication is good)
Then we can use this way of connecting to the contract with `@gala-chain/connect`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the existing gcclient.forApiConfig flow and the RestApiClientBuilder and RestApiClient implementations. Add the proposed forContractUrl(url) path for @gala-chain/connect, reusing the relevant connection behavior without fetching contract API data; done means a contract URL alone can connect to the contract.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, blockchain
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100