-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bitget wallet * bitget fixes * Changeset * remove redundant code * Revert "Changeset" This reverts commit 2ac894e. * Type fixes * Fix types * feat: cleans code and fixes typing --------- Co-authored-by: Marek Epicode <m.sadura@outlook.com> Co-authored-by: towan <95243956+towanTG@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
20e5fd3
commit cc61490
Showing
20 changed files
with
429 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@swapkit/helpers": patch | ||
--- | ||
|
||
ChainApi type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@swapkit/helpers": minor | ||
"@swapkit/wallet-bitget": minor | ||
--- | ||
|
||
Removes Kuji reference and adds new SwapKitError codes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@swapkit/plugin-kado": patch | ||
--- | ||
|
||
Fixes plugin typing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@swapkit/wallet-bitget": major | ||
"@swapkit/helpers": patch | ||
"@swapkit/wallets": patch | ||
--- | ||
|
||
Bitget wallet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# @swapkit/wallet-bitget |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { buildPackage } from "../../../tools/builder"; | ||
import { dependencies } from "./package.json"; | ||
|
||
buildPackage({ dependencies }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"description": "SwapKit Wallet - Bitget", | ||
"dependencies": { | ||
"@swapkit/helpers": "workspace:*", | ||
"@swapkit/toolbox-cosmos": "workspace:*", | ||
"@swapkit/toolbox-evm": "workspace:*", | ||
"@swapkit/toolbox-utxo": "workspace:*" | ||
}, | ||
"files": [ | ||
"src/", | ||
"dist/" | ||
], | ||
"homepage": "https://github.com/thorswap/SwapKit", | ||
"license": "Apache-2.0", | ||
"main": "./dist/index.js", | ||
"name": "@swapkit/wallet-bitget", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/thorswap/SwapKit.git" | ||
}, | ||
"scripts": { | ||
"build": "bun run ./build.ts", | ||
"clean": "rm -rf dist node_modules *.tsbuildinfo", | ||
"lint": "biome check --diagnostic-level=error --write ./src", | ||
"test": "echo 'bun test'", | ||
"test:coverage": "bun test --coverage", | ||
"type-check": "tsc --noEmit" | ||
}, | ||
"type": "module", | ||
"types": "./src/index.ts", | ||
"version": "0.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { | ||
Chain, | ||
type ConnectWalletParams, | ||
EVMChains, | ||
WalletOption, | ||
setRequestClientConfig, | ||
} from "@swapkit/helpers"; | ||
|
||
import { getWalletForChain } from "./helpers"; | ||
|
||
export const BITGET_SUPPORTED_CHAINS = [ | ||
...EVMChains, | ||
Chain.Cosmos, | ||
Chain.Bitcoin, | ||
Chain.Solana, | ||
] as const; | ||
|
||
function connectBitget({ | ||
addChain, | ||
config: { thorswapApiKey, covalentApiKey, ethplorerApiKey, blockchairApiKey }, | ||
}: ConnectWalletParams) { | ||
return async function connectBitget(chains: (typeof BITGET_SUPPORTED_CHAINS)[number][]) { | ||
setRequestClientConfig({ apiKey: thorswapApiKey }); | ||
|
||
const promises = chains.map(async (chain) => { | ||
const walletMethods = await getWalletForChain({ | ||
chain, | ||
covalentApiKey, | ||
ethplorerApiKey, | ||
blockchairApiKey, | ||
}); | ||
|
||
addChain({ | ||
...walletMethods, | ||
chain, | ||
balance: [], | ||
walletType: WalletOption.BITGET, | ||
}); | ||
}); | ||
|
||
await Promise.all(promises); | ||
|
||
return true; | ||
}; | ||
} | ||
|
||
export const bitgetWallet = { connectBitget } as const; |
Oops, something went wrong.