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

fix MATIC test asset id #110

Merged
merged 1 commit into from
Jul 8, 2024
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
16 changes: 8 additions & 8 deletions src/integrations/fb_signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { MaticTx } from "../types/matic";
export type AssetId =
| "SOL_TEST"
| "SOL"
| "ETH_TEST3"
| "ETH_TEST5"
| "ETH_TEST6"
| "ETH"
| "ATOM_COS_TEST"
Expand Down Expand Up @@ -85,12 +85,12 @@ export class FbSigner {
try {
const assetArgs = assetId
? {
assetId,
source: {
type: PeerType.VAULT_ACCOUNT,
id: this.vaultId.toString(),
},
}
assetId,
source: {
type: PeerType.VAULT_ACCOUNT,
id: this.vaultId.toString(),
},
}
: {};

const tx: TransactionArguments = {
Expand All @@ -115,7 +115,7 @@ export class FbSigner {
*/
public async signTypedMessage(
eip712message: any,
assetId: "ETH" | "ETH_TEST3" | "ETH_TEST6",
assetId: "ETH" | "ETH_TEST5" | "ETH_TEST6",
note?: string,
): Promise<TransactionResponse> {
try {
Expand Down
4 changes: 2 additions & 2 deletions src/services/matic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class MaticService extends Service {

const fbSigner = this.getFbSigner(integration);
const fbNote = note ? note : "MATIC tx from @kilnfi/sdk";
const fbTx = await fbSigner.sign(payload, this.testnet ? "ETH_TEST3" : "ETH", fbNote);
const fbTx = await fbSigner.sign(payload, this.testnet ? "ETH_TEST5" : "ETH", fbNote);
const { data } = await api.post<MaticSignedTx>(`/v1/matic/transaction/prepare`, {
unsigned_tx_serialized: tx.data.unsigned_tx_serialized,
r: `0x${fbTx?.signedMessages?.[0].signature.r}`,
Expand Down Expand Up @@ -163,7 +163,7 @@ export class MaticService extends Service {

const fbSigner = this.getFbSigner(integration);
const fbNote = note ? note : "MATIC tx from @kilnfi/sdk";
const assetId = this.testnet ? "ETH_TEST3" : "ETH";
const assetId = this.testnet ? "ETH_TEST5" : "ETH";
return await fbSigner.signAndBroadcastWith(
payload,
assetId,
Expand Down