2022-06-23 06:22:59 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-08-10 00:16:07 -07:00
|
|
|
set -ex pipefail
|
2022-06-23 06:22:59 -07:00
|
|
|
|
2022-12-19 10:50:09 -08:00
|
|
|
WALLET_WITH_FUNDS=~/.config/solana/mango-mainnet-1.json
|
2022-12-08 01:23:12 -08:00
|
|
|
PROGRAM_ID=4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg
|
2022-06-23 06:22:59 -07:00
|
|
|
|
|
|
|
# build program,
|
2023-02-14 23:42:07 -08:00
|
|
|
cargo run -p anchor-cli -- build -- --features enable-gpl
|
2022-06-23 06:22:59 -07:00
|
|
|
|
|
|
|
# patch types, which we want in rust, but anchor client doesn't support
|
|
|
|
./idl-fixup.sh
|
|
|
|
|
|
|
|
# update types in ts client package
|
|
|
|
cp -v ./target/types/mango_v4.ts ./ts/client/src/mango_v4.ts
|
|
|
|
|
2022-07-06 00:56:14 -07:00
|
|
|
(cd ./ts/client && yarn tsc)
|
2022-06-23 06:22:59 -07:00
|
|
|
|
2022-12-08 01:24:18 -08:00
|
|
|
# publish program
|
|
|
|
solana --url $MB_CLUSTER_URL program deploy --program-id $PROGRAM_ID \
|
|
|
|
-k $WALLET_WITH_FUNDS target/deploy/mango_v4.so
|
|
|
|
|
|
|
|
# publish idl
|
|
|
|
cargo run -p anchor-cli -- idl upgrade --provider.cluster $MB_CLUSTER_URL --provider.wallet $WALLET_WITH_FUNDS \
|
2022-12-14 00:55:25 -08:00
|
|
|
--filepath target/idl/mango_v4_no_docs.json $PROGRAM_ID
|
2022-06-23 06:22:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
# build npm package
|
2022-07-06 00:56:14 -07:00
|
|
|
(cd ./ts/client && yarn tsc)
|