Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c887286
feat: layerzero
gregdhill Aug 21, 2025
9e5078c
feat: wrap client for l0
gregdhill Aug 21, 2025
8ef07fc
feat: override execute for l0 offramp
gregdhill Aug 27, 2025
fd10bbc
feat: btc signer from mnemonic
Orland0x Aug 29, 2025
5f91b66
feat: layerzero client and test
Orland0x Aug 29, 2025
f974416
chore: comment out quote execution so CI passes without mnemonic
Orland0x Aug 29, 2025
e3cc395
chore: cleanup
Orland0x Aug 29, 2025
024838f
chore: fixed from chain typo
Orland0x Aug 29, 2025
9d74cde
chore: fixed deps
Orland0x Aug 29, 2025
22db27b
chore: typos
Orland0x Aug 29, 2025
50aefff
chore: move ScureBitcoinSigner to layer zero test file
Orland0x Aug 29, 2025
d4f7bea
chore: add missing comments
Orland0x Aug 29, 2025
79ed359
refactor: unified sendParam usage
Orland0x Aug 29, 2025
6c4a26e
chore: todo comment
Orland0x Aug 29, 2025
395db77
fix: SendParam types
Orland0x Aug 29, 2025
bef3dd0
Merge pull request #732 from bob-collective/feat/layerzero-test
gregdhill Aug 29, 2025
85e007c
Merge remote-tracking branch 'origin/master' into feat/layerzero
gregdhill Aug 29, 2025
7c89e95
chore: update package-lock.json
gregdhill Aug 29, 2025
c1ba4fc
chore: layer zero offramp test base
Orland0x Sep 1, 2025
51b91d4
chore: expose helper, bump sdk
gregdhill Sep 2, 2025
5fd400c
chore: cleanup ai review comments
gregdhill Sep 2, 2025
5704774
feat: layer zero offramp test
Orland0x Sep 2, 2025
9a44002
Merge branch 'feat/layerzero' into feat/layer-zero-offramp-test
Orland0x Sep 2, 2025
4dcfa62
chore: fixed tests
Orland0x Sep 2, 2025
1870b8f
Merge pull request #737 from bob-collective/feat/layer-zero-offramp-test
gregdhill Sep 2, 2025
3191c4b
Merge remote-tracking branch 'origin/master' into feat/layerzero
gregdhill Sep 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,183 changes: 967 additions & 1,216 deletions sdk/package-lock.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@gobob/bob-sdk",
"version": "4.1.3",
"version": "4.2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "vitest run test/*.ts",
"test": "vitest run test/*.ts --exclude test/layerzero.test.ts",
"deploy-relay": "ts-node src/scripts/relay-genesis.ts",
"update-relay": "ts-node src/scripts/relay-retarget.ts",
"build": "tsc -p tsconfig.json",
Expand All @@ -21,10 +21,12 @@
"README.md"
],
"devDependencies": {
"@scure/bip32": "^2.0.0",
"@types/node": "^24.3.0",
"@types/yargs": "^17.0.33",
"@typescript-eslint/eslint-plugin": "^8.40.0",
"@typescript-eslint/parser": "^8.38.0",
"bip39": "^3.1.0",
"ecpair": "^2.1.0",
"eslint": "^9.33.0",
"eslint-config-prettier": "^10.1.8",
Expand Down
132 changes: 132 additions & 0 deletions sdk/src/gateway/abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,135 @@ export const compoundV2CTokenAbi = parseAbi([
export const aaveV2AtokenAbi = parseAbi(['function UNDERLYING_ASSET_ADDRESS() external view returns (address)']);

export const claimDelayAbi = parseAbi(['function CLAIM_DELAY() view returns (uint64)']);

export const layerZeroOftAbi = [
{
type: 'function',
name: 'quoteSend',
inputs: [
{
name: 'sendParam',
type: 'tuple',
internalType: 'struct SendParam',
components: [
{ name: 'dstEid', type: 'uint32', internalType: 'uint32' },
{ name: 'to', type: 'bytes32', internalType: 'bytes32' },
{ name: 'amountLD', type: 'uint256', internalType: 'uint256' },
{ name: 'minAmountLD', type: 'uint256', internalType: 'uint256' },
{ name: 'extraOptions', type: 'bytes', internalType: 'bytes' },
{ name: 'composeMsg', type: 'bytes', internalType: 'bytes' },
{ name: 'oftCmd', type: 'bytes', internalType: 'bytes' },
],
},
{
name: 'isNative',
type: 'bool',
internalType: 'bool',
},
],
outputs: [
{
name: '',
type: 'tuple',
internalType: 'struct MessagingFee',
components: [
{ name: 'nativeFee', type: 'uint256', internalType: 'uint256' },
{ name: 'lzTokenFee', type: 'uint256', internalType: 'uint256' },
],
},
],
stateMutability: 'view',
},
{
type: 'function',
name: 'send',
inputs: [
{
name: 'sendParam',
type: 'tuple',
internalType: 'struct SendParam',
components: [
{ name: 'dstEid', type: 'uint32', internalType: 'uint32' },
{ name: 'to', type: 'bytes32', internalType: 'bytes32' },
{ name: 'amountLD', type: 'uint256', internalType: 'uint256' },
{ name: 'minAmountLD', type: 'uint256', internalType: 'uint256' },
{ name: 'extraOptions', type: 'bytes', internalType: 'bytes' },
{ name: 'composeMsg', type: 'bytes', internalType: 'bytes' },
{ name: 'oftCmd', type: 'bytes', internalType: 'bytes' },
],
},
{
name: 'fee',
type: 'tuple',
internalType: 'struct MessagingFee',
components: [
{ name: 'nativeFee', type: 'uint256', internalType: 'uint256' },
{ name: 'lzTokenFee', type: 'uint256', internalType: 'uint256' },
],
},
{
name: 'refundAddress',
type: 'address',
internalType: 'address',
},
],
outputs: [
{
name: 'receipt',
type: 'tuple',
internalType: 'struct MessagingReceipt',
components: [
{ name: 'guid', type: 'bytes32', internalType: 'bytes32' },
{ name: 'nonce', type: 'uint64', internalType: 'uint64' },
{
name: 'fee',
type: 'tuple',
internalType: 'struct MessagingFee',
components: [
{ name: 'nativeFee', type: 'uint256', internalType: 'uint256' },
{ name: 'lzTokenFee', type: 'uint256', internalType: 'uint256' },
],
},
],
},
{
name: 'oftReceipt',
type: 'tuple',
internalType: 'struct OFTReceipt',
components: [
{ name: 'amountSentLD', type: 'uint256', internalType: 'uint256' },
{ name: 'amountReceivedLD', type: 'uint256', internalType: 'uint256' },
],
},
],
stateMutability: 'payable',
},
] as const;

export const quoterV2Abi = [
{
type: 'function',
name: 'quoteExactOutputSingle',
inputs: [
{
name: 'params',
type: 'tuple',
internalType: 'struct IQuoterV2.QuoteExactOutputSingleParams',
components: [
{ name: 'tokenIn', type: 'address', internalType: 'address' },
{ name: 'tokenOut', type: 'address', internalType: 'address' },
{ name: 'amountOut', type: 'uint256', internalType: 'uint256' },
{ name: 'fee', type: 'uint24', internalType: 'uint24' },
{ name: 'sqrtPriceLimitX96', type: 'uint160', internalType: 'uint160' },
],
},
],
outputs: [
{ name: 'amountIn', type: 'uint256', internalType: 'uint256' },
{ name: 'sqrtPriceX96After', type: 'uint160', internalType: 'uint160' },
{ name: 'initializedTicksCrossed', type: 'uint32', internalType: 'uint32' },
{ name: 'gasEstimate', type: 'uint256', internalType: 'uint256' },
],
stateMutability: 'nonpayable',
},
] as const;
5 changes: 3 additions & 2 deletions sdk/src/gateway/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
zeroAddress,
maxUint256,
Hash,
Hex,
} from 'viem';
import { bob, bobSepolia } from 'viem/chains';
import { EsploraClient } from '../esplora';
Expand Down Expand Up @@ -87,7 +88,7 @@ interface EvmWalletClientParams {
publicClient: PublicClient<Transport>;
}

interface AllWalletClientParams extends EvmWalletClientParams {
export interface AllWalletClientParams extends EvmWalletClientParams {
/**
* Bitcoin signer used to sign the transaction inputs.
*/
Expand Down Expand Up @@ -411,7 +412,7 @@ export class GatewayApiClient {
satAmountToLock: BigInt(quote.amountLockInSat),
satFeesMax: BigInt(quote.feeBreakdown.overallFeeSats),
creationDeadline: BigInt(quote.deadline),
outputScript: receiverAddress as `0x${string}`,
outputScript: receiverAddress as Hex,
token: quote.token,
owner: params.fromUserAddress as Address,
},
Expand Down
1 change: 1 addition & 0 deletions sdk/src/gateway/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export { GatewayQuoteParams, GatewayQuote, OnrampOrder, GatewayStrategyContract,
export { parseBtc } from './utils';
export { ReownWalletAdapter } from './adapters/reown';
export { OkxWalletAdapter } from './adapters/okx-wallet';
export { LayerZeroGatewayClient } from './layerzero';
Loading
Loading