@1001-digital/layers.evm 1.0.2 → 1.0.3

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.
@@ -17,25 +17,12 @@
17
17
  <EvmTransactionFlow
18
18
  :request="sendTransaction"
19
19
  :text="{
20
- title: {
21
- confirm: 'Send Transaction',
22
- requesting: 'Requesting...',
23
- waiting: 'Waiting for confirmation...',
24
- complete: 'Transaction Complete!',
25
- error: 'Transaction Error',
26
- },
20
+ title: { confirm: 'Send Transaction' },
27
21
  lead: {
28
22
  confirm:
29
23
  'This will send 0 ETH to your address as a test transaction.',
30
- requesting: 'Please confirm the transaction in your wallet.',
31
- waiting: 'Your transaction is being processed...',
32
- complete: 'Your transaction has been confirmed on-chain.',
33
- error: 'An error occurred while processing your transaction.',
34
- },
35
- action: {
36
- confirm: 'Send Transaction',
37
- error: 'Try Again',
38
24
  },
25
+ action: { confirm: 'Send Transaction' },
39
26
  }"
40
27
  @complete="onTransactionComplete"
41
28
  @cancel="onTransactionCancel"
@@ -93,9 +93,9 @@ import type { Config } from '@wagmi/vue'
93
93
  import type { TransactionReceipt, Hash } from 'viem'
94
94
 
95
95
  interface TextConfig {
96
- title: Record<string, string>
97
- lead: Record<string, string>
98
- action: Record<string, string>
96
+ title?: Record<string, string>
97
+ lead?: Record<string, string>
98
+ action?: Record<string, string>
99
99
  }
100
100
 
101
101
  type Step =
@@ -107,6 +107,28 @@ type Step =
107
107
  | 'complete'
108
108
  | 'error'
109
109
 
110
+ const defaultText = {
111
+ title: {
112
+ confirm: 'Confirm Transaction',
113
+ chain: 'Switch Network',
114
+ requesting: 'Requesting',
115
+ waiting: 'Processing',
116
+ complete: 'Complete',
117
+ error: 'Error',
118
+ },
119
+ lead: {
120
+ confirm: 'Please review and confirm this transaction.',
121
+ chain: 'Please switch to the correct network to continue.',
122
+ requesting: 'Requesting transaction signature...',
123
+ waiting: 'Waiting for transaction confirmation...',
124
+ complete: 'Transaction confirmed successfully.',
125
+ },
126
+ action: {
127
+ confirm: 'Execute',
128
+ error: 'Try Again',
129
+ },
130
+ } satisfies TextConfig
131
+
110
132
  const slots = useSlots()
111
133
  const checkChain = useEnsureChainIdCheck()
112
134
 
@@ -124,17 +146,6 @@ const props = withDefaults(
124
146
  dismissable?: boolean
125
147
  }>(),
126
148
  {
127
- text: () => ({
128
- title: {
129
- confirm: 'Confirm Transaction',
130
- },
131
- lead: {
132
- confirm: 'Please review and confirm this transaction.',
133
- },
134
- action: {
135
- confirm: 'Execute',
136
- },
137
- }),
138
149
  delayAfter: 2000,
139
150
  delayAutoclose: 2000,
140
151
  skipConfirmation: false,
@@ -148,6 +159,12 @@ const emit = defineEmits<{
148
159
  cancel: []
149
160
  }>()
150
161
 
162
+ const text = computed<Required<TextConfig>>(() => ({
163
+ title: { ...defaultText.title, ...props.text?.title },
164
+ lead: { ...defaultText.lead, ...props.text?.lead },
165
+ action: { ...defaultText.action, ...props.text?.action },
166
+ }))
167
+
151
168
  const step = ref<Step>('idle')
152
169
 
153
170
  const open = computed({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@1001-digital/layers.evm",
3
3
  "type": "module",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "main": "./nuxt.config.ts",
6
6
  "devDependencies": {
7
7
  "@nuxt/eslint": "latest",