@gurge/sdk 0.3.10 → 0.3.12
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/common/src/API/enclaveSignatureCalls.cjs +1 -1
- package/common/src/API/enclaveSignatureCalls.d.ts +1 -1
- package/common/src/API/enclaveSignatureCalls.mjs +1 -1
- package/common/src/API/getServerURL.cjs +1 -1
- package/common/src/API/getServerURL.mjs +2 -2
- package/common/src/constants/protocol.constants.cjs +1 -1
- package/common/src/constants/protocol.constants.d.ts +2 -0
- package/common/src/constants/protocol.constants.mjs +2 -2
- package/common/src/constants/server.constants.cjs +1 -1
- package/common/src/constants/server.constants.d.ts +1 -1
- package/common/src/constants/server.constants.mjs +2 -2
- package/common/src/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/common/src/data-structures/Hinkal/Hinkal.d.ts +5 -1
- package/common/src/data-structures/Hinkal/Hinkal.mjs +125 -112
- package/common/src/data-structures/Hinkal/IHinkal.d.ts +5 -1
- package/common/src/error-handling/error-codes.constants.cjs +1 -1
- package/common/src/error-handling/error-codes.constants.d.ts +2 -0
- package/common/src/error-handling/error-codes.constants.mjs +2 -0
- package/common/src/functions/pre-transaction/sendV0Transaction.cjs +2 -1
- package/common/src/functions/pre-transaction/sendV0Transaction.mjs +2 -2
- package/common/src/functions/snarkjs/constant.cjs +1 -1
- package/common/src/functions/snarkjs/constant.mjs +1 -1
- package/common/src/functions/utils/enclave-signature-storage.cjs +1 -1
- package/common/src/functions/utils/enclave-signature-storage.d.ts +1 -1
- package/common/src/functions/utils/enclave-signature-storage.mjs +1 -1
- package/common/src/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/common/src/functions/utils/erc20tokenFunctions.d.ts +1 -0
- package/common/src/functions/utils/erc20tokenFunctions.mjs +3 -3
- package/common/src/webworker/package.json +1 -1
- package/common/src/webworker/viteWorkerURL.constant.cjs +3 -3
- package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
- package/functions/index.cjs +1 -1
- package/functions/index.mjs +0 -1
- package/functions/integrations/swapApi.cjs +1 -1
- package/functions/integrations/swapApi.d.ts +2 -2
- package/functions/integrations/swapApi.mjs +5 -4
- package/functions/utils/index.cjs +1 -1
- package/functions/utils/index.d.ts +0 -1
- package/functions/utils/index.mjs +0 -1
- package/index.cjs +1 -1
- package/index.mjs +2 -3
- package/internal/token.utils.cjs +1 -0
- package/internal/token.utils.d.ts +7 -0
- package/internal/token.utils.mjs +38 -0
- package/package.json +1 -1
- package/services/Hinkal.cjs +1 -1
- package/services/Hinkal.d.ts +23 -20
- package/services/Hinkal.mjs +50 -44
- package/types/IHinkal.d.ts +21 -19
- package/types/balances.types.d.ts +12 -1
- package/types/token.types.d.ts +5 -1
- package/functions/utils/getERC20Token.cjs +0 -1
- package/functions/utils/getERC20Token.d.ts +0 -2
- package/functions/utils/getERC20Token.mjs +0 -5
package/types/IHinkal.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BridgeRecipient, ExternalActionId, FeeStructure, LoginMessageMode, NearBridgeParams, NearBridgeResult, StealthAddressStructure, SubAccount } from '../common/src/types';
|
|
2
2
|
import { ethers, TypedDataDomain, TypedDataField } from 'ethers';
|
|
3
3
|
import { Types as TronWebTypes } from 'tronweb';
|
|
4
4
|
import { Utxo } from '../common/src/data-structures/utxo/Utxo';
|
|
5
5
|
import { PublicKey } from '@solana/web3.js';
|
|
6
6
|
import { IProviderAdapter } from './IProviderAdapter';
|
|
7
|
+
import { PrivateBalancesState, TokenBalance } from './balances.types';
|
|
8
|
+
import { TokenChanges } from './token.types';
|
|
7
9
|
export interface IHinkal<ConnectorType = unknown> {
|
|
8
10
|
getProviderAdapter(chainId?: number): IProviderAdapter;
|
|
9
11
|
initProviderAdapter(connector: ConnectorType, providerAdapter: IProviderAdapter<ConnectorType>): Promise<void>;
|
|
@@ -34,22 +36,22 @@ export interface IHinkal<ConnectorType = unknown> {
|
|
|
34
36
|
getEthereumAddressByChain(chainId: number): Promise<string>;
|
|
35
37
|
getRecipientInfo(): string;
|
|
36
38
|
getShieldedPublicKey(): string;
|
|
37
|
-
prooflessDeposit(
|
|
38
|
-
prooflessDepositWithPublicFee(
|
|
39
|
-
deposit(
|
|
40
|
-
depositSolana(
|
|
41
|
-
depositForOther(
|
|
42
|
-
depositSolanaForOther(
|
|
43
|
-
depositAndWithdraw(
|
|
44
|
-
depositAndBridge(
|
|
45
|
-
nearDepositAndBridge(
|
|
46
|
-
claimUtxo(
|
|
47
|
-
transfer(
|
|
48
|
-
withdraw(
|
|
49
|
-
withdrawStuckUtxos(
|
|
50
|
-
swap(
|
|
51
|
-
actionPrivateWallet(chainId: number,
|
|
52
|
-
proxySwap(
|
|
53
|
-
proxyToPrivate(
|
|
54
|
-
proxySend(
|
|
39
|
+
prooflessDeposit(chainId: number, erc20Addresses: string[], amountChanges: bigint[], stealthAddressStructures?: StealthAddressStructure[]): Promise<string | ethers.TransactionRequest | TronWebTypes.Transaction<TronWebTypes.TriggerSmartContract>>;
|
|
40
|
+
prooflessDepositWithPublicFee(chainId: number, erc20Address: string, amounts: bigint[], stealthAddressStructures: StealthAddressStructure[], feeAmount: bigint): Promise<string>;
|
|
41
|
+
deposit(chainId: number, erc20Addresses: string[], amountChanges: bigint[], preEstimateGas?: boolean, returnTxData?: boolean): Promise<ethers.TransactionResponse | ethers.TransactionRequest | string | TronWebTypes.Transaction<TronWebTypes.TriggerSmartContract>>;
|
|
42
|
+
depositSolana(chainId: number, erc20Address: string, amount: bigint): Promise<string>;
|
|
43
|
+
depositForOther(chainId: number, erc20Addresses: string[], amountChanges: bigint[], recipientInfo: string, preEstimateGas?: boolean, returnTxData?: boolean): Promise<ethers.TransactionResponse | ethers.TransactionRequest | string | TronWebTypes.Transaction<TronWebTypes.TriggerSmartContract>>;
|
|
44
|
+
depositSolanaForOther(chainId: number, erc20Address: string, amount: bigint, recipientInfo: string): Promise<string>;
|
|
45
|
+
depositAndWithdraw(chainId: number, erc20Address: string, recipientAmounts: bigint[], recipientAddresses: string[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, preEstimateGas?: boolean): Promise<string>;
|
|
46
|
+
depositAndBridge(chainId: number, erc20Address: string, recipientBridges: BridgeRecipient[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, preEstimateGas?: boolean): Promise<string>;
|
|
47
|
+
nearDepositAndBridge(chainId: number, erc20Address: string, recipientAmounts: bigint[], recipientAddresses: string[], params: NearBridgeParams, txCompletionTime?: number, feeStructureOverride?: FeeStructure): Promise<NearBridgeResult>;
|
|
48
|
+
claimUtxo(chainId: number, erc20Address: string, utxo: Utxo, feeStructureOverride?: FeeStructure, claimableSignature?: string): Promise<string>;
|
|
49
|
+
transfer(chainId: number, erc20Addresses: string[], amountChanges: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure): Promise<string>;
|
|
50
|
+
withdraw(chainId: number, erc20Addresses: string[], deltaAmounts: bigint[], recipientAddress: string, isRelayerOff: boolean, feeToken?: string, feeStructureOverride?: FeeStructure): Promise<ethers.TransactionResponse | string>;
|
|
51
|
+
withdrawStuckUtxos(chainId: number, erc20Address: string, recipientAddress: string): Promise<string[]>;
|
|
52
|
+
swap(chainId: number, erc20Addresses: string[], deltaAmounts: bigint[], externalActionId: ExternalActionId, swapData: string, feeToken?: string, feeStructureOverride?: FeeStructure): Promise<string>;
|
|
53
|
+
actionPrivateWallet(chainId: number, erc20Addresses: string[], deltaAmounts: bigint[], onChainCreation: boolean[], ops: string[], emporiumTokenChanges: TokenChanges<bigint>[], subAccount?: SubAccount, feeToken?: string, feeStructureOverride?: FeeStructure): Promise<string>;
|
|
54
|
+
proxySwap(chainId: number, erc20Addresses: string[], deltaAmounts: bigint[], externalActionId: ExternalActionId, swapData: string, isTheSameChainSwap: boolean, subAccount: SubAccount, feeToken?: string, feeStructureOverride?: FeeStructure): Promise<string>;
|
|
55
|
+
proxyToPrivate(chainId: number, erc20Addresses: string[], deltaAmountsBase: bigint[], subAccount: SubAccount, recipientInfo: string, feeToken?: string, feeStructureOverride?: FeeStructure): Promise<string>;
|
|
56
|
+
proxySend(chainId: number, erc20Addresses: string[], amounts: bigint[], subAccount: SubAccount, recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure): Promise<string>;
|
|
55
57
|
}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { PrivateBalanceUpdateEventType as CommonPrivateBalanceUpdateEventType } from '../common/src/types';
|
|
2
2
|
export { PrivateBalanceUpdateType } from '../common/src/types';
|
|
3
|
-
export type
|
|
3
|
+
export type TokenBalance = {
|
|
4
|
+
chainId: number;
|
|
5
|
+
erc20Address: string;
|
|
6
|
+
balance: bigint;
|
|
7
|
+
timestamp?: string;
|
|
8
|
+
};
|
|
9
|
+
export type TokenBalanceWithUsd = TokenBalance & {
|
|
10
|
+
isBalanceLoading?: boolean;
|
|
11
|
+
usdValue?: number;
|
|
12
|
+
isUsdValueLoading?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type PrivateBalancesState = Record<number, TokenBalanceWithUsd[] | undefined>;
|
|
4
15
|
export type PrivateBalanceUpdateEventType = Omit<CommonPrivateBalanceUpdateEventType, 'balanceChangeState'>;
|
package/types/token.types.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../common/src/functions/utils/erc20tokenFunctions.cjs`);var t=async(t,n)=>await e.getErc20TokenFromAPI(t,n);exports.getERC20Token=t;
|