- Consolidated duplicate UndoManagers to single instance - Fixed connection promise to only resolve on 'connected' status - Fixed WebSocketProvider import (WebsocketProvider) - Added proper doc.destroy() cleanup - Renamed isPresenceInitialized property to avoid conflict Co-Authored-By: Paperclip <noreply@paperclip.ing>
82 lines
1.8 KiB
TypeScript
82 lines
1.8 KiB
TypeScript
import type { Address } from 'abitype'
|
|
import type { DefaultCapabilitiesSchema } from '../types/capabilities.js'
|
|
import type { Hex } from '../types/misc.js'
|
|
import type { ExactPartial, OneOf } from '../types/utils.js'
|
|
import type { DecodeErrorResultReturnType } from '../utils/index.js'
|
|
import type { TransactionRequestTempo } from './Transaction.js'
|
|
|
|
export type Schema = Omit<DefaultCapabilitiesSchema, 'sendCalls'> & {
|
|
fillTransaction: {
|
|
ReturnType: FillTransactionCapabilities
|
|
}
|
|
sendCalls: {
|
|
Request: ExactPartial<TransactionRequestTempo>
|
|
}
|
|
}
|
|
|
|
export type FillTransactionCapabilities = {
|
|
autoSwap?:
|
|
| {
|
|
calls: readonly { to: Address; data: Hex; value: Hex }[]
|
|
maxIn: SwapAmount
|
|
minOut: SwapAmount
|
|
slippage: number
|
|
}
|
|
| undefined
|
|
balanceDiffs?: Readonly<Record<Address, readonly BalanceDiff[]>> | undefined
|
|
error?:
|
|
| OneOf<
|
|
| (DecodeErrorResultReturnType & {
|
|
data: Hex
|
|
message: string
|
|
})
|
|
| { errorName: 'unknown'; message: string }
|
|
>
|
|
| undefined
|
|
fee?:
|
|
| {
|
|
amount: Hex
|
|
decimals: number
|
|
formatted: string
|
|
symbol: string
|
|
}
|
|
| undefined
|
|
requireFunds?:
|
|
| {
|
|
amount: Hex
|
|
decimals: number
|
|
formatted: string
|
|
token: Address
|
|
symbol: string
|
|
}
|
|
| undefined
|
|
sponsor?:
|
|
| {
|
|
address: Address
|
|
name?: string | undefined
|
|
url?: string | undefined
|
|
}
|
|
| undefined
|
|
sponsored?: boolean | undefined
|
|
}
|
|
|
|
export type BalanceDiff = {
|
|
address: Address
|
|
decimals: number
|
|
direction: 'incoming' | 'outgoing'
|
|
formatted: string
|
|
name: string
|
|
recipients: readonly Address[]
|
|
symbol: string
|
|
value: Hex
|
|
}
|
|
|
|
export type SwapAmount = {
|
|
decimals: number
|
|
formatted: string
|
|
name: string
|
|
symbol: string
|
|
token: Address
|
|
value: Hex
|
|
}
|