forked from elizaOS/eliza
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: make bridge data fetcher reusable across the project
- Loading branch information
1 parent
8e467ff
commit 63acdd4
Showing
10 changed files
with
89 additions
and
80 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
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
7 changes: 4 additions & 3 deletions
7
packages/plugin-cosmos/src/actions/ibc-transfer/services/bridge-denom-provider.ts
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 |
---|---|---|
@@ -1,18 +1,4 @@ | ||
import { z } from "zod"; | ||
import { | ||
bridgeDataProviderParamsSchema, | ||
bridgeDataProviderResponseAssetsSchema, | ||
bridgeDataProviderResponseSchema, | ||
IBCTransferParamsSchema, | ||
} from "./schema"; | ||
import { IBCTransferParamsSchema } from "./schema"; | ||
|
||
export type IBCTransferActionParams = z.infer<typeof IBCTransferParamsSchema>; | ||
export type BridgeDataProviderParams = z.infer< | ||
typeof bridgeDataProviderParamsSchema | ||
>; | ||
export type BridgeDataProviderResponseAsset = z.infer< | ||
typeof bridgeDataProviderResponseAssetsSchema | ||
>; | ||
export type BridgeDataProviderResponse = z.infer< | ||
typeof bridgeDataProviderResponseSchema | ||
>; |
16 changes: 16 additions & 0 deletions
16
packages/plugin-cosmos/src/shared/services/skip-api/assets-from-source-fetcher/interfaces.ts
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,16 @@ | ||
import { z } from "zod"; | ||
import { | ||
skipApiAssetsFromSourceParamsSchema, | ||
skipApiAssetsFromSourceResponseAssetSchema, | ||
skipApiAssetsFromSourceResponseSchema, | ||
} from "./schema"; | ||
|
||
export type SkipApiAssetsFromSourceParams = z.infer< | ||
typeof skipApiAssetsFromSourceParamsSchema | ||
>; | ||
export type SkipApiAssetsFromSourceResponseAsset = z.infer< | ||
typeof skipApiAssetsFromSourceResponseAssetSchema | ||
>; | ||
export type SkipApiAssetsFromSourceResponse = z.infer< | ||
typeof skipApiAssetsFromSourceResponseSchema | ||
>; |
29 changes: 29 additions & 0 deletions
29
packages/plugin-cosmos/src/shared/services/skip-api/assets-from-source-fetcher/schema.ts
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,29 @@ | ||
import { z } from "zod"; | ||
|
||
export const skipApiAssetsFromSourceParamsSchema = z.object({ | ||
source_asset_denom: z.string(), | ||
source_asset_chain_id: z.string(), | ||
allow_multi_tx: z.boolean(), | ||
}); | ||
|
||
export const skipApiAssetsFromSourceResponseAssetSchema = z.object({ | ||
denom: z.string(), | ||
chain_id: z.string(), | ||
origin_denom: z.string(), | ||
origin_chain_id: z.string(), | ||
trace: z.string(), | ||
symbol: z.string().optional(), | ||
name: z.string().optional(), | ||
logo_uri: z.string().optional(), | ||
decimals: z.number().optional(), | ||
recommended_symbol: z.string().optional(), | ||
}); | ||
|
||
export const skipApiAssetsFromSourceResponseSchema = z.object({ | ||
dest_assets: z.record( | ||
z.string(), | ||
z.object({ | ||
assets: z.array(skipApiAssetsFromSourceResponseAssetSchema), | ||
}) | ||
), | ||
}); |
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 @@ | ||
export const skipApiBaseUrl = "https://api.skip.build/v2/"; |
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