@swapkit/toolboxes 4.0.0-beta.50 → 4.0.0-beta.52
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/dist/src/cosmos/index.cjs +2 -2
- package/dist/src/cosmos/index.cjs.map +10 -6
- package/dist/src/cosmos/index.js +2 -2
- package/dist/src/cosmos/index.js.map +10 -6
- package/dist/src/evm/index.cjs +2 -2
- package/dist/src/evm/index.cjs.map +10 -8
- package/dist/src/evm/index.js +2 -2
- package/dist/src/evm/index.js.map +10 -8
- package/dist/src/index.cjs +4 -2
- package/dist/src/index.cjs.map +54 -4
- package/dist/src/index.js +4 -2
- package/dist/src/index.js.map +54 -4
- package/dist/src/near/index.cjs +2 -2
- package/dist/src/near/index.cjs.map +7 -5
- package/dist/src/near/index.js +2 -2
- package/dist/src/near/index.js.map +7 -5
- package/dist/src/radix/index.cjs +2 -2
- package/dist/src/radix/index.cjs.map +2 -2
- package/dist/src/radix/index.js +2 -2
- package/dist/src/radix/index.js.map +2 -2
- package/dist/src/ripple/index.cjs +2 -2
- package/dist/src/ripple/index.cjs.map +2 -2
- package/dist/src/ripple/index.js +2 -2
- package/dist/src/ripple/index.js.map +2 -2
- package/dist/src/solana/index.cjs +2 -2
- package/dist/src/solana/index.cjs.map +5 -4
- package/dist/src/solana/index.js +2 -2
- package/dist/src/solana/index.js.map +5 -4
- package/dist/src/substrate/index.cjs +2 -2
- package/dist/src/substrate/index.cjs.map +6 -5
- package/dist/src/substrate/index.js +2 -2
- package/dist/src/substrate/index.js.map +6 -5
- package/dist/src/tron/index.cjs +2 -2
- package/dist/src/tron/index.cjs.map +6 -5
- package/dist/src/tron/index.js +2 -2
- package/dist/src/tron/index.js.map +6 -5
- package/dist/src/utxo/index.cjs +4 -4
- package/dist/src/utxo/index.cjs.map +10 -7
- package/dist/src/utxo/index.js +4 -4
- package/dist/src/utxo/index.js.map +10 -7
- package/{src/cosmos/index.ts → dist/types/cosmos/index.d.ts} +1 -0
- package/dist/types/cosmos/index.d.ts.map +1 -0
- package/dist/types/cosmos/thorchainUtils/addressFormat.d.ts +5 -0
- package/dist/types/cosmos/thorchainUtils/addressFormat.d.ts.map +1 -0
- package/{src/cosmos/thorchainUtils/index.ts → dist/types/cosmos/thorchainUtils/index.d.ts} +1 -0
- package/dist/types/cosmos/thorchainUtils/index.d.ts.map +1 -0
- package/dist/types/cosmos/thorchainUtils/messages.d.ts +208 -0
- package/dist/types/cosmos/thorchainUtils/messages.d.ts.map +1 -0
- package/dist/types/cosmos/thorchainUtils/registry.d.ts +4 -0
- package/dist/types/cosmos/thorchainUtils/registry.d.ts.map +1 -0
- package/dist/types/cosmos/thorchainUtils/types/MsgCompiled.d.ts +2 -0
- package/dist/types/cosmos/thorchainUtils/types/MsgCompiled.d.ts.map +1 -0
- package/dist/types/cosmos/thorchainUtils/types/client-types.d.ts +66 -0
- package/dist/types/cosmos/thorchainUtils/types/client-types.d.ts.map +1 -0
- package/dist/types/cosmos/thorchainUtils/types/index.d.ts +2 -0
- package/dist/types/cosmos/thorchainUtils/types/index.d.ts.map +1 -0
- package/dist/types/cosmos/toolbox/cosmos.d.ts +93 -0
- package/dist/types/cosmos/toolbox/cosmos.d.ts.map +1 -0
- package/dist/types/cosmos/toolbox/index.d.ts +14 -0
- package/dist/types/cosmos/toolbox/index.d.ts.map +1 -0
- package/dist/types/cosmos/toolbox/thorchain.d.ts +158 -0
- package/dist/types/cosmos/toolbox/thorchain.d.ts.map +1 -0
- package/{src/cosmos/types.ts → dist/types/cosmos/types.d.ts} +24 -29
- package/dist/types/cosmos/types.d.ts.map +1 -0
- package/dist/types/cosmos/util.d.ts +68 -0
- package/dist/types/cosmos/util.d.ts.map +1 -0
- package/dist/types/evm/api.d.ts +8 -0
- package/dist/types/evm/api.d.ts.map +1 -0
- package/dist/types/evm/contracts/eth/multicall.d.ts +36 -0
- package/dist/types/evm/contracts/eth/multicall.d.ts.map +1 -0
- package/dist/types/evm/contracts/op/gasOracle.d.ts +40 -0
- package/dist/types/evm/contracts/op/gasOracle.d.ts.map +1 -0
- package/dist/types/evm/helpers.d.ts +20 -0
- package/dist/types/evm/helpers.d.ts.map +1 -0
- package/{src/evm/index.ts → dist/types/evm/index.d.ts} +1 -0
- package/dist/types/evm/index.d.ts.map +1 -0
- package/dist/types/evm/toolbox/baseEVMToolbox.d.ts +82 -0
- package/dist/types/evm/toolbox/baseEVMToolbox.d.ts.map +1 -0
- package/dist/types/evm/toolbox/evm.d.ts +367 -0
- package/dist/types/evm/toolbox/evm.d.ts.map +1 -0
- package/dist/types/evm/toolbox/index.d.ts +89 -0
- package/dist/types/evm/toolbox/index.d.ts.map +1 -0
- package/dist/types/evm/toolbox/op.d.ts +62 -0
- package/dist/types/evm/toolbox/op.d.ts.map +1 -0
- package/dist/types/evm/types.d.ts +98 -0
- package/dist/types/evm/types.d.ts.map +1 -0
- package/dist/types/index.d.ts +63 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/near/helpers/core.d.ts +15 -0
- package/dist/types/near/helpers/core.d.ts.map +1 -0
- package/dist/types/near/helpers/gasEstimation.d.ts +41 -0
- package/dist/types/near/helpers/gasEstimation.d.ts.map +1 -0
- package/dist/types/near/helpers/nep141.d.ts +72 -0
- package/dist/types/near/helpers/nep141.d.ts.map +1 -0
- package/dist/types/near/index.d.ts +10 -0
- package/dist/types/near/index.d.ts.map +1 -0
- package/dist/types/near/toolbox.d.ts +4 -0
- package/dist/types/near/toolbox.d.ts.map +1 -0
- package/dist/types/near/types/contract.d.ts +38 -0
- package/dist/types/near/types/contract.d.ts.map +1 -0
- package/dist/types/near/types/nep141.d.ts +56 -0
- package/dist/types/near/types/nep141.d.ts.map +1 -0
- package/dist/types/near/types/toolbox.d.ts +57 -0
- package/dist/types/near/types/toolbox.d.ts.map +1 -0
- package/dist/types/near/types.d.ts +44 -0
- package/dist/types/near/types.d.ts.map +1 -0
- package/dist/types/radix/index.d.ts +14 -0
- package/dist/types/radix/index.d.ts.map +1 -0
- package/dist/types/ripple/index.d.ts +43 -0
- package/dist/types/ripple/index.d.ts.map +1 -0
- package/dist/types/solana/index.d.ts +37 -0
- package/dist/types/solana/index.d.ts.map +1 -0
- package/dist/types/solana/toolbox.d.ts +41 -0
- package/dist/types/solana/toolbox.d.ts.map +1 -0
- package/dist/types/substrate/balance.d.ts +17 -0
- package/dist/types/substrate/balance.d.ts.map +1 -0
- package/{src/substrate/index.ts → dist/types/substrate/index.d.ts} +1 -0
- package/dist/types/substrate/index.d.ts.map +1 -0
- package/dist/types/substrate/substrate.d.ts +148 -0
- package/dist/types/substrate/substrate.d.ts.map +1 -0
- package/dist/types/substrate/types.d.ts +100 -0
- package/dist/types/substrate/types.d.ts.map +1 -0
- package/dist/types/tron/helpers/trc20.abi.d.ts +156 -0
- package/dist/types/tron/helpers/trc20.abi.d.ts.map +1 -0
- package/dist/types/tron/helpers/trongrid.d.ts +8 -0
- package/dist/types/tron/helpers/trongrid.d.ts.map +1 -0
- package/dist/types/tron/index.d.ts +6 -0
- package/dist/types/tron/index.d.ts.map +1 -0
- package/dist/types/tron/toolbox.d.ts +26 -0
- package/dist/types/tron/toolbox.d.ts.map +1 -0
- package/dist/types/tron/types.d.ts +101 -0
- package/dist/types/tron/types.d.ts.map +1 -0
- package/dist/types/types.d.ts +18 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils.d.ts +4 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/utxo/helpers/api.d.ts +133 -0
- package/dist/types/utxo/helpers/api.d.ts.map +1 -0
- package/dist/types/utxo/helpers/bchaddrjs.d.ts +10 -0
- package/dist/types/utxo/helpers/bchaddrjs.d.ts.map +1 -0
- package/dist/types/utxo/helpers/coinselect.d.ts +16 -0
- package/dist/types/utxo/helpers/coinselect.d.ts.map +1 -0
- package/{src/utxo/helpers/index.ts → dist/types/utxo/helpers/index.d.ts} +1 -0
- package/dist/types/utxo/helpers/index.d.ts.map +1 -0
- package/dist/types/utxo/helpers/txSize.d.ts +21 -0
- package/dist/types/utxo/helpers/txSize.d.ts.map +1 -0
- package/{src/utxo/index.ts → dist/types/utxo/index.d.ts} +1 -0
- package/dist/types/utxo/index.d.ts.map +1 -0
- package/dist/types/utxo/toolbox/bitcoinCash.d.ts +104 -0
- package/dist/types/utxo/toolbox/bitcoinCash.d.ts.map +1 -0
- package/dist/types/utxo/toolbox/index.d.ts +50 -0
- package/dist/types/utxo/toolbox/index.d.ts.map +1 -0
- package/dist/types/utxo/toolbox/utxo.d.ts +102 -0
- package/dist/types/utxo/toolbox/utxo.d.ts.map +1 -0
- package/dist/types/utxo/toolbox/zcash.d.ts +83 -0
- package/dist/types/utxo/toolbox/zcash.d.ts.map +1 -0
- package/dist/types/utxo/types.d.ts +46 -0
- package/dist/types/utxo/types.d.ts.map +1 -0
- package/package.json +15 -18
- package/dist/chunk-0h4xdrwz.js +0 -5
- package/dist/chunk-0h4xdrwz.js.map +0 -10
- package/dist/chunk-4yap1fvd.js +0 -4
- package/dist/chunk-4yap1fvd.js.map +0 -10
- package/dist/chunk-9bqegm61.js +0 -4
- package/dist/chunk-9bqegm61.js.map +0 -10
- package/dist/chunk-fazw0jvt.js +0 -4
- package/dist/chunk-fazw0jvt.js.map +0 -9
- package/dist/chunk-fjfxga2v.js +0 -4
- package/dist/chunk-fjfxga2v.js.map +0 -10
- package/dist/chunk-s47y8512.js +0 -5
- package/dist/chunk-s47y8512.js.map +0 -9
- package/dist/chunk-vtd17cje.js +0 -4
- package/dist/chunk-vtd17cje.js.map +0 -10
- package/dist/chunk-zcdeg6h9.js +0 -5
- package/dist/chunk-zcdeg6h9.js.map +0 -10
- package/src/cosmos/thorchainUtils/addressFormat.ts +0 -26
- package/src/cosmos/thorchainUtils/messages.ts +0 -262
- package/src/cosmos/thorchainUtils/registry.ts +0 -44
- package/src/cosmos/thorchainUtils/types/MsgCompiled.ts +0 -2800
- package/src/cosmos/thorchainUtils/types/client-types.ts +0 -73
- package/src/cosmos/thorchainUtils/types/index.ts +0 -1
- package/src/cosmos/toolbox/cosmos.ts +0 -375
- package/src/cosmos/toolbox/index.ts +0 -33
- package/src/cosmos/toolbox/thorchain.ts +0 -313
- package/src/cosmos/util.ts +0 -266
- package/src/evm/__tests__/address-validation.test.ts +0 -86
- package/src/evm/__tests__/ethereum.test.ts +0 -141
- package/src/evm/api.ts +0 -21
- package/src/evm/contracts/eth/multicall.ts +0 -165
- package/src/evm/contracts/op/gasOracle.ts +0 -151
- package/src/evm/helpers.ts +0 -194
- package/src/evm/toolbox/baseEVMToolbox.ts +0 -762
- package/src/evm/toolbox/evm.ts +0 -66
- package/src/evm/toolbox/index.ts +0 -52
- package/src/evm/toolbox/op.ts +0 -131
- package/src/evm/types.ts +0 -146
- package/src/index.ts +0 -263
- package/src/near/__tests__/core.test.ts +0 -80
- package/src/near/helpers/contractFactory.ts +0 -22
- package/src/near/helpers/core.ts +0 -91
- package/src/near/helpers/gasEstimation.ts +0 -110
- package/src/near/helpers/index.ts +0 -5
- package/src/near/helpers/nep141.ts +0 -110
- package/src/near/index.ts +0 -24
- package/src/near/toolbox.ts +0 -509
- package/src/near/types/contract.ts +0 -48
- package/src/near/types/nep141.ts +0 -66
- package/src/near/types.ts +0 -57
- package/src/radix/index.ts +0 -156
- package/src/ripple/index.ts +0 -192
- package/src/solana/index.ts +0 -55
- package/src/solana/toolbox.ts +0 -433
- package/src/substrate/balance.ts +0 -92
- package/src/substrate/substrate.ts +0 -320
- package/src/substrate/types.ts +0 -120
- package/src/tron/__tests__/toolbox.test.ts +0 -147
- package/src/tron/helpers/trc20.abi.ts +0 -107
- package/src/tron/helpers/trongrid.ts +0 -54
- package/src/tron/index.ts +0 -17
- package/src/tron/toolbox.ts +0 -650
- package/src/tron/types.ts +0 -120
- package/src/utils.ts +0 -27
- package/src/utxo/__tests__/zcash-integration.test.ts +0 -114
- package/src/utxo/helpers/api.ts +0 -560
- package/src/utxo/helpers/bchaddrjs.ts +0 -183
- package/src/utxo/helpers/coinselect.ts +0 -98
- package/src/utxo/helpers/txSize.ts +0 -104
- package/src/utxo/toolbox/bitcoinCash.ts +0 -320
- package/src/utxo/toolbox/index.ts +0 -90
- package/src/utxo/toolbox/utxo.ts +0 -525
- package/src/utxo/toolbox/zcash.ts +0 -208
- package/src/utxo/types.ts +0 -57
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { AssetValue, Chain, type DerivationPathArray, FeeOption, type UTXOChain } from "@swapkit/helpers";
|
|
2
|
+
import { Psbt } from "bitcoinjs-lib";
|
|
3
|
+
import type { ECPairInterface } from "ecpair";
|
|
4
|
+
import type { BchECPair, TargetOutput, UTXOBuildTxParams, UTXOTransferParams, UTXOType } from "../types";
|
|
5
|
+
import type { UtxoToolboxParams } from "./index";
|
|
6
|
+
export declare const nonSegwitChains: Chain[];
|
|
7
|
+
declare function createTransaction({ assetValue, recipient, memo, feeRate, sender, fetchTxHex, }: UTXOBuildTxParams): Promise<{
|
|
8
|
+
psbt: Psbt;
|
|
9
|
+
utxos: UTXOType[];
|
|
10
|
+
inputs: UTXOType[];
|
|
11
|
+
}>;
|
|
12
|
+
export declare function getUTXOAddressValidator(): Promise<({ address, chain }: {
|
|
13
|
+
address: string;
|
|
14
|
+
chain: UTXOChain;
|
|
15
|
+
}) => boolean>;
|
|
16
|
+
export declare function createUTXOToolbox<T extends UTXOChain>({ chain, ...toolboxParams }: (UtxoToolboxParams[T] | {
|
|
17
|
+
phrase?: string;
|
|
18
|
+
derivationPath?: DerivationPathArray;
|
|
19
|
+
index?: number;
|
|
20
|
+
}) & {
|
|
21
|
+
chain: T;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: import("..").UTXOCalculateTxSizeParams & {
|
|
24
|
+
outputs: TargetOutput[];
|
|
25
|
+
chain: UTXOChain;
|
|
26
|
+
}) => {
|
|
27
|
+
inputs: (UTXOType | import("..").UTXOInputWithScriptType)[];
|
|
28
|
+
outputs: TargetOutput[];
|
|
29
|
+
fee: number;
|
|
30
|
+
} | {
|
|
31
|
+
fee: number;
|
|
32
|
+
inputs?: undefined;
|
|
33
|
+
outputs?: undefined;
|
|
34
|
+
};
|
|
35
|
+
calculateTxSize: ({ inputs, outputs, feeRate }: import("..").UTXOCalculateTxSizeParams) => number;
|
|
36
|
+
getAddressFromKeys: (keys: ECPairInterface | BchECPair) => string;
|
|
37
|
+
getAddress: () => Promise<string | undefined>;
|
|
38
|
+
validateAddress: (address: string) => boolean;
|
|
39
|
+
broadcastTx: (txHash: string) => Promise<string>;
|
|
40
|
+
createTransaction: typeof createTransaction;
|
|
41
|
+
createKeysForPath: (params: {
|
|
42
|
+
wif?: string;
|
|
43
|
+
phrase?: string;
|
|
44
|
+
derivationPath?: string;
|
|
45
|
+
}) => CreateKeysForPathReturnType[T];
|
|
46
|
+
getFeeRates: () => Promise<{
|
|
47
|
+
average: number;
|
|
48
|
+
fast: number;
|
|
49
|
+
fastest: number;
|
|
50
|
+
}>;
|
|
51
|
+
getInputsOutputsFee: typeof getInputsOutputsFee;
|
|
52
|
+
transfer: ({ memo, recipient, feeOptionKey, feeRate, assetValue, }: UTXOTransferParams) => Promise<string>;
|
|
53
|
+
getPrivateKeyFromMnemonic: (params: {
|
|
54
|
+
phrase: string;
|
|
55
|
+
derivationPath: string;
|
|
56
|
+
}) => string;
|
|
57
|
+
getBalance: (address: string, scamFilter?: boolean) => Promise<AssetValue[]>;
|
|
58
|
+
estimateTransactionFee: (params: {
|
|
59
|
+
assetValue: AssetValue;
|
|
60
|
+
recipient: string;
|
|
61
|
+
sender: string;
|
|
62
|
+
memo?: string;
|
|
63
|
+
feeOptionKey?: FeeOption;
|
|
64
|
+
feeRate?: number;
|
|
65
|
+
fetchTxHex?: boolean;
|
|
66
|
+
}) => Promise<AssetValue>;
|
|
67
|
+
estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
|
|
68
|
+
from: string;
|
|
69
|
+
memo?: string;
|
|
70
|
+
feeRate?: number;
|
|
71
|
+
feeOptionKey?: FeeOption;
|
|
72
|
+
recipients?: number | TargetOutput[];
|
|
73
|
+
}) => Promise<AssetValue>;
|
|
74
|
+
}>;
|
|
75
|
+
declare function getInputsOutputsFee({ assetValue, feeOptionKey, feeRate, memo, sender, recipient, }: Omit<UTXOBuildTxParams, "feeRate"> & {
|
|
76
|
+
feeOptionKey?: FeeOption;
|
|
77
|
+
feeRate?: number;
|
|
78
|
+
}): Promise<{
|
|
79
|
+
inputs: (UTXOType | import("..").UTXOInputWithScriptType)[];
|
|
80
|
+
outputs: TargetOutput[];
|
|
81
|
+
fee: number;
|
|
82
|
+
} | {
|
|
83
|
+
fee: number;
|
|
84
|
+
inputs?: undefined;
|
|
85
|
+
outputs?: undefined;
|
|
86
|
+
}>;
|
|
87
|
+
type CreateKeysForPathReturnType = {
|
|
88
|
+
[Chain.BitcoinCash]: BchECPair;
|
|
89
|
+
[Chain.Bitcoin]: ECPairInterface;
|
|
90
|
+
[Chain.Dash]: ECPairInterface;
|
|
91
|
+
[Chain.Dogecoin]: ECPairInterface;
|
|
92
|
+
[Chain.Litecoin]: ECPairInterface;
|
|
93
|
+
[Chain.Zcash]: ECPairInterface;
|
|
94
|
+
};
|
|
95
|
+
export declare function getCreateKeysForPath<T extends keyof CreateKeysForPathReturnType>(chain: T): Promise<(params: {
|
|
96
|
+
wif?: string;
|
|
97
|
+
phrase?: string;
|
|
98
|
+
derivationPath?: string;
|
|
99
|
+
}) => CreateKeysForPathReturnType[T]>;
|
|
100
|
+
export declare function addressFromKeysGetter(chain: UTXOChain): Promise<(keys: ECPairInterface | BchECPair) => string>;
|
|
101
|
+
export {};
|
|
102
|
+
//# sourceMappingURL=utxo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utxo.d.ts","sourceRoot":"","sources":["../../../../src/utxo/toolbox/utxo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,EAGL,KAAK,mBAAmB,EACxB,SAAS,EAIT,KAAK,SAAS,EAIf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAkD,MAAM,eAAe,CAAC;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAa9C,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,EACT,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AASjD,eAAO,MAAM,eAAe,SAA+B,CAAC;AAqD5D,iBAAe,iBAAiB,CAAC,EAC/B,UAAU,EACV,SAAS,EACT,IAAI,EACJ,OAAO,EACP,MAAM,EACN,UAAkB,GACnB,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,MAAM,EAAE,QAAQ,EAAE,CAAC;CACpB,CAAC,CAoCD;AAED,wBAAsB,uBAAuB,iCAGS;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,cAiB1F;AAyBD,wBAAsB,iBAAiB,CAAC,CAAC,SAAS,SAAS,EAAE,EAC3D,KAAK,EACL,GAAG,aAAa,EACjB,EAAE,CACC,iBAAiB,CAAC,CAAC,CAAC,GACpB;IACE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CACJ,GAAG;IAAE,KAAK,EAAE,CAAC,CAAA;CAAE;;;;;;;;;;;;;;+BA+O2B,eAAe,GAAG,SAAS;;+BAhNvC,MAAM;0BACX,MAAM;;gCAiIrB;QACP,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;;;;;;;wEA8FE,kBAAkB;wCA7NiB;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE;;qCA6F1D;QACpB,UAAU,EAAE,UAAU,CAAC;QACvB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,SAAS,CAAC;QACzB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB;oFA1DE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,SAAS,CAAC;QACzB,UAAU,CAAC,EAAE,MAAM,GAAG,YAAY,EAAE,CAAC;KACtC;GAxCF;AAED,iBAAe,mBAAmB,CAAC,EACjC,UAAU,EACV,YAA6B,EAC7B,OAAO,EACP,IAAI,EACJ,MAAM,EACN,SAAS,GACV,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC,GAAG;IACtC,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;;;;;;;;GAaA;AA6ED,KAAK,2BAA2B,GAAG;IACjC,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;IAC/B,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;IACjC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC;IAC9B,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;IAClC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;IAClC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC;CAChC,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,CAAC,SAAS,MAAM,2BAA2B,EACpF,KAAK,EAAE,CAAC,GACP,OAAO,CACR,CAAC,MAAM,EAAE;IACP,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,KAAK,2BAA2B,CAAC,CAAC,CAAC,CACrC,CAoEA;AAED,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,SAAS,kBAGjB,eAAe,GAAG,SAAS,aAWrE"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type ChainSigner, type DerivationPathArray, FeeOption } from "@swapkit/helpers";
|
|
2
|
+
import type { Psbt } from "bitcoinjs-lib";
|
|
3
|
+
import type { UTXOBuildTxParams, UTXOTransferParams } from "../types";
|
|
4
|
+
export declare function validateZcashAddress(address: string): boolean;
|
|
5
|
+
type ZcashSigner = ChainSigner<Psbt, Psbt>;
|
|
6
|
+
export declare function createZcashToolbox(toolboxParams: {
|
|
7
|
+
signer?: ZcashSigner;
|
|
8
|
+
} | {
|
|
9
|
+
phrase?: string;
|
|
10
|
+
derivationPath?: DerivationPathArray;
|
|
11
|
+
index?: number;
|
|
12
|
+
}): Promise<{
|
|
13
|
+
broadcastTx: (txHash: string) => Promise<string>;
|
|
14
|
+
getFeeRates: () => Promise<{
|
|
15
|
+
average: number;
|
|
16
|
+
fast: number;
|
|
17
|
+
fastest: number;
|
|
18
|
+
}>;
|
|
19
|
+
transfer: ({ recipient, assetValue, feeOptionKey, ...rest }: UTXOTransferParams) => Promise<string>;
|
|
20
|
+
getAddressFromKeys: (keys: {
|
|
21
|
+
getAddress: () => string;
|
|
22
|
+
}) => string;
|
|
23
|
+
validateAddress: typeof validateZcashAddress;
|
|
24
|
+
accumulative: ({ inputs, outputs, feeRate: initialFeeRate, chain, }: import("..").UTXOCalculateTxSizeParams & {
|
|
25
|
+
outputs: import("..").TargetOutput[];
|
|
26
|
+
chain: import("@swapkit/helpers").UTXOChain;
|
|
27
|
+
}) => {
|
|
28
|
+
inputs: (import("..").UTXOType | import("..").UTXOInputWithScriptType)[];
|
|
29
|
+
outputs: import("..").TargetOutput[];
|
|
30
|
+
fee: number;
|
|
31
|
+
} | {
|
|
32
|
+
fee: number;
|
|
33
|
+
inputs?: undefined;
|
|
34
|
+
outputs?: undefined;
|
|
35
|
+
};
|
|
36
|
+
calculateTxSize: ({ inputs, outputs, feeRate }: import("..").UTXOCalculateTxSizeParams) => number;
|
|
37
|
+
getAddress: () => Promise<string | undefined>;
|
|
38
|
+
createTransaction: ({ assetValue, recipient, memo, feeRate, sender, fetchTxHex, }: UTXOBuildTxParams) => Promise<{
|
|
39
|
+
psbt: Psbt;
|
|
40
|
+
utxos: import("..").UTXOType[];
|
|
41
|
+
inputs: import("..").UTXOType[];
|
|
42
|
+
}>;
|
|
43
|
+
createKeysForPath: (params: {
|
|
44
|
+
wif?: string;
|
|
45
|
+
phrase?: string;
|
|
46
|
+
derivationPath?: string;
|
|
47
|
+
}) => import("ecpair").ECPairInterface;
|
|
48
|
+
getInputsOutputsFee: ({ assetValue, feeOptionKey, feeRate, memo, sender, recipient, }: Omit<UTXOBuildTxParams, "feeRate"> & {
|
|
49
|
+
feeOptionKey?: FeeOption;
|
|
50
|
+
feeRate?: number;
|
|
51
|
+
}) => Promise<{
|
|
52
|
+
inputs: (import("..").UTXOType | import("..").UTXOInputWithScriptType)[];
|
|
53
|
+
outputs: import("..").TargetOutput[];
|
|
54
|
+
fee: number;
|
|
55
|
+
} | {
|
|
56
|
+
fee: number;
|
|
57
|
+
inputs?: undefined;
|
|
58
|
+
outputs?: undefined;
|
|
59
|
+
}>;
|
|
60
|
+
getPrivateKeyFromMnemonic: (params: {
|
|
61
|
+
phrase: string;
|
|
62
|
+
derivationPath: string;
|
|
63
|
+
}) => string;
|
|
64
|
+
getBalance: (address: string, scamFilter?: boolean) => Promise<import("@swapkit/helpers").AssetValue[]>;
|
|
65
|
+
estimateTransactionFee: (params: {
|
|
66
|
+
assetValue: import("@swapkit/helpers").AssetValue;
|
|
67
|
+
recipient: string;
|
|
68
|
+
sender: string;
|
|
69
|
+
memo?: string;
|
|
70
|
+
feeOptionKey?: FeeOption;
|
|
71
|
+
feeRate?: number;
|
|
72
|
+
fetchTxHex?: boolean;
|
|
73
|
+
}) => Promise<import("@swapkit/helpers").AssetValue>;
|
|
74
|
+
estimateMaxSendableAmount: ({ from, memo, feeRate, feeOptionKey, recipients, }: {
|
|
75
|
+
from: string;
|
|
76
|
+
memo?: string;
|
|
77
|
+
feeRate?: number;
|
|
78
|
+
feeOptionKey?: FeeOption;
|
|
79
|
+
recipients?: number | import("..").TargetOutput[];
|
|
80
|
+
}) => Promise<import("@swapkit/helpers").AssetValue>;
|
|
81
|
+
}>;
|
|
82
|
+
export {};
|
|
83
|
+
//# sourceMappingURL=zcash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zcash.d.ts","sourceRoot":"","sources":["../../../../src/utxo/toolbox/zcash.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,SAAS,EAMV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAM1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAiCtE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,WA2BnD;AAsBD,KAAK,WAAW,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAqC3C,wBAAsB,kBAAkB,CACtC,aAAa,EACT;IACE,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GACD;IACE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;;;;;;;iEA6BF,kBAAkB;+BATa;QAAE,UAAU,EAAE,MAAM,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;WAwCk0G,CAAC;cAAoB,CAAC;sBAA4B,CAAC;;;oBAAxwF,CAAC;eAAsB,CAAC;;;;;;;;;;;;;;;;;;;YAAihE,CAAC;oBAA0B,CAAC;eAAwB,CAAC;kBAAwB,CAAC;;;;YAAhhD,CAAC;eAAqB,CAAC;oBAA0B,CAAC;kBAA2B,CAAC;;GADj2C"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { GenericCreateTransactionParams, GenericTransferParams, Witness } from "@swapkit/helpers";
|
|
2
|
+
import type { UTXOScriptType } from "./helpers";
|
|
3
|
+
export type TransactionType = {
|
|
4
|
+
toHex(): string;
|
|
5
|
+
};
|
|
6
|
+
export type TargetOutput = {
|
|
7
|
+
address: string;
|
|
8
|
+
script?: Buffer;
|
|
9
|
+
value: number;
|
|
10
|
+
} | {
|
|
11
|
+
script: Buffer;
|
|
12
|
+
value: number;
|
|
13
|
+
};
|
|
14
|
+
export type UTXOType = {
|
|
15
|
+
hash: string;
|
|
16
|
+
index: number;
|
|
17
|
+
value: number;
|
|
18
|
+
txHex?: string;
|
|
19
|
+
witnessUtxo?: Witness;
|
|
20
|
+
};
|
|
21
|
+
export type UTXOInputWithScriptType = UTXOType & {
|
|
22
|
+
type: UTXOScriptType;
|
|
23
|
+
address: string;
|
|
24
|
+
};
|
|
25
|
+
export type UTXOCalculateTxSizeParams = {
|
|
26
|
+
inputs: (UTXOInputWithScriptType | UTXOType)[];
|
|
27
|
+
outputs?: TargetOutput[];
|
|
28
|
+
feeRate: number;
|
|
29
|
+
};
|
|
30
|
+
export type UTXOBuildTxParams = GenericCreateTransactionParams & {
|
|
31
|
+
fetchTxHex?: boolean;
|
|
32
|
+
};
|
|
33
|
+
export type UTXOTransferParams = GenericTransferParams;
|
|
34
|
+
export type BchECPair = {
|
|
35
|
+
getAddress: (index?: number) => string;
|
|
36
|
+
publicKey: Buffer;
|
|
37
|
+
toWIF: () => string;
|
|
38
|
+
};
|
|
39
|
+
export type TransactionBuilderType = {
|
|
40
|
+
inputs: any[];
|
|
41
|
+
sign(vin: number, keyPair: BchECPair, redeemScript?: Buffer, hashType?: number, witnessValue?: number, witnessScript?: Buffer, signatureAlgorithm?: string): void;
|
|
42
|
+
build(): TransactionType;
|
|
43
|
+
addOutput(addressOrScriptBuffer: string | Buffer, value: number): void;
|
|
44
|
+
addInput(txHash: string | Buffer, vout: number, sequence?: number, prevOutScript?: Buffer): void;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utxo/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,qBAAqB,EACrB,OAAO,EACR,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,IAAI,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GACpB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3F,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM,EAAE,CAAC,uBAAuB,GAAG,QAAQ,CAAC,EAAE,CAAC;IAC/C,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,8BAA8B,GAAG;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1F,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAEvD,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,IAAI,CACF,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,SAAS,EAClB,YAAY,CAAC,EAAE,MAAM,EACrB,QAAQ,CAAC,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,MAAM,EACrB,aAAa,CAAC,EAAE,MAAM,EACtB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,IAAI,CAAC;IACR,KAAK,IAAI,eAAe,CAAC;IACzB,SAAS,CAAC,qBAAqB,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACvE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClG,CAAC"}
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@solana/spl-memo": "~0.2.5",
|
|
20
20
|
"@solana/spl-token": "~0.4.13",
|
|
21
21
|
"@solana/web3.js": "~1.98.0",
|
|
22
|
-
"@swapkit/helpers": "4.0.0-beta.
|
|
22
|
+
"@swapkit/helpers": "4.0.0-beta.35",
|
|
23
23
|
"base64-js": "~1.5.1",
|
|
24
24
|
"bitcoinjs-lib": "~6.1.0",
|
|
25
25
|
"bs58check": "~4.0.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@solana/spl-memo": "0.2.5",
|
|
61
61
|
"@solana/spl-token": "0.4.13",
|
|
62
62
|
"@solana/web3.js": "1.98.2",
|
|
63
|
-
"@swapkit/helpers": "4.0.0-beta.
|
|
63
|
+
"@swapkit/helpers": "4.0.0-beta.35",
|
|
64
64
|
"@types/bn.js": "5.2.0",
|
|
65
65
|
"@types/crypto-js": "4.2.2",
|
|
66
66
|
"@types/elliptic": "6.4.18",
|
|
@@ -86,58 +86,55 @@
|
|
|
86
86
|
".": {
|
|
87
87
|
"default": "./dist/src/index.js",
|
|
88
88
|
"require": "./dist/src/index.cjs",
|
|
89
|
-
"types": "./
|
|
89
|
+
"types": "./dist/types/index.d.ts"
|
|
90
90
|
},
|
|
91
91
|
"./cosmos": {
|
|
92
92
|
"default": "./dist/src/cosmos/index.js",
|
|
93
93
|
"require": "./dist/src/cosmos/index.cjs",
|
|
94
|
-
"types": "./
|
|
94
|
+
"types": "./dist/types/cosmos/index.d.ts"
|
|
95
95
|
},
|
|
96
96
|
"./evm": {
|
|
97
97
|
"default": "./dist/src/evm/index.js",
|
|
98
98
|
"require": "./dist/src/evm/index.cjs",
|
|
99
|
-
"types": "./
|
|
99
|
+
"types": "./dist/types/evm/index.d.ts"
|
|
100
100
|
},
|
|
101
101
|
"./near": {
|
|
102
102
|
"default": "./dist/src/near/index.js",
|
|
103
103
|
"require": "./dist/src/near/index.cjs",
|
|
104
|
-
"types": "./
|
|
104
|
+
"types": "./dist/types/near/index.d.ts"
|
|
105
105
|
},
|
|
106
106
|
"./radix": {
|
|
107
107
|
"default": "./dist/src/radix/index.js",
|
|
108
108
|
"require": "./dist/src/radix/index.cjs",
|
|
109
|
-
"types": "./
|
|
109
|
+
"types": "./dist/types/radix/index.d.ts"
|
|
110
110
|
},
|
|
111
111
|
"./ripple": {
|
|
112
112
|
"default": "./dist/src/ripple/index.js",
|
|
113
113
|
"require": "./dist/src/ripple/index.cjs",
|
|
114
|
-
"types": "./
|
|
114
|
+
"types": "./dist/types/ripple/index.d.ts"
|
|
115
115
|
},
|
|
116
116
|
"./solana": {
|
|
117
117
|
"default": "./dist/src/solana/index.js",
|
|
118
118
|
"require": "./dist/src/solana/index.cjs",
|
|
119
|
-
"types": "./
|
|
119
|
+
"types": "./dist/types/solana/index.d.ts"
|
|
120
120
|
},
|
|
121
121
|
"./substrate": {
|
|
122
122
|
"default": "./dist/src/substrate/index.js",
|
|
123
123
|
"require": "./dist/src/substrate/index.cjs",
|
|
124
|
-
"types": "./
|
|
124
|
+
"types": "./dist/types/substrate/index.d.ts"
|
|
125
125
|
},
|
|
126
126
|
"./tron": {
|
|
127
127
|
"default": "./dist/src/tron/index.js",
|
|
128
128
|
"require": "./dist/src/tron/index.cjs",
|
|
129
|
-
"types": "./
|
|
129
|
+
"types": "./dist/types/tron/index.d.ts"
|
|
130
130
|
},
|
|
131
131
|
"./utxo": {
|
|
132
132
|
"default": "./dist/src/utxo/index.js",
|
|
133
133
|
"require": "./dist/src/utxo/index.cjs",
|
|
134
|
-
"types": "./
|
|
134
|
+
"types": "./dist/types/utxo/index.d.ts"
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
|
-
"files": [
|
|
138
|
-
"src/",
|
|
139
|
-
"dist/"
|
|
140
|
-
],
|
|
137
|
+
"files": ["dist/"],
|
|
141
138
|
"homepage": "https://github.com/swapkit/SwapKit",
|
|
142
139
|
"license": "Apache-2.0",
|
|
143
140
|
"name": "@swapkit/toolboxes",
|
|
@@ -155,5 +152,5 @@
|
|
|
155
152
|
"type-check:go": "tsgo"
|
|
156
153
|
},
|
|
157
154
|
"type": "module",
|
|
158
|
-
"version": "4.0.0-beta.
|
|
159
|
-
}
|
|
155
|
+
"version": "4.0.0-beta.52"
|
|
156
|
+
}
|
package/dist/chunk-0h4xdrwz.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{AssetValue as c,BaseDecimal as p}from"@swapkit/helpers";import{SwapKitApi as u}from"@swapkit/helpers/api";var l=typeof process!=="undefined"&&process.pid?process.pid.toString(36):"",a=0;function g(){function t(){let e=Date.now(),n=a||e;return a=n,e>a?e:n+1}return l+t().toString(36)}function w(t){return async function e(n,i=!0){return(await u.getChainBalance({chain:t,address:n,scamFilter:i})).map(({identifier:r,value:o,decimal:s})=>{return new c({decimal:s||p[t],value:o,identifier:r})})}}
|
|
2
|
-
export{g as a,w as b};
|
|
3
|
-
|
|
4
|
-
//# debugId=7D1F4061F0771C8264756E2164756E21
|
|
5
|
-
//# sourceMappingURL=chunk-0h4xdrwz.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/utils.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { AssetValue, BaseDecimal, type Chain } from \"@swapkit/helpers\";\nimport { SwapKitApi } from \"@swapkit/helpers/api\";\n\nconst pid = typeof process !== \"undefined\" && process.pid ? process.pid.toString(36) : \"\";\n\nlet last = 0;\nexport function uniqid() {\n function now() {\n const time = Date.now();\n const lastTime = last || time;\n last = lastTime;\n\n return time > last ? time : lastTime + 1;\n }\n\n return pid + now().toString(36);\n}\n\nexport function getBalance<T extends Chain>(chain: T) {\n return async function getBalance(address: string, scamFilter = true) {\n const balances = await SwapKitApi.getChainBalance({ chain, address, scamFilter });\n\n return balances.map(({ identifier, value, decimal }) => {\n return new AssetValue({ decimal: decimal || BaseDecimal[chain], value, identifier });\n });\n };\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": "AAAA,qBAAS,iBAAY,yBACrB,qBAAS,6BAET,IAAM,EAAM,OAAO,UAAY,aAAe,QAAQ,IAAM,QAAQ,IAAI,SAAS,EAAE,EAAI,GAEnF,EAAO,EACJ,SAAS,CAAM,EAAG,CACvB,SAAS,CAAG,EAAG,CACb,IAAM,EAAO,KAAK,IAAI,EAChB,EAAW,GAAQ,EAGzB,OAFA,EAAO,EAEA,EAAO,EAAO,EAAO,EAAW,EAGzC,OAAO,EAAM,EAAI,EAAE,SAAS,EAAE,EAGzB,SAAS,CAA2B,CAAC,EAAU,CACpD,OAAO,eAAe,CAAU,CAAC,EAAiB,EAAa,GAAM,CAGnE,OAFiB,MAAM,EAAW,gBAAgB,CAAE,QAAO,UAAS,YAAW,CAAC,GAEhE,IAAI,EAAG,aAAY,QAAO,aAAc,CACtD,OAAO,IAAI,EAAW,CAAE,QAAS,GAAW,EAAY,GAAQ,QAAO,YAAW,CAAC,EACpF",
|
|
8
|
-
"debugId": "7D1F4061F0771C8264756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-4yap1fvd.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var Y=O(require("protobufjs/minimal.js")),X=Y.default.Reader,J=Y.default.Writer,Q=Y.default.util,L=Y.default.roots.default||(Y.default.roots.default={});L.common=(()=>{let Z={};return Z.Asset=(()=>{function G(H){if(H){for(let q=Object.keys(H),B=0;B<q.length;++B)if(H[q[B]]!=null)this[q[B]]=H[q[B]]}}return G.prototype.chain="",G.prototype.symbol="",G.prototype.ticker="",G.prototype.synth=!1,G.create=function H(q){return new G(q)},G.encode=function H(q,B){if(!B)B=J.create();if(q.chain!=null&&Object.hasOwnProperty.call(q,"chain"))B.uint32(10).string(q.chain);if(q.symbol!=null&&Object.hasOwnProperty.call(q,"symbol"))B.uint32(18).string(q.symbol);if(q.ticker!=null&&Object.hasOwnProperty.call(q,"ticker"))B.uint32(26).string(q.ticker);if(q.synth!=null&&Object.hasOwnProperty.call(q,"synth"))B.uint32(32).bool(q.synth);return B},G.encodeDelimited=function H(q,B){return this.encode(q,B).ldelim()},G.decode=function H(q,B){if(!(q instanceof X))q=X.create(q);let z=B===void 0?q.len:q.pos+B,E=new L.common.Asset;while(q.pos<z){let V=q.uint32();switch(V>>>3){case 1:E.chain=q.string();break;case 2:E.symbol=q.string();break;case 3:E.ticker=q.string();break;case 4:E.synth=q.bool();break;default:q.skipType(V&7);break}}return E},G.decodeDelimited=function H(q){if(!(q instanceof X))q=new X(q);return this.decode(q,q.uint32())},G.verify=function H(q){if(typeof q!=="object"||q===null)return"object expected";if(q.chain!=null&&q.hasOwnProperty("chain")){if(!Q.isString(q.chain))return"chain: string expected"}if(q.symbol!=null&&q.hasOwnProperty("symbol")){if(!Q.isString(q.symbol))return"symbol: string expected"}if(q.ticker!=null&&q.hasOwnProperty("ticker")){if(!Q.isString(q.ticker))return"ticker: string expected"}if(q.synth!=null&&q.hasOwnProperty("synth")){if(typeof q.synth!=="boolean")return"synth: boolean expected"}return null},G.fromObject=function H(q){if(q instanceof L.common.Asset)return q;let B=new L.common.Asset;if(q.chain!=null)B.chain=String(q.chain);if(q.symbol!=null)B.symbol=String(q.symbol);if(q.ticker!=null)B.ticker=String(q.ticker);if(q.synth!=null)B.synth=Boolean(q.synth);return B},G.toObject=function H(q,B){if(!B)B={};let z={};if(B.defaults)z.chain="",z.symbol="",z.ticker="",z.synth=!1;if(q.chain!=null&&q.hasOwnProperty("chain"))z.chain=q.chain;if(q.symbol!=null&&q.hasOwnProperty("symbol"))z.symbol=q.symbol;if(q.ticker!=null&&q.hasOwnProperty("ticker"))z.ticker=q.ticker;if(q.synth!=null&&q.hasOwnProperty("synth"))z.synth=q.synth;return z},G.prototype.toJSON=function H(){return this.constructor.toObject(this,Y.default.util.toJSONOptions)},G})(),Z.Coin=(()=>{function G(H){if(H){for(let q=Object.keys(H),B=0;B<q.length;++B)if(H[q[B]]!=null)this[q[B]]=H[q[B]]}}return G.prototype.asset=null,G.prototype.amount="",G.prototype.decimals=Q.Long?Q.Long.fromBits(0,0,!1):0,G.create=function H(q){return new G(q)},G.encode=function H(q,B){if(!B)B=J.create();if(q.asset!=null&&Object.hasOwnProperty.call(q,"asset"))L.common.Asset.encode(q.asset,B.uint32(10).fork()).ldelim();if(q.amount!=null&&Object.hasOwnProperty.call(q,"amount"))B.uint32(18).string(q.amount);if(q.decimals!=null&&Object.hasOwnProperty.call(q,"decimals"))B.uint32(24).int64(q.decimals);return B},G.encodeDelimited=function H(q,B){return this.encode(q,B).ldelim()},G.decode=function H(q,B){if(!(q instanceof X))q=X.create(q);let z=B===void 0?q.len:q.pos+B,E=new L.common.Coin;while(q.pos<z){let V=q.uint32();switch(V>>>3){case 1:E.asset=L.common.Asset.decode(q,q.uint32());break;case 2:E.amount=q.string();break;case 3:E.decimals=q.int64();break;default:q.skipType(V&7);break}}return E},G.decodeDelimited=function H(q){if(!(q instanceof X))q=new X(q);return this.decode(q,q.uint32())},G.verify=function H(q){if(typeof q!=="object"||q===null)return"object expected";if(q.asset!=null&&q.hasOwnProperty("asset")){let B=L.common.Asset.verify(q.asset);if(B)return"asset."+B}if(q.amount!=null&&q.hasOwnProperty("amount")){if(!Q.isString(q.amount))return"amount: string expected"}if(q.decimals!=null&&q.hasOwnProperty("decimals")){if(!Q.isInteger(q.decimals)&&!(q.decimals&&Q.isInteger(q.decimals.low)&&Q.isInteger(q.decimals.high)))return"decimals: integer|Long expected"}return null},G.fromObject=function H(q){if(q instanceof L.common.Coin)return q;let B=new L.common.Coin;if(q.asset!=null){if(typeof q.asset!=="object")throw TypeError(".common.Coin.asset: object expected");B.asset=L.common.Asset.fromObject(q.asset)}if(q.amount!=null)B.amount=String(q.amount);if(q.decimals!=null){if(Q.Long)(B.decimals=Q.Long.fromValue(q.decimals)).unsigned=!1;else if(typeof q.decimals==="string")B.decimals=Number.parseInt(q.decimals,10);else if(typeof q.decimals==="number")B.decimals=q.decimals;else if(typeof q.decimals==="object")B.decimals=new Q.LongBits(q.decimals.low>>>0,q.decimals.high>>>0).toNumber()}return B},G.toObject=function H(q,B){if(!B)B={};let z={};if(B.defaults)if(z.asset=null,z.amount="",Q.Long){let E=new Q.Long(0,0,!1);z.decimals=B.longs===String?E.toString():B.longs===Number?E.toNumber():E}else z.decimals=B.longs===String?"0":0;if(q.asset!=null&&q.hasOwnProperty("asset"))z.asset=L.common.Asset.toObject(q.asset,B);if(q.amount!=null&&q.hasOwnProperty("amount"))z.amount=q.amount;if(q.decimals!=null&&q.hasOwnProperty("decimals"))if(typeof q.decimals==="number")z.decimals=B.longs===String?String(q.decimals):q.decimals;else z.decimals=B.longs===String?Q.Long.prototype.toString.call(q.decimals):B.longs===Number?new Q.LongBits(q.decimals.low>>>0,q.decimals.high>>>0).toNumber():q.decimals;return z},G.prototype.toJSON=function H(){return this.constructor.toObject(this,Y.default.util.toJSONOptions)},G})(),Z.PubKeySet=(()=>{function G(H){if(H){for(let q=Object.keys(H),B=0;B<q.length;++B)if(H[q[B]]!=null)this[q[B]]=H[q[B]]}}return G.prototype.secp256k1="",G.prototype.ed25519="",G.create=function H(q){return new G(q)},G.encode=function H(q,B){if(!B)B=J.create();if(q.secp256k1!=null&&Object.hasOwnProperty.call(q,"secp256k1"))B.uint32(10).string(q.secp256k1);if(q.ed25519!=null&&Object.hasOwnProperty.call(q,"ed25519"))B.uint32(18).string(q.ed25519);return B},G.encodeDelimited=function H(q,B){return this.encode(q,B).ldelim()},G.decode=function H(q,B){if(!(q instanceof X))q=X.create(q);let z=B===void 0?q.len:q.pos+B,E=new L.common.PubKeySet;while(q.pos<z){let V=q.uint32();switch(V>>>3){case 1:E.secp256k1=q.string();break;case 2:E.ed25519=q.string();break;default:q.skipType(V&7);break}}return E},G.decodeDelimited=function H(q){if(!(q instanceof X))q=new X(q);return this.decode(q,q.uint32())},G.verify=function H(q){if(typeof q!=="object"||q===null)return"object expected";if(q.secp256k1!=null&&q.hasOwnProperty("secp256k1")){if(!Q.isString(q.secp256k1))return"secp256k1: string expected"}if(q.ed25519!=null&&q.hasOwnProperty("ed25519")){if(!Q.isString(q.ed25519))return"ed25519: string expected"}return null},G.fromObject=function H(q){if(q instanceof L.common.PubKeySet)return q;let B=new L.common.PubKeySet;if(q.secp256k1!=null)B.secp256k1=String(q.secp256k1);if(q.ed25519!=null)B.ed25519=String(q.ed25519);return B},G.toObject=function H(q,B){if(!B)B={};let z={};if(B.defaults)z.secp256k1="",z.ed25519="";if(q.secp256k1!=null&&q.hasOwnProperty("secp256k1"))z.secp256k1=q.secp256k1;if(q.ed25519!=null&&q.hasOwnProperty("ed25519"))z.ed25519=q.ed25519;return z},G.prototype.toJSON=function H(){return this.constructor.toObject(this,Y.default.util.toJSONOptions)},G})(),Z.Tx=(()=>{function G(H){if(this.coins=[],this.gas=[],H){for(let q=Object.keys(H),B=0;B<q.length;++B)if(H[q[B]]!=null)this[q[B]]=H[q[B]]}}return G.prototype.id="",G.prototype.chain="",G.prototype.fromAddress="",G.prototype.toAddress="",G.prototype.coins=Q.emptyArray,G.prototype.gas=Q.emptyArray,G.prototype.memo="",G.create=function H(q){return new G(q)},G.encode=function H(q,B){if(!B)B=J.create();if(q.id!=null&&Object.hasOwnProperty.call(q,"id"))B.uint32(10).string(q.id);if(q.chain!=null&&Object.hasOwnProperty.call(q,"chain"))B.uint32(18).string(q.chain);if(q.fromAddress!=null&&Object.hasOwnProperty.call(q,"fromAddress"))B.uint32(26).string(q.fromAddress);if(q.toAddress!=null&&Object.hasOwnProperty.call(q,"toAddress"))B.uint32(34).string(q.toAddress);if(q.coins?.length)for(let z=0;z<q.coins.length;++z)L.common.Coin.encode(q.coins[z],B.uint32(42).fork()).ldelim();if(q.gas?.length)for(let z=0;z<q.gas.length;++z)L.common.Coin.encode(q.gas[z],B.uint32(50).fork()).ldelim();if(q.memo!=null&&Object.hasOwnProperty.call(q,"memo"))B.uint32(58).string(q.memo);return B},G.encodeDelimited=function H(q,B){return this.encode(q,B).ldelim()},G.decode=function H(q,B){if(!(q instanceof X))q=X.create(q);let z=B===void 0?q.len:q.pos+B,E=new L.common.Tx;while(q.pos<z){let V=q.uint32();switch(V>>>3){case 1:E.id=q.string();break;case 2:E.chain=q.string();break;case 3:E.fromAddress=q.string();break;case 4:E.toAddress=q.string();break;case 5:if(!E.coins?.length)E.coins=[];E.coins.push(L.common.Coin.decode(q,q.uint32()));break;case 6:if(!E.gas?.length)E.gas=[];E.gas.push(L.common.Coin.decode(q,q.uint32()));break;case 7:E.memo=q.string();break;default:q.skipType(V&7);break}}return E},G.decodeDelimited=function H(q){if(!(q instanceof X))q=new X(q);return this.decode(q,q.uint32())},G.verify=function H(q){if(typeof q!=="object"||q===null)return"object expected";if(q.id!=null&&q.hasOwnProperty("id")){if(!Q.isString(q.id))return"id: string expected"}if(q.chain!=null&&q.hasOwnProperty("chain")){if(!Q.isString(q.chain))return"chain: string expected"}if(q.fromAddress!=null&&q.hasOwnProperty("fromAddress")){if(!Q.isString(q.fromAddress))return"fromAddress: string expected"}if(q.toAddress!=null&&q.hasOwnProperty("toAddress")){if(!Q.isString(q.toAddress))return"toAddress: string expected"}if(q.coins!=null&&q.hasOwnProperty("coins")){if(!Array.isArray(q.coins))return"coins: array expected";for(let B=0;B<q.coins.length;++B){let z=L.common.Coin.verify(q.coins[B]);if(z)return"coins."+z}}if(q.gas!=null&&q.hasOwnProperty("gas")){if(!Array.isArray(q.gas))return"gas: array expected";for(let B=0;B<q.gas.length;++B){let z=L.common.Coin.verify(q.gas[B]);if(z)return"gas."+z}}if(q.memo!=null&&q.hasOwnProperty("memo")){if(!Q.isString(q.memo))return"memo: string expected"}return null},G.fromObject=function H(q){if(q instanceof L.common.Tx)return q;let B=new L.common.Tx;if(q.id!=null)B.id=String(q.id);if(q.chain!=null)B.chain=String(q.chain);if(q.fromAddress!=null)B.fromAddress=String(q.fromAddress);if(q.toAddress!=null)B.toAddress=String(q.toAddress);if(q.coins){if(!Array.isArray(q.coins))throw TypeError(".common.Tx.coins: array expected");B.coins=[];for(let z=0;z<q.coins.length;++z){if(typeof q.coins[z]!=="object")throw TypeError(".common.Tx.coins: object expected");B.coins[z]=L.common.Coin.fromObject(q.coins[z])}}if(q.gas){if(!Array.isArray(q.gas))throw TypeError(".common.Tx.gas: array expected");B.gas=[];for(let z=0;z<q.gas.length;++z){if(typeof q.gas[z]!=="object")throw TypeError(".common.Tx.gas: object expected");B.gas[z]=L.common.Coin.fromObject(q.gas[z])}}if(q.memo!=null)B.memo=String(q.memo);return B},G.toObject=function H(q,B){if(!B)B={};let z={};if(B.arrays||B.defaults)z.coins=[],z.gas=[];if(B.defaults)z.id="",z.chain="",z.fromAddress="",z.toAddress="",z.memo="";if(q.id!=null&&q.hasOwnProperty("id"))z.id=q.id;if(q.chain!=null&&q.hasOwnProperty("chain"))z.chain=q.chain;if(q.fromAddress!=null&&q.hasOwnProperty("fromAddress"))z.fromAddress=q.fromAddress;if(q.toAddress!=null&&q.hasOwnProperty("toAddress"))z.toAddress=q.toAddress;if(q.coins?.length){z.coins=[];for(let E=0;E<q.coins.length;++E)z.coins[E]=L.common.Coin.toObject(q.coins[E],B)}if(q.gas?.length){z.gas=[];for(let E=0;E<q.gas.length;++E)z.gas[E]=L.common.Coin.toObject(q.gas[E],B)}if(q.memo!=null&&q.hasOwnProperty("memo"))z.memo=q.memo;return z},G.prototype.toJSON=function H(){return this.constructor.toObject(this,Y.default.util.toJSONOptions)},G})(),Z.Fee=(()=>{function G(H){if(this.coins=[],H){for(let q=Object.keys(H),B=0;B<q.length;++B)if(H[q[B]]!=null)this[q[B]]=H[q[B]]}}return G.prototype.coins=Q.emptyArray,G.prototype.poolDeduct="",G.create=function H(q){return new G(q)},G.encode=function H(q,B){if(!B)B=J.create();if(q.coins?.length)for(let z=0;z<q.coins.length;++z)L.common.Coin.encode(q.coins[z],B.uint32(10).fork()).ldelim();if(q.poolDeduct!=null&&Object.hasOwnProperty.call(q,"poolDeduct"))B.uint32(18).string(q.poolDeduct);return B},G.encodeDelimited=function H(q,B){return this.encode(q,B).ldelim()},G.decode=function H(q,B){if(!(q instanceof X))q=X.create(q);let z=B===void 0?q.len:q.pos+B,E=new L.common.Fee;while(q.pos<z){let V=q.uint32();switch(V>>>3){case 1:if(!E.coins?.length)E.coins=[];E.coins.push(L.common.Coin.decode(q,q.uint32()));break;case 2:E.poolDeduct=q.string();break;default:q.skipType(V&7);break}}return E},G.decodeDelimited=function H(q){if(!(q instanceof X))q=new X(q);return this.decode(q,q.uint32())},G.verify=function H(q){if(typeof q!=="object"||q===null)return"object expected";if(q.coins!=null&&q.hasOwnProperty("coins")){if(!Array.isArray(q.coins))return"coins: array expected";for(let B=0;B<q.coins.length;++B){let z=L.common.Coin.verify(q.coins[B]);if(z)return"coins."+z}}if(q.poolDeduct!=null&&q.hasOwnProperty("poolDeduct")){if(!Q.isString(q.poolDeduct))return"poolDeduct: string expected"}return null},G.fromObject=function H(q){if(q instanceof L.common.Fee)return q;let B=new L.common.Fee;if(q.coins){if(!Array.isArray(q.coins))throw TypeError(".common.Fee.coins: array expected");B.coins=[];for(let z=0;z<q.coins.length;++z){if(typeof q.coins[z]!=="object")throw TypeError(".common.Fee.coins: object expected");B.coins[z]=L.common.Coin.fromObject(q.coins[z])}}if(q.poolDeduct!=null)B.poolDeduct=String(q.poolDeduct);return B},G.toObject=function H(q,B){if(!B)B={};let z={};if(B.arrays||B.defaults)z.coins=[];if(B.defaults)z.poolDeduct="";if(q.coins?.length){z.coins=[];for(let E=0;E<q.coins.length;++E)z.coins[E]=L.common.Coin.toObject(q.coins[E],B)}if(q.poolDeduct!=null&&q.hasOwnProperty("poolDeduct"))z.poolDeduct=q.poolDeduct;return z},G.prototype.toJSON=function H(){return this.constructor.toObject(this,Y.default.util.toJSONOptions)},G})(),Z.ProtoUint=(()=>{function G(H){if(H){for(let q=Object.keys(H),B=0;B<q.length;++B)if(H[q[B]]!=null)this[q[B]]=H[q[B]]}}return G.prototype.value="",G.create=function H(q){return new G(q)},G.encode=function H(q,B){if(!B)B=J.create();if(q.value!=null&&Object.hasOwnProperty.call(q,"value"))B.uint32(10).string(q.value);return B},G.encodeDelimited=function H(q,B){return this.encode(q,B).ldelim()},G.decode=function H(q,B){if(!(q instanceof X))q=X.create(q);let z=B===void 0?q.len:q.pos+B,E=new L.common.ProtoUint;while(q.pos<z){let V=q.uint32();switch(V>>>3){case 1:E.value=q.string();break;default:q.skipType(V&7);break}}return E},G.decodeDelimited=function H(q){if(!(q instanceof X))q=new X(q);return this.decode(q,q.uint32())},G.verify=function H(q){if(typeof q!=="object"||q===null)return"object expected";if(q.value!=null&&q.hasOwnProperty("value")){if(!Q.isString(q.value))return"value: string expected"}return null},G.fromObject=function H(q){if(q instanceof L.common.ProtoUint)return q;let B=new L.common.ProtoUint;if(q.value!=null)B.value=String(q.value);return B},G.toObject=function H(q,B){if(!B)B={};let z={};if(B.defaults)z.value="";if(q.value!=null&&q.hasOwnProperty("value"))z.value=q.value;return z},G.prototype.toJSON=function H(){return this.constructor.toObject(this,Y.default.util.toJSONOptions)},G})(),Z})();L.types=(()=>{let Z={};return Z.MsgDeposit=(()=>{function G(H){if(this.coins=[],H){for(let q=Object.keys(H),B=0;B<q.length;++B)if(H[q[B]]!=null)this[q[B]]=H[q[B]]}}return G.prototype.coins=Q.emptyArray,G.prototype.memo="",G.prototype.signer=Q.newBuffer([]),G.create=function H(q){return new G(q)},G.encode=function H(q,B){if(!B)B=J.create();if(q.coins?.length)for(let z=0;z<q.coins.length;++z)L.common.Coin.encode(q.coins[z],B.uint32(10).fork()).ldelim();if(q.memo!=null&&Object.hasOwnProperty.call(q,"memo"))B.uint32(18).string(q.memo);if(q.signer!=null&&Object.hasOwnProperty.call(q,"signer"))B.uint32(26).bytes(q.signer);return B},G.encodeDelimited=function H(q,B){return this.encode(q,B).ldelim()},G.decode=function H(q,B){if(!(q instanceof X))q=X.create(q);let z=B===void 0?q.len:q.pos+B,E=new L.types.MsgDeposit;while(q.pos<z){let V=q.uint32();switch(V>>>3){case 1:if(!E.coins?.length)E.coins=[];E.coins.push(L.common.Coin.decode(q,q.uint32()));break;case 2:E.memo=q.string();break;case 3:E.signer=q.bytes();break;default:q.skipType(V&7);break}}return E},G.decodeDelimited=function H(q){if(!(q instanceof X))q=new X(q);return this.decode(q,q.uint32())},G.verify=function H(q){if(typeof q!=="object"||q===null)return"object expected";if(q.coins!=null&&q.hasOwnProperty("coins")){if(!Array.isArray(q.coins))return"coins: array expected";for(let B=0;B<q.coins.length;++B){let z=L.common.Coin.verify(q.coins[B]);if(z)return"coins."+z}}if(q.memo!=null&&q.hasOwnProperty("memo")){if(!Q.isString(q.memo))return"memo: string expected"}if(q.signer!=null&&q.hasOwnProperty("signer")){if(!(q.signer&&typeof q.signer.length==="number"||Q.isString(q.signer)))return"signer: buffer expected"}return null},G.fromObject=function H(q){if(q instanceof L.types.MsgDeposit)return q;let B=new L.types.MsgDeposit;if(q.coins){if(!Array.isArray(q.coins))throw TypeError(".types.MsgDeposit.coins: array expected");B.coins=[];for(let z=0;z<q.coins.length;++z){if(typeof q.coins[z]!=="object")throw TypeError(".types.MsgDeposit.coins: object expected");B.coins[z]=L.common.Coin.fromObject(q.coins[z])}}if(q.memo!=null)B.memo=String(q.memo);if(q.signer!=null){if(typeof q.signer==="string")Q.base64.decode(q.signer,B.signer=Q.newBuffer(Q.base64.length(q.signer)),0);else if(q.signer.length)B.signer=q.signer}return B},G.toObject=function H(q,B){if(!B)B={};let z={};if(B.arrays||B.defaults)z.coins=[];if(B.defaults){if(z.memo="",B.bytes===String)z.signer="";else if(z.signer=[],B.bytes!==Array)z.signer=Q.newBuffer(z.signer)}if(q.coins?.length){z.coins=[];for(let E=0;E<q.coins.length;++E)z.coins[E]=L.common.Coin.toObject(q.coins[E],B)}if(q.memo!=null&&q.hasOwnProperty("memo"))z.memo=q.memo;if(q.signer!=null&&q.hasOwnProperty("signer"))z.signer=B.bytes===String?Q.base64.encode(q.signer,0,q.signer.length):B.bytes===Array?Array.prototype.slice.call(q.signer):q.signer;return z},G.prototype.toJSON=function H(){return this.constructor.toObject(this,Y.default.util.toJSONOptions)},G})(),Z.MsgSend=(()=>{function G(H){if(this.amount=[],H){for(let q=Object.keys(H),B=0;B<q.length;++B)if(H[q[B]]!=null)this[q[B]]=H[q[B]]}}return G.prototype.fromAddress=Q.newBuffer([]),G.prototype.toAddress=Q.newBuffer([]),G.prototype.amount=Q.emptyArray,G.create=function H(q){return new G(q)},G.encode=function H(q,B){if(!B)B=J.create();if(q.fromAddress!=null&&Object.hasOwnProperty.call(q,"fromAddress"))B.uint32(10).bytes(q.fromAddress);if(q.toAddress!=null&&Object.hasOwnProperty.call(q,"toAddress"))B.uint32(18).bytes(q.toAddress);if(q.amount?.length)for(let z=0;z<q.amount.length;++z)L.cosmos.base.v1beta1.Coin.encode(q.amount[z],B.uint32(26).fork()).ldelim();return B},G.encodeDelimited=function H(q,B){return this.encode(q,B).ldelim()},G.decode=function H(q,B){if(!(q instanceof X))q=X.create(q);let z=B===void 0?q.len:q.pos+B,E=new L.types.MsgSend;while(q.pos<z){let V=q.uint32();switch(V>>>3){case 1:E.fromAddress=q.bytes();break;case 2:E.toAddress=q.bytes();break;case 3:if(!E.amount?.length)E.amount=[];E.amount.push(L.cosmos.base.v1beta1.Coin.decode(q,q.uint32()));break;default:q.skipType(V&7);break}}return E},G.decodeDelimited=function H(q){if(!(q instanceof X))q=new X(q);return this.decode(q,q.uint32())},G.verify=function H(q){if(typeof q!=="object"||q===null)return"object expected";if(q.fromAddress!=null&&q.hasOwnProperty("fromAddress")){if(!(q.fromAddress&&typeof q.fromAddress.length==="number"||Q.isString(q.fromAddress)))return"fromAddress: buffer expected"}if(q.toAddress!=null&&q.hasOwnProperty("toAddress")){if(!(q.toAddress&&typeof q.toAddress.length==="number"||Q.isString(q.toAddress)))return"toAddress: buffer expected"}if(q.amount!=null&&q.hasOwnProperty("amount")){if(!Array.isArray(q.amount))return"amount: array expected";for(let B=0;B<q.amount.length;++B){let z=L.cosmos.base.v1beta1.Coin.verify(q.amount[B]);if(z)return"amount."+z}}return null},G.fromObject=function H(q){if(q instanceof L.types.MsgSend)return q;let B=new L.types.MsgSend;if(q.fromAddress!=null){if(typeof q.fromAddress==="string")Q.base64.decode(q.fromAddress,B.fromAddress=Q.newBuffer(Q.base64.length(q.fromAddress)),0);else if(q.fromAddress.length)B.fromAddress=q.fromAddress}if(q.toAddress!=null){if(typeof q.toAddress==="string")Q.base64.decode(q.toAddress,B.toAddress=Q.newBuffer(Q.base64.length(q.toAddress)),0);else if(q.toAddress.length)B.toAddress=q.toAddress}if(q.amount){if(!Array.isArray(q.amount))throw TypeError(".types.MsgSend.amount: array expected");B.amount=[];for(let z=0;z<q.amount.length;++z){if(typeof q.amount[z]!=="object")throw TypeError(".types.MsgSend.amount: object expected");B.amount[z]=L.cosmos.base.v1beta1.Coin.fromObject(q.amount[z])}}return B},G.toObject=function H(q,B){if(!B)B={};let z={};if(B.arrays||B.defaults)z.amount=[];if(B.defaults){if(B.bytes===String)z.fromAddress="";else if(z.fromAddress=[],B.bytes!==Array)z.fromAddress=Q.newBuffer(z.fromAddress);if(B.bytes===String)z.toAddress="";else if(z.toAddress=[],B.bytes!==Array)z.toAddress=Q.newBuffer(z.toAddress)}if(q.fromAddress!=null&&q.hasOwnProperty("fromAddress"))z.fromAddress=B.bytes===String?Q.base64.encode(q.fromAddress,0,q.fromAddress.length):B.bytes===Array?Array.prototype.slice.call(q.fromAddress):q.fromAddress;if(q.toAddress!=null&&q.hasOwnProperty("toAddress"))z.toAddress=B.bytes===String?Q.base64.encode(q.toAddress,0,q.toAddress.length):B.bytes===Array?Array.prototype.slice.call(q.toAddress):q.toAddress;if(q.amount?.length){z.amount=[];for(let E=0;E<q.amount.length;++E)z.amount[E]=L.cosmos.base.v1beta1.Coin.toObject(q.amount[E],B)}return z},G.prototype.toJSON=function H(){return this.constructor.toObject(this,Y.default.util.toJSONOptions)},G})(),Z})();L.cosmos=(()=>{let Z={};return Z.base=(()=>{let G={};return G.v1beta1=(()=>{let H={};return H.Coin=(()=>{function q(B){if(B){for(let z=Object.keys(B),E=0;E<z.length;++E)if(B[z[E]]!=null)this[z[E]]=B[z[E]]}}return q.prototype.denom="",q.prototype.amount="",q.create=function B(z){return new q(z)},q.encode=function B(z,E){if(!E)E=J.create();if(z.denom!=null&&Object.hasOwnProperty.call(z,"denom"))E.uint32(10).string(z.denom);if(z.amount!=null&&Object.hasOwnProperty.call(z,"amount"))E.uint32(18).string(z.amount);return E},q.encodeDelimited=function B(z,E){return this.encode(z,E).ldelim()},q.decode=function B(z,E){if(!(z instanceof X))z=X.create(z);let V=E===void 0?z.len:z.pos+E,_=new L.cosmos.base.v1beta1.Coin;while(z.pos<V){let N=z.uint32();switch(N>>>3){case 1:_.denom=z.string();break;case 2:_.amount=z.string();break;default:z.skipType(N&7);break}}return _},q.decodeDelimited=function B(z){if(!(z instanceof X))z=new X(z);return this.decode(z,z.uint32())},q.verify=function B(z){if(typeof z!=="object"||z===null)return"object expected";if(z.denom!=null&&z.hasOwnProperty("denom")){if(!Q.isString(z.denom))return"denom: string expected"}if(z.amount!=null&&z.hasOwnProperty("amount")){if(!Q.isString(z.amount))return"amount: string expected"}return null},q.fromObject=function B(z){if(z instanceof L.cosmos.base.v1beta1.Coin)return z;let E=new L.cosmos.base.v1beta1.Coin;if(z.denom!=null)E.denom=String(z.denom);if(z.amount!=null)E.amount=String(z.amount);return E},q.toObject=function B(z,E){if(!E)E={};let V={};if(E.defaults)V.denom="",V.amount="";if(z.denom!=null&&z.hasOwnProperty("denom"))V.denom=z.denom;if(z.amount!=null&&z.hasOwnProperty("amount"))V.amount=z.amount;return V},q.prototype.toJSON=function B(){return this.constructor.toObject(this,Y.default.util.toJSONOptions)},q})(),H.DecCoin=(()=>{function q(B){if(B){for(let z=Object.keys(B),E=0;E<z.length;++E)if(B[z[E]]!=null)this[z[E]]=B[z[E]]}}return q.prototype.denom="",q.prototype.amount="",q.create=function B(z){return new q(z)},q.encode=function B(z,E){if(!E)E=J.create();if(z.denom!=null&&Object.hasOwnProperty.call(z,"denom"))E.uint32(10).string(z.denom);if(z.amount!=null&&Object.hasOwnProperty.call(z,"amount"))E.uint32(18).string(z.amount);return E},q.encodeDelimited=function B(z,E){return this.encode(z,E).ldelim()},q.decode=function B(z,E){if(!(z instanceof X))z=X.create(z);let V=E===void 0?z.len:z.pos+E,_=new L.cosmos.base.v1beta1.DecCoin;while(z.pos<V){let N=z.uint32();switch(N>>>3){case 1:_.denom=z.string();break;case 2:_.amount=z.string();break;default:z.skipType(N&7);break}}return _},q.decodeDelimited=function B(z){if(!(z instanceof X))z=new X(z);return this.decode(z,z.uint32())},q.verify=function B(z){if(typeof z!=="object"||z===null)return"object expected";if(z.denom!=null&&z.hasOwnProperty("denom")){if(!Q.isString(z.denom))return"denom: string expected"}if(z.amount!=null&&z.hasOwnProperty("amount")){if(!Q.isString(z.amount))return"amount: string expected"}return null},q.fromObject=function B(z){if(z instanceof L.cosmos.base.v1beta1.DecCoin)return z;let E=new L.cosmos.base.v1beta1.DecCoin;if(z.denom!=null)E.denom=String(z.denom);if(z.amount!=null)E.amount=String(z.amount);return E},q.toObject=function B(z,E){if(!E)E={};let V={};if(E.defaults)V.denom="",V.amount="";if(z.denom!=null&&z.hasOwnProperty("denom"))V.denom=z.denom;if(z.amount!=null&&z.hasOwnProperty("amount"))V.amount=z.amount;return V},q.prototype.toJSON=function B(){return this.constructor.toObject(this,Y.default.util.toJSONOptions)},q})(),H.IntProto=(()=>{function q(B){if(B){for(let z=Object.keys(B),E=0;E<z.length;++E)if(B[z[E]]!=null)this[z[E]]=B[z[E]]}}return q.prototype.int="",q.create=function B(z){return new q(z)},q.encode=function B(z,E){if(!E)E=J.create();if(z.int!=null&&Object.hasOwnProperty.call(z,"int"))E.uint32(10).string(z.int);return E},q.encodeDelimited=function B(z,E){return this.encode(z,E).ldelim()},q.decode=function B(z,E){if(!(z instanceof X))z=X.create(z);let V=E===void 0?z.len:z.pos+E,_=new L.cosmos.base.v1beta1.IntProto;while(z.pos<V){let N=z.uint32();switch(N>>>3){case 1:_.int=z.string();break;default:z.skipType(N&7);break}}return _},q.decodeDelimited=function B(z){if(!(z instanceof X))z=new X(z);return this.decode(z,z.uint32())},q.verify=function B(z){if(typeof z!=="object"||z===null)return"object expected";if(z.int!=null&&z.hasOwnProperty("int")){if(!Q.isString(z.int))return"int: string expected"}return null},q.fromObject=function B(z){if(z instanceof L.cosmos.base.v1beta1.IntProto)return z;let E=new L.cosmos.base.v1beta1.IntProto;if(z.int!=null)E.int=String(z.int);return E},q.toObject=function B(z,E){if(!E)E={};let V={};if(E.defaults)V.int="";if(z.int!=null&&z.hasOwnProperty("int"))V.int=z.int;return V},q.prototype.toJSON=function B(){return this.constructor.toObject(this,Y.default.util.toJSONOptions)},q})(),H.DecProto=(()=>{function q(B){if(B){for(let z=Object.keys(B),E=0;E<z.length;++E)if(B[z[E]]!=null)this[z[E]]=B[z[E]]}}return q.prototype.dec="",q.create=function B(z){return new q(z)},q.encode=function B(z,E){if(!E)E=J.create();if(z.dec!=null&&Object.hasOwnProperty.call(z,"dec"))E.uint32(10).string(z.dec);return E},q.encodeDelimited=function B(z,E){return this.encode(z,E).ldelim()},q.decode=function B(z,E){if(!(z instanceof X))z=X.create(z);let V=E===void 0?z.len:z.pos+E,_=new L.cosmos.base.v1beta1.DecProto;while(z.pos<V){let N=z.uint32();switch(N>>>3){case 1:_.dec=z.string();break;default:z.skipType(N&7);break}}return _},q.decodeDelimited=function B(z){if(!(z instanceof X))z=new X(z);return this.decode(z,z.uint32())},q.verify=function B(z){if(typeof z!=="object"||z===null)return"object expected";if(z.dec!=null&&z.hasOwnProperty("dec")){if(!Q.isString(z.dec))return"dec: string expected"}return null},q.fromObject=function B(z){if(z instanceof L.cosmos.base.v1beta1.DecProto)return z;let E=new L.cosmos.base.v1beta1.DecProto;if(z.dec!=null)E.dec=String(z.dec);return E},q.toObject=function B(z,E){if(!E)E={};let V={};if(E.defaults)V.dec="";if(z.dec!=null&&z.hasOwnProperty("dec"))V.dec=z.dec;return V},q.prototype.toJSON=function B(){return this.constructor.toObject(this,Y.default.util.toJSONOptions)},q})(),H})(),G})(),Z})();
|
|
2
|
-
|
|
3
|
-
//# debugId=F50163E6D500BE1D64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=chunk-4yap1fvd.js.map
|