Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / MatchAccessResponse

Interface: MatchAccessResponse

Defined in: packages/ts-sdk/src/generated/types/match-access-response.ts:254

Example:

ts
import { 
createSimulatorClient
} from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes. const
simulatorClient
=
createSimulatorClient
({
baseUrl
: 'http://127.0.0.1:4000',
}) // Use card ids; the server validates deck legality. const
premierHostDeck
= {
leader
: 46102, // Leia Organa - Someone Who Loves You
base
: 308, // Echo Base
cards
:
Array
.
from
({
length
: 50 }, () => 45), // Alliance X-Wing
} const
matchAccessResponse
= await
simulatorClient
.
matches
.
create
({
hostDeck
:
premierHostDeck
})
console
.
log
(
matchAccessResponse
)

Indexable

[k: string]: unknown

Properties

matchId

Example:

ts
import { 
createSimulatorClient
} from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes. const
simulatorClient
=
createSimulatorClient
({
baseUrl
: 'http://127.0.0.1:4000',
}) // Use card ids; the server validates deck legality. const
premierHostDeck
= {
leader
: 46102, // Leia Organa - Someone Who Loves You
base
: 308, // Echo Base
cards
:
Array
.
from
({
length
: 50 }, () => 45), // Alliance X-Wing
} const
matchAccessResponse
= await
simulatorClient
.
matches
.
create
({
hostDeck
:
premierHostDeck
})
const {
matchId
} =
matchAccessResponse
console
.
log
(
matchId
)

matchId: string

Defined in: packages/ts-sdk/src/generated/types/match-access-response.ts:255


seat

Example:

ts
import { 
createSimulatorClient
} from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes. const
simulatorClient
=
createSimulatorClient
({
baseUrl
: 'http://127.0.0.1:4000',
}) // Use card ids; the server validates deck legality. const
premierHostDeck
= {
leader
: 46102, // Leia Organa - Someone Who Loves You
base
: 308, // Echo Base
cards
:
Array
.
from
({
length
: 50 }, () => 45), // Alliance X-Wing
} const
matchAccessResponse
= await
simulatorClient
.
matches
.
create
({
hostDeck
:
premierHostDeck
})
const {
seat
:
matchSeat
} =
matchAccessResponse
console
.
log
(
matchSeat
)

seat: Seat

Defined in: packages/ts-sdk/src/generated/types/match-access-response.ts:256


seatToken

Example:

ts
import { 
createSimulatorClient
} from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes. const
simulatorClient
=
createSimulatorClient
({
baseUrl
: 'http://127.0.0.1:4000',
}) // Use card ids; the server validates deck legality. const
premierHostDeck
= {
leader
: 46102, // Leia Organa - Someone Who Loves You
base
: 308, // Echo Base
cards
:
Array
.
from
({
length
: 50 }, () => 45), // Alliance X-Wing
} const
matchAccessResponse
= await
simulatorClient
.
matches
.
create
({
hostDeck
:
premierHostDeck
})
const {
seatToken
} =
matchAccessResponse
console
.
log
(
seatToken
)

seatToken: string

Defined in: packages/ts-sdk/src/generated/types/match-access-response.ts:257


snapshot

Example:

ts
import { 
createSimulatorClient
} from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes. const
simulatorClient
=
createSimulatorClient
({
baseUrl
: 'http://127.0.0.1:4000',
}) // Use card ids; the server validates deck legality. const
premierHostDeck
= {
leader
: 46102, // Leia Organa - Someone Who Loves You
base
: 308, // Echo Base
cards
:
Array
.
from
({
length
: 50 }, () => 45), // Alliance X-Wing
} const
matchAccessResponse
= await
simulatorClient
.
matches
.
create
({
hostDeck
:
premierHostDeck
})
const {
snapshot
:
initialMatchSnapshot
} =
matchAccessResponse
console
.
log
(
initialMatchSnapshot
)

snapshot: GameState

Defined in: packages/ts-sdk/src/generated/types/match-access-response.ts:258

Released under the MIT License.