Skip to content

Commit 9ab66bc

Browse files
committed
fix(typescript-sdk): remove v0 api dependency
1 parent 4994adf commit 9ab66bc

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

typescript-sdk/jsr.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://jsr.io/schema/config-file.v1.json",
33
"name": "@union/client",
4-
"version": "0.0.26",
4+
"version": "0.0.27",
55
"license": "MIT",
66
"exports": {
77
".": "./src/mod.ts"

typescript-sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@unionlabs/client",
3-
"version": "0.0.26",
3+
"version": "0.0.27",
44
"homepage": "https://union.build",
55
"description": "Union Labs cross-chain transfers client",
66
"type": "module",

typescript-sdk/src/pfm.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ export async function getHubbleChainDetails({
8181
})
8282
}
8383

84-
const forward = ucsConfiguration.forward.find(
84+
const forward = ucsConfiguration.forwards.find(
8585
item => item.destination_chain.chain_id === destinationChainId
8686
)
8787

8888
if (!forward) return err(new Error("Forward configuration not found"))
8989
return ok({
9090
transferType,
91-
port: forward.port,
91+
port: forward.port_id,
9292
destinationChannel: forward.channel_id,
9393
sourceChannel: ucsConfiguration.channel_id,
9494
relayContractAddress: ucsConfiguration.contract_address,

typescript-sdk/src/query/offchain/hubble.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const offchainQuery = {
4343
> => {
4444
return await hubbleRestFetch<
4545
OffchainQueryBaseResponse<Chain<typeof includeEndpoints, typeof includeContracts>>
46-
>("/chains", {
46+
>("/v1/chains", {
4747
query: {
4848
include_rpcs: includeEndpoints,
4949
include_contracts: includeContracts,
@@ -78,7 +78,7 @@ export const offchainQuery = {
7878
> => {
7979
return await hubbleRestFetch<
8080
OffchainQueryBaseResponse<Chain<typeof includeEndpoints, typeof includeContracts>>
81-
>(`/chains/${chainId}`, {
81+
>(`/v1/chains/${chainId}`, {
8282
query: {
8383
include_assets: includeAssets,
8484
include_rpcs: includeEndpoints,
@@ -107,7 +107,7 @@ interface Asset {
107107
}
108108

109109
interface Forward {
110-
port: string
110+
port_id: string
111111
channel_id: string
112112
connection_id: string
113113
contract_address: string
@@ -119,28 +119,24 @@ interface Forward {
119119
export interface Ucs1Configuration {
120120
channel_id: string
121121
connection_id: string
122-
source_chain_id: number
123122
contract_address: string
124123
source_chain: {
125-
id: number
126124
testnet: boolean
127125
enabled: boolean
128126
chain_id: string
129127
addr_prefix: string
130128
display_name: string
131129
logo_uri: string | null
132130
}
133-
destination_chain_id: number
134131
destination_chain: {
135-
id: number
136132
testnet: boolean
137133
enabled: boolean
138134
chain_id: ChainId
139135
addr_prefix: string
140136
display_name: string
141137
logo_uri: string | null
142138
}
143-
forward: Array<Forward>
139+
forwards: Array<Forward>
144140
}
145141

146142
export interface Chain<

0 commit comments

Comments
 (0)