@injectivelabs/utils
Advanced tools
Comparing version 1.14.41-alpha.0 to 1.14.41-alpha.1
import { Network, NetworkEndpoints } from '@injectivelabs/networks'; | ||
import { ChainId, Coin, EthereumChainId } from '@injectivelabs/ts-types'; | ||
export declare const prepareEip712: <T>({ messages, gas, network, injectiveAddress, ethereumAddress, accountNumber, sequence, timeoutHeight, memo, }: { | ||
export declare const prepareEip712: <T>({ messages, gas, network, injectiveAddress, ethereumAddress, endpoints, accountNumber, sequence, timeoutHeight, memo, }: { | ||
ethereumAddress?: string; | ||
@@ -12,2 +12,3 @@ messages: T; | ||
memo?: string; | ||
endpoints?: Partial<NetworkEndpoints>; | ||
injectiveAddress?: string; | ||
@@ -14,0 +15,0 @@ }) => { |
@@ -8,5 +8,5 @@ "use strict"; | ||
const index_js_2 = require("./mocks/index.js"); | ||
const prepareEip712 = ({ messages, gas = constants_js_1.DEFAULT_GAS_LIMIT, network = networks_1.Network.Devnet, injectiveAddress = index_js_2.mockFactory.injectiveAddress, ethereumAddress = index_js_2.mockFactory.ethereumAddress, accountNumber = 1, sequence = 0, timeoutHeight = 999_999_999, memo = '', }) => { | ||
const prepareEip712 = ({ messages, gas = constants_js_1.DEFAULT_GAS_LIMIT, network = networks_1.Network.Devnet, injectiveAddress = index_js_2.mockFactory.injectiveAddress, ethereumAddress = index_js_2.mockFactory.ethereumAddress, endpoints = {}, accountNumber = 1, sequence = 1, timeoutHeight = 999_999_999, memo = '', }) => { | ||
const chainInfo = (0, networks_1.getNetworkInfo)(network); | ||
const endpoints = (0, networks_1.getNetworkEndpoints)(network); | ||
const actualEndpoints = { ...(0, networks_1.getNetworkEndpoints)(network), ...endpoints }; | ||
const msgs = Array.isArray(messages) ? messages : [messages]; | ||
@@ -50,5 +50,5 @@ const web3Msgs = msgs.map((msg) => msg.toWeb3()); | ||
}; | ||
return { endpoints, eip712Args, prepareEip712Request }; | ||
return { endpoints: actualEndpoints, eip712Args, prepareEip712Request }; | ||
}; | ||
exports.prepareEip712 = prepareEip712; | ||
//# sourceMappingURL=msgs.js.map |
import { Network, NetworkEndpoints } from '@injectivelabs/networks'; | ||
import { ChainId, Coin, EthereumChainId } from '@injectivelabs/ts-types'; | ||
export declare const prepareEip712: <T>({ messages, gas, network, injectiveAddress, ethereumAddress, accountNumber, sequence, timeoutHeight, memo, }: { | ||
export declare const prepareEip712: <T>({ messages, gas, network, injectiveAddress, ethereumAddress, endpoints, accountNumber, sequence, timeoutHeight, memo, }: { | ||
ethereumAddress?: string; | ||
@@ -12,2 +12,3 @@ messages: T; | ||
memo?: string; | ||
endpoints?: Partial<NetworkEndpoints>; | ||
injectiveAddress?: string; | ||
@@ -14,0 +15,0 @@ }) => { |
@@ -5,5 +5,5 @@ import { DEFAULT_GAS_LIMIT, DEFAULT_GAS_PRICE } from '../constants.js'; | ||
import { mockFactory } from './mocks/index.js'; | ||
export const prepareEip712 = ({ messages, gas = DEFAULT_GAS_LIMIT, network = Network.Devnet, injectiveAddress = mockFactory.injectiveAddress, ethereumAddress = mockFactory.ethereumAddress, accountNumber = 1, sequence = 0, timeoutHeight = 999_999_999, memo = '', }) => { | ||
export const prepareEip712 = ({ messages, gas = DEFAULT_GAS_LIMIT, network = Network.Devnet, injectiveAddress = mockFactory.injectiveAddress, ethereumAddress = mockFactory.ethereumAddress, endpoints = {}, accountNumber = 1, sequence = 1, timeoutHeight = 999_999_999, memo = '', }) => { | ||
const chainInfo = getNetworkInfo(network); | ||
const endpoints = getNetworkEndpoints(network); | ||
const actualEndpoints = { ...getNetworkEndpoints(network), ...endpoints }; | ||
const msgs = Array.isArray(messages) ? messages : [messages]; | ||
@@ -47,4 +47,4 @@ const web3Msgs = msgs.map((msg) => msg.toWeb3()); | ||
}; | ||
return { endpoints, eip712Args, prepareEip712Request }; | ||
return { endpoints: actualEndpoints, eip712Args, prepareEip712Request }; | ||
}; | ||
//# sourceMappingURL=msgs.js.map |
{ | ||
"name": "@injectivelabs/utils", | ||
"description": "List of utils and helper functions that can be reused throughout Injective's projects.", | ||
"version": "1.14.41-alpha.0", | ||
"version": "1.14.41-alpha.1", | ||
"sideEffects": false, | ||
@@ -80,4 +80,4 @@ "type": "module", | ||
"@injectivelabs/exceptions": "^1.14.41-alpha.0", | ||
"@injectivelabs/networks": "^1.14.41-alpha.0", | ||
"@injectivelabs/ts-types": "^1.14.41-alpha.0", | ||
"@injectivelabs/networks": "^1.14.41-alpha.1", | ||
"@injectivelabs/ts-types": "^1.14.41-alpha.1", | ||
"axios": "^1.6.4", | ||
@@ -91,3 +91,3 @@ "bignumber.js": "^9.0.1", | ||
}, | ||
"gitHead": "0d2a71e8f8c59500fa4a45f2be48ead6c8bd2d93" | ||
"gitHead": "903ffea1547cdd018c7ac3259702a388b58c035a" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
182942
2496