@ritbit/v4-client-js 2.2.5 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/src/clients/composite-client.js +20 -1
- package/build/cjs/src/clients/modules/composer.js +15 -1
- package/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/build/esm/src/clients/composite-client.d.ts +13 -0
- package/build/esm/src/clients/composite-client.d.ts.map +1 -1
- package/build/esm/src/clients/composite-client.js +20 -1
- package/build/esm/src/clients/modules/composer.d.ts +1 -0
- package/build/esm/src/clients/modules/composer.d.ts.map +1 -1
- package/build/esm/src/clients/modules/composer.js +16 -2
- package/build/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/ritbit-v4-client-js-2.2.6.tgz +0 -0
- package/src/clients/composite-client.ts +35 -0
- package/src/clients/modules/composer.ts +25 -0
- package/ritbit-v4-client-js-2.2.5.tgz +0 -0
package/package.json
CHANGED
|
Binary file
|
|
@@ -1003,6 +1003,41 @@ export class CompositeClient {
|
|
|
1003
1003
|
);
|
|
1004
1004
|
}
|
|
1005
1005
|
|
|
1006
|
+
/**
|
|
1007
|
+
* @description Create message to withdraw from account to EVM chain (bridge withdrawal).
|
|
1008
|
+
*
|
|
1009
|
+
* @param sender Cosmos address of the sender
|
|
1010
|
+
* @param ethTokenAddress Address of the token on EVM chain
|
|
1011
|
+
* @param amount Amount in min units (string)
|
|
1012
|
+
* @param ethRecipient Recipient address on EVM chain
|
|
1013
|
+
* @param ethChainId Target EVM chain ID
|
|
1014
|
+
* @param denom Token denom in Cosmos
|
|
1015
|
+
*
|
|
1016
|
+
* @returns The message
|
|
1017
|
+
*/
|
|
1018
|
+
withdrawalMessage(
|
|
1019
|
+
sender: string,
|
|
1020
|
+
ethTokenAddress: string,
|
|
1021
|
+
amount: string,
|
|
1022
|
+
ethRecipient: string,
|
|
1023
|
+
ethChainId: number,
|
|
1024
|
+
denom: string,
|
|
1025
|
+
): EncodeObject {
|
|
1026
|
+
const validatorClient = this._validatorClient;
|
|
1027
|
+
if (validatorClient === undefined) {
|
|
1028
|
+
throw new Error('validatorClient not set');
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
return this.validatorClient.post.composer.composeMsgWithdrawal(
|
|
1032
|
+
sender,
|
|
1033
|
+
ethTokenAddress,
|
|
1034
|
+
amount,
|
|
1035
|
+
ethRecipient,
|
|
1036
|
+
Long.fromNumber(ethChainId),
|
|
1037
|
+
denom,
|
|
1038
|
+
);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1006
1041
|
/**
|
|
1007
1042
|
* @description Create message to send chain token from subaccount to wallet
|
|
1008
1043
|
* with human readable input.
|
|
@@ -20,6 +20,7 @@ import { MsgDelayMessage } from '@ritbit/v4-proto/src/codegen/ritbit/delaymsg/tx
|
|
|
20
20
|
import { PerpetualMarketType } from '@ritbit/v4-proto/src/codegen/ritbit/perpetuals/perpetual';
|
|
21
21
|
import { MsgCreatePerpetual } from '@ritbit/v4-proto/src/codegen/ritbit/perpetuals/tx';
|
|
22
22
|
import { MsgCreateOracleMarket } from '@ritbit/v4-proto/src/codegen/ritbit/prices/tx';
|
|
23
|
+
import { MsgInitiateWithdrawal } from '@ritbit/v4-proto/src/codegen/ritbit/bridge/tx';
|
|
23
24
|
import {
|
|
24
25
|
MsgDepositToMegavault,
|
|
25
26
|
MsgWithdrawFromMegavault,
|
|
@@ -55,6 +56,7 @@ import {
|
|
|
55
56
|
TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS,
|
|
56
57
|
TYPE_URL_MSG_ADD_AUTHENTICATOR,
|
|
57
58
|
TYPE_URL_MSG_REMOVE_AUTHENTICATOR,
|
|
59
|
+
TYPE_URL_MSG_INITIATE_WITHDRAWAL,
|
|
58
60
|
AuthenticatorType,
|
|
59
61
|
} from '../constants';
|
|
60
62
|
import { DenomConfig, ITwapParameters, IBuilderCodeParameters } from '../types';
|
|
@@ -336,6 +338,29 @@ export class Composer {
|
|
|
336
338
|
};
|
|
337
339
|
}
|
|
338
340
|
|
|
341
|
+
public composeMsgWithdrawal(
|
|
342
|
+
sender: string,
|
|
343
|
+
ethTokenAddress: string,
|
|
344
|
+
amount: string,
|
|
345
|
+
ethRecipient: string,
|
|
346
|
+
ethChainId: Long,
|
|
347
|
+
denom: string,
|
|
348
|
+
): EncodeObject {
|
|
349
|
+
const msg: MsgInitiateWithdrawal = {
|
|
350
|
+
sender,
|
|
351
|
+
ethTokenAddress,
|
|
352
|
+
amount,
|
|
353
|
+
ethRecipient,
|
|
354
|
+
ethChainId,
|
|
355
|
+
denom,
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
return {
|
|
359
|
+
typeUrl: TYPE_URL_MSG_INITIATE_WITHDRAWAL,
|
|
360
|
+
value: msg,
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
|
|
339
364
|
// ------------ x/bank ------------
|
|
340
365
|
public composeMsgSendToken(
|
|
341
366
|
address: string,
|
|
Binary file
|