-
Notifications
You must be signed in to change notification settings - Fork 273
Expand file tree
/
Copy pathsdk.ts
More file actions
24 lines (21 loc) · 859 Bytes
/
sdk.ts
File metadata and controls
24 lines (21 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import type { Call, RpcProvider } from 'starknet'
import { formatOmniPoint, OmniPoint, OmniTransaction } from '@layerzerolabs/devtools'
import { createModuleLogger, type Logger } from '@layerzerolabs/io-devtools'
import type { IOmniSDK } from './types'
import { serializeStarknetCalls } from '../transactions'
export class OmniSDK implements IOmniSDK {
constructor(
public readonly provider: RpcProvider,
public readonly point: OmniPoint,
protected readonly logger: Logger = createModuleLogger(`Starknet SDK @ ${formatOmniPoint(point)}`)
) {}
get label(): string {
return `Starknet contract @ ${formatOmniPoint(this.point)}`
}
protected createTransaction(calls: Call[]): OmniTransaction {
return {
point: this.point,
data: serializeStarknetCalls(calls),
}
}
}