diff --git a/packages/huma-shared/src/solana/idl/devnet.json b/packages/huma-shared/src/solana/idl/huma.json similarity index 100% rename from packages/huma-shared/src/solana/idl/devnet.json rename to packages/huma-shared/src/solana/idl/huma.json diff --git a/packages/huma-shared/src/solana/idl/devnet.ts b/packages/huma-shared/src/solana/idl/huma.ts similarity index 100% rename from packages/huma-shared/src/solana/idl/devnet.ts rename to packages/huma-shared/src/solana/idl/huma.ts diff --git a/packages/huma-shared/src/solana/idl/index.ts b/packages/huma-shared/src/solana/idl/index.ts index 23285ced..7bc0ba8e 100644 --- a/packages/huma-shared/src/solana/idl/index.ts +++ b/packages/huma-shared/src/solana/idl/index.ts @@ -1,2 +1,2 @@ -export * as HumaSolanaDevnet from './devnet' +export * as HumaSolana from './huma' export * from './localhost' diff --git a/packages/huma-shared/src/solana/metadata/devnet.ts b/packages/huma-shared/src/solana/metadata/devnet.ts index 8d02424c..626b9114 100644 --- a/packages/huma-shared/src/solana/metadata/devnet.ts +++ b/packages/huma-shared/src/solana/metadata/devnet.ts @@ -4,7 +4,6 @@ import { SolanaChainEnum } from '../chain' import { SolanaChainInfo, SolanaPoolsInfo } from '../pool' export const SOLANA_DEVNET_INFO: SolanaChainInfo = { - humaProgramAuthority: 'DMEiNSUMjXUXh2XX6gUydSt7Uan5Q4BhAjLJwYxaZUEm', poolProgram: 'EVQ4s1b6N1vmWFDv8PRNc77kufBP8HcrSNWXQAhRsJq9', sentinel: '8GQMZVEvYsssewqu2EvoAtVeBMWEkns7vGiUMQ6V7KDo', } @@ -28,7 +27,6 @@ export const SOLANA_DEVNET_METADATA: SolanaPoolsInfo = { seniorTrancheMint: 'AAZ5cHWkG9XbmQBkKfeFJG1kEsxzFFhonsAinx2K2w9', seniorTrancheState: '4GKihfFhjGRLn3Bi7PCPzjuaJHPznDB7CioDjMZ7reZP', trancheDecimals: 6, - receivable: '5o7qiQZeCbTowg75xgB5xMnYRHpXx43c6CnFbnC3MXkJ', underlyingMint: { address: '4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU', symbol: 'USDC', @@ -38,5 +36,8 @@ export const SOLANA_DEVNET_METADATA: SolanaPoolsInfo = { KYC: { Persona: ARF_PERSONA_KYC_COPY, }, + extra: { + hasReceivables: true, + }, }, } diff --git a/packages/huma-shared/src/solana/metadata/mainnet.ts b/packages/huma-shared/src/solana/metadata/mainnet.ts new file mode 100644 index 00000000..70fe5177 --- /dev/null +++ b/packages/huma-shared/src/solana/metadata/mainnet.ts @@ -0,0 +1,43 @@ +import { POOL_NAME, POOL_TYPE } from '../../utils/pool' +import { ARF_PERSONA_KYC_COPY } from '../../v2' +import { SolanaChainEnum } from '../chain' +import { SolanaChainInfo, SolanaPoolsInfo } from '../pool' + +export const SOLANA_DEVNET_INFO: SolanaChainInfo = { + poolProgram: 'EVQ4s1b6N1vmWFDv8PRNc77kufBP8HcrSNWXQAhRsJq9', + sentinel: 'Huma3jh5pZd1WKKEApB66W5c75vzHfFdRUHM7oMLwdQV', // +} + +export const SOLANA_DEVNET_METADATA: SolanaPoolsInfo = { + ArfCreditPool6Months: { + title: 'Arf - Cross Border Payment Financing', + poolName: POOL_NAME.ArfCreditPool6Months, + poolType: POOL_TYPE.CreditLine, + chainId: SolanaChainEnum.SolanaMainnet, + industry: 'Remittance Financing', + desc: 'Arf provides an innovative on-chain liquidity solution that simplifies cross-border payments by facilitating immediate USDC-based settlements and tokenizing payment orders, enhancing transparency in the process.', + poolId: '6oAuPDYheeDBrmRgY5z1iXvmFwbmtpEGdGBtMCWgAHwb', + poolAuthority: 'FyBd4A7VzeTBP1dyfmmi1rqZYx6wpLT63xKKzngDKu5p', + poolUnderlyingTokenAccount: 'FwZoHpBs1cwHRZzQ9XAzd2Jai4okVVAsNTZbAoEysRpV', + poolConfig: '4beixqv1temogHLmJU98SLpQvGyxkgTyn2AK7dWTr3k8', + humaConfig: 'Fh2WKYCJfota6k76gDGnhTELUuhPa7FHQvVza4cE11ja', + poolState: 'BA1nPxHMnaWiuXeqHSGQntNnx7hobXhHNtiK1PWhrS6E', + juniorTrancheMint: 'EabTCfsZytPd8PRAsSVxcPpMn9hPARLFgvNx6eRjFz1i', + juniorTrancheState: '78Jz2ne15ahye3iC2vVmWF4kDQba7xFFcVE3nT9nE1q6', + seniorTrancheMint: '9J7t9Lnd3bwmACix1Xiw9W3crdtzx6q5Y18LGt25UYco', + seniorTrancheState: 'GGsYvQW5Xw4VLwJAzRA36NHFc146XBQJ6DveR2qBAUgS', + trancheDecimals: 6, + underlyingMint: { + address: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', + symbol: 'USDC', + decimals: 6, + icon: 'USDC', + }, + KYC: { + Persona: ARF_PERSONA_KYC_COPY, + }, + extra: { + hasReceivables: true, + }, + }, +} diff --git a/packages/huma-shared/src/solana/pool.ts b/packages/huma-shared/src/solana/pool.ts index 64cfb5e8..54ad32ba 100644 --- a/packages/huma-shared/src/solana/pool.ts +++ b/packages/huma-shared/src/solana/pool.ts @@ -21,7 +21,6 @@ export type SolanaPoolInfo = { seniorTrancheState: string trancheDecimals: number humaConfig: string - receivable?: string underlyingMint: { address: string symbol: string @@ -32,6 +31,7 @@ export type SolanaPoolInfo = { extra?: { isClosed?: boolean hidden?: boolean + hasReceivables?: boolean } } @@ -49,7 +49,6 @@ export const SOLANA_CHAIN_POOLS_INFO = { export type SolanaChainInfo = { poolProgram: string - humaProgramAuthority: string sentinel: string } diff --git a/packages/huma-shared/src/solana/utils/programUtils.ts b/packages/huma-shared/src/solana/utils/programUtils.ts index 6e1abf26..dd5b3feb 100644 --- a/packages/huma-shared/src/solana/utils/programUtils.ts +++ b/packages/huma-shared/src/solana/utils/programUtils.ts @@ -3,8 +3,8 @@ import { Connection, PublicKey } from '@solana/web3.js' import { POOL_NAME } from '../../utils' import { SolanaChainEnum } from '../chain' -import { Huma as HumaSolanaDevnet } from '../idl/devnet' -import HumaDevnetIDL from '../idl/devnet.json' +import { Huma as HumaProgram } from '../idl/huma' +import HumaIDL from '../idl/huma.json' import { SOLANA_CHAIN_INFO, SOLANA_CHAIN_POOLS_INFO, @@ -17,9 +17,6 @@ export const getPoolProgramAddress = (chainId: SolanaChainEnum) => export const getSentinelAddress = (chainId: SolanaChainEnum) => SOLANA_CHAIN_INFO[chainId].sentinel -export const getHumaProgramAuthorityAddress = (chainId: SolanaChainEnum) => - SOLANA_CHAIN_INFO[chainId].humaProgramAuthority - export const getSolanaPoolInfo = ( chainId: SolanaChainEnum, poolName: POOL_NAME, @@ -47,22 +44,15 @@ export function getSolanaPoolInfoForPoolAddress( } export const getHumaProgram = ( - chainId: SolanaChainEnum, + _chainId: SolanaChainEnum, connection: Connection, wallet?: Wallet, -): Program => { +): Program => { const provider = wallet ? new AnchorProvider(connection, wallet, {}) : undefined - if (chainId === SolanaChainEnum.SolanaDevnet) { - return new Program( - HumaDevnetIDL as HumaSolanaDevnet, - provider, - ) - } - - throw new Error('Chain not supported') + return new Program(HumaIDL as HumaProgram, provider) } export const getCreditAccounts = (