-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from hyperweb-io/fix-cache-logic
fix tx data array
- Loading branch information
Showing
61 changed files
with
222 additions
and
174 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
@@ -95,12 +95,15 @@ export function buildTx<TMsg>(opts: TxBuilderOptions) { | |
client.addEncoders(opts.encoders ?? []); | ||
client.addConverters(opts.converters ?? []); | ||
|
||
const data = [ | ||
{ | ||
typeUrl: opts.typeUrl, | ||
value: message, | ||
}, | ||
]; | ||
const data = Array.isArray(message) | ||
? message.map(msg => ({ | ||
typeUrl: opts.typeUrl, | ||
value: msg, | ||
})) | ||
: [{ | ||
typeUrl: opts.typeUrl, | ||
value: message, | ||
}]; | ||
return client.signAndBroadcast!(signerAddress, data, fee, memo); | ||
}; | ||
} | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
@@ -10,7 +10,6 @@ import { BinaryReader, BinaryWriter } from "./binary"; | |
import { getRpcClient } from "./extern"; | ||
import { isRpc, Rpc } from "./helpers"; | ||
import { TelescopeGeneratedCodec } from "./types"; | ||
import { GlobalDecoderRegistry } from "./registry"; | ||
|
||
export interface QueryBuilderOptions<TReq, TRes> { | ||
encode: (request: TReq, writer?: BinaryWriter) => BinaryWriter | ||
|
@@ -103,12 +102,15 @@ export function buildTx<TMsg>(opts: TxBuilderOptions) { | |
client.addEncoders(opts.encoders ?? []); | ||
client.addConverters(opts.converters ?? []); | ||
|
||
const data = [ | ||
{ | ||
typeUrl: opts.typeUrl, | ||
value: message, | ||
}, | ||
]; | ||
const data = Array.isArray(message) | ||
? message.map(msg => ({ | ||
typeUrl: opts.typeUrl, | ||
value: msg, | ||
})) | ||
: [{ | ||
typeUrl: opts.typeUrl, | ||
value: message, | ||
}]; | ||
return client.signAndBroadcast!(signerAddress, data, fee, memo); | ||
}; | ||
} | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,11 +1,11 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
||
|
||
import { getRpcClient } from './extern' | ||
import { getRpcClient } from './extern' | ||
import { | ||
isRpc, | ||
Rpc, | ||
|
@@ -94,11 +94,6 @@ export const useRpcClient = <TData = ProtobufRpcClient>({ | |
}, options); | ||
}; | ||
|
||
export interface UseQueryBuilderOptions<TReq, TRes> { | ||
builderQueryFn: (clientResolver?: RpcResolver) => (request: TReq) => Promise<TRes>, | ||
queryKeyPrefix: string, | ||
} | ||
|
||
const getRpcClientFromCache = ( | ||
queryClient: ReturnType<typeof useQueryClient>, | ||
key: string, | ||
|
@@ -108,6 +103,12 @@ const getRpcClientFromCache = ( | |
return queryClient.getQueryData<Rpc>(queryKey); | ||
}; | ||
|
||
export interface UseQueryBuilderOptions<TReq, TRes> { | ||
builderQueryFn: (clientResolver?: RpcResolver) => (request: TReq) => Promise<TRes>, | ||
queryKeyPrefix: string, | ||
} | ||
|
||
|
||
export function buildUseQuery<TReq, TRes>(opts: UseQueryBuilderOptions<TReq, TRes>) { | ||
return <TData = TRes>({ | ||
request, | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
@@ -95,12 +95,15 @@ export function buildTx<TMsg>(opts: TxBuilderOptions) { | |
client.addEncoders(opts.encoders ?? []); | ||
client.addConverters(opts.converters ?? []); | ||
|
||
const data = [ | ||
{ | ||
typeUrl: opts.typeUrl, | ||
value: message, | ||
}, | ||
]; | ||
const data = Array.isArray(message) | ||
? message.map(msg => ({ | ||
typeUrl: opts.typeUrl, | ||
value: msg, | ||
})) | ||
: [{ | ||
typeUrl: opts.typeUrl, | ||
value: message, | ||
}]; | ||
return client.signAndBroadcast!(signerAddress, data, fee, memo); | ||
}; | ||
} | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
@@ -31,6 +31,7 @@ import { | |
} from '@tanstack/vue-query'; | ||
|
||
import { HttpEndpoint, ProtobufRpcClient } from '@cosmjs/stargate'; | ||
import { Tendermint34Client } from '@cosmjs/tendermint-rpc'; | ||
import {Ref} from 'vue' | ||
|
||
export const DEFAULT_RPC_CLIENT_QUERY_KEY = 'rpcClient'; | ||
|
@@ -110,6 +111,32 @@ export function useRpcClient<TData = ProtobufRpcClient>({ | |
); | ||
} | ||
|
||
interface UseTendermintClient extends VueQueryParams<Tendermint34Client> { | ||
rpcEndpoint: string | HttpEndpoint; | ||
} | ||
|
||
/** | ||
* Function that uses vue-query to cache a connected tendermint client. | ||
*/ | ||
export const useTendermintClient = ({ | ||
rpcEndpoint, | ||
options, | ||
}: UseTendermintClient) => { | ||
const { data: client } = useQuery<Tendermint34Client, Error, Tendermint34Client>({ | ||
queryKey: ['client', 'tendermint', rpcEndpoint], | ||
queryFn: () => Tendermint34Client.connect(rpcEndpoint), | ||
...{ | ||
// allow overriding | ||
onError: (e: any) => { | ||
throw new Error(`Failed to connect to ${rpcEndpoint}` + '\n' + e) | ||
}, | ||
...options, | ||
} | ||
} | ||
); | ||
return { client }; | ||
}; | ||
|
||
export interface UseQueryBuilderOptions<TReq, TRes> { | ||
builderQueryFn: ( | ||
clientResolver?: RpcResolver | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
@@ -10,7 +10,6 @@ import { BinaryReader, BinaryWriter } from "./binary"; | |
import { getRpcClient } from "./extern"; | ||
import { isRpc, Rpc } from "./helpers"; | ||
import { TelescopeGeneratedCodec } from "./types"; | ||
import { GlobalDecoderRegistry } from "./registry"; | ||
|
||
export interface QueryBuilderOptions<TReq, TRes> { | ||
encode: (request: TReq, writer?: BinaryWriter) => BinaryWriter | ||
|
@@ -103,12 +102,15 @@ export function buildTx<TMsg>(opts: TxBuilderOptions) { | |
client.addEncoders(opts.encoders ?? []); | ||
client.addConverters(opts.converters ?? []); | ||
|
||
const data = [ | ||
{ | ||
typeUrl: opts.typeUrl, | ||
value: message, | ||
}, | ||
]; | ||
const data = Array.isArray(message) | ||
? message.map(msg => ({ | ||
typeUrl: opts.typeUrl, | ||
value: msg, | ||
})) | ||
: [{ | ||
typeUrl: opts.typeUrl, | ||
value: message, | ||
}]; | ||
return client.signAndBroadcast!(signerAddress, data, fee, memo); | ||
}; | ||
} | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
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,5 +1,5 @@ | ||
/** | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].16 | ||
* This file and any referenced files were automatically generated by @cosmology/[email protected].19 | ||
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain | ||
* and run the transpile command or npm scripts command that is used to regenerate this bundle. | ||
*/ | ||
|
Oops, something went wrong.