deploy.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Migrations are an early feature. Currently, they're nothing more than this
  2. // single deploy script that's invoked from the CLI, injecting a provider
  3. // configured from the workspace's Anchor.toml.
  4. var __awaiter =
  5. (this && this.__awaiter) ||
  6. function (thisArg, _arguments, P, generator) {
  7. function adopt(value) {
  8. return value instanceof P
  9. ? value
  10. : new P(function (resolve) {
  11. resolve(value);
  12. });
  13. }
  14. return new (P || (P = Promise))(function (resolve, reject) {
  15. function fulfilled(value) {
  16. try {
  17. step(generator.next(value));
  18. } catch (e) {
  19. reject(e);
  20. }
  21. }
  22. function rejected(value) {
  23. try {
  24. step(generator["throw"](value));
  25. } catch (e) {
  26. reject(e);
  27. }
  28. }
  29. function step(result) {
  30. result.done
  31. ? resolve(result.value)
  32. : adopt(result.value).then(fulfilled, rejected);
  33. }
  34. step((generator = generator.apply(thisArg, _arguments || [])).next());
  35. });
  36. };
  37. const anchor = require("@coral-xyz/anchor");
  38. module.exports = function (provider) {
  39. return __awaiter(this, void 0, void 0, function* () {
  40. // Configure client to use the provider.
  41. anchor.setProvider(provider);
  42. // Add your deploy script here.
  43. });
  44. };