2022-04-12 07:53:45 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e pipefail
|
|
|
|
|
2022-07-25 07:07:53 -07:00
|
|
|
ANCHOR_BRANCH=v0.25.0-mangov4
|
|
|
|
ANCHOR_FORK=$(cd ../anchor && git rev-parse --abbrev-ref HEAD)
|
|
|
|
if [ "$ANCHOR_FORK" != "$ANCHOR_BRANCH" ]; then
|
|
|
|
echo "Check out anchor fork at git@github.com:blockworks-foundation/anchor.git, and switch to branch $ANCHOR_BRANCH!"
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2022-05-18 08:16:14 -07:00
|
|
|
# TODO fix need for --skip-lint
|
|
|
|
# build program,
|
2022-07-25 07:07:53 -07:00
|
|
|
cargo run --manifest-path ../anchor/cli/Cargo.toml build --skip-lint
|
2022-05-18 08:16:14 -07:00
|
|
|
|
|
|
|
# patch types, which we want in rust, but anchor client doesn't support
|
2022-04-12 07:53:45 -07:00
|
|
|
./idl-fixup.sh
|
2022-05-18 08:16:14 -07:00
|
|
|
|
|
|
|
# update types in ts client package
|
2022-04-12 23:48:35 -07:00
|
|
|
cp -v ./target/types/mango_v4.ts ./ts/client/src/mango_v4.ts
|
2022-05-18 08:16:14 -07:00
|
|
|
|
2022-07-06 00:56:14 -07:00
|
|
|
(cd ./ts/client && yarn tsc)
|