Skip to content

Latest commit

 

History

History
227 lines (114 loc) · 4.84 KB

File metadata and controls

227 lines (114 loc) · 4.84 KB

@grainlify/contracts-sdk


@grainlify/contracts-sdk / ProgramEscrowClient

Class: ProgramEscrowClient

Defined in: src/program-escrow-client.ts:56

Client for interacting with the ProgramEscrow Soroban contract

Constructors

Constructor

new ProgramEscrowClient(config): ProgramEscrowClient

Defined in: src/program-escrow-client.ts:64

Create a client bound to one ProgramEscrow contract and Soroban RPC endpoint.

Parameters

config

ProgramEscrowConfig

Returns

ProgramEscrowClient

Methods

batchPayout()

batchPayout(recipients, amounts, sourceKeypair): Promise<ProgramData>

Defined in: src/program-escrow-client.ts:135

Execute batch payouts to multiple recipients

Parameters

recipients

string[]

amounts

bigint[]

sourceKeypair

Keypair

Returns

Promise<ProgramData>


createProgramReleaseSchedule()

createProgramReleaseSchedule(recipient, amount, releaseTimestamp, sourceKeypair): Promise<ProgramReleaseSchedule>

Defined in: src/program-escrow-client.ts:229

Create a release schedule

Parameters

recipient

string

amount

bigint

releaseTimestamp

number

sourceKeypair

Keypair

Returns

Promise<ProgramReleaseSchedule>


getProgramInfo()

getProgramInfo(): Promise<ProgramData>

Defined in: src/program-escrow-client.ts:205

Get program information

Returns

Promise<ProgramData>


getRemainingBalance()

getRemainingBalance(): Promise<bigint>

Defined in: src/program-escrow-client.ts:217

Get remaining balance

Returns

Promise<bigint>


initProgram()

initProgram(programId, authorizedPayoutKey, tokenAddress, sourceKeypair): Promise<ProgramData>

Defined in: src/program-escrow-client.ts:83

Initialize a new program escrow

Parameters

programId

string

authorizedPayoutKey

string

tokenAddress

string

sourceKeypair

Keypair

Returns

Promise<ProgramData>


lockProgramFunds()

lockProgramFunds(from, amount, sourceKeypair): Promise<ProgramData>

Defined in: src/program-escrow-client.ts:111

Lock funds into the program escrow

Parameters

from

string

amount

bigint

sourceKeypair

Keypair

Returns

Promise<ProgramData>


singlePayout()

singlePayout(recipient, amount, sourceKeypair): Promise<ProgramData>

Defined in: src/program-escrow-client.ts:179

Execute a single payout

Parameters

recipient

string

amount

bigint

sourceKeypair

Keypair

Returns

Promise<ProgramData>


triggerProgramReleases()

triggerProgramReleases(sourceKeypair): Promise<number>

Defined in: src/program-escrow-client.ts:256

Trigger program releases

Parameters

sourceKeypair

Keypair

Returns

Promise<number>