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

Hotfix/release 3.7 patch #82

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions packages/e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "e2e",
"version": "3.9.0",
"version": "3.9.1-alpha.0",
"private": true,
"main": "index.js",
"license": "MIT",
Expand All @@ -11,9 +11,9 @@
"lint:fix": "yarn lint --fix"
},
"dependencies": {
"@heliofi/common": "0.1.195",
"@heliofi/react": "^3.7.0",
"@heliofi/sdk": "^0.5.0",
"@heliofi/common": "0.1.248",
"@heliofi/react": "^3.7.1-alpha.0",
"@heliofi/sdk": "^0.5.1-alpha.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
12 changes: 8 additions & 4 deletions packages/e2e/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ window.Buffer = window.Buffer || require('buffer').Buffer;

const App = () => {
const [paymentId, setPaymentId] = useState<string | null>(
'6438011a8fdd74a899bd0f51'
'6463450b60755941ed524a0e'
);

return (
Expand All @@ -25,8 +25,10 @@ const App = () => {
/>
<HelioPay
additionalJSON={{ key1: 'value1' }}
cluster="devnet"
customApiUrl="https://dev.api.hel.io/v1"
cluster="mainnet-beta"
// customApiUrl="https://dev.api.hel.io/v1"
// additionalJSON={{ key1: 'value1' }}
// customApiUrl="https://api.dev.hel.io/v1"
paymentRequestId={paymentId}
onSuccess={(event: SuccessPaymentEvent) => {
console.log('onSuccess', event);
Expand All @@ -41,8 +43,10 @@ const App = () => {
console.log('onStartPayment');
}}
supportedCurrencies={['USDC', 'SOL']}
// paymentType={PaymentRequestType.PAYSTREAM}
paymentType={'PAYLINK' as any}
// totalAmount={0.01} // @TODO bug when also has normalizedPrice
totalAmount={0.0001}
// totalAmount={undefined}
/>
</>
);
Expand Down
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@heliofi/react",
"version": "3.7.0",
"version": "3.7.1-alpha.0",
"description": "React components for Helio",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -14,12 +14,12 @@
},
"dependencies": {
"@aws-amplify/api-graphql": "^2.3.12",
"@coral-xyz/anchor": "^0.27.0",
"@heliofi/common": "0.1.195",
"@heliofi/helio-icons": "^1.0.5",
"@heliofi/sdk": "^0.5.0",
"@heliofi/sdk": "^0.5.1-alpha.0",
"@heliofi/solana-adapter": "^3.3.10-alpha.0",
"@popperjs/core": "^2.11.7",
"@project-serum/anchor": "^0.25.0",
"@solana/spl-token": "^0.3.6",
"@solana/wallet-adapter-base": "^0.9.5",
"@solana/wallet-adapter-react": "^0.15.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/heliopay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const HelioPay = ({
const { HelioSDK } = useCompositionRoot();

useMemo(() => {
HelioSDK.setCluster(cluster as Cluster);
HelioSDK.setCluster(cluster as any);
}, [cluster]);

useMemo(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/providers/anchor/AnchorContext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Program } from '@project-serum/anchor';
import { Program } from '@coral-xyz/anchor';
import { createContext, useContext } from 'react';
import { HelioIdl } from '@heliofi/solana-adapter';

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/providers/anchor/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IDL, PROGRAM_ID } from '@heliofi/solana-adapter';
import { AnchorProvider as Provider, Program } from '@project-serum/anchor';
import { AnchorProvider as Provider, Program } from '@coral-xyz/anchor';
import { useAnchorWallet, useConnection } from '@solana/wallet-adapter-react';
import { ConfirmOptions } from '@solana/web3.js';
import React, { FC, ReactNode, useMemo } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/providers/helio/HelioContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const useHelioProvider = () => {
}

if (bonkCurrency && mintAddress !== bonkCurrency.mintAddress) {
currencies.push(bonkCurrency);
currencies.unshift(bonkCurrency);
}

setTokenSwapCurrencies(currencies as unknown as Currency[]);
Expand Down
5 changes: 4 additions & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@heliofi/sdk",
"version": "0.5.0",
"version": "0.5.1-alpha.0",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -18,7 +18,10 @@
"author": "",
"license": "ISC",
"dependencies": {
"@coral-xyz/anchor": "^0.27.0",
"@ethersproject/providers": "^5.7.0",
"@heliofi/common": "0.1.195",
"@heliofi/evm-adapter": "0.0.30-beta",
"@heliofi/solana-adapter": "^3.3.10-alpha.0",
"@project-serum/anchor": "^0.25.0",
"@solana/wallet-adapter-react": "^0.15.20",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { PrepareTransaction } from '@heliofi/common';
import { Message, Transaction } from '@solana/web3.js';

export function createTransaction(
prepareTransactionResponse: PrepareTransaction
prepareTransactionResponse: any
): Transaction {
if (prepareTransactionResponse.serializedTransaction != null) {
return Transaction.from(
JSON.parse(prepareTransactionResponse.serializedTransaction).data
);
}
const message = Message.from(
Buffer.from(JSON.parse(prepareTransactionResponse.transactionMessage).data)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HelioIdl } from '@heliofi/solana-adapter';
import { Program } from '@project-serum/anchor';
import { Program } from '@coral-xyz/anchor';
import { AnchorWallet } from '@solana/wallet-adapter-react';
import { Cluster, Connection } from '@solana/web3.js';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export class PaylinkSubmitService extends BasePaymentService<
}> {
const prepareSwapTransactionResponse =
await this.apiService.getPreparedTransactionSwapMessage(
`${this.prepareEndpoint}/swap`,
`${this.prepareEndpoint}/swap${this.getQueryParams()}`,
JSON.stringify({
paymentRequestId,
currency: symbol,
Expand Down Expand Up @@ -262,7 +262,7 @@ export class PaylinkSubmitService extends BasePaymentService<
}: GetAndSignPayload): Promise<SignedTxAndToken> {
const prepareTransactionResponse =
await this.apiService.getPreparedTransactionMessage(
this.prepareEndpoint,
this.prepareEndpoint + this.getQueryParams(),
JSON.stringify({
paymentRequestId,
currency: symbol,
Expand All @@ -280,4 +280,8 @@ export class PaylinkSubmitService extends BasePaymentService<
token: prepareTransactionResponse.transactionToken,
};
}

private getQueryParams(): string {
return `?feePayer=HELIO`;
}
}
21 changes: 21 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2941,6 +2941,20 @@
class-validator "^0.14.0"
moment "^2.29.4"

"@heliofi/common@0.1.248":
version "0.1.248"
resolved "https://registry.yarnpkg.com/@heliofi/common/-/common-0.1.248.tgz#0b251b9b48b856d7877c256f851917f1d4bd0d76"
integrity sha512-dA/QA/PuLWuHDD6vCcMSkLtch+kVMCcbs8M29WUqcTnGbxR9CPouCqQfIHbH1Tj3lABkVTfYsY9T5XKp1j0aLA==
dependencies:
"@heliofi/evm-adapter" "^0.0.28-beta"
"@project-serum/anchor" "^0.25.0"
"@solana/web3.js" "^1.44.0"
bignumber.js "^9.1.1"
bs58 "^5.0.0"
class-transformer "^0.5.1"
class-validator "^0.14.0"
moment "^2.29.4"

"@heliofi/eslint-config-helio@^0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@heliofi/eslint-config-helio/-/eslint-config-helio-0.0.4.tgz#51eeddbf669f67866e1303201120a373ec0e8d22"
Expand All @@ -2951,6 +2965,13 @@
resolved "https://registry.yarnpkg.com/@heliofi/eslint-config-helio/-/eslint-config-helio-0.1.1.tgz#2e35edc2e725b2536fcd79aa0b1141a8b0e95028"
integrity sha512-23VJ5uixK2OO2uugcXKVzdPwW/BjJ1elfwMZnwMF+VYGTz6dv6HeA77vMjGJ2IkV6nnCwsYC7FeuBXOIKrzPxw==

"@heliofi/evm-adapter@0.0.30-beta":
version "0.0.30-beta"
resolved "https://registry.yarnpkg.com/@heliofi/evm-adapter/-/evm-adapter-0.0.30-beta.tgz#ee82f2813b6f827a6b9cd274ef0ef962f430fcac"
integrity sha512-B0tAEUKU7+VqqL/5esaR45TPkqTkHX0/Xb6Y8fGGjdiHosMjnEB5+1KZ/Crth7F5gfzOD0yxTSZltA3i3ZHWOA==
dependencies:
ethers "^5.7.2"

"@heliofi/evm-adapter@^0.0.28-beta":
version "0.0.28-beta"
resolved "https://registry.yarnpkg.com/@heliofi/evm-adapter/-/evm-adapter-0.0.28-beta.tgz#3e55af3e6a34cf2c956728610396833265587dbe"
Expand Down