Skip to content

Commit 290e4b4

Browse files
committed
fix(typescript-sdk): delete cosmos transferAssetLegacy
1 parent 87264a3 commit 290e4b4

File tree

1 file changed

+0
-68
lines changed

1 file changed

+0
-68
lines changed

typescript-sdk/src/cosmos/client.ts

-68
Original file line numberDiff line numberDiff line change
@@ -121,74 +121,6 @@ export const createCosmosClient = (parameters: CosmosClientParameters) =>
121121
]
122122
})
123123
},
124-
transferAssetLegacy: async ({
125-
memo: _memo,
126-
amount,
127-
receiver,
128-
denomAddress,
129-
destinationChainId,
130-
relayContractAddress,
131-
account = parameters.account,
132-
gasPrice = parameters.gasPrice
133-
}: TransferAssetsParametersLegacy<CosmosChainId>): Promise<Result<string, Error>> => {
134-
const sourceChainId = parameters.chainId
135-
const rpcUrl = parameters.transport({}).value?.url
136-
137-
if (!rpcUrl) return err(new Error("No cosmos RPC URL found"))
138-
if (!account) return err(new Error("No cosmos signer found"))
139-
if (!gasPrice) return err(new Error("No gas price found"))
140-
141-
// if (sourceChainId === destinationChainId) {
142-
// const transfer = await cosmosSameChainTransfer({
143-
// rpcUrl,
144-
// account,
145-
// gasPrice,
146-
// receiver,
147-
// asset: { denom: denomAddress, amount: amount.toString() }
148-
// })
149-
// return transfer
150-
// }
151-
152-
const stamp = timestamp()
153-
const chainDetails = await getHubbleChainDetails({
154-
sourceChainId,
155-
destinationChainId
156-
})
157-
158-
if (chainDetails.isErr()) return err(chainDetails.error)
159-
160-
const sourceChannel = chainDetails.value.sourceChannel
161-
relayContractAddress ??= chainDetails.value.relayContractAddress
162-
163-
if (!sourceChannel) return err(new Error("Source channel not found"))
164-
if (!relayContractAddress) return err(new Error("Relay contract address not found"))
165-
166-
const transfer = await cosmwasmTransfer({
167-
account,
168-
rpcUrl,
169-
gasPrice,
170-
instructions: [
171-
{
172-
contractAddress: relayContractAddress,
173-
msg: {
174-
transfer: {
175-
channel_id: sourceChannel,
176-
receiver: receiver,
177-
base_token: denomAddress,
178-
base_amount: amount,
179-
quote_token: "0x9EC5e8b3509162D12209A882e42A6A4Fd1751A84", // TODO: don't hardcode
180-
quote_amount: amount,
181-
timeout_height: 1000000000,
182-
timeout_timestamp: 0,
183-
salt: generateSalt()
184-
}
185-
},
186-
funds: [{ amount: amount.toString(), denom: denomAddress }]
187-
}
188-
]
189-
})
190-
return transfer
191-
},
192124
simulateTransaction: async ({
193125
memo,
194126
amount,

0 commit comments

Comments
 (0)