Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync: main to staging #678

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions examples/nextjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# nextjs

## 0.1.37

### Patch Changes

- Updated dependencies [a008f2b]
- @skip-go/[email protected]

## 0.1.36

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nextjs",
"version": "0.1.36",
"version": "0.1.37",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
6 changes: 6 additions & 0 deletions packages/client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @skip-go/client

## 0.16.5

### Patch Changes

- a008f2b: add chainIdsToAffiliate to msgs and msgsDirect

## 0.16.4

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@skip-go/client",
"description": "JavaScript SDK for Skip Go API",
"version": "0.16.4",
"version": "0.16.5",
"repository": "https://github.com/skip-mev/skip-go",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -35,7 +35,7 @@
"@protobufs/gogoproto": "0.0.10",
"@protobufs/google": "0.0.10",
"@types/keccak": "3.0.4",
"chain-registry": "^1.69.71",
"chain-registry": "^1.69.95",
"minimatch": "^9.0.3",
"proxy-from-env": "^1.1.0",
"vitest": "^1.2.2"
Expand Down
55 changes: 29 additions & 26 deletions packages/client/src/client-types.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { OfflineAminoSigner } from '@cosmjs/amino';
import { OfflineAminoSigner } from "@cosmjs/amino";
import {
GeneratedType,
OfflineDirectSigner,
OfflineSigner,
} from '@cosmjs/proto-signing';
} from "@cosmjs/proto-signing";
import {
AminoConverters,
GasPrice,
SignerData,
StdFee,
} from '@cosmjs/stargate';
} from "@cosmjs/stargate";

import { WalletClient } from 'viem';
import { WalletClient } from "viem";

import * as types from './types';
import { Adapter } from '@solana/wallet-adapter-base';
import { TransactionCallbacks } from './types';
import * as types from "./types";
import { Adapter } from "@solana/wallet-adapter-base";
import { TransactionCallbacks } from "./types";

/** Common Types */
export interface UserAddress {
Expand All @@ -32,24 +32,30 @@ export type Gas = {
error: null;
asset: types.FeeAsset;
fee: StdFee;
}
};

/** Signer Getters */
export interface SignerGetters {
getEVMSigner?: (chainID: string) => Promise<WalletClient>;
getCosmosSigner?: (chainID: string) => Promise<OfflineAminoSigner & OfflineDirectSigner | OfflineAminoSigner | OfflineDirectSigner>;
getCosmosSigner?: (
chainID: string,
) => Promise<
| (OfflineAminoSigner & OfflineDirectSigner)
| OfflineAminoSigner
| OfflineDirectSigner
>;
getSVMSigner?: () => Promise<Adapter>;
}

/** Gas Options */
export type GetFallbackGasAmount = (
chainID: string,
chainType: types.ChainType
chainType: types.ChainType,
) => Promise<number | undefined>;

export type GetGasPrice = (
chainID: string,
chainType: types.ChainType
chainType: types.ChainType,
) => Promise<GasPrice | undefined>;

interface GasOptions {
Expand Down Expand Up @@ -91,13 +97,12 @@ export type ExecuteRouteOptions = SignerGetters &
simulate?: boolean;
slippageTolerancePercent?: string;
/**
* Arbitrary Tx to be executed before or after route msgs
*/
* Arbitrary Tx to be executed before or after route msgs
*/
beforeMsg?: types.CosmosMsg;
afterMsg?: types.CosmosMsg;
};


export type ExecuteCosmosMessageOptions = {
signerAddress: string;
signer: OfflineSigner;
Expand All @@ -107,12 +112,12 @@ export type ExecuteCosmosMessageOptions = {

export type ExecuteCosmosMessage = GasOptions & {
signerAddress: string;
getCosmosSigner?: SignerGetters['getCosmosSigner'];
getCosmosSigner?: SignerGetters["getCosmosSigner"];
chainID: string;
messages: types.CosmosMsg[];
gas: Gas
onTransactionSigned?: TransactionCallbacks['onTransactionSigned'];
onTransactionBroadcast?: TransactionCallbacks['onTransactionBroadcast'];
gas: Gas;
onTransactionSigned?: TransactionCallbacks["onTransactionSigned"];
onTransactionBroadcast?: TransactionCallbacks["onTransactionBroadcast"];
};

interface SignCosmosMessageOptionsBase {
Expand All @@ -123,12 +128,10 @@ interface SignCosmosMessageOptionsBase {
signerData: SignerData;
}

export type SignCosmosMessageDirectOptions =
SignCosmosMessageOptionsBase & {
signer: OfflineDirectSigner;
};
export type SignCosmosMessageDirectOptions = SignCosmosMessageOptionsBase & {
signer: OfflineDirectSigner;
};

export type SignCosmosMessageAminoOptions =
SignCosmosMessageOptionsBase & {
signer: OfflineAminoSigner;
};
export type SignCosmosMessageAminoOptions = SignCosmosMessageOptionsBase & {
signer: OfflineAminoSigner;
};
Loading
Loading