Skip to content

Commit

Permalink
✨ Add manual commit to the typescript sdk (#59)
Browse files Browse the repository at this point in the history
# ✨ Add manual commit to the typescript sdk

| Status  | Type  | ⚠️ Core Change | Issue |
| :---: | :---: | :---: | :--: |
| Ready | Feature | No | - |

## Description

Add Ephemeral Rollups manual commit instruction to the typescript sdk
  • Loading branch information
GabrielePicco authored Jun 21, 2024
1 parent 3d6d727 commit 391cff5
Show file tree
Hide file tree
Showing 10 changed files with 304 additions and 147 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-bolt-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
solana_version: v1.18.8
solana_version: v1.18.15

jobs:
install:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-bolt-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
solana_version: v1.18.8
solana_version: v1.18.15

jobs:
install:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

env:
solana_version: v1.18.9
solana_version: v1.18.15

jobs:
install:
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
- name: Generate lib
run: |
cd clients/bolt-sdk
yarn build
yarn install && yarn build
cd ../..
- name: run tests
Expand Down
3 changes: 2 additions & 1 deletion clients/bolt-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"private": false,
"dependencies": {
"@metaplex-foundation/beet": "^0.7.1",
"@metaplex-foundation/beet-solana": "^0.4.0"
"@metaplex-foundation/beet-solana": "^0.4.0",
"@magicblock-labs/delegation-program": "0.1.1"
},
"devDependencies": {
"@metaplex-foundation/solita": "^0.20.1",
Expand Down
16 changes: 8 additions & 8 deletions clients/bolt-sdk/src/delegation/accounts.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { PublicKey } from "@solana/web3.js";

const SEED_BUFFER_PDA = "buffer";
const SEED_DELEGATION_PDA = "delegation";
const DELEGATED_ACCOUNT_SEEDS = "account-seeds";
const SEED_COMMIT_STATE_RECORD_PDA = "commit-state-record";
const SEED_STATE_DIFF_PDA = "state-diff";
export const DELEGATION_PROGRAM_ID =
"DELeGGvXpWV2fqJUhqcF5ZSYMS4JTLjteaAMARRSaeSh";
import {
DELEGATED_ACCOUNT_SEEDS,
DELEGATION_PROGRAM_ID,
SEED_BUFFER_PDA,
SEED_COMMIT_STATE_RECORD_PDA,
SEED_DELEGATION_PDA,
SEED_STATE_DIFF_PDA,
} from "@magicblock-labs/delegation-program";

export function getDelegationAccounts(
accountToDelegate: PublicKey,
Expand Down
3 changes: 2 additions & 1 deletion clients/bolt-sdk/src/delegation/delegate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as beet from "@metaplex-foundation/beet";
import * as web3 from "@solana/web3.js";
import { DELEGATION_PROGRAM_ID, getDelegationAccounts } from "./accounts";
import { getDelegationAccounts } from "./accounts";
import { DELEGATION_PROGRAM_ID } from "@magicblock-labs/delegation-program";

export interface DelegateInstructionArgs {
validUntil: beet.bignum;
Expand Down
115 changes: 0 additions & 115 deletions clients/bolt-sdk/src/delegation/undelegate.ts

This file was deleted.

6 changes: 5 additions & 1 deletion clients/bolt-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ export * from "./generated/instructions";
export * from "./world/transactions";
export * from "./delegation/accounts";
export * from "./delegation/delegate";
export * from "./delegation/undelegate";
export {
createCommitInstruction,
createUndelegateInstruction,
DELEGATION_PROGRAM_ID,
} from "@magicblock-labs/delegation-program";

export const SYSVAR_INSTRUCTIONS_PUBKEY = new PublicKey(
"Sysvar1nstructions1111111111111111111111111"
Expand Down
Loading

0 comments on commit 391cff5

Please sign in to comment.