@rainlanguage/ui-components 0.0.1-alpha.21 → 0.0.1-alpha.210
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/__fixtures__/settings.yaml +125 -0
- package/dist/__mocks__/CodeMirrorRainlang.svelte +4 -0
- package/dist/__mocks__/CodeMirrorRainlang.svelte.d.ts +18 -0
- package/dist/__mocks__/MockComponent.svelte +4 -0
- package/dist/__mocks__/MockComponent.svelte.d.ts +3 -1
- package/dist/__mocks__/stores.d.ts +47 -33
- package/dist/__mocks__/stores.js +61 -38
- package/dist/components/ButtonLoading.svelte +1 -1
- package/dist/components/ButtonVaultLink.svelte +11 -11
- package/dist/components/ButtonVaultLink.svelte.d.ts +4 -3
- package/dist/components/CheckboxInactiveOrdersVault.svelte +20 -0
- package/dist/components/CheckboxInactiveOrdersVault.svelte.d.ts +19 -0
- package/dist/components/CheckboxMyItemsOnly.svelte +3 -2
- package/dist/components/CheckboxMyItemsOnly.svelte.d.ts +2 -3
- package/dist/components/CheckboxZeroBalanceVault.svelte.d.ts +2 -2
- package/dist/components/CodeMirrorDotrain.svelte +4 -0
- package/dist/components/CodeMirrorDotrain.svelte.d.ts +1 -0
- package/dist/components/CodeMirrorRainlang.svelte +3 -12
- package/dist/components/CodeMirrorRainlang.svelte.d.ts +2 -2
- package/dist/components/EditableSpan.svelte +3 -14
- package/dist/components/EditableSpan.svelte.d.ts +0 -1
- package/dist/components/Hash.svelte +3 -3
- package/dist/components/License.svelte +5 -4
- package/dist/components/ListViewOrderbookFilters.svelte +45 -23
- package/dist/components/ListViewOrderbookFilters.svelte.d.ts +27 -22
- package/dist/components/LocalDbStatusBadge.svelte +27 -0
- package/dist/components/LocalDbStatusBadge.svelte.d.ts +19 -0
- package/dist/components/LocalDbStatusCard.svelte +40 -0
- package/dist/components/LocalDbStatusCard.svelte.d.ts +20 -0
- package/dist/components/LocalDbStatusModal.svelte +103 -0
- package/dist/components/LocalDbStatusModal.svelte.d.ts +21 -0
- package/dist/components/OrderOrVaultHash.svelte +12 -12
- package/dist/components/OrderOrVaultHash.svelte.d.ts +4 -4
- package/dist/components/PageHeader.svelte +1 -1
- package/dist/components/TanstackAppTable.svelte +179 -28
- package/dist/components/TanstackAppTable.svelte.d.ts +14 -8
- package/dist/components/ToastDetail.svelte +42 -0
- package/dist/components/ToastDetail.svelte.d.ts +20 -0
- package/dist/components/Tooltip.svelte +8 -0
- package/dist/components/Tooltip.svelte.d.ts +21 -0
- package/dist/components/VaultBalanceChangeTypeFilter.svelte +23 -0
- package/dist/components/VaultBalanceChangeTypeFilter.svelte.d.ts +19 -0
- package/dist/components/VaultCard.svelte +18 -0
- package/dist/components/VaultCard.svelte.d.ts +19 -0
- package/dist/components/charts/LightweightChart.svelte +1 -1
- package/dist/components/charts/LightweightChart.svelte.d.ts +5 -5
- package/dist/components/charts/OrderTradesChart.svelte +300 -28
- package/dist/components/charts/OrderTradesChart.svelte.d.ts +4 -4
- package/dist/components/charts/TanstackLightweightChartLine.svelte +5 -9
- package/dist/components/charts/VaultBalanceChart.svelte +8 -26
- package/dist/components/charts/VaultBalanceChart.svelte.d.ts +1 -7
- package/dist/components/charts/transformAndSortData.d.ts +24 -0
- package/dist/components/charts/transformAndSortData.js +111 -0
- package/dist/components/checkbox/CheckboxActiveOrders.svelte +11 -0
- package/dist/components/checkbox/CheckboxActiveOrders.svelte.d.ts +19 -0
- package/dist/components/deployment/ButtonSelectOption.svelte +2 -0
- package/dist/components/deployment/ButtonSelectOption.svelte.d.ts +1 -0
- package/dist/components/deployment/ComposedRainlangModal.svelte +2 -1
- package/dist/components/deployment/ComposedRainlangModal.svelte.d.ts +1 -4
- package/dist/components/deployment/DeploymentSectionHeader.svelte +7 -4
- package/dist/components/deployment/DeploymentSteps.svelte +209 -216
- package/dist/components/deployment/DeploymentSteps.svelte.d.ts +6 -12
- package/dist/components/deployment/DeploymentTile.svelte +2 -2
- package/dist/components/deployment/DeploymentTile.svelte.d.ts +1 -1
- package/dist/components/deployment/DeploymentsSection.svelte +15 -22
- package/dist/components/deployment/DeploymentsSection.svelte.d.ts +3 -2
- package/dist/components/deployment/DepositInput.svelte +8 -10
- package/dist/components/deployment/DepositInput.svelte.d.ts +1 -2
- package/dist/components/deployment/DisclaimerModal.svelte +6 -7
- package/dist/components/deployment/FieldDefinitionInput.svelte +7 -11
- package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +1 -2
- package/dist/components/deployment/InvalidOrdersSection.svelte +17 -0
- package/dist/components/deployment/InvalidOrdersSection.svelte.d.ts +19 -0
- package/dist/components/deployment/{StrategyPage.svelte → OrderPage.svelte} +15 -24
- package/dist/components/deployment/OrderPage.svelte.d.ts +21 -0
- package/dist/components/deployment/SelectToken.svelte +125 -48
- package/dist/components/deployment/SelectToken.svelte.d.ts +4 -3
- package/dist/components/deployment/TokenBalance.svelte +19 -0
- package/dist/components/deployment/TokenBalance.svelte.d.ts +19 -0
- package/dist/components/deployment/TokenIOInput.svelte +25 -15
- package/dist/components/deployment/TokenIOInput.svelte.d.ts +3 -3
- package/dist/components/deployment/TokenSelectionModal.svelte +148 -0
- package/dist/components/deployment/TokenSelectionModal.svelte.d.ts +20 -0
- package/dist/components/deployment/{ValidStrategiesSection.svelte → ValidOrdersSection.svelte} +7 -7
- package/dist/components/deployment/ValidOrdersSection.svelte.d.ts +19 -0
- package/dist/components/deployment/VaultIdInformation.svelte +17 -0
- package/dist/components/deployment/VaultIdInformation.svelte.d.ts +21 -0
- package/dist/components/detail/OrderDetail.svelte +184 -80
- package/dist/components/detail/OrderDetail.svelte.d.ts +21 -15
- package/dist/components/detail/TanstackOrderQuote.svelte +92 -46
- package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +14 -16
- package/dist/components/detail/VaultDetail.svelte +78 -77
- package/dist/components/detail/VaultDetail.svelte.d.ts +12 -18
- package/dist/components/dropdown/DropdownActiveNetworks.svelte +44 -0
- package/dist/components/dropdown/DropdownActiveNetworks.svelte.d.ts +19 -0
- package/dist/components/dropdown/DropdownCheckbox.svelte +4 -4
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte +5 -2
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte.d.ts +2 -3
- package/dist/components/dropdown/DropdownOrderbooksFilter.svelte +172 -0
- package/dist/components/dropdown/DropdownOrderbooksFilter.svelte.d.ts +25 -0
- package/dist/components/dropdown/DropdownTokensFilter.svelte +152 -0
- package/dist/components/dropdown/DropdownTokensFilter.svelte.d.ts +28 -0
- package/dist/components/icon/Refresh.svelte +2 -1
- package/dist/components/icon/Refresh.svelte.d.ts +1 -0
- package/dist/components/input/InputOrderHash.svelte +1 -1
- package/dist/components/input/InputOrderHash.svelte.d.ts +3 -3
- package/dist/components/input/InputRegistryUrl.svelte +36 -14
- package/dist/components/input/InputToken.svelte +2 -2
- package/dist/components/input/InputTokenAmount.svelte +16 -21
- package/dist/components/input/InputTokenAmount.svelte.d.ts +3 -3
- package/dist/components/tables/OrderAPY.svelte +6 -33
- package/dist/components/tables/OrderAPY.svelte.d.ts +1 -4
- package/dist/components/tables/OrderTradesListTable.svelte +84 -81
- package/dist/components/tables/OrderTradesListTable.svelte.d.ts +4 -4
- package/dist/components/tables/OrderVaultsVolTable.svelte +17 -22
- package/dist/components/tables/OrderVaultsVolTable.svelte.d.ts +2 -2
- package/dist/components/tables/OrdersListTable.svelte +200 -108
- package/dist/components/tables/OrdersListTable.svelte.d.ts +17 -21
- package/dist/components/tables/VaultBalanceChangesTable.svelte +83 -43
- package/dist/components/tables/VaultBalanceChangesTable.svelte.d.ts +13 -11
- package/dist/components/tables/VaultsListTable.svelte +268 -145
- package/dist/components/tables/VaultsListTable.svelte.d.ts +24 -32
- package/dist/components/transactions/FixedBottomTransaction.svelte +63 -0
- package/dist/components/transactions/FixedBottomTransaction.svelte.d.ts +16 -0
- package/dist/components/transactions/TransactionDetail.svelte +31 -0
- package/dist/components/transactions/TransactionDetail.svelte.d.ts +20 -0
- package/dist/components/transactions/TransactionList.svelte +17 -0
- package/dist/components/transactions/TransactionList.svelte.d.ts +16 -0
- package/dist/components/transactions/getStatusEmoji.d.ts +2 -0
- package/dist/components/transactions/getStatusEmoji.js +20 -0
- package/dist/components/wallet/WalletConnect.svelte +5 -4
- package/dist/components/wallet/WalletConnect.svelte.d.ts +0 -1
- package/dist/consts.d.ts +1 -0
- package/dist/consts.js +1 -0
- package/dist/errors/DeploymentStepsError.d.ts +8 -2
- package/dist/errors/DeploymentStepsError.js +7 -1
- package/dist/hooks/useGui.d.ts +1 -1
- package/dist/hooks/useGui.js +1 -1
- package/dist/hooks/useLocalDb.d.ts +3 -0
- package/dist/hooks/useLocalDb.js +10 -0
- package/dist/hooks/useRaindexClient.d.ts +3 -0
- package/dist/hooks/useRaindexClient.js +11 -0
- package/dist/index.d.ts +42 -19
- package/dist/index.js +41 -16
- package/dist/models/Transaction.d.ts +75 -0
- package/dist/models/Transaction.js +100 -0
- package/dist/providers/GuiProvider.svelte +1 -1
- package/dist/providers/GuiProvider.svelte.d.ts +1 -1
- package/dist/providers/LocalDbProvider.svelte +8 -0
- package/dist/providers/LocalDbProvider.svelte.d.ts +21 -0
- package/dist/providers/RaindexClientProvider.svelte +8 -0
- package/dist/providers/RaindexClientProvider.svelte.d.ts +21 -0
- package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte +8 -0
- package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte.d.ts +24 -0
- package/dist/providers/dotrainRegistry/context.d.ts +9 -0
- package/dist/providers/dotrainRegistry/context.js +40 -0
- package/dist/providers/dotrainRegistry/useDotrainRegistry.d.ts +5 -0
- package/dist/providers/dotrainRegistry/useDotrainRegistry.js +35 -0
- package/dist/providers/registry/RegistryManager.d.ts +65 -0
- package/dist/providers/registry/RegistryManager.js +133 -0
- package/dist/providers/registry/RegistryProvider.svelte +6 -0
- package/dist/providers/registry/RegistryProvider.svelte.d.ts +21 -0
- package/dist/providers/registry/context.d.ts +10 -0
- package/dist/providers/registry/context.js +46 -0
- package/dist/providers/registry/useRegistry.d.ts +7 -0
- package/dist/providers/registry/useRegistry.js +29 -0
- package/dist/providers/toasts/ToastProvider.svelte +17 -0
- package/dist/providers/toasts/ToastProvider.svelte.d.ts +18 -0
- package/dist/providers/toasts/context.d.ts +14 -0
- package/dist/providers/toasts/context.js +22 -0
- package/dist/providers/toasts/useToasts.d.ts +16 -0
- package/dist/providers/toasts/useToasts.js +63 -0
- package/dist/providers/transactions/TransactionManager.d.ts +235 -0
- package/dist/providers/transactions/TransactionManager.js +509 -0
- package/dist/providers/transactions/TransactionProvider.svelte +11 -0
- package/dist/providers/transactions/TransactionProvider.svelte.d.ts +24 -0
- package/dist/providers/transactions/context.d.ts +19 -0
- package/dist/providers/transactions/context.js +28 -0
- package/dist/providers/transactions/useTransactions.d.ts +13 -0
- package/dist/providers/transactions/useTransactions.js +18 -0
- package/dist/providers/wallet/WalletProvider.svelte +7 -0
- package/dist/providers/wallet/WalletProvider.svelte.d.ts +21 -0
- package/dist/providers/wallet/context.d.ts +10 -0
- package/dist/providers/wallet/context.js +47 -0
- package/dist/providers/wallet/useAccount.d.ts +8 -0
- package/dist/providers/wallet/useAccount.js +148 -0
- package/dist/queries/keys.d.ts +1 -0
- package/dist/queries/keys.js +1 -0
- package/dist/queries/queryClient.d.ts +1 -1
- package/dist/queries/queryClient.js +11 -6
- package/dist/services/awaitTransactionIndexing.d.ts +107 -0
- package/dist/services/awaitTransactionIndexing.js +58 -0
- package/dist/services/getExplorerLink.d.ts +1 -1
- package/dist/services/getExplorerLink.js +2 -4
- package/dist/services/handleShareChoices.d.ts +2 -2
- package/dist/services/handleShareChoices.js +7 -2
- package/dist/services/historicalOrderCharts.d.ts +2 -2
- package/dist/services/historicalOrderCharts.js +267 -333
- package/dist/services/index.d.ts +2 -1
- package/dist/services/index.js +2 -1
- package/dist/services/loadRegistryUrl.d.ts +2 -0
- package/dist/services/loadRegistryUrl.js +22 -0
- package/dist/services/pairTradesChartData.d.ts +47 -0
- package/dist/services/pairTradesChartData.js +190 -0
- package/dist/services/registry.d.ts +5 -5
- package/dist/services/registry.js +8 -208
- package/dist/services/time.d.ts +12 -0
- package/dist/services/time.js +88 -6
- package/dist/storesGeneric/cachedWritableStore.d.ts +57 -0
- package/dist/storesGeneric/cachedWritableStore.js +93 -0
- package/dist/types/account.d.ts +3 -0
- package/dist/types/appStores.d.ts +9 -14
- package/dist/types/modal.d.ts +26 -14
- package/dist/types/{strategy.d.ts → order.d.ts} +3 -3
- package/dist/types/order.js +1 -0
- package/dist/types/toast.d.ts +11 -0
- package/dist/types/toast.js +1 -0
- package/dist/types/tokenBalance.d.ts +6 -0
- package/dist/types/tokenBalance.js +1 -0
- package/dist/types/transaction.d.ts +66 -21
- package/dist/types/transaction.js +31 -1
- package/dist/utils/configHelpers.d.ts +4 -0
- package/dist/utils/configHelpers.js +21 -0
- package/dist/utils/constructHashLink.d.ts +24 -0
- package/dist/utils/constructHashLink.js +115 -0
- package/dist/utils/getNetworkName.d.ts +1 -0
- package/dist/utils/getNetworkName.js +13 -0
- package/dist/utils/number.d.ts +0 -7
- package/dist/utils/number.js +0 -27
- package/dist/utils/tokens.d.ts +2 -0
- package/dist/utils/tokens.js +3 -0
- package/dist/utils/vaultBalanceChangeLabels.d.ts +4 -0
- package/dist/utils/vaultBalanceChangeLabels.js +18 -0
- package/package.json +39 -34
- package/dist/__fixtures__/orderDetail.d.ts +0 -99
- package/dist/__fixtures__/orderDetail.js +0 -204
- package/dist/__fixtures__/settings-12-11-24.json +0 -160
- package/dist/__mocks__/mockTransactionStore.d.ts +0 -22
- package/dist/__mocks__/mockTransactionStore.js +0 -56
- package/dist/__mocks__/settings.d.ts +0 -3
- package/dist/__mocks__/settings.js +0 -37
- package/dist/components/deployment/InvalidStrategiesSection.svelte +0 -19
- package/dist/components/deployment/InvalidStrategiesSection.svelte.d.ts +0 -19
- package/dist/components/deployment/StrategyPage.svelte.d.ts +0 -19
- package/dist/components/deployment/ValidStrategiesSection.svelte.d.ts +0 -19
- package/dist/components/deployment/getDeploymentTransactionArgs.d.ts +0 -17
- package/dist/components/deployment/getDeploymentTransactionArgs.js +0 -28
- package/dist/components/detail/DepositOrWithdrawButtons.svelte +0 -44
- package/dist/components/detail/DepositOrWithdrawButtons.svelte.d.ts +0 -26
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte +0 -38
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte.d.ts +0 -21
- package/dist/components/dropdown/DropdownOrderStatus.svelte +0 -31
- package/dist/components/dropdown/DropdownOrderStatus.svelte.d.ts +0 -19
- package/dist/stores/transactionStore.d.ts +0 -98
- package/dist/stores/transactionStore.js +0 -303
- package/dist/utils/time.d.ts +0 -12
- package/dist/utils/time.js +0 -27
- package/dist/utils/vault.d.ts +0 -2
- package/dist/utils/vault.js +0 -29
- /package/dist/types/{strategy.js → account.js} +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { timestampSecondsToUTCTimestamp } from '../
|
|
1
|
+
import { timestampSecondsToUTCTimestamp } from '../services/time';
|
|
2
2
|
import { sortBy } from 'lodash';
|
|
3
|
-
import { formatUnits } from 'viem';
|
|
4
3
|
export function prepareHistoricalOrderChartData(takeOrderEntities, colorTheme) {
|
|
5
4
|
const transformedData = takeOrderEntities.map((d) => ({
|
|
6
|
-
value: Math.abs(Number(
|
|
7
|
-
Number(
|
|
5
|
+
value: Math.abs(Number(d.inputVaultBalanceChange.formattedAmount) /
|
|
6
|
+
Number(d.outputVaultBalanceChange.formattedAmount)),
|
|
8
7
|
time: timestampSecondsToUTCTimestamp(BigInt(d.timestamp)),
|
|
9
8
|
color: colorTheme == 'dark' ? '#5178FF' : '#4E4AF6',
|
|
10
|
-
outputAmount:
|
|
9
|
+
outputAmount: Number(d.outputVaultBalanceChange.amount)
|
|
11
10
|
}));
|
|
12
11
|
// if we have multiple object in the array with the same timestamp, we need to merge them
|
|
13
12
|
// we do this by taking the weighted average of the ioratio values for objects that share the same timestamp.
|
|
@@ -38,219 +37,189 @@ if (import.meta.vitest) {
|
|
|
38
37
|
const takeOrderEntities = [
|
|
39
38
|
{
|
|
40
39
|
id: '1',
|
|
41
|
-
timestamp:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
timestamp: '1632000000',
|
|
48
|
-
blockNumber: '0'
|
|
49
|
-
}
|
|
40
|
+
timestamp: BigInt(1632000000),
|
|
41
|
+
transaction: {
|
|
42
|
+
id: 'transaction_id',
|
|
43
|
+
from: '0xsender_address',
|
|
44
|
+
timestamp: BigInt(1632000000),
|
|
45
|
+
blockNumber: BigInt(0)
|
|
50
46
|
},
|
|
51
47
|
outputVaultBalanceChange: {
|
|
52
|
-
amount:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
vaultId: 'vault-id1',
|
|
56
|
-
token: {
|
|
57
|
-
id: 'output_token',
|
|
58
|
-
address: 'output_token',
|
|
59
|
-
name: 'output_token',
|
|
60
|
-
symbol: 'output_token',
|
|
61
|
-
decimals: '1'
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
id: '1',
|
|
48
|
+
amount: BigInt(100),
|
|
49
|
+
formattedAmount: '100',
|
|
50
|
+
vaultId: BigInt(1),
|
|
65
51
|
__typename: 'Withdraw',
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
52
|
+
token: {
|
|
53
|
+
id: 'output_token',
|
|
54
|
+
address: '0xoutput_token',
|
|
55
|
+
name: 'output_token',
|
|
56
|
+
symbol: 'output_token',
|
|
57
|
+
decimals: BigInt(1)
|
|
58
|
+
},
|
|
59
|
+
newBalance: BigInt(0),
|
|
60
|
+
formattedNewBalance: '0',
|
|
61
|
+
oldBalance: BigInt(0),
|
|
62
|
+
formattedOldBalance: '0',
|
|
63
|
+
timestamp: BigInt(0),
|
|
69
64
|
transaction: {
|
|
70
65
|
id: 'transaction_id',
|
|
71
66
|
from: 'sender_address',
|
|
72
|
-
timestamp:
|
|
73
|
-
blockNumber:
|
|
67
|
+
timestamp: BigInt(1632000000),
|
|
68
|
+
blockNumber: BigInt(0)
|
|
74
69
|
},
|
|
75
|
-
orderbook:
|
|
76
|
-
},
|
|
77
|
-
order: {
|
|
78
|
-
id: 'order_id',
|
|
79
|
-
orderHash: 'orderHash'
|
|
70
|
+
orderbook: '0x1'
|
|
80
71
|
},
|
|
72
|
+
orderHash: 'orderHash',
|
|
81
73
|
inputVaultBalanceChange: {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
symbol: 'output_token',
|
|
90
|
-
decimals: '1'
|
|
91
|
-
}
|
|
74
|
+
vaultId: BigInt(1),
|
|
75
|
+
token: {
|
|
76
|
+
id: 'output_token',
|
|
77
|
+
address: '0xoutput_token',
|
|
78
|
+
name: 'output_token',
|
|
79
|
+
symbol: 'output_token',
|
|
80
|
+
decimals: BigInt(1)
|
|
92
81
|
},
|
|
93
|
-
amount:
|
|
94
|
-
|
|
82
|
+
amount: BigInt(50),
|
|
83
|
+
formattedAmount: '50',
|
|
95
84
|
__typename: 'Withdraw',
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
85
|
+
newBalance: BigInt(0),
|
|
86
|
+
formattedNewBalance: '0',
|
|
87
|
+
oldBalance: BigInt(0),
|
|
88
|
+
formattedOldBalance: '0',
|
|
89
|
+
timestamp: BigInt(0),
|
|
99
90
|
transaction: {
|
|
100
91
|
id: 'transaction_id',
|
|
101
|
-
from: '
|
|
102
|
-
timestamp:
|
|
103
|
-
blockNumber:
|
|
92
|
+
from: '0xsender_address',
|
|
93
|
+
timestamp: BigInt(1632000000),
|
|
94
|
+
blockNumber: BigInt(0)
|
|
104
95
|
},
|
|
105
|
-
orderbook:
|
|
96
|
+
orderbook: '0x1'
|
|
106
97
|
},
|
|
107
|
-
orderbook:
|
|
108
|
-
id: '0x00'
|
|
109
|
-
}
|
|
98
|
+
orderbook: '0x00'
|
|
110
99
|
},
|
|
111
100
|
{
|
|
112
101
|
id: '2',
|
|
113
|
-
timestamp:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
timestamp: '1631000000',
|
|
120
|
-
blockNumber: '0'
|
|
121
|
-
}
|
|
102
|
+
timestamp: BigInt(1631000000),
|
|
103
|
+
transaction: {
|
|
104
|
+
id: 'transaction_id',
|
|
105
|
+
from: '0xsender_address',
|
|
106
|
+
timestamp: BigInt(1631000000),
|
|
107
|
+
blockNumber: BigInt(0)
|
|
122
108
|
},
|
|
123
109
|
outputVaultBalanceChange: {
|
|
124
|
-
amount:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
decimals: '1'
|
|
134
|
-
}
|
|
110
|
+
amount: BigInt(100),
|
|
111
|
+
formattedAmount: '100',
|
|
112
|
+
vaultId: BigInt(1),
|
|
113
|
+
token: {
|
|
114
|
+
id: 'output_token',
|
|
115
|
+
address: '0xoutput_token',
|
|
116
|
+
name: 'output_token',
|
|
117
|
+
symbol: 'output_token',
|
|
118
|
+
decimals: BigInt(1)
|
|
135
119
|
},
|
|
136
|
-
|
|
120
|
+
newBalance: BigInt(0),
|
|
121
|
+
formattedNewBalance: '0',
|
|
122
|
+
oldBalance: BigInt(0),
|
|
123
|
+
formattedOldBalance: '0',
|
|
137
124
|
__typename: 'Withdraw',
|
|
138
|
-
|
|
139
|
-
oldVaultBalance: '0',
|
|
140
|
-
timestamp: '0',
|
|
125
|
+
timestamp: BigInt(0),
|
|
141
126
|
transaction: {
|
|
142
127
|
id: 'transaction_id',
|
|
143
|
-
from: '
|
|
144
|
-
timestamp:
|
|
145
|
-
blockNumber:
|
|
128
|
+
from: '0xsender_address',
|
|
129
|
+
timestamp: BigInt(1632000000),
|
|
130
|
+
blockNumber: BigInt(0)
|
|
146
131
|
},
|
|
147
|
-
orderbook:
|
|
148
|
-
},
|
|
149
|
-
order: {
|
|
150
|
-
id: 'order_id',
|
|
151
|
-
orderHash: 'orderHash'
|
|
132
|
+
orderbook: '0x1'
|
|
152
133
|
},
|
|
134
|
+
orderHash: 'orderHash',
|
|
153
135
|
inputVaultBalanceChange: {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
symbol: 'output_token',
|
|
162
|
-
decimals: '1'
|
|
163
|
-
}
|
|
136
|
+
vaultId: BigInt(1),
|
|
137
|
+
token: {
|
|
138
|
+
id: 'output_token',
|
|
139
|
+
address: '0xoutput_token',
|
|
140
|
+
name: 'output_token',
|
|
141
|
+
symbol: 'output_token',
|
|
142
|
+
decimals: BigInt(1)
|
|
164
143
|
},
|
|
165
|
-
amount:
|
|
166
|
-
|
|
144
|
+
amount: BigInt(50),
|
|
145
|
+
formattedAmount: '50',
|
|
167
146
|
__typename: 'Withdraw',
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
147
|
+
newBalance: BigInt(0),
|
|
148
|
+
formattedNewBalance: '0',
|
|
149
|
+
oldBalance: BigInt(0),
|
|
150
|
+
formattedOldBalance: '0',
|
|
151
|
+
timestamp: BigInt(0),
|
|
171
152
|
transaction: {
|
|
172
153
|
id: 'transaction_id',
|
|
173
|
-
from: '
|
|
174
|
-
timestamp:
|
|
175
|
-
blockNumber:
|
|
154
|
+
from: '0xsender_address',
|
|
155
|
+
timestamp: BigInt(1632000000),
|
|
156
|
+
blockNumber: BigInt(0)
|
|
176
157
|
},
|
|
177
|
-
orderbook:
|
|
158
|
+
orderbook: '0x1'
|
|
178
159
|
},
|
|
179
|
-
orderbook:
|
|
180
|
-
id: '0x00'
|
|
181
|
-
}
|
|
160
|
+
orderbook: '0x00'
|
|
182
161
|
},
|
|
183
162
|
{
|
|
184
163
|
id: '3',
|
|
185
|
-
timestamp:
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
timestamp: '1630000000',
|
|
192
|
-
blockNumber: '0'
|
|
193
|
-
}
|
|
164
|
+
timestamp: BigInt(1630000000),
|
|
165
|
+
transaction: {
|
|
166
|
+
id: 'transaction_id',
|
|
167
|
+
from: '0xsender_address',
|
|
168
|
+
timestamp: BigInt(1630000000),
|
|
169
|
+
blockNumber: BigInt(0)
|
|
194
170
|
},
|
|
195
171
|
outputVaultBalanceChange: {
|
|
196
|
-
amount:
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
decimals: '1'
|
|
206
|
-
}
|
|
172
|
+
amount: BigInt(100),
|
|
173
|
+
formattedAmount: '100',
|
|
174
|
+
vaultId: BigInt(1),
|
|
175
|
+
token: {
|
|
176
|
+
id: 'output_token',
|
|
177
|
+
address: '0xoutput_token',
|
|
178
|
+
name: 'output_token',
|
|
179
|
+
symbol: 'output_token',
|
|
180
|
+
decimals: BigInt(1)
|
|
207
181
|
},
|
|
208
|
-
|
|
182
|
+
newBalance: BigInt(0),
|
|
183
|
+
formattedNewBalance: '0',
|
|
184
|
+
oldBalance: BigInt(0),
|
|
185
|
+
formattedOldBalance: '0',
|
|
209
186
|
__typename: 'Withdraw',
|
|
210
|
-
|
|
211
|
-
oldVaultBalance: '0',
|
|
212
|
-
timestamp: '0',
|
|
187
|
+
timestamp: BigInt(0),
|
|
213
188
|
transaction: {
|
|
214
189
|
id: 'transaction_id',
|
|
215
190
|
from: 'sender_address',
|
|
216
|
-
timestamp:
|
|
217
|
-
blockNumber:
|
|
191
|
+
timestamp: BigInt(1632000000),
|
|
192
|
+
blockNumber: BigInt(0)
|
|
218
193
|
},
|
|
219
|
-
orderbook:
|
|
220
|
-
},
|
|
221
|
-
order: {
|
|
222
|
-
id: 'order_id',
|
|
223
|
-
orderHash: 'orderHash'
|
|
194
|
+
orderbook: '0x1'
|
|
224
195
|
},
|
|
196
|
+
orderHash: 'orderHash',
|
|
225
197
|
inputVaultBalanceChange: {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
symbol: 'output_token',
|
|
234
|
-
decimals: '1'
|
|
235
|
-
}
|
|
198
|
+
vaultId: BigInt(1),
|
|
199
|
+
token: {
|
|
200
|
+
id: 'output_token',
|
|
201
|
+
address: '0xoutput_token',
|
|
202
|
+
name: 'output_token',
|
|
203
|
+
symbol: 'output_token',
|
|
204
|
+
decimals: BigInt(1)
|
|
236
205
|
},
|
|
237
|
-
|
|
238
|
-
|
|
206
|
+
newBalance: BigInt(0),
|
|
207
|
+
formattedNewBalance: '0',
|
|
208
|
+
oldBalance: BigInt(0),
|
|
209
|
+
formattedOldBalance: '0',
|
|
210
|
+
amount: BigInt(50),
|
|
211
|
+
formattedAmount: '50',
|
|
239
212
|
__typename: 'Withdraw',
|
|
240
|
-
|
|
241
|
-
oldVaultBalance: '0',
|
|
242
|
-
timestamp: '0',
|
|
213
|
+
timestamp: BigInt(0),
|
|
243
214
|
transaction: {
|
|
244
215
|
id: 'transaction_id',
|
|
245
216
|
from: 'sender_address',
|
|
246
|
-
timestamp:
|
|
247
|
-
blockNumber:
|
|
217
|
+
timestamp: BigInt(1632000000),
|
|
218
|
+
blockNumber: BigInt(0)
|
|
248
219
|
},
|
|
249
|
-
orderbook:
|
|
220
|
+
orderbook: '0x1'
|
|
250
221
|
},
|
|
251
|
-
orderbook:
|
|
252
|
-
id: '0x00'
|
|
253
|
-
}
|
|
222
|
+
orderbook: '0x00'
|
|
254
223
|
}
|
|
255
224
|
];
|
|
256
225
|
const result = prepareHistoricalOrderChartData(takeOrderEntities, 'dark');
|
|
@@ -270,219 +239,184 @@ if (import.meta.vitest) {
|
|
|
270
239
|
const takeOrderEntities = [
|
|
271
240
|
{
|
|
272
241
|
id: '1',
|
|
273
|
-
timestamp:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
timestamp: '1632000000',
|
|
280
|
-
blockNumber: '0'
|
|
281
|
-
}
|
|
242
|
+
timestamp: BigInt(1632000000),
|
|
243
|
+
transaction: {
|
|
244
|
+
id: 'transaction_id',
|
|
245
|
+
from: '0xsender_address',
|
|
246
|
+
timestamp: BigInt(1632000000),
|
|
247
|
+
blockNumber: BigInt(0)
|
|
282
248
|
},
|
|
283
249
|
outputVaultBalanceChange: {
|
|
284
|
-
amount:
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
decimals: '1'
|
|
294
|
-
}
|
|
250
|
+
amount: BigInt(100),
|
|
251
|
+
formattedAmount: '100',
|
|
252
|
+
vaultId: BigInt(1),
|
|
253
|
+
token: {
|
|
254
|
+
id: 'output_token',
|
|
255
|
+
address: '0xoutput_token',
|
|
256
|
+
name: 'output_token',
|
|
257
|
+
symbol: 'output_token',
|
|
258
|
+
decimals: BigInt(1)
|
|
295
259
|
},
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
timestamp:
|
|
260
|
+
newBalance: BigInt(0),
|
|
261
|
+
formattedNewBalance: '0',
|
|
262
|
+
oldBalance: BigInt(0),
|
|
263
|
+
formattedOldBalance: '0',
|
|
264
|
+
timestamp: BigInt(0),
|
|
301
265
|
transaction: {
|
|
302
266
|
id: 'transaction_id',
|
|
303
|
-
from: '
|
|
304
|
-
timestamp:
|
|
305
|
-
blockNumber:
|
|
267
|
+
from: '0xsender_address',
|
|
268
|
+
timestamp: BigInt(1632000000),
|
|
269
|
+
blockNumber: BigInt(0)
|
|
306
270
|
},
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
order: {
|
|
310
|
-
id: 'order_id',
|
|
311
|
-
orderHash: 'orderHash'
|
|
271
|
+
__typename: 'Withdraw',
|
|
272
|
+
orderbook: '0x1'
|
|
312
273
|
},
|
|
274
|
+
orderHash: 'orderHash',
|
|
313
275
|
inputVaultBalanceChange: {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
symbol: 'output_token',
|
|
322
|
-
decimals: '1'
|
|
323
|
-
}
|
|
276
|
+
vaultId: BigInt(1),
|
|
277
|
+
token: {
|
|
278
|
+
id: 'output_token',
|
|
279
|
+
address: '0xoutput_token',
|
|
280
|
+
name: 'output_token',
|
|
281
|
+
symbol: 'output_token',
|
|
282
|
+
decimals: BigInt(1)
|
|
324
283
|
},
|
|
325
|
-
amount:
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
284
|
+
amount: BigInt(50),
|
|
285
|
+
formattedAmount: '50',
|
|
286
|
+
newBalance: BigInt(0),
|
|
287
|
+
formattedNewBalance: '0',
|
|
288
|
+
oldBalance: BigInt(0),
|
|
289
|
+
formattedOldBalance: '0',
|
|
290
|
+
timestamp: BigInt(0),
|
|
331
291
|
transaction: {
|
|
332
292
|
id: 'transaction_id',
|
|
333
|
-
from: '
|
|
334
|
-
timestamp:
|
|
335
|
-
blockNumber:
|
|
293
|
+
from: '0xsender_address',
|
|
294
|
+
timestamp: BigInt(1632000000),
|
|
295
|
+
blockNumber: BigInt(0)
|
|
336
296
|
},
|
|
337
|
-
orderbook:
|
|
297
|
+
orderbook: '0x1'
|
|
338
298
|
},
|
|
339
|
-
orderbook:
|
|
340
|
-
id: '0x00'
|
|
341
|
-
}
|
|
299
|
+
orderbook: '0x00'
|
|
342
300
|
},
|
|
343
301
|
{
|
|
344
302
|
id: '2',
|
|
345
|
-
timestamp:
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
timestamp: '1632000000',
|
|
352
|
-
blockNumber: '0'
|
|
353
|
-
}
|
|
303
|
+
timestamp: BigInt(1632000000),
|
|
304
|
+
transaction: {
|
|
305
|
+
id: 'transaction_id',
|
|
306
|
+
from: '0xsender_address',
|
|
307
|
+
timestamp: BigInt(1632000000),
|
|
308
|
+
blockNumber: BigInt(0)
|
|
354
309
|
},
|
|
355
310
|
outputVaultBalanceChange: {
|
|
356
|
-
amount:
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
decimals: '1'
|
|
366
|
-
}
|
|
311
|
+
amount: BigInt(200),
|
|
312
|
+
formattedAmount: '200',
|
|
313
|
+
vaultId: BigInt(1),
|
|
314
|
+
token: {
|
|
315
|
+
id: 'output_token',
|
|
316
|
+
address: '0xoutput_token',
|
|
317
|
+
name: 'output_token',
|
|
318
|
+
symbol: 'output_token',
|
|
319
|
+
decimals: BigInt(1)
|
|
367
320
|
},
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
timestamp:
|
|
321
|
+
newBalance: BigInt(0),
|
|
322
|
+
formattedNewBalance: '0',
|
|
323
|
+
oldBalance: BigInt(0),
|
|
324
|
+
formattedOldBalance: '0',
|
|
325
|
+
timestamp: BigInt(0),
|
|
373
326
|
transaction: {
|
|
374
327
|
id: 'transaction_id',
|
|
375
|
-
from: '
|
|
376
|
-
timestamp:
|
|
377
|
-
blockNumber:
|
|
328
|
+
from: '0xsender_address',
|
|
329
|
+
timestamp: BigInt(1632000000),
|
|
330
|
+
blockNumber: BigInt(0)
|
|
378
331
|
},
|
|
379
|
-
orderbook:
|
|
380
|
-
},
|
|
381
|
-
order: {
|
|
382
|
-
id: 'order_id',
|
|
383
|
-
orderHash: 'orderHash'
|
|
332
|
+
orderbook: '0x1'
|
|
384
333
|
},
|
|
334
|
+
orderHash: 'orderHash',
|
|
385
335
|
inputVaultBalanceChange: {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
symbol: 'output_token',
|
|
394
|
-
decimals: '1'
|
|
395
|
-
}
|
|
336
|
+
vaultId: BigInt(1),
|
|
337
|
+
token: {
|
|
338
|
+
id: 'output_token',
|
|
339
|
+
address: '0xoutput_token',
|
|
340
|
+
name: 'output_token',
|
|
341
|
+
symbol: 'output_token',
|
|
342
|
+
decimals: BigInt(1)
|
|
396
343
|
},
|
|
397
|
-
amount:
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
344
|
+
amount: BigInt(50),
|
|
345
|
+
formattedAmount: '50',
|
|
346
|
+
newBalance: BigInt(0),
|
|
347
|
+
formattedNewBalance: '0',
|
|
348
|
+
oldBalance: BigInt(0),
|
|
349
|
+
formattedOldBalance: '0',
|
|
350
|
+
timestamp: BigInt(0),
|
|
403
351
|
transaction: {
|
|
404
352
|
id: 'transaction_id',
|
|
405
|
-
from: '
|
|
406
|
-
timestamp:
|
|
407
|
-
blockNumber:
|
|
353
|
+
from: '0xsender_address',
|
|
354
|
+
timestamp: BigInt(1632000000),
|
|
355
|
+
blockNumber: BigInt(0)
|
|
408
356
|
},
|
|
409
|
-
orderbook:
|
|
357
|
+
orderbook: '0x1'
|
|
410
358
|
},
|
|
411
|
-
orderbook:
|
|
412
|
-
id: '0x00'
|
|
413
|
-
}
|
|
359
|
+
orderbook: '0x00'
|
|
414
360
|
},
|
|
415
361
|
{
|
|
416
362
|
id: '3',
|
|
417
|
-
timestamp:
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
timestamp: '1632000000',
|
|
424
|
-
blockNumber: '0'
|
|
425
|
-
}
|
|
363
|
+
timestamp: BigInt(1632000000),
|
|
364
|
+
transaction: {
|
|
365
|
+
id: 'transaction_id',
|
|
366
|
+
from: '0xsender_address',
|
|
367
|
+
timestamp: BigInt(1632000000),
|
|
368
|
+
blockNumber: BigInt(0)
|
|
426
369
|
},
|
|
427
370
|
outputVaultBalanceChange: {
|
|
428
|
-
amount:
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
decimals: '1'
|
|
438
|
-
}
|
|
371
|
+
amount: BigInt(400),
|
|
372
|
+
formattedAmount: '400',
|
|
373
|
+
vaultId: BigInt(1),
|
|
374
|
+
token: {
|
|
375
|
+
id: 'output_token',
|
|
376
|
+
address: '0xoutput_token',
|
|
377
|
+
name: 'output_token',
|
|
378
|
+
symbol: 'output_token',
|
|
379
|
+
decimals: BigInt(1)
|
|
439
380
|
},
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
timestamp:
|
|
381
|
+
newBalance: BigInt(0),
|
|
382
|
+
formattedNewBalance: '0',
|
|
383
|
+
oldBalance: BigInt(0),
|
|
384
|
+
formattedOldBalance: '0',
|
|
385
|
+
timestamp: BigInt(0),
|
|
445
386
|
transaction: {
|
|
446
387
|
id: 'transaction_id',
|
|
447
|
-
from: '
|
|
448
|
-
timestamp:
|
|
449
|
-
blockNumber:
|
|
388
|
+
from: '0xsender_address',
|
|
389
|
+
timestamp: BigInt(1632000000),
|
|
390
|
+
blockNumber: BigInt(0)
|
|
450
391
|
},
|
|
451
|
-
orderbook:
|
|
452
|
-
},
|
|
453
|
-
order: {
|
|
454
|
-
id: 'order_id',
|
|
455
|
-
orderHash: 'orderHash'
|
|
392
|
+
orderbook: '0x1'
|
|
456
393
|
},
|
|
394
|
+
orderHash: 'orderHash',
|
|
457
395
|
inputVaultBalanceChange: {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
symbol: 'output_token',
|
|
466
|
-
decimals: '1'
|
|
467
|
-
}
|
|
396
|
+
vaultId: BigInt(1),
|
|
397
|
+
token: {
|
|
398
|
+
id: 'output_token_id',
|
|
399
|
+
address: '0xoutput_token',
|
|
400
|
+
name: 'output_token',
|
|
401
|
+
symbol: 'output_token',
|
|
402
|
+
decimals: BigInt(1)
|
|
468
403
|
},
|
|
469
|
-
amount:
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
404
|
+
amount: BigInt(50),
|
|
405
|
+
formattedAmount: '50',
|
|
406
|
+
newBalance: BigInt(0),
|
|
407
|
+
formattedNewBalance: '0',
|
|
408
|
+
oldBalance: BigInt(0),
|
|
409
|
+
formattedOldBalance: '0',
|
|
410
|
+
timestamp: BigInt(0),
|
|
475
411
|
transaction: {
|
|
476
412
|
id: 'transaction_id',
|
|
477
|
-
from: '
|
|
478
|
-
timestamp:
|
|
479
|
-
blockNumber:
|
|
413
|
+
from: '0xsender_address',
|
|
414
|
+
timestamp: BigInt(1632000000),
|
|
415
|
+
blockNumber: BigInt(0)
|
|
480
416
|
},
|
|
481
|
-
orderbook:
|
|
417
|
+
orderbook: '0x1'
|
|
482
418
|
},
|
|
483
|
-
orderbook:
|
|
484
|
-
id: '0x00'
|
|
485
|
-
}
|
|
419
|
+
orderbook: '0x00'
|
|
486
420
|
}
|
|
487
421
|
];
|
|
488
422
|
const result = prepareHistoricalOrderChartData(takeOrderEntities, 'dark');
|